[jboss-user] [JBoss Messaging] - NoClassDefFound Exception connecting to JBM 1.4.0

dkuanwang do-not-reply at jboss.com
Tue Apr 7 19:11:17 EDT 2009


Hi, 

I am writing a standalone java client to connect to JBM 1.4.0 queue.

Following is my code:

Properties p = new Properties();
            p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
            p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming: org.jnp.interfaces");
            p.put(Context.PROVIDER_URL, "jnp://host:port");

            Context jndiContext = new InitialContext(p);
                       
            //get reference to the ConnectionFactory
            ConnectionFactory connectionFactory =
                    (ConnectionFactory) jndiContext.lookup("ClusteredConnectionFactory");
            
            //get reference to JMS destination
            javax.jms.Queue destination =
                    (javax.jms.Queue) jndiContext.lookup("queue/queue1");
            
            Connection connection = connectionFactory.createConnection("user","pwd");

I am getting exception at the createConnection:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.jboss.remoting.util.TimerUtil
        at org.jboss.remoting.ConnectionValidator.start(ConnectionValidator.java:503)
        at org.jboss.remoting.ConnectionValidator.addConnectionListener(ConnectionValidator.java:345)
        at org.jboss.remoting.Client.addConnectionListener(Client.java:385)
        at org.jboss.remoting.Client.addConnectionListener(Client.java:355)
        at org.jboss.remoting.Client.addConnectionListener(Client.java:343)
        at org.jboss.jms.client.remoting.JMSRemotingConnection.addConnectionListener(JMSRemotingConnection.java:462)
        at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:101)
        at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect_z_handleCreateConnectionDelegate_1027049.invoke(StateCreationAspect_z_handleCreateConnectionDelegate_1027049.java)
        at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
        at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
        at org.jboss.jms.client.container.ClusteringAspect.handleCreateConnectionDelegate(ClusteringAspect.java:134)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:122)
        at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientClusteredConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
        at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.java)
        at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
        at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
        at jmsremoteclient.TestMessageProducer.main(TestMessageProducer.java:44)

I have included the jbossall-client.jar in the classpath so I am not sure why it's getting class definition not found exception.

My classpath is as followed:
jboss-aop.jar
jboss-remoting.jar
javassist.jar
trove.jar
jbossall-client.jar
jboss-mdr.jar

Can someone also explain how the JBM class loading works with AOP , jboss-remoting.jar and jbossall-client.jar? 

thanks in advance,
David 


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4224195#4224195

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4224195



More information about the jboss-user mailing list