开发者

JBoss 5.0 EAR: Locate @Service ejb local interface from struts 1 action in nested war with jndi lookup

I have a war (using struts 1) nested in an ear with session ejbs. If I lookup normal session beans from the war with lookup("earname/beanname/local") everything works. If I lookup a @Service ejb the same way it fails from the war with a NamingException.

To make sure I was doing the lookup correctly I looked up one @Service bean开发者_StackOverflow from another's start() method (instead of injecting with annotations) and the jndi lookup succeeded.

What could be the cause of this behavior? I am currently stuck with JBoss 5.0.


After going through the jmx-console like Nicholas recommended I was able to track down my mistake.

It turns out my two lookups were in fact different. The war was using the service name that I wanted, everything else (which was working) was using the class name of the implementation of the @Local interface.

To further the confusion I used @Service(objectName="blah") instead of @Service(name="blah").

I am now able to successfully lookup my @Service ejbs from my war.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜