Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException #475

Closed
samarian opened this issue Dec 5, 2013 · 9 comments
Closed

ClassNotFoundException #475

samarian opened this issue Dec 5, 2013 · 9 comments

Comments

@samarian
Copy link

samarian commented Dec 5, 2013

hi there
when i create a jar file from traccar server and run it using this command:
java -jar traccarserver.jar
i downloaded zip file source code from github
i encounter this error:
D:\projects\traccar\traccar-master\out\artifacts>java -jar traccar.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/netty/boots
trap/Bootstrap
at org.traccar.Main.main(Main.java:26)
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.bootstrap.Bootstrap

    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)
    ... 1 more

best regards

@tananaev
Copy link
Member

tananaev commented Dec 5, 2013

Third party library is missing...

@samarian
Copy link
Author

samarian commented Dec 6, 2013

which version of java must be used , which library might be missing ?

@tananaev
Copy link
Member

tananaev commented Dec 6, 2013

Java version 6+. As for libraries, it's a maven project, so they will be downloaded automatically if you use maven or IDE with a maven plugin.

@samarian
Copy link
Author

samarian commented Dec 6, 2013

hi anton,
i attached pom.xml to this mail ,
i imported the traccar project as an existing maven project in intellij idea .
i tested it with java 6 and 7.

thanks a lot

@tananaev
Copy link
Member

tananaev commented Dec 7, 2013

You can't attach files to GitHub emails, did you change pom file? I'm using NetBeans, not sure about IDEA..

@samarian
Copy link
Author

samarian commented Dec 7, 2013

it work in intellij Idea ,but when i package it as a jar file and run it in command line in windows it raise throw this exception,
i have another question : what is the parameter of Main class ,for example how can i pass config file to this server

@tananaev
Copy link
Member

tananaev commented Dec 7, 2013

You don't have third party libraries on your classpath, that's why you get an exception. Probably you forgot to copy them or something.

As for config file, you need to pass it as a command line argument:

java -jar tracker-server.jar "C:\traccar.cfg"

@mah5353
Copy link

mah5353 commented May 24, 2014

Hi Tananaev

I used this command java -jar tracker-server.jar " traccar.cfg" to run the server . But i am getting an exception called

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
        at org.traccar.Main.<clinit>(Main.java:25)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
        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)
        ... 1 more

@tananaev
Copy link
Member

@mah5353, have you read this thread? It already has an answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants