• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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: https://coderanch.com/t/87535/Tomcat/Security-Exception-while-starting-tomcat
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic