Topic
  • 3 replies
  • Latest Post - ‏2012-10-22T10:54:13Z by SystemAdmin
SystemAdmin
SystemAdmin
37422 Posts

Pinned topic Startup bean initialization error

‏2012-09-25T09:24:32Z |
Hi all,
i'm trying to deploy an EAR application containing a was and few jars. In one of these jars i have a @Startup EJB. In the @PostConstruct annotated method of this ejb i'm trying to call a method of another EJB that i've injected. If i do that i can deploy the application but i got the following error when i try to start it: "javax.ejb.NoSuchEJBException: An error occurred during initialization of singleton session bean Synthesis#permission-manager-ejb.jar#LicenseManager, resulting in the discarding of the singleton instance". The ejb that I've injected is not null and if i'm not trying to use any of it's method into the @PostConstruct i can start the application without errors.
To be more clear i have the following situation:

@Singleton
@Startup
public class MyEjb{
@EJB private OtherEjb other;
....
}
Updated on 2012-10-22T10:54:13Z at 2012-10-22T10:54:13Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Startup bean initialization error

    ‏2012-09-25T09:31:04Z  
    @Singleton
    @Startup
    public class MyEjb{
    @EJB private OtherEjb other;
    ....
    @PostConstruct
    private void post(){
    other.mymethod(); //if i do this the application wont start, giving me the error mentioned before
    }
    }
  • bkail
    bkail
    372 Posts

    Re: Startup bean initialization error

    ‏2012-10-11T16:21:19Z  
    This should work. Is the OtherEjb in the same module or another module? Can you paste the full error message from the logs, or just attach your SystemOut.log?
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Startup bean initialization error

    ‏2012-10-22T10:54:13Z  
    • bkail
    • ‏2012-10-11T16:21:19Z
    This should work. Is the OtherEjb in the same module or another module? Can you paste the full error message from the logs, or just attach your SystemOut.log?
    hi,
    my bad... it was just a misconfiguration in my persistence.xml