aspose file tools*
The moose likes Servlets and the fly likes ServletException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletException" Watch "ServletException" New topic
Author

ServletException

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Hi,
I am new in working with servlets,eclipse and tomcat.In my eclipse IDE ,I am having an web project SampleWebProject.In src/com/example/servlets, I am having my servlet program which originates a call to a outbound number.The following is my servlet code:

I am calling this servlet from a jsp program through link.when i press the submit button, i am getting the name and phone number in url,but i am getting the following error:

exception:
javax.servlet.ServletException: Error instantiating servlet class com.example.servlets.OutboundServlet1
etc...
root cause:
java.lang.NoClassDefFoundError : org/asteriskjava/manager/action/ManagerAction
etc...
root cause
java.lang.ClassNotFoundException :
org.asteriskjava.manager.action.ManagerAction

please assist me to do this.

Thanks

[ March 28, 2008: Message edited by: preethi Ayyappan ]
[ March 28, 2008: Message edited by: preethi Ayyappan ]
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
Your Servlet class in the package com.example.servlets . But your container is looking for a file in org/asteriskjava/manager/action/ManagerAction
.

I think, you have already map your servlet in web.xml.
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Thanks for your reply.please guide me what i have to do now.
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
Can you post your JSP Code? and web.xml content?
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
The following is my jsp code.

I am also pasting web.xml file

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 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">
<display-name>
SampleWebProject</display-name>
<servlet>
<description>
</description>
<display-name>
HelloServlet</display-name>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>
com.example.servlets.HelloServlet</servlet-class>
</servlet>
<servlet>
<description>
</description>
<display-name>
OutboundServlet1</display-name>
<servlet-name>OutboundServlet1</servlet-name>
<servlet-class>
com.example.servlets.OutboundServlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>OutboundServlet1</servlet-name>
<url-pattern>/OutboundServlet1</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>



[ March 28, 2008: Message edited by: preethi Ayyappan ]

[ March 28, 2008: Message edited by: preethi Ayyappan ]
[ March 28, 2008: Message edited by: preethi Ayyappan ]
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334


Please check this.
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
I have checked that.This displays the following error:

HTTP Status 404 - /SampleWebProject/com/example/servlets/OutboundServlet1
type Status report

message /SampleWebProject/com/example/servlets/OutboundServlet1

description The requested resource (/SampleWebProject/com/example/servlets/OutboundServlet1) is not available.
Apache Tomcat/5.5.26

[ March 28, 2008: Message edited by: preethi Ayyappan ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ServletException