Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

tomcat's problem  RSS feed

 
Sam Yang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
I used tomcat 4.1.24 as my web container
I wrote a java bean to parse the designated
xml file(on the server) trying to show it's
contents on the IE browser..but , I received a illegalAccessException message by tomcat, anybody could tell me what's going wrong?
p.s. the program works well under the command mode
 
Amol Desai
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You need to post stack trace of the exception along with the relevant code for any one to help you.
 
Sam Yang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry,
here is the exception message showed on the browser
exception
org.apache.jasper.JasperException: class hospital.manage.AdminFlow : java.lang.IllegalAccessException: hospital.manage.AdminFlow
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(Stand
 
Sam Yang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
package hospital.manage;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.util.*;
public class AdminFlow {
Hashtable ht = new Hashtable(10);
Vector v1 = new Vector(); //type
private String _type="";
AdminFlow() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document domTree = builder.parse("C:\\tomcat\\webapps\\hospital\\flows.xml");
Element root = domTree.getDocumentElement();
NodeList nl1 = root.getElementsByTagName("type");
v1.add(new String(nl1.item(0).getFirstChild().getNodeValue()));
} catch (Exception exceptions) {
System.out.println("error");
}
} // end constructor
public Hashtable getInfo() {
ht.put("2",v1); //type
return ht;
}
}
,and my jsp code are
<jsp:useBean id="adminFlow" scope="page" class="hospital.manage.AdminFlow" />
 
Sam Yang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem solved.
I missed the point "Public constructor with no arguments."
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!