-
1. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
arnab_ghosh Jan 12, 2016 12:35 PM (in response to arnab_ghosh)jbertram can you please help on this ?
-
2. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
jbertram Jan 12, 2016 12:57 PM (in response to arnab_ghosh)Wildfly doesn't have any support for JBoss Messaging so you've got a couple of choices:
- Use the Generic JMS JCA Resource Adapter (documentation includes instructions for integrating with JBoss Messaging).
- Just have your JMS client connect directly to the JBoss Messaging server without using a connection factory hosted by Wildfly.
-
3. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
arnab_ghosh Jan 12, 2016 1:11 PM (in response to jbertram)Justin,
Thanks a lot for your reply. If I choose option 2 should the code look something like below:
Properties properties = new Properties(); properties.put(Context.PROVIDER_URL, "hostname:1099"); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); Context context = new InitialContext(properties); QueueConnectionFactory conFactory = (QueueConnectionFactory) context.lookup("ConnectionFactory");
Regards
Arnab
-
4. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
jbertram Jan 12, 2016 1:24 PM (in response to arnab_ghosh)Yes, something like that.
-
5. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
arnab_ghosh Jan 12, 2016 1:56 PM (in response to jbertram)I am getting below Exception:
... 208 more
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory from [Module "deployment.aoma.service.ear.aoma.service.common.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_40]
at java.lang.Class.forName(Class.java:348) [rt.jar:1.8.0_40]
at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:113)
I have added this code inside a stateless SessionBean which is getting invoked by a MDB. What am I doing wrong ?
-
6. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
jbertram Jan 12, 2016 2:01 PM (in response to arnab_ghosh)This is a pretty basic Java exception. The class-loader can't find org.jnp.interfaces.NamingContextFactory. You need to put this class where the class-loader can find it (e.g. in your application or module).
-
7. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
arnab_ghosh Jan 12, 2016 3:08 PM (in response to jbertram)Justin,
I thought the JNP dependencies are already included in the server and should be loaded my bad. So should I add all Jnp dependencies in the EAR ?
Please let me know.
Regards
Arnab
-
8. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
jbertram Jan 12, 2016 3:30 PM (in response to arnab_ghosh)As you've noticed, there's no JNP support in Wildfly (at least not that I'm aware of) as the JNDI implementation in Wildfly is completely different. Therefore, if you want to use JNP (and JBoss Messaging as well) then you'll need to add the proper dependencies. Where you add them doesn't really matter (e.g. in your app, in a module loaded by your app, etc.) as long as the class-loader can find them when it needs them.
-
9. Re: How to create a ConnectionFactory pointing to a remote JBoss server not using HornetQ
arnab_ghosh Jan 12, 2016 8:58 PM (in response to jbertram)Thanks Justin. I will make required changes.
Regards
Arnab