problem with seam and mdb on jboss5.1

你说的曾经没有我的故事 提交于 2019-12-08 04:39:05

问题


I have a problem when using a mdb as a seam component. In the bean I inject some other seam somponents.

The problem is that when the server restart after a crash and the mdb is deployed it starts reading the messages but seam is not initialized yet and I got an exception(listed above). If i start the server whith the queues empty and submit a message to queue after the server start it is working ok.

Is there a posibility to stop or delay the sending off messages on server startup and start sending them only when seam is fully funcional?

I tried the @Depends antotatin on the bean but withowt success

my environment : jboss5.1 GA seam 2.2.0 GA jboss messaging 1.4

Any help would be appreceated

the error on startup :

11:24:20,477 ERROR [TxPolicy] javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalStateException: Attempted to invoke a Seam component outside an initialized application

11:24:30,483 ERROR [TxPolicy] javax.ejb.EJBException: Failed to acquire the pool semaphore, strictTimeout=10000


回答1:


Find the solution...I was trying with the wrong name pattrn with @Depends

Add this annotation:

@Depends( {"jboss.web.deployment:war=/myappname"} )

Where myappname is the name of your app's warfile. This will delay the initialization of the MDB until after Seam has finished initializing during the war deployment.

Hope this helps someone



来源:https://stackoverflow.com/questions/3052081/problem-with-seam-and-mdb-on-jboss5-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!