aspose file tools*
The moose likes JBoss/WildFly and the fly likes How do I enable the invoker-servlet in JBoss AS 5.1.0.GA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How do I enable the invoker-servlet in JBoss AS 5.1.0.GA" Watch "How do I enable the invoker-servlet in JBoss AS 5.1.0.GA" New topic
Author

How do I enable the invoker-servlet in JBoss AS 5.1.0.GA

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
I'm running JBoss application server, version 5.1.0.GA and am going through a Servlet tutorial which makes use of an invoker-servlet, such that servlets can be invoked without creating servlet-specific entries in the web.xml file. The tutorial makes use of a customized Tomcat distribution, but I would like to just use my existing JBoss installation.

After quite a bit of searching, I can't figure out how to enable an invoker-servlet on JBoss. Can someone please point me to some instructions for this?

Thanks for any help.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Open the file server/xxx/deployers/jbossweb.deploy/web.xml and search for "invoker". You will find a commented-out block of config information for the invoker servlet - copy that <servlet> config element to your web.xml file.


JBoss In Action
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
Thanks, Peter. Is there a way to just enable this in the application server, so I don't have to include it in each application's web.xml file?
I tried just uncommenting it in the deployers web.xml file you mentioned, but then got a number of errors when starting the application server like:
I'm guessing there is additional configuration required. I tried searching for this in your book: JBoss in Action, but couldn't find anything that seemed appropriate.

Thanks,
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
Hmmm, it seems I get this error even when placing the above mentioned XML snippet in the web application's web.xml file. Here is the text of the exception:

I'm guessing that there's a security-related configuration which needs to be done, but I can't find it.

How do I unrestrict the class: org.apache.catalina.servlets.InvokerServlet?

Thanks,
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Mark E Hansen wrote:Is there a way to just enable this in the application server, so I don't have to include it in each application's web.xml file?

The web.xml file I specified is a global file that gets applied to every web app - you could uncomment it there. But before before you do that you should know that the invoker servlet open up a huge security hole, so I recommend avoiding it (I told you to edit your web.xml because that would at least somewhat limit that hole).

As for the security error you are getting, see if this helps: http://www.coderanch.com/t/87535/Tomcat/Security-Exception-while-starting-tomcat
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
Thanks, Peter. I'm wanting this just for my test server, which is not accessible to the Internet, so security is not a concern. I understand that I won't want this on my production server, and have no plans to do that.

I'll look at the reference you provided and see if I can make it work.

Thanks,
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
Thanks again, Peter. I was able to get it working with the help of that other posting.

To be honest, however, I don't see much value in this in my case, as the Create New Servlet wizard in Eclipse makes it real easy to add the servlet mapping XML when creating a new servlet

Best Regards,
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How do I enable the invoker-servlet in JBoss AS 5.1.0.GA