[jboss-as7-dev] Setting up implicit dependency on JMS provider impl module

Jaikiran Pai jpai at redhat.com
Thu Apr 21 08:05:35 EDT 2011


Comments inline.

On Wednesday 20 April 2011 06:39 PM, David M. Lloyd wrote:
> On 04/20/2011 02:38 AM, Jaikiran Pai wrote:
>> When testing this, it runs into this exception:
>>
>> 12:51:38,061 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) Caused by:
>> java.lang.ClassNotFoundException:
>> org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy
>> from [Module "deployment.test.war:main" from Service Module Loader]
>> 12:51:38,061 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
>> org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:184)
>> 12:51:38,062 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:357)
>> 12:51:38,062 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:306)
>> 12:51:38,063 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
>> org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:100)
>> 12:51:38,068 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at
>> org.hornetq.core.client.impl.ClientSessionFactoryImpl$1.run(ClientSessionFactoryImpl.java:1162)
>> 12:51:38,069 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) ... 28 more
>>
>>
>> Adding a Dependencies: org.hornetq to the .war/META-INF/MANIFEST.MF of
>> the war and redeploying the war gets me past this issue. But shouldn't
>> this dependency on our internal JMS provider impl module be setup
>> automatically by one of our deployment unit processors, instead of the
>> user having to do it?
>
> No we should not need the dependency at all.  I think the problem here
> is HornetQ using the TCCL (from
> org.hornetq.core.client.impl.ClientSessionFactoryImpl$1.run) to load one
> of its own classes
> (org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy).
>    It probably should be using its own class loader for this purpose, IMO.
>
Yes indeed! HornetQ ClientSessionFactoryImpl uses TCCL:

       AccessController.doPrivileged(new PrivilegedAction<Object>()
       {
          public Object run()
          {
             ClassLoader loader = 
Thread.currentThread().getContextClassLoader();
             try
             {
                Class<?> clazz = 
loader.loadClass(connectionLoadBalancingPolicyClassName);


So how do we fix such issues in thirdparty libraries?

P.S: Is this worth a JIRA?

-Jaikiran



More information about the jboss-as7-dev mailing list