General J2EE: Tomcat 6.0 and Eclipse.

  1. Tomcat 6.0 and Eclipse. (3 messages)

    I have configured a web application in Eclipse and linked the same with tomcat 6.0 server. I wanted my application servlets URL path like following: //servlet/ However tomcat 6.0 runs my servlet only if I change the path to following format: // I dont want this and hence I uncomment the invoker servlet and its mapping in tomcat's web.xml file. Now I am gettting the following exception when I try to start the server: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet 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:4045) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) How to fix this. If I again comment invokder servlets mapping then it runs fine but dont take the servlet execution path as desired by me so I HAVE TO use invoker servlet concept. Anyone faced this ? Any help would be really appreciated. Thanks.

    Threaded Messages (3)

  2. Re: Tomcat 6.0 and Eclipse.[ Go to top ]

    Hi, Try this a) Comment back the invoker b) Modify your application's web.xml (not Tomcats) Add the following lines after context-param MyServlet com.acme.MyServlet MyServlet /servlet/com.acme.MyServlet You should then be able to access the servlet via the following url http://yourserver/yourapp/servlet/com.acme.MyServlet Hope this helps
  3. Thanks a lot for your comment. I already tried this and IT WORKED. :-) I found somewhere then InvokerServlet is an evil and should not be uncommented and its not a standard part of Tomcat 6.0 release. It was said so as InvokerServlet puts security concerns on stake can breach the wall of application security by calling anonymous servlets because we have uncommented it. Hence I commented it back. But later I tried my self of introducing InvokerServlet in my application's own deployment descriptor. The problem got solved now and I can use servlet/* URL pattern to call my application servlets. Cofiguring a Hibernate Web application in eclipse with tomcat server was a great learning experience for me. Can someone tell me where can I post my blog that document all I learnt in this process so the same could help others doing this. Thanks.
  4. Thanks a bunch![ Go to top ]

    This post helped me resolve the following error message on Tomcat 6 java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1145) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:619)