• 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

HTTP Status 500 -

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone!

I got this error when I was running form.html.
My URL is http://localhost:8080/Beer-v1/form.html
My html file:
<html>
<h1 align ="center">this is a page</h1>
<form method="POST"
action ="SelectBeer.do">
select beer characteristics<p>
color:
<select name ="color" size="1">
<option value="light"> light </option>
<option value="amberr"> amberr </option>
<option value="orange"> orange </option>
<option value="green"> green </option>
</select>
<br><br>
<center>
<input type="submit">
</center>
</form>
</body>
</html>

My web.xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
version="2.4">

<servlet>
<servlet-name>Ch3Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>


<servlet-mapping>
<servlet-name>Ch3Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>

</web-app>

I selected color and click "submit" button. And then I got following error:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1293)
java.lang.Thread.run(Thread.java:619)
root cause

java.lang.NoClassDefFoundError: com/example/web/BeerSelect (wrong name: com/examle/web/BeerSelect)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1960)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:933)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1405)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1293)
java.lang.Thread.run(Thread.java:619)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.32 logs.


Could you please help me solve this problem. Thank you all in advance.

Tom
 
Marshal
Posts: 67447
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like your servlet class file didn't end up in the right place.

Based upon the deployment descriptor, the class file should be located at:

WEB-INF/classes/com/example/web/BeerSelect.class

is it there?

 
Bear Bibeault
Marshal
Posts: 67447
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And... make sure that the correct package declaration is in the Java source file.
 
Tom Nishan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys for your quick response.
Package declaration was wrong. The problem is solved.

Thank you for your help. I really appreciate it.


 
    Bookmark Topic Watch Topic
  • New Topic