I am getting an exception when I try to bring up JBoss 6.0.0.Final when the message queue is not empty.
I have a @Singleton defined
@Singleton
@TransactionManagement(TransactionManagementType.BEAN)
public class EjbAppContext
{
//Initialize AppContext
public EjbAppContext()
{
//do the initialization ...
}
}
And I have a MessageDrivenBean :
public class ConfigurableMessageBean implements MessageListener
{
@EJB EjbAppContext ejbAppCtx;
...
}
On starting up JBoss I get this error:
Caused by: org.jboss.injection.manager.spi.InjectionException: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: ear-1.0-SNAPSHOT not bound]]
At other times I get a similar error except instead of "ear-1.0-SNAPSHOT not bound", it says "EjbAppContext!no-interface not bound"
These messages go on for several screens full (hundred's) and then eventually it settles down and proceses the messages in the queue and works normally. As far as I can tell it doesn't drop any messages. It just makes startup ugly. Also, it seems to go on longer (more screenfuls of errors) if there are a large number of messages in the queue.
Is there some way to delay the MessageListener queue consumers until the system is completely initialized?
I've looked into using @Depends, but I cannot figure out what to make it @Depend on.