-
1. Re: Lookup CommandDispatcherFactory
rsteeghs Mar 6, 2015 10:44 AM (in response to skull)Hi Juliano,
Did you already find a solution to your problem? I am wondering because we face the same issue.
-
2. Re: Lookup CommandDispatcherFactory
skull Mar 6, 2015 11:03 AM (in response to rsteeghs)I didnt find. Have you a success?
But I have 2 builds, one for standalone and another for cluster
-
3. Re: Lookup CommandDispatcherFactory
pferraro Mar 9, 2015 8:02 AM (in response to skull)Which version of WildFly are you using? The local CommandDispatcherFactory implementation was added in 8.2.
-
4. Re: Lookup CommandDispatcherFactory
pferraro Mar 9, 2015 8:46 AM (in response to skull)To use a vanilla JNDI lookup you will need to define a resource-ref in your deployment descriptor and lookup the entry from the resulting java:comp/env namespace. This will ensure the proper dependency is created between your deployment and the CommandDispatcherFactory.
-
5. Re: Lookup CommandDispatcherFactory
rsteeghs Mar 9, 2015 4:44 PM (in response to pferraro)Thnx...
We are using 8.0.0.Final. For now we were able to get it working by changing our standalone server to standalone-ha server with only one node. With this it works just as on our other environment with two nodes started as standalone-ha. Will the resource-ref solution work with 8.0.0.Final?
If so then we try this.
-
6. Re: Lookup CommandDispatcherFactory
skull Mar 10, 2015 8:25 AM (in response to pferraro)I am using 8.2.0-Final
-
7. Re: Lookup CommandDispatcherFactory
skull Mar 10, 2015 9:02 AM (in response to pferraro)If i create at web.xml
<resource-env-ref> <resource-env-ref-name>dispatcher</resource-env-ref-name> <resource-env-ref-type>org.wildfly.clustering.dispatcher.CommandDispatcherFactory</resource-env-ref-type> </resource-env-ref>
then use a Lookup
Properties p = new Properties(); p.put(Context.URL_PKG_PREFIXES, "org.jboss.as.naming.interfaces:org.jboss.ejb.client.naming"); factory = (CommandDispatcherFactory) new InitialContext(p).lookup("java:comp/env/dispatcher");
But before the breakpoint stop at Properties p = new Properties();
I got an error: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.myapp.myapp.env.dispatcher is missing [jboss.naming.context.java.jboss.resources.dispatcher]"]}
I try this at 8.2.0-Final standalone.xml and standalone-ha.xml
-
8. Re: Lookup CommandDispatcherFactory
pferraro Mar 11, 2015 7:38 AM (in response to skull)My mistake. I had intended initially backported the local implementations of the clustering API from WF9 to 8.x, but the change was reverted because of some testsuite regressions. Thus, non-HA support for the clustering API can be found only in 9.0.0.Alpha1 and later.
-
9. Re: Lookup CommandDispatcherFactory
pferraro Mar 11, 2015 7:53 AM (in response to skull)You'd want something like this in web.xml:
<resource-ref> <res-ref-name>dispatcher</res-ref-name> <res-type>org.wildfly.clustering.dispatcher.CommandDispatcherFactory</res-type> <res-auth>Container</res-auth> <lookup-name>java:jboss/clustering/dispatcher/web</lookup-name> </resource-ref>