I'm using the last stable, 1.0.2
It seems that the javax.naming.InitialContext class is not in the JRE
classes white list of AppEngine java runtime.
But I don't understand why my code needs this class, thereas your code not.
Perhaps I've to configure more in my web.xml?
2009/4/9 Paul Sandoz (via Nabble)
<ml-user+51078-502935899_at_n2.nabble.com<ml-user%2B51078-502935899_at_n2.nabble.com>
>
> Hi,
>
> What version are you using? 1.0.2?
>
> The code path to get an instance of InitialContext not conditionally
> executed, so it seems to work for some.
>
> This is the code in 1.0.3-SNAPSHOT:
>
> private javax.naming.Context getContext() {
> try {
> return new InitialContext();
> } catch (NamingException ex) {
> return null;
> }
> }
>
> I could change that to catch Exception instead.
>
> Paul.
>
> On Apr 9, 2009, at 9:05 AM, dbaran wrote:
>
> >
> > Hi,
> >
> > I'm newbe on Jersey, but I try to deploy a simple class to try
> > Jersey on the AppEngine, and when I try to access to my REST
> > resource, I've a server error, with this log in the AppEngine admin
> > console :
> >
> > Uncaught exception from servlet
> > java.lang.NoClassDefFoundError: javax.naming.InitialContext is a
> > restricted class. Please see the Google App Engine developer's guide
> > for more details.
> > at
> > com
> > .google
> > .apphosting
> > .runtime
> > .security
> > .shared.stub.javax.naming.InitialContext.<clinit>(InitialContext.java)
> > at
> > com
> > .sun
> > .jersey
> > .spi.container.servlet.WebComponent.getContext(WebComponent.java:674)
> > at
> > com
> > .sun
> > .jersey
> > .spi
> > .container
> > .servlet.WebComponent.configureJndiResources(WebComponent.java:649)
> > at
> > com
> > .sun
> > .jersey
> > .spi.container.servlet.WebComponent.configure(WebComponent.java:379)
> > at
> > com
> > .sun
> > .jersey
> > .spi
> > .container.servlet.ServletContainer.configure(ServletContainer.java:
> > 461)
> > at
> > com
> > .sun
> > .jersey.spi.container.servlet.WebComponent.load(WebComponent.java:432)
> > at
> > com
> > .sun
> > .jersey.spi.container.servlet.WebComponent.init(WebComponent.java:167)
> > at
> > com
> > .sun
> > .jersey
> > .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> > 197)
> > at
> > org
> > .mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:
> > 433)
> > at
> > org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:
> > 256)
> > at
> > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
> > 40)
> > at
> > org
> > .mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:
> > 612)
> > at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
> > at
> > org
> > .mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:
> > 1218)
> > at
> > org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:
> > 500)
> > at
> > org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
> > at
> > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
> > 40)
> > at
> > com
> > .google
> > .apphosting
> > .runtime
> > .jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:
> > 190)
> > at
> > com
> > .google
> > .apphosting
> > .runtime
> > .jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:167)
> > at
> > com
> > .google
> > .apphosting
> > .runtime
> > .jetty
> > .JettyServletEngineAdapter
> > .serviceRequest(JettyServletEngineAdapter.java:113)
> > at
> > com
> > .google
> > .apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
> > at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:4547)
> > at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:4545)
> > at
> > com
> > .google
> > .net
> > .rpc
> > .impl
> > .BlockingApplicationHandler
> > .handleRequest(BlockingApplicationHandler.java:24)
> > at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> > 359)
> > at com.google.net.rpc.impl.Server$2.run(Server.java:792)
> > at
> > com
> > .google
> > .tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
> > at
> > com
> > .google
> > .tracing
> > .LocalTraceSpanBuilder
> > .internalContinueSpan(LocalTraceSpanBuilder.java:489)
> > at com.google.net.rpc.impl.Server.startRpc(Server.java:748)
> > at com.google.net.rpc.impl.Server.processRequest(Server.java:340)
> > at
> > com
> > .google
> > .net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:
> > 422)
> > at
> > com
> > .google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:
> > 319)
> > at
> > com
> > .google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:
> > 290)
> > at com.google.net.async.Connection.handleReadEvent(Connection.java:
> > 419)
> > at
> > com
> > .google
> > .net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:
> > 733)
> > at
> > com
> > .google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:
> > 207)
> > at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
> > 101)
> > at
> > com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:
> > 249)
> > at com.google.apphosting.runtime.JavaRuntime
> > $RpcRunnable.run(JavaRuntime.java:373)
> > at java.lang.Thread.run(Unknown Source)
> >
> >
> > I've only initialized and mapped the ServletContainer in the
> > web.xml, like this:
> >
> >
> > <servlet>
> > <servlet-name>Jersey</servlet-name>
> > <servlet-
> > class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-
> > class>
> > <init-param>
> > <param-name>com.sun.jersey.config.property.packages</param-name>
> > <param-value>my.package</param-value>
> > </init-param>
> > <load-on-startup>1</load-on-startup>
> > </servlet>
> >
> > <servlet-mapping>
> > <servlet-name>Jersey</servlet-name>
> > <url-pattern>/*</url-pattern>
> > </servlet-mapping>
> >
> >
> > Regards,
> >
> >
> > Thanks for pointing that Paul.
> >
> >> BTW in your web.xml you have two types of Jersey configuration in the
> >> init-params. The following will take precedence:
> >>
> >>> <init-param>
> >>>
> >>> <param-name>com.sun.jersey.config.property.resourceConfigClass</
> >>> param-name>
> >>>
> >>> <param-value>com.sun.jersey.api.core.PackagesResourceConfig</
> >>> param-value>
> >>> </init-param>
> >>> <init-param>
> >>> <param-name>com.sun.jersey.config.property.packages</param-
> >>> name>
> >>> <param-value>com.joovie.webapp.pages</param-value>
> >>> </init-param>
> >>
> >>> <init-param>
> >>> <param-name>javax.ws.rs.Application</param-name>
> >>> <param-value>Joovie</param-value>
> >>> </init-param>
> >>
> >>
> >> over the specific application class "Joovie" you have declared:
> >>
> >>> <init-param>
> >>> <param-name>javax.ws.rs.Application</param-name>
> >>> <param-value>Joovie</param-value>
> >>> </init-param>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2609737&i=0>
> > For additional commands, e-mail: users-help@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2609737&i=1>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://n2.nabble.com/Jersey-on-app-engine-tp2604278p2609679.html
> > Sent from the Jersey mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2609737&i=2>
> > For additional commands, e-mail: users-help@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2609737&i=3>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2609737&i=4>
> For additional commands, e-mail: users-help@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2609737&i=5>
>
>
>
> ------------------------------
> This email is a reply to your post @
> http://n2.nabble.com/Jersey-on-app-engine-tp2604278p2609737.html
> You can reply by email or by visting the link above.
>
>
--
View this message in context: http://n2.nabble.com/Jersey-on-app-engine-tp2604278p2609862.html
Sent from the Jersey mailing list archive at Nabble.com.