Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFound-wrong name

 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am working with web services and i am trying to test them, i am shocked to get the following exception, the thing is there is a Test.java file in a package and build the class using ant build.xml the Test.java consist of main method but i am facing the following error and i checked many a times the source file name with the class name, and named them by copying from what i have typed but still
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15484
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is exactly the command that you typed in to run your application? Try this instead:

java -classpath build\classes org.apache.ws.axis2.Test
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no change
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your directory structure (source and build), and how are you trying to run it? It's definitely a classpath issue; it looks like it's trying to run something with the classpath set up the hierarchy too far.
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is my directory structure
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, the command given by Jesper should work assuming that the current directory is the top-level one (in which "src" and "classes" reside).
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:how are you trying to run it?
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i am running through the prompt by changing the directory to the appropriate location and run in the usual way i am getting the error which i have specified earlier but when i am using an IDE i am getting the following error.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The usual way"? How would I know what your "usual way" is? TellTheDetails. Don't make us guess what you're doing--it makes it very painful to help.
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry if i am providing less information

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And your classpath is? Where are you in your directory hierarchy when you try to run?
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HelloService is the root directory

when i am running the File Test.class i will in the location
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java Test

This can't possibly work, since the class is part of the org.apache.ws.axis2 package. Try "java org.apache.ws.axis2.Test" instead.

You need to change into the "HelloService" directory first, and then the command posted by Jesper will work.
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have tried in your way
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*sigh*
 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change to

drive:\XXXX\HelloService


and then run

java -classpath build\classes org.apache.ws.axis2.Test
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is really the problem with the classpath and the location i am using, the one you have said is working.
even earlier one of the member asked me to do the same but the location made the difference.
thanks for every one who took the risk and pain to help me.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you running from Eclipse? That is the only place I have seen Unresolved compilation problems.
 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or any other IDE that allows you to run code without solving compiler errors. And this is why you never should run an application while there are still compiler errors; you should always solve these before trying to run your application. Any application with compiler errors will always be broken.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic