-
1. Re: How to deploy JCA connector wrapped in ear
jaikiran Jun 11, 2015 5:45 AM (in response to martin.wortner)Which exact version of JBoss AS7/WildFly is this? Do you have any jboss-web.xml? If yes, what does it look like?
-
2. Re: How to deploy JCA connector wrapped in ear
martin.wortner Jun 11, 2015 6:11 AM (in response to jaikiran)It is 8.0.0
I tried with this jboss-web.xml file(but this file is ignored if it is packaged inside .ear isn't it?)
<!DOCTYPE jboss-web PUBLIC
"-//JBoss//DTD Web Application 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
<context-root>/host</context-root>
<resource-ref>
<res-ref-name>eis/host</res-ref-name>
<jndi-name>java:jboss/eis/host-somehost</jndi-name>
</resource-ref>
</jboss-web>Note: I don't know how to properly name it the error shown below made me think it should be java:/env/eis/host-somehost
I suppose the .war file needs the resource-ref to be able to reference the connector, do I really need to have some configuration in standalone.xml.
I'd like to just deploy the .ear without configuring always the name of the .rar.
-
3. Re: How to deploy JCA connector wrapped in ear
jaikiran Jun 11, 2015 6:59 AM (in response to martin.wortner)You have to place that jboss-web.xml in the WEB-INF folder of the .war (which is within the .ear). Which means, just beside where your web.xml is currently is.
But in this case, since Java EE 6 (or was it 5) you can just have your resource-ref in the web.xml to have a lookup-name element to point to the (container specific) JNDI name. So try updating your web.xml to contain this:
<resource-ref>
<res-ref-name>eis/host</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
<!-- This should match the jndi-name in the subsystem configuration -->
<lookup-name>java:/env/eis/host-somehost</lookup-name>
</resource-ref>
-
4. Re: How to deploy JCA connector wrapped in ear
martin.wortner Jun 11, 2015 7:24 AM (in response to jaikiran)That should help(trying it out), however I'm not really clear about the naming. The lookup-name should refer to configuration in standalone.xml?. Is there a way how can I see my resource adapter in WF admin console?
-
5. Re: How to deploy JCA connector wrapped in ear
jaikiran Jun 11, 2015 7:44 AM (in response to martin.wortner)The way, the resource-ref (and other portable ENC names) works is that it sets up a portable JNDI name within the application's environment naming context (ENC) to point to server specific resources. So the resource-ref-name is the ENC namespace relative portable JNDI name ( java:comp/env/eis/host) and for the server to be able to point to the right resource, it needs certain hints. Using the lookup-name is one such hint to point to an already existing JNDI resource within the server and that JNDI name is potentially application server specific (like in this case java:/env/eis/host-somehost that you have setup in the standalone.xml)
Martin Wortner wrote:
Is there a way how can I see my resource adapter in WF admin console?
This, I don't know because I rarely use the admin console.
-
6. Re: How to deploy JCA connector wrapped in ear
martin.wortner Jun 15, 2015 1:37 AM (in response to jaikiran)Hi, now I have in my standalone.xml JNDI name java:jboss/eis/some-host in my web.xml I have
<resource-ref>
<res-ref-name>eis/host</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
<lookup-name>java:jboss/eis/some-host</lookup-name>
</resource-ref>
And it is still not working -
7. Re: How to deploy JCA connector wrapped in ear
jaikiran Jun 15, 2015 2:08 AM (in response to martin.wortner)Martin Wortner wrote:
<lookup-name>java:jboss/eis/some-host</lookup-name>
</resource-ref>
And it is still not working
That value doesn't look right. Please see a previous post of mine in this thread, where I have used a different value for this element. If that still doesn't work, please post the (new) entire exception stacktrace.
-
8. Re: How to deploy JCA connector wrapped in ear
martin.wortner Jun 15, 2015 2:26 AM (in response to jaikiran)I'm lost just trying out the names randomly. Why is the name wrong ? Should it be java:global/eis/some-host? or java:global/env/eis/some-host(this is using ENC and I don't need it right)? Note: I'm trying all the day all possible combination nothing seams to work.
Can you confirm that lookup-name in web.xml and jndi-name in connection-definition from standalone.xml must much.
Thanks
-
9. Re: How to deploy JCA connector wrapped in ear
jaikiran Jun 15, 2015 2:31 AM (in response to martin.wortner)Here's the snippet that I posted earlier:
<resource-ref>
<res-ref-name>eis/host</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
<!-- This should match the jndi-name in the subsystem configuration -->
<lookup-name>java:/env/eis/host-somehost</lookup-name>
</resource-ref>
Use that same value for lookup-name element. Like I noted in my comment there, it should match teh jndi-name attribute that you have used in the subsystem configuration which is (based on your earlier post):
<connection-definition class-name=".....jca.spi.HostManagedConnectionFactory" jndi-name="java:/env/eis/host-somehost" ......
-
10. Re: How to deploy JCA connector wrapped in ear
martin.wortner Jun 15, 2015 2:40 AM (in response to jaikiran)08:35:51,122 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "HostConnector-ear-1.17
-SNAPSHOT-local.ear")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"HostConnector-ear-1.17-SNAPSHOT-loc
al\".\"HostConnector-war-1.17-SNAPSHOT\".env.eis.host is missing [jboss.naming.context.java.env.eis.host-somehost]"]}
standalone.xml
<subsystem xmlns="urn:jboss:domain:resource-adapters:2.0">
<resource-adapters>
<resource-adapter id="ra">
<archive>
HostConnector-1.17-SNAPSHOT-local#HostConnector-rar-1.17-SNAPSHOT.rar
</archive>
<connection-definitions>
<connection-definition class-name="......jca.spi.ManagedConnectionFactory" jndi-name="java:/env/eis/host-somehost" enabled="true" use-java-context="false" pool-name="SomePool"/>
</connection-definitions>
</resource-adapter>
</resource-adapters>
</subsystem>
web.xml
<resource-ref>
<res-ref-name>eis/host</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
<lookup-name>java:/env/eis/host-somehost</lookup-name>
</resource-ref>
-
11. Re: How to deploy JCA connector wrapped in ear
jaikiran Jun 16, 2015 4:33 AM (in response to martin.wortner)At this point, I can only guess that the JNDI name specified in the subsystem configuration isn't being bound to. Why that's happening, I don't know. Maybe you are having that config in some different standalone/domain xml than the one you are using to bootup the server? If you have a reproducible application to reproduce this, please attach it to this thread. Someone might take a look. You should probably even attach the complete server.log from the time you boot the server till you notice this exception.
-
12. Re: How to deploy JCA connector wrapped in ear
martin.wortner Jun 16, 2015 5:04 AM (in response to jaikiran)I can see the resource adapter in console with following JNDI name java:/env/eis/isohost-localcsas. Isn't it possible thath I must use java:global for the resource adapter to be globally visible?
-
13. Re: How to deploy JCA connector wrapped in ear
jaikiran Jun 16, 2015 5:09 AM (in response to martin.wortner)The java:global is just a EE (portable) namespace. The java:/ namespace too is a server level "global" namespace accessible to all applications. So it doesn't actually matter whether you use java:global namespace in this case.
-
14. Re: How to deploy JCA connector wrapped in ear
martin.wortner Jun 30, 2015 8:55 AM (in response to jaikiran)No success still, I'm blind shooting. I guess the best will be to get some working example with .rar embedded in .ear file, but so far I have found nothing useful.