[jboss-user] [EJB 3.0] - ServiceBean and depends clause - Help Please

rnicholson10 do-not-reply at jboss.com
Sun Jun 28 17:46:53 EDT 2009


I have a Service Bean in a jar file called: phase-input.jar

This jar also contains a stateless timer bean (SourceBridgeCheckTimerBean). The service bean is dependent on the timer bean.

So when deploying this jar in it's own EAR file the @ depends clause in the Service Bean looks like this:

  | @Service
  | @Local(InputServiceBeanLocal.class)
  | @Remote(InputServiceBeanRemote.class)
  | @Management(InputServiceBeanManagement.class)
  | @Depends(value={"jboss.messaging.destination:service=Queue,name=phaseQueueToEngine", 
  | 					"jboss.j2ee:ear=phase-input.ear,jar=phase-input.jar,name=SourceBridgeCheckTimerBean,service=EJB3"})

But this jar is supposed to be a service deployed on many different servers in different applications.

When I create a new EAR called phase-test.ear the depends fails because the clause should now look like this:

  | @Depends(value={"jboss.messaging.destination:service=Queue,name=phaseQueueToEngine", 
  | 					"jboss.j2ee:ear=phase-test.ear,jar=phase-input.jar,name=SourceBridgeCheckTimerBean,service=EJB3"})

I would need to recompile phase-input.jar to change this. In fact, I would need to recompile it for every different EAR I want to add it to.

Furthermore, the JNDI name of the local interface to SourceBridgeCheckTimerBean changes from this:

  | phase-input/SourceBridgeCheckTimerBean/local


  | phase-test/SourceBridgeCheckTimerBean/local

Two questions:

1) How do I put SourceBridgeCheckTimerBean into JNDI with a common name so no matter what EAR it resides in I can call it in a common way (not another EJB, I'm calling it in a POJO so have to do a JNDI lookup)?

2) Similarly, how do I depend on my timer bean in the Service bean no matter what EAR file it's part of?

Note: there will only ever be one Input Service Bean on any JBoss instance.

Or is the solution to deploy my Input service bean in it's own jar directly into the deploy directory. In this case can I access the service bean on the local interface as it's not deployed in the same ear as the application?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240565#4240565

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240565

More information about the jboss-user mailing list