hubiquitus-old / hubiquitus4java

Hubiquitus client (hAPI) for Java
Other
0 stars 5 forks source link

ClassNotFoundException in testing bots #1

Open mvand opened 11 years ago

mvand commented 11 years ago

I just want to try the HelloBot and i have this exception thrown:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/camel/spi/Registry at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) at java.lang.Class.getMethod0(Class.java:2685) at java.lang.Class.getMethod(Class.java:1620) at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:492) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:484) Caused by: java.lang.ClassNotFoundException: org.apache.camel.spi.Registry at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 6 more

It seems like the camel-core and the camel-jetty jars are not valid (HubotsSDK). I tried to download and use those we can found on the official website (http://camel.apache.org/) instead of maven ones but this do not solve my problem.

Any suggestions ?

sunchenliang commented 11 years ago

Before you running the HelloBot, did you do a mvn clean install on projects hAPI and HubotsSDK to generate the jars.

mvand commented 11 years ago

I used 3 ways of compilation (using Netbeans IDE):

And i have always the same exception.

HelloBot needs HubotsSDK and hAPI. Both compilation worked.

The class org.apache.camel.spi.Registry is in my camel jar. I really do not understand why it does not work.

bnadim commented 11 years ago

Hello,

Do you have the file jndi.properties in your classpath ?

mvand commented 11 years ago

This file exists and contains java.naming.factory.initial = org.apache.camel.util.jndi.CamelInitialContextFactory He is in HubotsSDK/src/main/resources.

mvand commented 11 years ago

Any other ideas ?

maniadel commented 11 years ago

Are you installing the HNode? if yes you tourne it up, and you need to create a user (user ejabberd) for the helloBot, put the user and his password in config file of the helloBot, do not forgot the endPoint (ie: localhost:8080 if you turn it up in local) . I wish you a good luck.


To install the HNode see the read me: https://github.com/hubiquitus/hubiquitus-node

ebrulato commented 11 years ago

Hi mvand,

Firts of all I apologize for the long delay...

I have fixed this issue on the HelloBot (in fact it is a workarround but it works).

I'm working to fix all the samples and I am reorganizing the maven path to have something more friendly.

Maniadel is working on the documentation in order to provide a better support for the installation and to run the samples.

So you can download the last version of the master branch and install in your local maven repository :

then you just have to run the main Java file of the HelloBot.

Note : I suppose you have already installed a v0.5.x version of the Hubiquitus hNode in order to provide a valid user login and password.

Then you can test the HelloBot with the TestClient. We have not yet finished the documentation, so I keep this issue open.

This issue will be fixed in the v0.5.6

Best Regards,

Eric Brulatout