[rabbitmq-discuss] re java client error

Paul Jones pauljones23 at gmail.com
Tue Sep 8 08:09:45 BST 2009


Aniruddh,

You haven't included commons-io in your classpath.

Paul.

On Tue, Sep 8, 2009 at 7:40 AM, aniruddh narayan <
aniruddh.narayan at yahoo.co.in> wrote:

> HI paul..as u told i canged the source file ie(HelloServer.java) to my
> present working directory C:\ ,Also deleted the package
> com.rabbitmq.examples;...the file is compiling fine and a .class file is
> being produced (but thing as they are not supposed to work ver
> easily...[:)])..the following error is displayed when trying to run the file
>
>
> C:\>javac HelloServer.java
>
> C:\>java HelloServer
> Main thread caught exception: java.io.IOException
> java.io.IOException
>         at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:121)
>         at
> com.rabbitmq.client.impl.AMQConnection.open(AMQConnection.java:363)
>         at
> com.rabbitmq.client.impl.AMQConnection.<init>(AMQConnection.java:208)
>
>         at
> com.rabbitmq.client.impl.AMQConnection.<init>(AMQConnection.java:178)
>
>         at
> com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory
> .java:165)
>         at
> com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory
> .java:213)
>         at
> com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory
> .java:227)
>         at
> com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory
> .java:238)
>         at HelloServer.main(HelloServer.java:45)
> Caused by: com.rabbitmq.client.ShutdownSignalException: connection error;
> reason
> : java.lang.NoClassDefFoundError:
> org/apache/commons/io/input/ProxyInputStream
>         at
> com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:59
> 9)
>         at
> com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.jav
> a:465)
> Caused by: java.lang.NoClassDefFoundError:
> org/apache/commons/io/input/ProxyInpu
> tStream
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
> 4)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         at
> com.rabbitmq.client.impl.MethodArgumentReader.<init>(MethodArgumentRe
> ader.java:70)
>         at
> com.rabbitmq.client.impl.AMQImpl.readMethodFrom(AMQImpl.java:5710)
>         at
> com.rabbitmq.client.impl.AMQCommand$Assembler.handleFrame(AMQCommand.
> java:275)
>         at
> com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:107)
>         at
> com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.jav
> a:439)
>
> ....also my server is running fine and showing the message "broker
> running"....
>
>
> --- On *Tue, 8/9/09, Paul Jones <pauljones23 at gmail.com>* wrote:
>
>
> From: Paul Jones <pauljones23 at gmail.com>
> Subject: Re: [rabbitmq-discuss] re java client error
> To: "aniruddh narayan" <aniruddh.narayan at yahoo.co.in>
> Cc: rabbitmq-discuss at lists.rabbitmq.com
> Date: Tuesday, 8 September, 2009, 11:22 AM
>
>
> Aniruddh,
>
> Ok. So the wrong name message means that you compiled the HelloServer
> example slightly wrong. Perhaps the quickest thing to do would be to change
> the source file, and remove the package declaration at the top. Then, if you
> recompile, java HelloServer should work just fine.
>
> Have you considered my suggestion about an IDE? Given the trouble it takes
> just to get single class files to work, I'm sure you can see how troublesome
> it could be to try to get something more complicated to work. An IDE also
> gives you the ability to debug the code, and step through it as it does its
> thing.
>
> Also, would you be able to reply to emails instead of starting new threads?
> In threaded mail readers (such as gmail), this conversation keeps coming in
> as new mail conversations.
>
> Thanks,
> Paul.
>
> On Tue, Sep 8, 2009 at 6:26 AM, aniruddh narayan <
> aniruddh.narayan at yahoo.co.in<http://mc/compose?to=aniruddh.narayan@yahoo.co.in>
> > wrote:
>
>>  Hi paul..the previous was a typo error....anyway included the (.) current
>> directory to the classpath.....but in vain....following is the output
>>
>> C:\>javac HelloServer.java
>>
>> C:\>java HelloServer
>> Exception in thread "main" java.lang.NoClassDefFoundError: HelloServer
>> (wrong na
>> me: com/rabbitmq/examples/HelloServer)
>>         at java.lang.ClassLoader.defineClass1(Native Method)
>>         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>>         at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
>> 4)
>>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>>         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>>
>> C:\>java com.rabbitmq.examples.HelloServer
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> com/rabbitmq/examples
>> /HelloServer
>>
>> Ani
>>
>>
>>
> ------------------------------
> See the Web's breaking stories, chosen by people like you. Check out Yahoo!
> Buzz <http://in.rd.yahoo.com/tagline_buzz_1/*http://in.buzz.yahoo.com/>.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090908/b9bfebd1/attachment.htm 


More information about the rabbitmq-discuss mailing list