[rabbitmq-discuss] ConnectionFactory Class not found in Java

George gray at mix.wvu.edu
Sun Jul 15 04:03:46 BST 2012

I am attempting to run a Java class I developed called Send to publish 
messages. It breaks on creating a connection. This is on a Windows server 
with the RabbitMQ service running successfully - I can use it fine with 

Here is my Java compile statement:
C:\java>javac -classpath 

Here is the code
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.*;

public class Send {

  public static void main(String[] argv) throws Exception {

      ConnectionFactory factory = new ConnectionFactory();


Here are the results
C:\java>java Send
Exception in thread "main" java.lang.NoClassDefFoundError: 
        at Send.main(Send.java:10)
Caused by: java.lang.ClassNotFoundException: 
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

Has anyone encountered and resolved this issue? Two thoughts I have are 
ConnectionFactory is dependent on classes not in my compile command and 
that ConnectionFactory has no parameter-less definitions. 

Thanks for any help,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120714/96f6166b/attachment.htm>

More information about the rabbitmq-discuss mailing list