1 2 Previous Next 26 Replies Latest reply on Feb 5, 2010 6:15 PM by he youlin

    google app engine and weld

    Stijn Cremers Novice

      Hi there folks!


      Is there any support for using weld in the google app engine?


      Greetz

        • 1. Re: google app engine and weld
          Dan Allen Master

          Yes and no. Yes, it has been done once before. No, because we haven't yet completely verifying it with the current version of Weld. Shane has been working on this and promised to throw together a wiki page in the next couple of days to report his findings. So stay tuned!


          We are also going to incorporate GAE deployment into the Weld archetypes very soon.

          • 2. Re: google app engine and weld
            Stijn Cremers Novice

            Is there any new on this topic?

            • 3. Re: google app engine and weld
              Drew Arrigoni Newbie

              Stijn Cremers wrote on Jan 07, 2010 12:06:


              Is there any new on this topic?


              +1

              • 4. Re: google app engine and weld
                Shane Bryzak Master

                I've been working on this in my spare time and there's a couple of little issues that we need to fix.  Once I get a functioning app working I'll be sure to blog about it or something.

                • 5. Re: google app engine and weld
                  Stijn Cremers Novice

                  I'm thinking of building an app running on google app engine.
                  I only want to use the DI of weld. Does this work?


                  Is there something i can help you with? some testing?

                  • 6. Re: google app engine and weld
                    Nicklas Karlsson Master

                    I think I broke reflection recently due to GAE SecurityManager usage but we're (Shane is) working on it it.

                    • 7. Re: google app engine and weld
                      Shane Bryzak Master

                      Nik's reflection fixes are looking good, Pete and I are just banging out a serialization issue that has been giving us some grief for the last few days.  Hopefully once it's resolved there will be no further issues.

                      • 8. Re: google app engine and weld
                        Shane Bryzak Master

                        Thanks to Pete the serialization issue is now fixed - if you use the latest trunk version of Weld then you should have no problems deploying to GAE.

                        • 9. Re: google app engine and weld
                          Steven Farley Newbie

                          I built the Weld core and servlet modules from trunk, and added the org.jboss.weld.environment.servlet.Listener to the web.xml file for my GAE project.  I put the weld-servlet-1.0.0-SNAPSHOT.jar into WEB-INF/lib and a beans.xml file into WEB-INF.


                          I'm then attempting to access an application-scoped bean from a JSP page (trying both EL forms, ${} and #{}) and it's not working.  There are no exceptions being thrown, I just see the unevaluated expressions on the page.


                          What am I doing wrong?


                          • 10. Re: google app engine and weld
                            Stijn Cremers Novice

                            I've got it working on google app engine using the trunk version of the weld core, the 1.0.0-CR2 of weld-servlet, JSF 2.0 and JPA!

                            • 11. Re: google app engine and weld
                              Steven Farley Newbie

                              I've built weld-servlet-1.0.0-CR2 from source (checked out from http://anonsvn.jboss.org/repos/weld/extensions/tags/1.0.0-CR2/servlet), replacing the weld-core dependency with my local weld-core-1.0.1-SNAPSHOT built from trunk.  This packages everything into a local weld-servlet-1.0.0-CR2.jar which I copied to WEB-INF/lib in my GAE structure.


                              I'm then using @Inject to inject a @Model-annotated bean into a simple HttpServlet.  When the servlet doGet() executes, the bean is null.  I know Weld is being started because I see the listener writing to the log upon startup.  I'm running the App Engine 1.3 dev server.


                              Should this work, or am I missing something?


                              • 12. Re: google app engine and weld
                                Stijn Cremers Novice

                                You can contact me at cremersstijn{ad}gmail.com, so i give you me code examples...

                                • 13. Re: google app engine and weld
                                  Stijn Cremers Novice

                                  When i deployed my application to the google app engine, i got the following error:


                                  It worked when deploying locally...



                                  Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@d1b72d{/,/base/data/home/apps/my-things/1.339490771952719595}
                                  java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on private static final long java.lang.Throwable.serialVersionUID
                                       at com.google.appengine.runtime.Request.process-61e49efb8c338a58(Request.java)
                                       at java.lang.reflect.Field.setAccessible(Field.java:157)
                                       at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:228)
                                       at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:133)
                                       at org.jboss.weld.resources.ClassTransformer$2.call(ClassTransformer.java:72)
                                       at org.jboss.weld.resources.ClassTransformer$2.call(ClassTransformer.java:68)
                                       at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
                                       at java.util.concurrent.FutureTask.run(Unknown Source)
                                       at org.jboss.weld.util.collections.ConcurrentCache.putIfAbsent(ConcurrentCache.java:125)
                                       at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:67)
                                       at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:156)
                                       at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:133)
                                       at org.jboss.weld.resources.ClassTransformer$2.call(ClassTransformer.java:72)
                                       at org.jboss.weld.resources.ClassTransformer$2.call(ClassTransformer.java:68)
                                       at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
                                       at java.util.concurrent.FutureTask.run(Unknown Source)
                                       at org.jboss.weld.util.collections.ConcurrentCache.putIfAbsent(ConcurrentCache.java:125)
                                       at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:67)
                                       at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:156)
                                       at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:133)
                                       at org.jboss.weld.resources.ClassTransformer$2.call(ClassTransformer.java:72)
                                       at org.jboss.weld.resources.ClassTransformer$2.call(ClassTransformer.java:68)
                                       at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
                                       at java.util.concurrent.FutureTask.run(Unknown Source)
                                       at org.jboss.weld.util.collections.ConcurrentCache.putIfAbsent(ConcurrentCache.java:125)
                                       at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:67)
                                       at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:59)
                                       at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:86)
                                       at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:134)
                                       at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:367)
                                       at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:158)
                                       at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)
                                       at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
                                       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:191)
                                       at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
                                       at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
                                       at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
                                       at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5235)
                                       at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5233)
                                       at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
                                       at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
                                       at com.google.net.rpc.impl.Server$2.run(Server.java:838)
                                       at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
                                       at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:536)
                                       at com.google.net.rpc.impl.Server.startRpc(Server.java:793)
                                       at com.google.net.rpc.impl.Server.processRequest(Server.java:368)
                                       at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:448)
                                       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:466)
                                       at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:759)
                                       at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:205)
                                       at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
                                       at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
                                       at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:394)
                                       at java.lang.Thread.run(Unknown Source)
                                  Caused by: java.lang.IllegalAccessException: Reflection is not allowed on private static final long java.lang.Throwable.serialVersionUID
                                       ... 59 more



                                  • 14. Re: google app engine and weld
                                    Pete Muir Master

                                    Can you show us the full stack trace?

                                    1 2 Previous Next