1

私はこのリンクをjsfでGoogleアプリエンジンに使用しているので、Eclipseで実行するとこのエラーが発生するので、希望のソリューションリンクを提供して ください http://www.mkyong.com/google-app-engine/google-app-engine -jsf-2-example/

    java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass
     (IsolatedAppClassLoader.java:207)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at org.mortbay.util.Loader.loadClass(Loader.java:91)
    at org.mortbay.util.Loader.loadClass(Loader.java:71)
    at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    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:197)
    at com.google.appengine.tools.development.AbstractContainerService.startup
    (AbstractContainerService.java:241)
    at com.google.appengine.tools.development.DevAppServerImpl.start
    (DevAppServerImpl.java:148)
    at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply
    (DevAppServerMain.java:310)
    at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
    at com.google.appengine.tools.development.DevAppServerMain.<init>
     (DevAppServerMain.java:249)
     at com.google.appengine.tools.development.DevAppServerMain.main
     (DevAppServerMain.java:225)

  Sep 06, 2012 10:58:55 AM com.google.appengine.tools.development.ApiProxyLocalImpl log
     SEVERE: javax.servlet.ServletContext log: unavailable
      javax.servlet.UnavailableException: javax.faces.webapp.FacesServlet
    at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    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:197)
    at com.google.appengine.tools.development.AbstractContainerService.startup
     (AbstractContainerService.java:241)
    at com.google.appengine.tools.development.DevAppServerImpl.start
    (DevAppServerImpl.java:148)
    at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply
    (DevAppServerMain.java:310)
    at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
    at com.google.appengine.tools.development.DevAppServerMain.
    <init>(DevAppServerMain.java:249)
    at com.google.appengine.tools.development.DevAppServerMain.main
    (DevAppServerMain.java:225)

     Sep 06, 2012 10:58:55 AM com.google.apphosting.utils.jetty.JettyLogger warn
   WARNING: failed Faces Servlet: java.lang.NullPointerException
    Sep 06, 2012 10:58:55 AM com.google.apphosting.utils.jetty.JettyLogger warn
   WARNING: Failed startup of context
   com.google.appengine.tools.development.DevAppEngineWebAppContext@1dc94ea
    {/,C:\Documents and Settings\Shilendra Sharma\workspace\Shilu\war}
     java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(Native Method)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    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:197)
    at com.google.appengine.tools.development.AbstractContainerService.startup
    (AbstractContainerService.java:241)
    at com.google.appengine.tools.development.DevAppServerImpl.start
    (DevAppServerImpl.java:148)
    at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply
    (DevAppServerMain.java:310)
    at com.google.appengine.tools.util.Parser$ParseResult.applyArgs
    (Parser.java:48)
    at com.google.appengine.tools.development.DevAppServerMain.
    <init>(DevAppServerMain.java:249)
    at com.google.appengine.tools.development.DevAppServerMain.main
    (DevAppServerMain.java:225)


   so any one help me for it work properly

アプリ シレンドラ

4

1 に答える 1

1

JSF 2 は、GAE でサポートされていない「javax.naming.InitialContext」を使用しています。

これを解決するには:

  • JSF のソース コードのコピーを取得する必要があります。WebConfiguration.java をコピーします。
  • 「javax.naming.InitialContext」クラスを使用しているコメント メソッド
  • しかし、待ってください。私は最新のもの (jsf 2.2.12) を変更しました。これはWebConfiguration.javaです。
  • パッケージ com.sun.faces.config に入れます。

これで、新しく作成した WebConfiguration.java クラスが元の WebConfiguration.java をオーバーロードします。

于 2016-01-06T10:17:55.407 に答える