• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

NoClassDefFound-wrong name

 
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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • 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
 
Author
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
 
Rancher
Posts: 43016
76
  • 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
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
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
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: 43016
76
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*sigh*
 
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.
 
Marshal
Posts: 70228
282
  • 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.
 
Sheriff
Posts: 21997
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic