[
https://issues.jboss.org/browse/AS7-4872?page=com.atlassian.jira.plugin.s...
]
jaikiran pai commented on AS7-4872:
-----------------------------------
Assigning to myself. For reference, here's some IRC discussion about this issue:
{quote}
(01:50:07 IST) Jaikiran: saw your mail on the dev thread
(01:50:26 IST) Jaikiran: so you are having a problem where the remote naming module tries
to load the ejb client class?
(01:50:43 IST) magesh1 [~magesh@redhat/jboss/magesh] entered the room.
(01:50:43 IST) mode (+v magesh1) by ChanServ
(01:50:46 IST) jmesnil: Jaikiran, yes
(01:51:01 IST) jmesnil: Jaikiran, I want to lookup a JMS resources from one AS7 instance
to another
(01:51:30 IST) jmesnil: nothing related to ejb but the remote naming module tries to load
the ejb client class in any case
(01:51:30 IST) Jaikiran: jmesnil: and this error happens on the destination AS7
instance?
(01:51:53 IST) Jaikiran: yeah, i see what you are saying. what i'm trying to
understand though is why we didn't run into this earlier
(01:52:12 IST) Jaikiran: in any case, this does look like a bug in remote-naming but i
would like to understand the scenario a bit better to fix this
(01:52:21 IST) jmesnil: Jaikiran, i'm not sure I am doing something that is allowed
(01:52:29 IST) jmesnil: I am in the messaging subsystem
(01:52:49 IST) kkhan [~kkhan@redhat/jboss/kkhan] entered the room.
(01:52:49 IST) mode (+v kkhan) by ChanServ
(01:53:00 IST) jmesnil: I try to setup a JMS bridge and for that do a new
InitialContext() with the same properties that a client uses for a remote JNDI invocation
(01:53:09 IST) Jaikiran: ok
(01:53:41 IST) magesh left the room (quit: Ping timeout: 252 seconds).
(01:53:43 IST) jmesnil: Jaikiran, I added a dependency from org.jboss.as.messaging module
to remote-naming module to be able to do this
(01:53:55 IST) Jaikiran: jmesnil: that's correct
(01:54:04 IST) Jaikiran: and i see what's going on and why this wasn't discovered
before
(01:54:07 IST) jmesnil: Jaikiran, but I don't want to add a dep to ejb-client to the
messaging subsystem
(01:54:18 IST) Jaikiran: jmesnil: that's correct, you shouldn't have to
(01:54:46 IST) stalep left the room (quit: Quit: Leaving).
(01:54:48 IST) Jaikiran: jmesnil: unlike in the standalone case where remote-naming is
used, the messaging subsystem in AS7 instance is backed by modular classloader
(01:55:01 IST) jmesnil: yes
(01:55:08 IST) Jaikiran: so since remote-naming doesn't have a dep on ejb-client (for
right reasons) it fails to find that class
(01:55:17 IST) jmesnil: right
(01:55:19 IST) Jaikiran: could you please file a JIRA in AS7 project for this?
(01:55:26 IST) jmesnil: ok will do
(01:55:30 IST) Jaikiran: thanks
(01:55:59 IST) jmesnil: Jaikiran, i saw in jira we want to add a jms: protocol to lookup
remote JMS resources
(01:56:20 IST) Jaikiran: jmesnil: btw, this wasn't "discovered" before
because typically users do these kind of lookups in their application deployment which has
by default visibility to the "ejb-client" module
(01:56:34 IST) jmesnil: Jaikiran, ideally, I'd use that to setup a JMS bridge but
until it is implemented i can only use the remote protocol
(01:56:39 IST) jmesnil: Jaikiran, i see
{quote}
Linkage error when doing remote JNDI lookup from messaging subsystem
--------------------------------------------------------------------
Key: AS7-4872
URL:
https://issues.jboss.org/browse/AS7-4872
Project: Application Server 7
Issue Type: Bug
Components: Naming
Affects Versions: 7.1.2.Final (EAP)
Reporter: Jeff Mesnil
Assignee: jaikiran pai
Priority: Minor
Working on AS7-4626 to add JMS bridge, the messaging subsystem now need to perform remote
JNDI lookup on another AS7 instances.
I added the org.jboss.remote-naming to the org.jboss.as.messaging to be able to load
org.jboss.naming.remote.client.InitialContextFactory.
However this creates a Linkage error:
09:45:42,100 WARN [org.jboss.modules] (MSC service thread 1-4) Failed to define class
org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector in Module
"org.jboss.remote-naming:main" from local module loader @a94884d (roots:
/home/jmesnil/Developer/jboss-as/build/target/jboss-as-7.2.0.Alpha1-SNAPSHOT/modules):
java.lang.LinkageError: Failed to link
org/jboss/naming/remote/client/ejb/RemoteNamingEjbClientContextSelector (Module
"org.jboss.remote-naming:main" from local module loader @a94884d (roots:
/home/jmesnil/Developer/jboss-as/build/target/jboss-as-7.2.0.Alpha1-SNAPSHOT/modules))
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
at
org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
at
org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
at org.jboss.modules.Module.loadModuleClass(Module.java:527)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at
org.jboss.naming.remote.client.InitialContextFactory.<clinit>(InitialContextFactory.java:118)
[jboss-remote-naming-1.0.3.Final.jar:1.0.3.Final]
at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_24]
at java.lang.Class.forName(Class.java:264) [rt.jar:1.6.0_24]
at
org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:61)
[jboss-as-naming-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:681)
[rt.jar:1.6.0_24]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
[rt.jar:1.6.0_24]
at javax.naming.InitialContext.init(InitialContext.java:240) [rt.jar:1.6.0_24]
at javax.naming.InitialContext.<init>(InitialContext.java:214)
[rt.jar:1.6.0_24]
at
org.hornetq.jms.bridge.impl.JNDIFactorySupport.createObject(JNDIFactorySupport.java:55)
[hornetq-jms-2.2.16.Final.jar:2.2.16.Final (HQ_2_2_16_FINAL, 122)]
at
org.hornetq.jms.bridge.impl.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:40)
[hornetq-jms-2.2.16.Final.jar:2.2.16.Final (HQ_2_2_16_FINAL, 122)]
at
org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjects(JMSBridgeImpl.java:1083)
[hornetq-jms-2.2.16.Final.jar:2.2.16.Final (HQ_2_2_16_FINAL, 122)]
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.start(JMSBridgeImpl.java:348)
[hornetq-jms-2.2.16.Final.jar:2.2.16.Final (HQ_2_2_16_FINAL, 122)]
at
org.jboss.as.messaging.jms.bridge.JMSBridgeService.start(JMSBridgeService.java:57)
[jboss-as-messaging-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[rt.jar:1.6.0_24]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.6.0_24]
at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]
Caused by: java.lang.NoClassDefFoundError: org/jboss/ejb/client/ContextSelector
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_24]
at java.lang.ClassLoader.defineClass(ClassLoader.java:634) [rt.jar:1.6.0_24]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[rt.jar:1.6.0_24]
at
org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
... 26 more
Caused by: java.lang.ClassNotFoundException: org.jboss.ejb.client.ContextSelector from
[Module "org.jboss.remote-naming:main" from local module loader @a94884d (roots:
/home/jmesnil/Developer/jboss-as/build/target/jboss-as-7.2.0.Alpha1-SNAPSHOT/modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 31 more
This error does not prevent doing remote lookups but looks ugly when starting the JMS
bridge...
org.jboss.naming.remote.client.InitialContextFactory is trying to load
org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector
in its static initialization block.
This class depends on org.jboss.ejb.client.ContextSelector which is in the
org.jboss.ejb-client module.
I don't want to add a dependency from org.jboss.as.messaging to org.jboss.ejb-client
if I can avoid it.
The org.jboss.naming.remote.client.InitialContextFactory defines a SETUP_EJB_CONTEXT
property that I could set to false but this property is checked after trying to load the
ejb-client class in the static block. afaict, loading the class only after checking the
property would be enough to prevent having this error being displayed
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira