1 2 Previous Next 23 Replies Latest reply on Jan 8, 2014 5:27 AM by mgreau

    CapeDwarf and WildFly

    mgreau

      Hi,

       

      I have an app which is deployed on appengine-1.8. This app is very simple and it uses the Cloud Endpoint API, the Datastore API (with Objectify v4), the OAuth API and Search API.

      I want to test it under WildFly-8.0.0-beta1, what's the easy way to do it (clone github repos...) ?

       

      Regards.

      Thanks.

        • 1. Re: CapeDwarf and WildFly
          alesj

          Currently CapeDwarf AS integration builds against JBossAS7.2.0.Final.

           

          I do have a Wildfly branch of all CapeDwarf pieces - Shared, Blue and AS-int.

          (search my alesj CapeDwarf repos for "wf" branch)

          And it's high on my TODO list to merge this into upstream master.

          If all goes well, next CapeDwarf release should be against Wildfly.

           

          Wrt Endpoints, I'm fixing our current impl, as the docs and our understanding of them was a bit off.

          Should also be fixed in the next release.

           

          While Marko works on our OAuth API impl.

           

          I can ping you before we're ready to release,

          so that we see which issues we still need to iron out.

          (hopefully nothing big, so you can have a working release)

           

          btw: did you try running your app against CapeDwarf 1.0.0.Beta6?

          1 of 1 people found this helpful
          • 2. Re: Re: CapeDwarf and WildFly
            mgreau

            I'm ok to be notified when you will be ready to release

             

            Thanks for information about your github repo, I will try to build a version for WildFly.

             

            I just started to test my app with CapeDwarf_AS7_1.0.0.Beta6 :

            • deployment failed with appengine-1.8.6 and appengine-endpoints-1.8.6 since google renamed or removed com.google.api.server.spi.config.ApiSerializationProperty
              • Caused by: java.lang.NoClassDefFoundError: com/google/api/server/spi/config/ApiSerializationProperty at org.jboss.capedwarf.bytecode.endpoints.DtoAnnotator.addAnnotations(DtoAnnotator.java:47) [capedwarf-bytecode-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT] at org.jboss.capedwarf.bytecode.endpoints.EndpointsTransformer.transform(EndpointsTransformer.java:47) [capedwarf-bytecode-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]

            • deployment is ok with appengine-1.8.5 and appengine-endpoints-1.8.5
            • I deployed may app as ROOT.war so I can access to the admin console http://localhost:8080/_ah/admin/ => its' OK
            • My basic servlet is available and works well (just hello world )
            • Endpoints API :
              • My endpoints seems to be discovered by capedwarf/jbossas, since I can see on the admin console DeploymentWeb > Subsystem > Servlet > javax.ws.rs.core.Application
              • But I can't access (or I don't know how to) this endpoints like I do in appengine, indeed when I execute curl  http://localhost:8080/_ah/api/bookingendpoint/v1/hotel , I have a 404 response. Is it the same URL in CapeDwarf and appengine ?

            Thanks

            • 3. Re: Re: CapeDwarf and WildFly
              alesj

              I just started to test my app with CapeDwarf_AS7_1.0.0.Beta6 :

              • deployment failed with appengine-1.8.6 and appengine-endpoints-1.8.6 since google renamed or removed com.google.api.server.spi.config.ApiSerializationProperty
                • Caused by: java.lang.NoClassDefFoundError: com/google/api/server/spi/config/ApiSerializationProperty at org.jboss.capedwarf.bytecode.endpoints.DtoAnnotator.addAnnotations(DtoAnnotator.java:47) [capedwarf-bytecode-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT] at org.jboss.capedwarf.bytecode.endpoints.EndpointsTransformer.transform(EndpointsTransformer.java:47) [capedwarf-bytecode-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]

              Yes, this is expected, as this was renamed -- we'll fix accordingly in next release.

               

              • Endpoints API :
                • My endpoints seems to be discovered by capedwarf/jbossas, since I can see on the admin console DeploymentWeb > Subsystem > Servlet > javax.ws.rs.core.Application
                • But I can't access (or I don't know how to) this endpoints like I do in appengine, indeed when I execute curl  http://localhost:8080/_ah/api/bookingendpoint/v1/hotel , I have a 404 response. Is it the same URL in CapeDwarf and appengine ?

               

              It should work -- try debugging?

               

              If you don't have any custom "serialization" (@ApiSerializer) you should be fine.

               

              We have this tests here:

              * https://github.com/GoogleCloudPlatform/appengine-tck/blob/master/core/endpoints/src/test/java/com/google/appengine/tck/e…

              and they pass for us.

              • 4. Re: CapeDwarf and WildFly
                gregor.sfiligoj

                There is another "incompatibility" I discovered running my ported application in CapeDwarf. Using the JSON-RPC endpoint seems all ok, but using the REST endpoint no.

                The point is the JSON rapresentation of Long which is a 64bit value. Appengine returns it as a String (otherwise javascript cannot convert it) and CapeDwarf returns it as an integer.

                Take a look at this Google explanation for data types: https://developers.google.com/discovery/v1/type-format

                The same inconsistency could be also for datetime types (if rapresented by a long timemillis value).

                 

                @ApiSerializer problem: if you are using the REST API the workaround is... not using it :-) I'm explain: because Appengine (and CapeDwarf too) use field accessors (getters and setters) for retrieving which properties to transform in JSON, the solution is something like this:

                 

                ...

                SomeType item;

                ...

                 

                //IGNORE THIS GETTERS/SETTERS

                @ApiSerializationProperty(ignore = AnnotationBoolean.TRUE)

                public SomeType getItem(){

                ...

                }

                 

                public void setItem(SomeType item){

                     this.item = item;

                }

                 

                //ADD THESE GETTERS/SETTERS

                @ApiSerializationProperty(name = "item")

                public String getItemAsString(){

                     return "String rapresentation of the SomeType instance";

                }

                 

                public void setItemFromString(String item){

                     this.item = convertTheStringRapresentationToSomeType(item);

                }

                 

                This works as a workaround also for Long/String problem, but also for more generic JSON serialization, because Appengine and CapeDwarf will see the "item" property as a String, internal type could be something else instead!

                • 5. Re: CapeDwarf and WildFly
                  alesj

                  I'm ok to be notified when you will be ready to release

                  I have CapeDwarf 99,9% working on Wildlfy, but it needs a few SNAPSHOTs to work:

                  (it's only failing MapReduce test ... which is a pita to see why ...)

                   

                  Building things from sources in this order:

                   

                  * Wildfly: https://github.com/wildfly/wildfly

                  * Infinispan: https://github.com/infinispan/infinispan/

                   

                  And then my CapeDwarf WF branches:

                  * Shared: https://github.com/alesj/capedwarf-shared/tree/wf2

                  * Blue: https://github.com/alesj/capedwarf-blue/tree/wf4

                  * WF-int: https://github.com/alesj/capedwarf-jboss-as/tree/wf2

                   

                  Where you build CD-jboss-as as:

                  * https://github.com/capedwarf/capedwarf-blue/blob/master/README.md (4)

                  • 6. Re: CapeDwarf and WildFly
                    mgreau

                    Cool

                    I've updated my app two weeks ago in order to test :

                    • Datastore API (Objectify 4)
                    • Search API
                    • Blobstore
                    • GCS
                    • TaskQueue
                    • Endpoint

                    https://cloud-booking.appspot.com/

                    https://cloud-booking-client.appspot.com/client-js/

                     

                    I will let you know if it works.

                    Thanks

                    Maxime

                    • 7. Re: CapeDwarf and WildFly
                      alesj

                      https://cloud-booking.appspot.com/

                      This looks great -- a good way to quickly test things.

                      Do you have this open sourced?

                      (I quickly looked at your github repos, and couldn't find it)

                      • 8. Re: CapeDwarf and WildFly
                        mgreau
                        • 9. Re: CapeDwarf and WildFly
                          alesj

                          Nightly snapshot:

                          * https://t.co/v0wPesj0Jb

                          • 10. Re: CapeDwarf and WildFly
                            mgreau

                            I've updated my project dependencies with GAE 1.8.7 and then :

                            • deployed the app in appengine-1.8.7 => it works fine
                            • deployed the app in CapeDwarf Nightly snapshot => the app is deployed but at first web access there is an error [1] when Objectify want to initialize

                             

                            [1] StackTrace :

                            Caused by: java.lang.NullPointerException: No API environment is registered for this thread.

                              at org.jboss.capedwarf.common.app.Application.getJBossEnvironment(Application.java:49)

                              at org.jboss.capedwarf.common.app.Application.getAppId(Application.java:43)

                              at org.jboss.capedwarf.memcache.CapedwarfMemcacheService.<init>(CapedwarfMemcacheService.java:69)

                              at org.jboss.capedwarf.memcache.CapedwarfMemcacheServiceFactoryProvider$1.getMemcacheService(CapedwarfMemcacheServiceFactoryProvider.java:42)

                              at com.google.appengine.api.memcache.MemcacheServiceFactory.getMemcacheService(MemcacheServiceFactory.java:46) [appengine-api-1.0-sdk-1.8.7-capedwarf.jar:]

                              at com.googlecode.objectify.cache.EntityMemcache.<init>(EntityMemcache.java:176) [objectify-4.0rc1.jar:]

                              at com.googlecode.objectify.ObjectifyFactory.<init>(ObjectifyFactory.java:70) [objectify-4.0rc1.jar:]

                              at com.googlecode.objectify.ObjectifyService.<clinit>(ObjectifyService.java:21) [objectify-4.0rc1.jar:]

                            • 11. Re: CapeDwarf and WildFly
                              alesj

                              Can you post the whole stack trace?

                              Or when is ObjectifyService initialized?

                              • 12. Re: CapeDwarf and WildFly
                                mgreau

                                yes, my app is named ROOT.war :

                                 

                                15:17:28,330 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss Capedwarf 1.0.0.CR1 (WildFly 8.0.0.Beta2-SNAPSHOT) started in 3363ms - Started 185 of 234 services (77 services are lazy, passive or on-demand)

                                15:17:58,201 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "ROOT.war" (runtime-name: "ROOT.war")

                                15:17:59,342 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment ROOT.war

                                15:17:59,434 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.0.1.Final

                                15:17:59,609 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: ROOT.war

                                15:17:59,644 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.1.0 (Final)

                                15:17:59,694 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016008: Starting weld service for deployment ROOT.war

                                15:18:00,731 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017534: Register web context: /

                                15:18:00,791 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "ROOT.war" (runtime-name : "ROOT.war")

                                15:18:13,641 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /overview.jsp: java.lang.ExceptionInInitializerError

                                  at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:51) [objectify-4.0rc1.jar:]

                                  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:59) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:81)

                                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:65) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:70) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:239) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:226) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:72) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:145) [undertow-servlet-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:139) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:638) [undertow-core-1.0.0.Beta24.jar:1.0.0.Beta24]

                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]

                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]

                                  at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

                                Caused by: java.lang.NullPointerException: No API environment is registered for this thread.

                                  at org.jboss.capedwarf.common.app.Application.getJBossEnvironment(Application.java:49)

                                  at org.jboss.capedwarf.common.app.Application.getAppId(Application.java:43)

                                  at org.jboss.capedwarf.memcache.CapedwarfMemcacheService.<init>(CapedwarfMemcacheService.java:69)

                                  at org.jboss.capedwarf.memcache.CapedwarfMemcacheServiceFactoryProvider$1.getMemcacheService(CapedwarfMemcacheServiceFactoryProvider.java:42)

                                  at com.google.appengine.api.memcache.MemcacheServiceFactory.getMemcacheService(MemcacheServiceFactory.java:46) [appengine-api-1.0-sdk-1.8.7-capedwarf.jar:]

                                  at com.googlecode.objectify.cache.EntityMemcache.<init>(EntityMemcache.java:176) [objectify-4.0rc1.jar:]

                                  at com.googlecode.objectify.ObjectifyFactory.<init>(ObjectifyFactory.java:70) [objectify-4.0rc1.jar:]

                                  at com.googlecode.objectify.ObjectifyService.<clinit>(ObjectifyService.java:21) [objectify-4.0rc1.jar:]

                                  ... 24 more

                                • 13. Re: CapeDwarf and WildFly
                                  ctomc

                                  You should be running wildfly with -c standalone-capedwarf.xml

                                   

                                  as from your log it is clearly seen that you are running default wildfly configuration no capedwarf at all

                                   

                                   

                                  --

                                  tomaz

                                  • 14. Re: CapeDwarf and WildFly
                                    mgreau

                                    thanks

                                    Sorry, I forgot that point, I thought it was default behavior.

                                     

                                    So, it works much better

                                    My first tests are ok : Objectify, Endpoints, Search, TaskQueue

                                    And the web admin is great !

                                     

                                    I will do much more tests and get back to you.

                                     

                                    Thanks and good job !

                                    1 2 Previous Next