This content has been marked as final.
Show 3 replies
-
1. Re: ServiceBean and depends clause - Help Please
jaikiran Jun 29, 2009 3:46 AM (in response to rnicholson10)"rnicholson10" wrote:
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)?
You can override the default JNDI names by using the @RemoteBinding or the @LocalBinding annotations. You can even use the jboss.xml to override these. See these tutorials:
http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/tutorial/1.0.7/html/JNDI_Bindings.html
http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/tutorial/1.0.7/html/jboss.xml_deployment_descriptor.html
"rnicholson10" wrote:
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. ...
2) Similarly, how do I depend on my timer bean in the Service bean no matter what EAR file it's part of?
How about adding the dependency through the jboss.xml instead of the annotations? -
2. Re: ServiceBean and depends clause - Help Please
rnicholson10 Jul 15, 2009 10:19 AM (in response to rnicholson10)I added the following dependency using the jboss.xml file (which is in the META-INF directory in the EAR file):
<?xml version='1.0' encoding='UTF-8' ?> <jboss> <enterprise-beans> <session> <ejb-name>InputServiceBean</ejb-name> <depends>jboss.j2ee:ear=phase-test.ear,jar=phase-input.jar,name=SourceBridgeCheckTimerBean,service=EJB3</depends> </session> </enterprise-beans> </jboss>
And with the fully qualified class name for the service bean:<?xml version='1.0' encoding='UTF-8' ?> <jboss> <enterprise-beans> <session> <ejb-name>com.paddypower.phase.input.bean.service.InputServiceBean</ejb-name> <depends>jboss.j2ee:ear=phase-test.ear,jar=phase-input.jar,name=SourceBridgeCheckTimerBean,service=EJB3</depends> </session> </enterprise-beans> </jboss>
But neither of these seems to work. The SourceBridgeCheckTimerBean always loads after the ServiceBean which would indicate that the depends clause has no effect.
Am I specifying the ejb-name correctly? The depends clause is specified in the same way I used in the ServiceBean previously. -
3. Re: ServiceBean and depends clause - Help Please
rnicholson10 Jul 15, 2009 10:52 AM (in response to rnicholson10)Ok, the jboss.xml is definitely being picked up, so it must be the way I'm referencing the service bean is incorrect...
2009-07-15 15:35:24,600 DEBUG [org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper] (HDScanner) Parsing file: ZipEntryHandler@12863780[path=phase-test.ear/META-INF/jboss.xml context=file:/opt/jboss-5.1.0.Beta1-jdk6/server/default/deploy/ real=file:/opt/jboss-5.1.0.Beta1-jdk6/server/default/deploy/phase-test.ear/META-INF/jboss.xml] for type: class org.jboss.metadata.ejb.jboss.JBossMetaData 2009-07-15 15:35:24,635 DEBUG [org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper] (HDScanner) Parsed file: ZipEntryHandler@12863780[path=phase-test.ear/META-INF/jboss.xmlcontext=file:/opt/jboss-5.1.0.Beta1-jdk6/server/default/deploy/ real=file:/opt/jboss-5.1.0.Beta1-jdk6/server/default/deploy/phase-test.ear/META-INF/jboss.xml] to: org.jboss.metadata.ejb.jboss.JBoss50MetaData@1f