1
votes

I have two EJBs , EJB A references EJB B, both are deployed to the same server.

Each time I try to deploy EJB A it tries to register EJB B which is already deployed and registered which causes error:

java.lang.IllegalStateException

Any idea how to prevent EJB A from registering the referenced EJB?

I am using NetBeans and JBoss 4.2.3 as well as EJB 3.0.

2
Could you provide more of the stack trace ? - thelost
10:58:31,359 WARN [ServiceController] Problem creating service jboss.j2ee:module=mobichannel-txplugin-1.0.jar,uid=426285,service=EJB3 java.lang.IllegalStateException: Container jboss.j2ee:jar=mobichannel-txplugin-1.0.jar,name=TrxPlugin,service=EJB3,VMID=99b9a8c1e00ae44b:55066fa4:12a79b098fb:-7ffd + is already registered at org.jboss.ejb3.Ejb3Registry.register(Ejb3Registry.java:114) at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:494) at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:442) at - Mohamed Magdy
Did you solve this problem meanwhile? It seems as if I could have the same problem: stackoverflow.com/questions/7552929/… - Martin Thoma

2 Answers

1
votes

If you use maven build you can use

<scope> provided </scope>

in the pom file of maven of EJB A

-2
votes

Although I cannot imagine why you get an exception if your EJB A is singleton try the annotation @DependsOn on A to specify a dependency on B.