8 Replies Latest reply on Jan 26, 2011 12:16 PM by Ara Minosian

    GAE maven plugin integration with RichFaces 4

    Ara Minosian Newbie

      I try to integrate [maven-gae-plugin => http://code.google.com/p/maven-gae-plugin/] with RichFaces 4. I have success but during running I h've got an error from resource plugin.

      `

      java.lang.UnsupportedOperationException

                at javax.faces.context.ExternalContext.getMimeType(ExternalContext.java:424)

                at org.richfaces.resource.ResourceFactoryImpl$ExternalStaticResourceFactory.createResource(ResourceFactoryImpl.java:74)

                at org.richfaces.resource.ResourceFactoryImpl.createResource(ResourceFactoryImpl.java:429)

                at org.richfaces.cdk.resource.handler.impl.DynamicResourceHandler.createResource(DynamicResourceHandler.java:89)

                at org.richfaces.cdk.resource.handler.impl.AbstractResourceHandler.createResource(AbstractResourceHandler.java:43)

                at org.richfaces.cdk.task.ResourceTaskFactoryImpl$ResourcesRendererCallable.createResource(ResourceTaskFactoryImpl.java:63)

                at org.richfaces.cdk.task.ResourceTaskFactoryImpl$ResourcesRendererCallable.checkResource(ResourceTaskFactoryImpl.java:95)

                at org.richfaces.cdk.task.ResourceTaskFactoryImpl$ResourcesRendererCallable.call(ResourceTaskFactoryImpl.java:122)

                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

                at java.util.concurrent.FutureTask.run(FutureTask.java:138)

                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

                at java.util.concurrent.FutureTask.run(FutureTask.java:138)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                at java.lang.Thread.run(Thread.java:619)

      `

       

      Resourses are in target folder

      My pom:

      `

      <build>

              <plugins>

                  <plugin>

                      <groupId>org.apache.maven.plugins</groupId>

                      <artifactId>maven-checkstyle-plugin</artifactId>

                      <version>2.5</version>

                      <configuration>

                          <configLocation>richfaces-checkstyle/richfaces-checkstyle.xml</configLocation>

                          <logViolationsToConsole>true</logViolationsToConsole>

                          <violationSeverity>error</violationSeverity>

                      </configuration>

                      <executions>

                          <execution>

                              <id>richfaces-checkstyle-report</id>

                              <phase>process-sources</phase>

                              <goals>

                                  <goal>check</goal>

                              </goals>

                          </execution>

                      </executions>

                      <dependencies>

                          <dependency>

                              <groupId>org.richfaces</groupId>

                              <artifactId>richfaces-build-checkstyle</artifactId>

                              <version>${richfaces.checkstyle.version}</version>

                          </dependency>

                      </dependencies>

                  </plugin>

       

       

                  <plugin>

                      <groupId>org.apache.maven.plugins</groupId>

                      <artifactId>maven-war-plugin</artifactId>

                      <version>2.1-beta-1</version>

                      <configuration>

                          <webResources>

                              <resource>

                                  <directory>src/main/webapp</directory>

                                  <filtering>true</filtering>

                                  <includes>

                                      <include>**/appengine-web.xml</include>

                                  </includes>

                              </resource>

                              <resource>

                                  <directory>${project.build.directory}/generated-resources</directory>

                                  <targetPath>static-resources</targetPath>

                              </resource>

                          </webResources>

                      </configuration>

                  </plugin>

                  <plugin>

                      <groupId>org.richfaces.cdk</groupId>

                      <artifactId>maven-resources-plugin</artifactId>

                      <version>4.0.0-SNAPSHOT</version>

                      <executions>

                          <execution>

                              <id>process</id>

                              <goals>

                                  <goal>process</goal>

                              </goals>

                              <configuration>

                                  <outputDir>generated-resources</outputDir>

                                  <skins>

                                      <skin>blueSky</skin>

                                      <skin>classic</skin>

                                      <skin>deepMarine</skin>

                                      <skin>emeraldTown</skin>

                                      <skin>japanCherry</skin>

                                      <skin>ruby</skin>

                                      <skin>wine</skin>

                                  </skins>

                                  <includedContentTypes>

                                      <include>application/javascript</include>

                                      <include>text/css</include>

                                      <include>image/.+</include>

                                  </includedContentTypes>

                                  <fileNameMappings>

                                      <property>

                                          <name>^.*showcase.*/([^/]+\.css)$</name>

                                          <value>org.richfaces.showcase.css/$1</value>

                                      </property>

                                      <property>

                                          <name>^.+/([^/]+\.(png|gif|jpg))$</name>

                                          <value>org.richfaces.images/$1</value>

                                      </property>

                                      <property>

                                          <name>^.+/([^/]+\.css)$</name>

                                          <value>org.richfaces.css/$1</value>

                                      </property>

                                  </fileNameMappings>

                              </configuration>

                          </execution>

                      </executions>

                  </plugin>

       

       

                  <!--

                         The actual maven-gae-plugin. Type "mvn gae:run" to run project, "mvn

                         gae:deploy" to upload to GAE.

                     -->

                  <plugin>

                      <groupId>net.kindleit</groupId>

                      <artifactId>maven-gae-plugin</artifactId>

                      <version>0.8.1</version>

       

       

                      <configuration>

       

       

                          <sdkDir>d:\newproject\libs\appengine-java-sdk-1.4.0\</sdkDir>

                      </configuration>

                      <dependencies>

                          <dependency>

                              <groupId>net.kindleit</groupId>

                              <artifactId>gae-runtime</artifactId>

                              <version>${gae.version}</version>

                              <type>pom</type>

                          </dependency>

                      </dependencies>

                  </plugin>

       

       

                  <!--

                         Upload application to the appspot automatically, during

                         release:perform

                     -->

                  <plugin>

                      <artifactId>maven-release-plugin</artifactId>

                      <configuration>

                          <goals>gae:deploy</goals>

                      </configuration>

                  </plugin>

       

       

                  <!-- Java compiler version -->

                  <plugin>

                      <groupId>org.apache.maven.plugins</groupId>

                      <artifactId>maven-compiler-plugin</artifactId>

                      <version>2.0</version>

                      <configuration>

                          <encoding>UTF-8</encoding>

                          <source>1.6</source>

                          <target>1.6</target>

                      </configuration>

                  </plugin>

                  <!--<plugin>

                      <groupId>org.apache.maven.plugins</groupId>

                      <artifactId>maven-surefire-plugin</artifactId>

                      <version>2.5</version>

                      <configuration>

                          <parallel>classes</parallel>

                          &lt;!&ndash;<threadCount>3</threadCount>&ndash;&gt;

                      </configuration>

                  </plugin>-->

              </plugins>

       

       

          </build>

      `

      Any ideas?

       

        • 1. GAE maven plugin integration with RichFaces 4
          Ara Minosian Newbie

          <build>

                  <plugins>

                      <plugin>

                          <groupId>org.apache.maven.plugins</groupId>

                          <artifactId>maven-checkstyle-plugin</artifactId>

                          <version>2.5</version>

                          <configuration>

                              <configLocation>richfaces-checkstyle/richfaces-checkstyle.xml</configLocation>

                              <logViolationsToConsole>true</logViolationsToConsole>

                              <violationSeverity>error</violationSeverity>

                          </configuration>

                          <executions>

                              <execution>

                                  <id>richfaces-checkstyle-report</id>

                                  <phase>process-sources</phase>

                                  <goals>

                                      <goal>check</goal>

                                  </goals>

                              </execution>

                          </executions>

                          <dependencies>

                              <dependency>

                                  <groupId>org.richfaces</groupId>

                                  <artifactId>richfaces-build-checkstyle</artifactId>

                                  <version>${richfaces.checkstyle.version}</version>

                              </dependency>

                          </dependencies>

                      </plugin>

           

           

                      <plugin>

                          <groupId>org.apache.maven.plugins</groupId>

                          <artifactId>maven-war-plugin</artifactId>

                          <version>2.1-beta-1</version>

                          <configuration>

                              <webResources>

                                  <resource>

                                      <directory>src/main/webapp</directory>

                                      <filtering>true</filtering>

                                      <includes>

                                          <include>**/appengine-web.xml</include>

                                      </includes>

                                  </resource>

                                  <resource>

                                      <directory>${project.build.directory}/generated-resources</directory>

                                      <targetPath>static-resources</targetPath>

                                  </resource>

                              </webResources>

                          </configuration>

                      </plugin>

                      <plugin>

                          <groupId>org.richfaces.cdk</groupId>

                          <artifactId>maven-resources-plugin</artifactId>

                          <version>4.0.0-SNAPSHOT</version>

                          <executions>

                              <execution>

                                  <id>process</id>

                                  <goals>

                                      <goal>process</goal>

                                  </goals>

                                  <configuration>

                                      <outputDir>generated-resources</outputDir>

                                      <skins>

                                          <skin>blueSky</skin>

                                          <skin>classic</skin>

                                          <skin>deepMarine</skin>

                                          <skin>emeraldTown</skin>

                                          <skin>japanCherry</skin>

                                          <skin>ruby</skin>

                                          <skin>wine</skin>

                                      </skins>

                                      <includedContentTypes>

                                          <include>application/javascript</include>

                                          <include>text/css</include>

                                          <include>image/.+</include>

                                      </includedContentTypes>

                                      <fileNameMappings>

                                          <property>

                                              <name>^.*showcase.*/([^/]+\.css)$</name>

                                              <value>org.richfaces.showcase.css/$1</value>

                                          </property>

                                          <property>

                                              <name>^.+/([^/]+\.(png|gif|jpg))$</name>

                                              <value>org.richfaces.images/$1</value>

                                          </property>

                                          <property>

                                              <name>^.+/([^/]+\.css)$</name>

                                              <value>org.richfaces.css/$1</value>

                                          </property>

                                      </fileNameMappings>

                                  </configuration>

                              </execution>

                          </executions>

                      </plugin>

           

           

                      <!--

                             The actual maven-gae-plugin. Type "mvn gae:run" to run project, "mvn

                             gae:deploy" to upload to GAE.

                         -->

                      <plugin>

                          <groupId>net.kindleit</groupId>

                          <artifactId>maven-gae-plugin</artifactId>

                          <version>0.8.1</version>

           

           

                          <configuration>

           

           

                              <sdkDir>d:\newproject\libs\appengine-java-sdk-1.4.0\</sdkDir>

                          </configuration>

                          <dependencies>

                              <dependency>

                                  <groupId>net.kindleit</groupId>

                                  <artifactId>gae-runtime</artifactId>

                                  <version>${gae.version}</version>

                                  <type>pom</type>

                              </dependency>

                          </dependencies>

                      </plugin>

           

           

                      <!--

                             Upload application to the appspot automatically, during

                             release:perform

                         -->

                      <plugin>

                          <artifactId>maven-release-plugin</artifactId>

                          <configuration>

                              <goals>gae:deploy</goals>

                          </configuration>

                      </plugin>

           

           

                      <!-- Java compiler version -->

                      <plugin>

                          <groupId>org.apache.maven.plugins</groupId>

                          <artifactId>maven-compiler-plugin</artifactId>

                          <version>2.0</version>

                          <configuration>

                              <encoding>UTF-8</encoding>

                              <source>1.6</source>

                              <target>1.6</target>

                          </configuration>

                      </plugin>

                      <!--<plugin>

                          <groupId>org.apache.maven.plugins</groupId>

                          <artifactId>maven-surefire-plugin</artifactId>

                          <version>2.5</version>

                          <configuration>

                              <parallel>classes</parallel>

                              &lt;!&ndash;<threadCount>3</threadCount>&ndash;&gt;

                          </configuration>

                      </plugin>-->

                  </plugins>

           

           

              </build>

          • 2. GAE maven plugin integration with RichFaces 4
            Ara Minosian Newbie

            Finally, I resolved a problem. This config is correct! Just do clean before gae:run. That’s all! Maven gae plugin is integrated!!

            • 3. GAE maven plugin integration with RichFaces 4
              Jay Balunas Master

              Excellent!  Good investigation.  Could you post this in jira and we'll take a closer look, and integrate if there is time?

              • 4. GAE maven plugin integration with RichFaces 4
                Ara Minosian Newbie

                OkJay, butnow I have new problem. Application work in local mode and causeerror  in deployed and the reason is RichFaces. Iuse weld-servlet. May bereason in it? May be I lose some depandancys or config parameters? Any ideas?

                 

                 

                Uncaught exception from servlet

                java.lang.NoClassDefFoundError: Could not initialize class org.richfaces.resource.ResourceLibraryFactoryImpl

                at org.richfaces.application.DefaultModule.configure(DefaultModule.java:31)

                at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:28)

                at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:136)

                at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:110)

                at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152)

                at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)

                at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2040)

                at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2016)

                at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:298)

                at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:330)

                at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:598)

                at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:341)

                at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:220)

                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 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:261)

                at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8495)

                at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8493)

                at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)

                at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:435)

                at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:572)

                at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)

                at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)

                at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)

                at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)

                at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                at java.lang.Thread.run(Thread.java:636)

                • 5. GAE maven plugin integration with RichFaces 4
                  Ara Minosian Newbie

                  Now new error. I checked guava and is not able to find method .precomputeCharMatcher in com.google.common.base.Platform.  Guava bug?

                   

                  Uncaught exception from servlet

                  java.lang.NoSuchMethodError: com.google.common.base.Platform.precomputeCharMatcher(Lcom/google/common/base/CharMatcher;)Lcom/google/common/base/CharMatcher;

                  at com.google.common.base.CharMatcher.precomputed(CharMatcher.java:662)

                  at com.google.common.base.CharMatcher.<clinit>(CharMatcher.java:69)

                  at com.google.common.base.Splitter.on(Splitter.java:117)

                  at org.richfaces.resource.ResourceLibraryFactoryImpl.<clinit>(ResourceLibraryFactoryImpl.java:46)

                  at org.richfaces.application.DefaultModule.configure(DefaultModule.java:31)

                  at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:28)

                  at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:136)

                  at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:110)

                  at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152)

                  at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)

                  at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2040)

                  at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2016)

                  at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:298)

                  at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:330)

                  at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:598)

                  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:341)

                  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:220)

                  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 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:261)

                  at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8495)

                  at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8493)

                  at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)

                  at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:435)

                  at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:572)

                  at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)

                  at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)

                  at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)

                  at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)

                  at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                  at java.lang.Thread.run(Thread.java:636)

                  • 6. GAE maven plugin integration with RichFaces 4
                    Ara Minosian Newbie

                    I found a problem. Weld servlet contains com.google.common.base.Platform,that does not contain method precomputeCharMatcher and google guava r07contains com.google.common.base.Platform that contains this method. Howto force application not to use wrong class?

                    • 7. GAE maven plugin integration with RichFaces 4
                      Ara Minosian Newbie

                      So, I just remove all .com stuff from weld-servlet-1.0.1.Final.jar by hand. Problem is solved.