It's not a secret anymore!
The moose likes Servlets and the fly likes How should I set up the servlet ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How should I set up the servlet ?" Watch "How should I set up the servlet ?" New topic

How should I set up the servlet ?

Calanthe Wei
Ranch Hand

Joined: Oct 27, 2001
Posts: 42
I am testing the code in the book "Java Developer's guide to servelt and JSP" the part of Applet and Servlet communication.
I am using JBuilder and I am totally lost what's wrong with my setting and I keep getting the error message. Pls help me with it. Thank you so much!
This is the exact code in this book.
package test515;
import com.javaranch.common.*;
// I use the package in Javaranch
// You can find it in this website
// And ObjectServlet is a servlet class in
// that package
class PipelineServlet extends ObjectServlet{
public Object doObject(Object obj){
String old = (String)obj;
String s = "";
for(int i = old.length() -1;i>=0; i--){
s+= old.charAt(i);
return s;
What I do is set up a project and import the com.javaranch.common package inthis project. And then use servlet wizard to write a servlet as above. The only difference is that it extends ObjectServlet instead of HttpServlet
Here is the web.xml
I think maybe there's something wrong with this
But i don't know what's it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "">
The error message is like
Error: 500 Location: /pipelineservletInternal Servlet Error:java.lang.IllegalAccessException: test515.PipelineServlet
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(
at org.apache.tomcat.core.ServletWrapper.loadServlet(
at org.apache.tomcat.core.ServletWrapper.init(
at org.apache.tomcat.core.Handler.service(
at org.apache.tomcat.core.ServletWrapper.service(
at org.apache.tomcat.core.ContextManager.internalService(
at org.apache.tomcat.core.ContextManager.service(
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(
at org.apache.tomcat.service.TcpWorkerThread.runIt(
at org.apache.tomcat.util.ThreadPool$
Thank you in advance!
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036

That sure sounds like a file-system access problem.
Calanthe Wei
Ranch Hand

Joined: Oct 27, 2001
Posts: 42
Then what should I do to avoid this? I am quite new to this stuff. Thank you so much!
I agree. Here's the link:
subject: How should I set up the servlet ?
jQuery in Action, 3rd edition