Preston McFarland

Greenhorn
+ Follow
since Aug 18, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Preston McFarland

Bob,
Just wanted to thank you for the help. The servelet is running fine now.
Thanks again,
Preston
22 years ago
William thanks for the response.
I was under the impression that all one need to do was place the class file in the "app name"/web-inf/classes folder and tomcat would auto register it. Then when accessing the page you would use http://localhost:8080/"app name"/"servlet name".
If I understand you correctly, becuase the servlet contains the following package line package com.ups.xmlsdk.servlet; I must create that entire directory structure.
1. Now will Tomcat still automatically regesiter the servelet?
2. What does the URL then look like?
3. How does that affect my web.xml file?
Current web-xml
<web-app>
<servlet>
<servlet-name>HandyShip</servlet-name>
<servlet-class>HandyShip</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HandyShip</servlet-name>
<url-pattern>/HandyShip</url-pattern>
</servlet-mapping>
</web-app>
22 years ago
I have a servlet that won't run on Tomcat. At one point I did have the servlet running, but in an attempt to clean things up (I had copies of jar and class files everyhwere) it won't run again.
I can compile the servlet just fine in Forte. However, when I run it I get the following error:
java.lang.NoClassDefFoundError: webapps/servlet/Web-inf/classes/HandyShip (wrong name: com/ups/xmlsdk/servlet/HandyShip)
the "webapps/servlet/Web-inf/classes/HandyShip" represents the path to the servlet it self
com/us/xmlskd/servlet is the name of the package in servlet Handyship "package com.ups.xmlsdk.servlet;"

Any ideas would be great.
22 years ago