Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Servlet not working

Reply
Thread Tools

Servlet not working

 
 
dami.gupta@gmail.com
Guest
Posts: n/a
 
      04-03-2007
Hello,
This is a newbie question. Any help would be MUCH appreciated.

I am using JBoss. My servlet, HelloServlet, prints a simple Hello
statement. I create a hello.war file with files


welcome.html
META-INF/Manifest.mf
WEB-INF/web.xml
WEB-INF/classes/hello/HelloServlet.class

web.xml is as -

<?xml version="1.0"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" >


<web-app>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>hello.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>welcome.html</welcome-file>
</welcome-file-list>
</web-app>


I place the hello.war in the jboss/server/default/deploy directory.
JBoss starts up fine saying that the war file has been deployed.
In my browser, I type
http://localhost:8080/hello/welcome.html
This works fine.


However when I do
http://localhost:8080/hello/HelloServlet


I get
"Internal Server Error
The server encountered an internal error (Internal Server Error) that
prevented it from fulfilling this request"
...and so on

I have been following the SAMS Teach yourself EJB book.

Further, I have also tried putting my files in jboss/catalina/webapps
The structure is as

webapps/helloapp/welcome.html
webapps/helloapp/META-INF
webapps/helloapp/WEB-INF/web.xml
webapps/helloapp/WEB-INF/classes/hello/HelloServlet.class

At the browser, I do
http://localhost:8080/helloapp/HelloServlet and get

No Context configured to process this request
The server encountered an internal error (No Context configured to
process this request) that prevented it from fulfilling this request.



Please help. Thanks, DG

 
Reply With Quote
 
 
 
 
dami.gupta@gmail.com
Guest
Posts: n/a
 
      04-03-2007
On Apr 3, 2:01 pm, (E-Mail Removed) wrote:
> Hello,
> This is a newbie question. Any help would be MUCH appreciated.
>
> I am using JBoss. My servlet, HelloServlet, prints a simple Hello
> statement. I create a hello.war file with files
>
> welcome.html
> META-INF/Manifest.mf
> WEB-INF/web.xml
> WEB-INF/classes/hello/HelloServlet.class
>
> web.xml is as -
>
> <?xml version="1.0"?>
>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
> Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" >
>
> <web-app>
> <servlet>
> <servlet-name>HelloServlet</servlet-name>
> <servlet-class>hello.HelloServlet</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>HelloServlet</servlet-name>
> <url-pattern>/HelloServlet</url-pattern>
> </servlet-mapping>
> <welcome-file-list>
> <welcome-file>welcome.html</welcome-file>
> </welcome-file-list>
> </web-app>
>
> I place the hello.war in the jboss/server/default/deploy directory.
> JBoss starts up fine saying that the war file has been deployed.
> In my browser, I typehttp://localhost:8080/hello/welcome.html
> This works fine.
>
> However when I dohttp://localhost:8080/hello/HelloServlet
>
> I get
> "Internal Server Error
> The server encountered an internal error (Internal Server Error) that
> prevented it from fulfilling this request"
> ..and so on
>
> I have been following the SAMS Teach yourself EJB book.
>
> Further, I have also tried putting my files in jboss/catalina/webapps
> The structure is as
>
> webapps/helloapp/welcome.html
> webapps/helloapp/META-INF
> webapps/helloapp/WEB-INF/web.xml
> webapps/helloapp/WEB-INF/classes/hello/HelloServlet.class
>
> At the browser, I dohttp://localhost:8080/helloapp/HelloServletand get
>
> No Context configured to process this request
> The server encountered an internal error (No Context configured to
> process this request) that prevented it from fulfilling this request.
>
> Please help. Thanks, DG


Hi All,

I don't know how, but it seems to have all started working now.
I thank you all very very very much.
DG

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Servlet Error]- not a servlet class Jitender Java 2 10-17-2007 02:24 PM
Servlet error ...package Javax.servlet does not exist cormacdebarra@gmail.com Java 4 11-11-2006 01:55 PM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM
how to get my servlet configuration before the servlet is initialised Andy Fish Java 4 12-17-2003 09:47 PM



Advertisments