4 Replies Latest reply on Feb 6, 2011 3:06 PM by Ara Minosian

    Article on running Weld with Google App Engine

    Shane Bryzak Master

      For anyone that doesn't read the team's blog on http://in.relation.to, I've published the first part of a two part article there describing how to run Weld in Google App Engine.  Enjoy!


      http://in.relation.to/Bloggers/WeldJSF20AndGoogleAppEngineNavigatingTheMinefieldPart1

        • 1. Re: Article on running Weld with Google App Engine
          Ara Minosian Newbie

          I try to start weld 1.1.0.Final on GAE withou succes. 1.0.1 works fine.



          24.01.2011 13:30:57 org.jboss.weld.environment.servlet.Listener contextInitialized
          WARNING: @Resource injection not available in simple beans
          24.01.2011 13:30:57 org.jboss.weld.bootstrap.WeldBootstrap startContainer
          INFO: WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
          24.01.2011 13:30:58 com.google.apphosting.utils.jetty.JettyLogger warn
          WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@3ac93e{/,G:\ideaworkspace\richgost\target\agost}: java.lang.NoClassDefFoundError: org/apache/catalina/core/ApplicationContextFacade
          24.01.2011 13:30:58 com.google.apphosting.utils.jetty.JettyLogger warn
          WARNING: failed JettyContainerService$ApiProxyHandler@ecb67f: java.lang.NoClassDefFoundError: org/apache/catalina/core/ApplicationContextFacade
          24.01.2011 13:30:58 com.google.apphosting.utils.jetty.JettyLogger warn
          WARNING: Error starting handlers
          java.lang.NoClassDefFoundError: org/apache/catalina/core/ApplicationContextFacade
                  at org.jboss.weld.environment.tomcat.WeldForwardingAnnotationProcessor.getStandardContext(WeldForwardingAnnotationProcessor.java:92)
                  at org.jboss.weld.environment.tomcat.WeldForwardingAnnotationProcessor.replaceAnnotationProcessor(WeldForwardingAnnotationProcessor.java:69)
                  at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:192)
                  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:185)
                  at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:149)
                  at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
                  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)
          Caused by: java.lang.ClassNotFoundException: org.apache.catalina.core.ApplicationContextFacade
                  at java.net.URLClassLoader$1.run(Unknown Source)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at java.net.URLClassLoader.findClass(Unknown Source)
                  at java.lang.ClassLoader.loadClass(Unknown Source)
                  at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:151)
                  at java.lang.ClassLoader.loadClass(Unknown Source)
                  ... 21 more


          One more problem is logging. GAE use common logger. How to use slf4j and weld log injection together. If I include slf4j I have this error:



          SLF4J: Class path contains multiple SLF4J bindings.
          SLF4J: Found binding in [jar:file:/G:/ideaworkspace/richgost/target/agost/WEB-INF/lib/slf4j-jdk14-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
          SLF4J: Found binding in [jar:file:/G:/ideaworkspace/richgost/target/agost/WEB-INF/lib/weld-servlet-1.1.0.Final.jar!/org/slf4j/impl/StaticLoggerBinder.class]
          SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
          24.01.2011 13:16:47 com.google.apphosting.utils.jetty.JettyLogger warn
          WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@1e232b5{/,G:\ideaworkspace\richgost\target\agost}: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
          24.01.2011 13:16:47 com.google.apphosting.utils.jetty.JettyLogger warn
          WARNING: failed JettyContainerService$ApiProxyHandler@16f144c: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
          24.01.2011 13:16:47 com.google.apphosting.utils.jetty.JettyLogger warn
          WARNING: Error starting handlers
          java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
                  at org.slf4j.cal10n.LocLogger.info(LocLogger.java:122)
                  at org.jboss.weld.bootstrap.WeldBootstrap.<clinit>(WeldBootstrap.java:207)
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                  at java.lang.reflect.Constructor.newInstance(Unknown Source)
                  at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:112)
                  at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:132)
                  at org.jboss.weld.environment.servlet.util.Reflections.newInstance(Reflections.java:41)
                  at org.jboss.weld.environment.servlet.Listener.<init>(Listener.java:68)




          • 2. Re: Article on running Weld with Google App Engine
            Ara Minosian Newbie

            Logger problem is partially solved. Weld-servlet contains slf4j, but if I inject logger in ViewScoped or SessionScoped beans I get an error, so old play private static final logger pattern is used.

            • 3. Re: Article on running Weld with Google App Engine
              Stijn Cremers Novice

              Any solution found for this problem? i've got the same ...

              • 4. Re: Article on running Weld with Google App Engine
                Ara Minosian Newbie

                I suspect not. The problem is fixed in trunk. You would also wait for 1.2 Would you be able to report positive or negative results if any?