tags:

views:

262

answers:

1

I built application by using Netbeans and its working fine. But When i deployed on TOMCAT I am getting this error

javax.servlet.ServletException: Servlet.init() for servlet Relay threw exception
       org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
       org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
       org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
       java.lang.Thread.run(Thread.java:636)

*root cause*

java.security.AccessControlException: access denied (java.util.PropertyPermission jasper.reports.compile.class.path write)
       java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
       java.security.AccessController.checkPermission(AccessController.java:553)
       java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
       java.lang.System.setProperty(System.java:744)
       com.servlet.Relay.init(Relay.java:38)
       javax.servlet.GenericServlet.init(GenericServlet.java:212)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.lang.reflect.Method.invoke(Method.java:616)
       org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
       java.security.AccessController.doPrivileged(Native Method)
       javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
       org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)
       org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
       org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115)
       org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
       org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
       org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) 

Any Idea.

+2  A: 

Looks like the SecurityManager is configured to block modifications of the class path. What platform are you running on? And have a look at the tomcat conf directory for security manager configuration.

Check out these docs for tomcat 5.5.

I think you should check out whether you have a file $CATALINA_BASE/conf/catalina.policy, and if so add something like:

permission jasper.reports "jasper.reports.compile.class.path", "write";

If you write to that class path in your Relay servlet you should not use jasper.reports but your own package.

extraneon
I am running on WindowsXP.
Talha Bin Shakir