jQuery in Action, 3rd edition
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes unable to execute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "unable to execute" Watch "unable to execute" New topic

unable to execute

Chitra Jay
Ranch Hand

Joined: May 02, 2002
Posts: 76
This is my first program, i have problems in viewing the output.
I am able to run tomcat
http://localhost:8080 works fine.
But,When i try to see my output
http://localhost:8080/chapter01/servlet/HelloWorldServlet , it doesnt work.
I copied the class file and placed in
and created web.xml in the directory
my classpath is
Please tell me if i am missing something

Sudd Ghosh
Ranch Hand

Joined: Oct 23, 2002
Posts: 187
I placed my classes in the path webapps/examples/WEB-INF/classes, and that worked. I guess this is the default path in tomcat. I did not create my own directory in place of "examples". But I too want to know what all changes have to be done in case I want to keep my servlet classes in some user-specific path, like webapps/chapter1/WEB-INF/classes. Do I have to modify the server.xml file or some other file, and if so, what all changed are required.
Any help will be appreciated.
Thanks, Sudd

Don Bosco
Ranch Hand

Joined: Oct 31, 2002
Posts: 108
Ok Guys, here is what u need to do.
Create a copy of the examples directory in the webapps directory. Rename it to chapter01.
Now remove all the unnecessary files and directories in chapter01 and put your class files in the classes dir.
clean up the web.xml and add the tags u needed.
Thats it. For more info check this thread

Check this

SCJP 1.4<p>Wingardium Leviosa!!
Madan, Gopal
Ranch Hand

Joined: Aug 13, 2001
Posts: 86
Assuming everything is installed fine, there are couple of things you can do for HelloWorldServlet under chapter01 webapp to work.
1. You can enable the default "invoker" servlet to kick-in ( which is what you tried to use ).
2. Create a servlet-mapping element in your chapter01\WEB-INF\web.xml file.
For the first option, uncomment the servlet-mapping element for the "invoker" servlet, in the file $CATALINA_HOME\conf\web.xml. This is commented out, by default in tomcat 4.1.12, which i assume is the case with your version, too. Then the URL you used should work.
For the second option, add the following servlet-mapping to your chapter01\WEB-INF\web.xml file.

Then your HelloWorldServlet can be access via HelloWorldServlet
Change the url-pattern and the port #, as you wish.
Hope this helps
Sudd Ghosh
Ranch Hand

Joined: Oct 23, 2002
Posts: 187
Don's suggestion worked. Thanks Don. It was not as complicated as I imagined.
Thanks, Sudd
I agree. Here's the link: http://aspose.com/file-tools
subject: unable to execute
It's not a secret anymore!