-
1. Re: Setup dependencies within an EAR
jaikiran Oct 13, 2009 8:00 AM (in response to rnicholson10)"rnicholson10" wrote:
Specifically there is a ServiceBean in phase-input.jar that I want to depend on.
That bean will have a MBean name corresponding to it. The jmx-console will help you in finding that name. Once you know that MBean ObjectName, just add a<depends>ThatMBeanObjectName</depends>
in the META-INF/jboss.xml of phase-test.jar and add the same in the WEB-INF/jboss-web.xml of the .war file. -
2. Re: Setup dependencies within an EAR
rnicholson10 Oct 13, 2009 10:56 AM (in response to rnicholson10)Brilliant.
One further question:
I don't have either of those files for my jar or war. It's a seam application. I do have a jboss-app.xml in the jar though.
Are the jboss.xml and jboss-web.xml optional files that are only read if their there? Can I just create them in the required format with only a depends clause?
Thanks again,
Ross -
3. Re: Setup dependencies within an EAR
jaikiran Oct 14, 2009 1:13 AM (in response to rnicholson10)"rnicholson10" wrote:
I do have a jboss-app.xml in the jar though.
I assume that's a typo and you actually meant jboss-app.xml the EAR?"rnicholson10" wrote:
Are the jboss.xml and jboss-web.xml optional files that are only read if their there?
Yes, that's correct."rnicholson10" wrote:
Can I just create them in the required format with only a depends clause?
Yes, that's correct again. Only a depends clause should be enough. And remember, each of these has a different location in the .jar and .war, see my previous post for details. -
4. Re: Setup dependencies within an EAR
rnicholson10 Oct 14, 2009 5:18 AM (in response to rnicholson10)Cheers, works a dream.
-
5. Re: Setup dependencies within an EAR
rnicholson10 Oct 14, 2009 6:47 AM (in response to rnicholson10)I spoke too soon!
The jboss-web.xml is perfect so the war is sorted:<?xml version="1.0" encoding="UTF-8"?> <jboss-web> <depends>jboss.j2ee:ear=phase-test.ear,jar=phase-input.jar,name=InputServiceBean,service=EJB3</depends> </jboss-web>
But the jboss.xml is not quite right.<?xml version="1.0" encoding="UTF-8"?> <jboss> <depends>jboss.j2ee:ear=phase-test.ear,jar=phase-input.jar,name=InputServiceBean,service=EJB3</depends> </jboss>
And has the following error:Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: depends not found as a child of jboss in unordered_sequence: webservices? resource-managers? jmx-name? unauthenticated-principal? enforce-ejb-restrictions? container-configurations? assembly-descriptor? loader-repository? security-domain? exception-on-rollback? enterprise-beans* invoker-proxy-bindings? missing-method-permissions-excluded-mode?
I can't tell from the DTD how this should be setup. -
6. Re: Setup dependencies within an EAR
wolfgangknauf Oct 14, 2009 8:22 AM (in response to rnicholson10)Hi,
the "depends" in jboss.xml can only be specified on bean level. Here is a sample for a session bean depending on something else:<jboss ...> <enterprise-beans> <session> <ejb-name>...</ejb-name> <depends>...</depends> </session> </enterprise-beans> </jboss>
Best regards
Wolfgang -
7. Re: Setup dependencies within an EAR
rnicholson10 Oct 14, 2009 9:26 AM (in response to rnicholson10)Ok, but what if I both my ejbs are ServiceBeans?
I've tried adding the service element but I get another error stating that is not a choice under enterprise-beans... It should be because I checked the Schema.
Runnign 5.1.0.GA.<?xml version="1.0" encoding="UTF-8"?> <jboss> <enterprise-beans> <service> <ejb-name>TestServiceBean</ejb-name> <depends>jboss.j2ee:ear=phase-test.ear,jar=phase-input.jar,name=InputServiceBean,service=EJB3</depends> </service> </enterprise-beans> </jboss>
Error:Caused by: org.jboss.xb.binding.JBossXBRuntimeException: service not found as a child of enterprise-beans in sequence: {choice}*
-
8. Re: Setup dependencies within an EAR
jaikiran Oct 14, 2009 9:48 AM (in response to rnicholson10)Add the xsd declaration to the xml:
<?xml version="1.0"?> <jboss xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" version="3.0"> ...
-
9. Re: Setup dependencies within an EAR
rnicholson10 Oct 14, 2009 10:37 AM (in response to rnicholson10)Brilliant, a big thanks to the both of you!