Two Laptop Bag
The moose likes Servlets and the fly likes Allocate exception for my firstr and very simple servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

Allocate exception for my firstr and very simple servlet

lucio bosque

Joined: Apr 28, 2010
Posts: 11
Hi ,
Can anyone please assist
I am a newbay to servlets , I am trying to create a simple servlet using eclipse helios with Jboss 5.1 GA .
I have created a new Dynamic Web project named JavaRanchSample , (AddingServletToSrc.JPG attach )
and then I have wrote the most simplest code can be in the DoPost method
PrintWriter out = response.getWriter();
out.println("Hello World");
Then I have tried to run it on the server (RunSrvOnJboss.JPG attach)
and I am getting the following exception :
20:22:03,250 ERROR [[FirstServlet]] Allocate exception for servlet FirstServlet
java.lang.ClassNotFoundException: lucio.FirstServlet
at Method)
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(
at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(
at org.apache.catalina.core.StandardWrapper.loadServlet(
at org.apache.catalina.core.StandardWrapper.allocate(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

[Thumbnail for SimplestServletCode.JPG]

[Thumbnail for AddingServletToSrc.JPG]

Martin Caminoa

Joined: Oct 25, 2010
Posts: 5
Seems to be related to web.xml configuration file.
lucio bosque

Joined: Apr 28, 2010
Posts: 11
thanks for you quick replay
I have tried alot of time to customize my web.xml file without success
the basic setting are as in the image attach.
and it's seems just fine

[Thumbnail for webxml.JPG]

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

If you right-click the project and check the build path, the bottom of the first tab should have the default output folder and should be
(something something something)/WEB-INF/classes
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63869

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please click this link ⇒ CarefullyChooseOneForum ⇐ for more information.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Allocate exception for my firstr and very simple servlet
It's not a secret anymore!