geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: GBean - NoClassDefFoundError javax.jms.TopicConnectionFactory
Date Tue, 10 Apr 2007 20:50:19 GMT
I can't quite see how this  could make a difference but you might try  
setting the ThreadContextClassloader on the threads you create to the  
same as the gbeans TCCL.

thanks
david jencks


On Apr 10, 2007, at 1:39 PM, Oli Kessler wrote:

> It might be a threading issue.
>
> Our GBean spawns some more threads, each instrumented with a new  
> connection to the JMS. In this scenario, all threads fail with the  
> NCDFE.
>
>
> However, if the GBean accesses the JMS on it's own (in the same  
> thread), everything works.
> The broker implementation starts up, the logging is indicating  
> success (Journal open, channel at vm://localhost open, client gets  
> added)
>
> The test code is the following:
>
> logger.info("uuuhh - trying direct JMS access");
> TopicConnection con = ((TopicConnectionFactory) 
> this.managedConnectionFactoryWrapper.$getResource 
> ()).createTopicConnection();
> con.setClientID("customGBean-main");
> con.start();
> javax.jms.TopicSession s = con.createTopicSession(false,  
> Session.AUTO_ACKNOWLEDGE);
> javax.jms.Topic t = s.createTopic(this.jmsTopicName);
> TopicPublisher pub = s.createPublisher(t);
> logger.info("Publisher is " + pub);
>
>
> If however I run this code in a separate thread spawned by the  
> GBean, the startup fails with the NCDFE.
>
> Do I have to use thread pools or any other special means in this case?
>
> Thanks in advance
> -ok
>
> PS: now on geronimo-1.2beta
>
>
>
> On 10.04.2007, at 02:25, David Jencks wrote:
>
>> Generally if you use dependencies on jars that are also present in  
>> server classloaders you will get into trouble, although I'm a  
>> little surprised at NCDFE.
>>
>> Try replacing all the geronimo dependencies with one on the  
>> connector configuration
>>
>>     <dependencies>
>>       <dependency>
>>         <groupId>geronimo</groupId>
>>         <artifactId>j2ee-server</artifactId>
>>         <type>car</type>
>>       </dependency>
>>
>> (I think that's correct for 1.1.1, I'm a lot more familiar with  
>> 1.2 and trunk at the moment).
>>
>> thanks
>> david jencks
>>
>>
>>
>
>


Mime
View raw message