Quantcast

Re: CGIServlet in Tomcat 6

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CGIServlet in Tomcat 6

samk-2
See Thread at: http://www.techienuggets.com/Detail?tx=4877 Posted on behalf of a User

Add it where exactly?  In $CATALINA_HOME/conf/context.xml?  In $CATALINA_HOME/conf/server.xml?  Please provide the exact path and a snippet of the code...


In Response To:

Hi all,

I'm using CGI servlet in Tomcat 5 without any problem, but with Tomcat
6 I get this error when deploying my web application:

java.lang.SecurityException: Servlet of class
org.apache.catalina.servlets.CGIServlet is privileged and cannot be
loaded by this web application

In Tomcat 6, I noticed that the servlet-cgi.jar is now part of
catalina.jar, but that's it.

thanks a lot for any advice.

Yannick


compete error message:

java.lang.SecurityException: Servlet of class
org.apache.catalina.servlets.CGIServlet is privileged and cannot be
loaded by this        web application
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1134)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:451)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

---------------------------------------------------------------------
To start a new topic, e-mail: [hidden email]
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To start a new topic, e-mail: [hidden email]
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: CGIServlet in Tomcat 6

Martin Gainty

grant tomcat access to CGIServlet.jar
edit $TOMCAT_HOME/conf/catalina.policy

grant codeBase "file:${catalina.home}/webapps/YourWebApp/WEB-INF/lib/CGIServlet.jar"
{
     permission java.security.AllPermission;
};

HTH
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.


> Date: Tue, 12 Aug 2008 14:32:50 -0500
> From: [hidden email]
> To: [hidden email]
> Subject: Re: CGIServlet in Tomcat 6
>
> See Thread at: http://www.techienuggets.com/Detail?tx=4877 Posted on behalf of a User
>
> Add it where exactly?  In $CATALINA_HOME/conf/context.xml?  In $CATALINA_HOME/conf/server.xml?  Please provide the exact path and a snippet of the code...
>
>
> In Response To:
>
> Hi all,
>
> I'm using CGI servlet in Tomcat 5 without any problem, but with Tomcat
> 6 I get this error when deploying my web application:
>
> java.lang.SecurityException: Servlet of class
> org.apache.catalina.servlets.CGIServlet is privileged and cannot be
> loaded by this web application
>
> In Tomcat 6, I noticed that the servlet-cgi.jar is now part of
> catalina.jar, but that's it.
>
> thanks a lot for any advice.
>
> Yannick
>
>
> compete error message:
>
> java.lang.SecurityException: Servlet of class
> org.apache.catalina.servlets.CGIServlet is privileged and cannot be
> loaded by this        web application
>         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1134)
>         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
>         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
>         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
>         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
>         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>         at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
>         at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
>         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
>         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
>         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
>         at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
>         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>         at org.apache.catalina.core.StandardService.start(StandardService.java:451)
>         at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: [hidden email]
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: [hidden email]
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

_________________________________________________________________
Got Game? Win Prizes in the Windows Live Hotmail Mobile Summer Games Trivia Contest
http://www.gowindowslive.com/summergames?ocid=TXT_TAGHM
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CGIServlet in Tomcat 6

markt
Martin Gainty wrote:
> grant tomcat access to CGIServlet.jar
> edit $TOMCAT_HOME/conf/catalina.policy
>
> grant codeBase "file:${catalina.home}/webapps/YourWebApp/WEB-INF/lib/CGIServlet.jar"
> {
>      permission java.security.AllPermission;
> };
>
> HTH

That won't help at all. The CGIServlet bypasses the security policy.

The privileged attribute needs to be set on the context.

Mark



---------------------------------------------------------------------
To start a new topic, e-mail: [hidden email]
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CGIServlet in Tomcat 6

Konstantin Kolinko
2008/8/13 Mark Thomas <[hidden email]>:
>
> The privileged attribute needs to be set on the context.
>

In your own web application create a file,
META-INF/context.xml, with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<Context privileged="true" />

See the manager application for an example.

Then redeploy your application, and it should work.

Contexts are documented here:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html#A%20word%20on%20Contexts

---------------------------------------------------------------------
To start a new topic, e-mail: [hidden email]
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...