java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: com/MyCompany/Beans/Crawler (wrong name: Crawler). I keep getting this error when i try and run a .jsp page. The problem stems from this line: <jsp:useBean id="craw" class="com.MyCompany.Beans.Crawler">. The line looks right to me. :confused:
Re: java.lang.NoClassDefFoundError
Are you using an IDE now? If so, try to add tools.jar to the project.
ØØ
Re: java.lang.NoClassDefFoundError
I went back to using notepad for now. As far as i understand it tomcat looks for classes stored in the following directory C:\Jakarta\jakarta-tomcat-5.0.28\webapps\ora\WEB-INF\classes. Im storing my classes in com\MyCompany\Beans which is off of the classes dir. So i should just have to use the latter directory path within the <jsp:useBean> tag but it doesn't work.
Re: java.lang.NoClassDefFoundError
do you add -classpath as a parameter when you compile JSP files with javac? If so, check to see that it is pointing to the right location. So it can locate the classes you need.
ØØ
Re: java.lang.NoClassDefFoundError
I think -classpath can be only used when running .class files using java. C:\jdk1.5.0\bin> javac -classpath C:\; Test.java won't work. The build.xml file should give the paths where the tomcat container can find the files. Shouldn't it? :confused:
Re: java.lang.NoClassDefFoundError
After looking at the build.xml file i found the following line. It looks like it's telling tomcat where to find any files to run. I don't know squat about .xml so im just guessing. :lol:
Code:
<classpath>
<pathelement location="${webapp.path}/WEB-INF/classes"/>
Re: java.lang.NoClassDefFoundError
Quote:
Originally Posted by Dilenger4
I think -classpath can be only used when running .class files using java. C:\jdk1.5.0\bin> javac -classpath C:\; Test.java won't work. The build.xml file should give the paths where the tomcat container can find the files. Shouldn't it? :confused:
You should do it when you compile servlets too, but not sure about JSP though. I am more of a pure Java langauge guy.....so I have no idea about your XML file either, but it looks like you are right about what you say.
But then it HAS to be something with your varaibles. When I google on it I keep finding stuff like this:
Quote:
Answer
java.lang.NoClassDefFoundError: sun/tools/javac/Main means that your classpath is not set correctly. Make sure your JAVA_HOME is set up right before you run the tomcat or startup scripts. If that doesn't do it, see these FAQ.