users@jersey.java.net

Re: [Jersey] Does Jersey work on Sun Application server 8.1 ?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 06 Nov 2009 10:27:18 +0100

Hi,

You need to update the server.policy file to grant permission to Jersey:

   http://java.sun.com/j2se/1.5.0/docs/guide/security/permissions.html#RuntimePermission

   http://docs.sun.com/source/816-7149-10/dgsecure.html#23037

Jersey will also use reflection and attempt to make private fields
accessible so it can inject so you may need to grant other permissions
to Jersey such as the ReflectPermission:

   http://java.sun.com/j2se/1.5.0/docs/guide/security/permissions.html#ReflectPermission

Paul.

On Nov 6, 2009, at 3:35 AM, dantu wrote:

>
> Deploying the Restful WS ( Jersey imp) works fine on Glassfish but
> when i try
> to deploy it onto Sun Application server 8.1 , it throws the
> following error
>
> javax.servlet.ServletException: Servlet.init() for servlet
> ServletAdaptor
> threw exception
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:
> 185)
>
> com
> .sun
> .enterprise
> .web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
>
> com
> .sun
> .enterprise
> .web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
>
> com
> .sun
> .enterprise
> .web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
>
> com
> .sun
> .enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:
> 55)
>
> root cause
>
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission getClassLoader)
>
> java
> .security
> .AccessControlContext.checkPermission(AccessControlContext.java:264)
>
> java.security.AccessController.checkPermission(AccessController.java:
> 427)
> java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> java.lang.Class.getClassLoader(Class.java:588)
>
> com
> .sun
> .jersey
> .spi
> .container.servlet.ServletContainer.configure(ServletContainer.java:
> 581)
>
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.load(ServletContainer.java:
> 537)
>
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 197)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> sun
> .reflect
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> sun
> .reflect
> .DelegatingMethodAccessorImpl
> .invoke(DelegatingMethodAccessorImpl.java:25)
>
> Our production version uses Sun Application server 8.1, so cannot use
> glassfish for now.
>
> Do i need to change my server.policy file to give some extra
> permissions for
> Jersey code to work or it's not supported to run on Sun Application
> server
> 8.1 .
>
> Please let me know , any help is greatly appreciated.
>
>
> --
> View this message in context: http://n2.nabble.com/Does-Jersey-work-on-Sun-Application-server-8-1-tp3956483p3956483.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>