can't run GAE in local , throw this exception

7 views
Skip to first unread message

THIHA SOE via StackOverflow

unread,
Jan 6, 2016, 5:28:08 AM1/6/16
to google-appengin...@googlegroups.com

developing JSF on GAE, can't run my project , when i run , it throws this exception

Jun 26, 2011 4:09:21 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jun 26, 2011 4:09:21 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\THS\workspace\jsfgae\war\WEB-INF/appengine-web.xml
Jun 26, 2011 4:09:21 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\Users\THS\workspace\jsfgae\war\WEB-INF/web.xml
Jun 26, 2011 4:09:23 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@1700391{/,C:\Users\THS\workspace\jsfgae\war}: java.lang.NoClassDefFoundError: javax.naming.InitialContext is a restricted class. Please see the Google  App Engine developer's guide for more details.
Jun 26, 2011 4:09:23 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed JettyContainerService$ApiProxyHandler@78dc4c: java.lang.NoClassDefFoundError: javax.naming.InitialContext is a restricted class. Please see the Google  App Engine developer's guide for more details.
Jun 26, 2011 4:09:23 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Error starting handlers
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.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at com.sun.faces.config.WebConfiguration.processJndiEntries(WebConfiguration.java:613)
at com.sun.faces.config.WebConfiguration.<init>(WebConfiguration.java:122)
at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:182)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:163)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:186)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:157)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:169)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)
Jun 26, 2011 4:09:23 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8888/


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/6485134/cant-run-gae-in-local-throw-this-exception

Igor Artamonov via StackOverflow

unread,
Jan 6, 2016, 5:28:09 AM1/6/16
to google-appengin...@googlegroups.com

Yes, it's common problem, look at http://java.dzone.com/news/jsf2-configuration-google-app how to fix this.

And also look at http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine There is a lot of information about what Java libraries works on GAE, and what are not



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/6485134/cant-run-gae-in-local-throw-this-exception/6488276#6488276

Yster via StackOverflow

unread,
Jan 6, 2016, 5:28:12 AM1/6/16
to google-appengin...@googlegroups.com

This helped me:

From the this tutorial:

JSF 2 is using “javax.naming.InitialContext” that’s not supported in GAE.

To solve this:

  • You need to get a copy of the JSF’s source code. Copy the WebConfiguration.java
  • Comment methods that are using "javax.naming.InitialContext" class
  • But wait, you can get the already modified class from the tutorial (the long one).
  • Put it in the package com.sun.faces.config.
  • If you get an error on the split method, this could be the solution:

    result = Util.split(servletContext, value, sep);

Now, your newly created WebConfiguration.java class will overload the original WebConfiguration.java.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/6485134/cant-run-gae-in-local-throw-this-exception/34630723#34630723
Reply all
Reply to author
Forward
0 new messages