3 Replies Latest reply on Nov 17, 2010 7:38 AM by fano

    RESTEasy not responding

    fano

      hi all together,


      i have a strange problem using RESTEasy in conjunction with seam. When i try to access a RESTEasy URI the browser is loading and loading but nothing happens, no exceptions, no new log entries, but the javaw.exe starts consuming about 70% cpu on my development machine.


      I created the project using seam-gen through the JBoss Tools on Eclipse 3.6 (Helios), JDK 1.6.22 and JBossAS 5.1.0 (JDK6 compiled version).


      The component.xml file looks like this inside the web project:


      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
           xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence"
           xmlns:drools="http://jboss.com/products/seam/drools" xmlns:bpm="http://jboss.com/products/seam/bpm"
           xmlns:security="http://jboss.com/products/seam/security" xmlns:mail="http://jboss.com/products/seam/mail"
           xmlns:web="http://jboss.com/products/seam/web" xmlns:resteasy="http://jboss.com/products/seam/resteasy"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                       http://jboss.com/products/seam/resteasy http://jboss.com/products/seam/resteasy-2.2.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">
      
           <core:init debug="true" jndi-pattern="@jndiPattern@" />
      
           <core:manager concurrent-request-timeout="500"
                conversation-timeout="120000" conversation-id-parameter="cid"
                parent-conversation-id-parameter="pid" />
      
           <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
           <web:hot-deploy-filter url-pattern="*.seam" />
      
           <persistence:managed-persistence-context
                name="em" auto-create="true" persistence-unit-jndi-name="java:/ScioEntityManagerFactory" />
      
           <drools:rule-base name="securityRules">
                <drools:rule-files>
                     <value>/security.drl</value>
                </drools:rule-files>
           </drools:rule-base>
      
           <security:rule-based-permission-resolver
                security-rules="#{securityRules}" />
      
           <security:identity authenticate-method="#{authenticator.authenticate}"
                remember-me="true" />
      
           <!-- <security:identity-manager identity-store="#{jpaIdentityStore}" /> -->
      <!---->
           <!-- <security:jpa-identity-store -->
           <!-- user-class="de.scio.scioserver.entity.User" -->
           <!-- role-class="de.scio.scioserver.entity.Roles" /> -->
      
           <event type="org.jboss.seam.security.notLoggedIn">
                <action execute="#{redirect.captureCurrentView}" />
           </event>
           <event type="org.jboss.seam.security.loginSuccessful">
                <action execute="#{redirect.returnToCapturedView}" />
           </event>
      
           <mail:mail-session host="localhost" port="25" />
      
           <!-- For use with jBPM pageflow or process management -->
           <!-- <bpm:jbpm> <bpm:process-definitions></bpm:process-definitions> <bpm:pageflow-definitions></bpm:pageflow-definitions> 
                </bpm:jbpm> -->
      
           <resteasy:application resource-path-prefix="/restv1"
                scan-providers="true" scan-resources="true" use-builtin-providers="true">
                <resteasy:resource-class-names>
                     <value>de.scio.scioserver.ws.ScioResource</value>
                </resteasy:resource-class-names>
           </resteasy:application>
      
      </components>
      



      The ScioResource.java looks like this inside the ear:


      package de.scio.scioserver.ws;
      
      import javax.ws.rs.GET;
      import javax.ws.rs.Path;
      import javax.ws.rs.Produces;
      import javax.ws.rs.core.MediaType;
      
      import org.jboss.seam.annotations.Name;
      
      @Name("scioResource")
      @Path("/sciores")
      public class ScioResource {
      
           @GET
           @Produces(MediaType.TEXT_PLAIN)
           public String getCardSets() {
                return "Hello World";
           }
      }



      RESTEasy is booting up correctly:


      2010-11-15 22:50:49,722 INFO  [javax.servlet.ServletContextListener] (HDScanner) Welcome to Seam 2.2.0.GA
      2010-11-15 22:50:55,261 WARN  [org.jboss.seam.security.permission.PersistentPermissionResolver] (HDScanner) no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.
      2010-11-15 22:50:55,403 INFO  [org.jboss.seam.resteasy.ResteasyBootstrap] (HDScanner) bootstrapping JAX-RS application
      2010-11-15 22:50:55,465 DEBUG [org.jboss.seam.resteasy.ResteasyBootstrap] (HDScanner) discovering all Seam components
      2010-11-15 22:50:55,481 INFO  [org.jboss.seam.resteasy.ResteasyBootstrap] (HDScanner) registering built-in RESTEasy providers
      2010-11-15 22:50:55,481 DEBUG [org.jboss.resteasy.plugins.providers] (HDScanner) Registering standard providers
      2010-11-15 22:50:55,496 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider DataSourceProvider
      2010-11-15 22:50:55,496 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider DefaultTextPlain
      2010-11-15 22:50:55,496 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider org.jboss.resteasy.plugins.providers.StringTextStar
      2010-11-15 22:50:55,512 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider org.jboss.resteasy.plugins.providers.InputStreamProvider
      2010-11-15 22:50:55,512 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider org.jboss.resteasy.plugins.providers.ByteArrayProvider
      2010-11-15 22:50:55,512 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider org.jboss.resteasy.plugins.providers.FormUrlEncodedProvider
      2010-11-15 22:50:55,512 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider org.jboss.resteasy.plugins.providers.FormUrlEncodedProvider
      2010-11-15 22:50:55,512 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Added built in provider org.jboss.resteasy.plugins.providers.StreamingOutputProvider
      2010-11-15 22:50:55,543 INFO  [org.jboss.resteasy.plugins.providers] (HDScanner) Adding built in provider org.jboss.resteasy.plugins.providers.IIOImageProvider




      Now when i try to access http://localhost:8080/Scio/seam/resource/restv1 the following log entries are generated:



      2010-11-15 22:52:59,729 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) processing REST request
      2010-11-15 22:52:59,780 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) removing SeamResourceServlet url-pattern and dispatcher prefix from request path
      2010-11-15 22:52:59,783 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) UriInfo, absolute URI       : http://localhost:8080/Scio/seam/resource/restv1
      2010-11-15 22:52:59,783 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) UriInfo, base URI           : http://localhost:8080/Scio/seam/resource/restv1
      2010-11-15 22:52:59,784 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) UriInfo, relative path/@Path: 
      2010-11-15 22:52:59,784 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) UriInfo, query string       : null
      2010-11-15 22:52:59,796 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) completed processing of REST request



      But when i try to access the url http://localhost:8080/Scio/seam/resource/restv1/sciores (which should return a simple Hello World) the following log entries are appended to the server.log and the server stops responding completely:


      2010-11-15 22:55:00,506 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) processing REST request
      2010-11-15 22:55:00,508 DEBUG [org.jboss.seam.resteasy.ResteasyResourceAdapter] (http-localhost%2F127.0.0.1-8080-2) removing SeamResourceServlet url-pattern and dispatcher prefix from request path



      I tried different setups etc. but i am ending up with this error all the time.
      Perhaps you folks here have an idea what could be wrong?


      Thanks in advance!


      Cheers,
      Fabian












        • 1. Re: RESTEasy not responding
          jharting

          Could you open a Seam JIRA issue and attach the application to that reproduces the problem? I'll take a look.

          • 2. Re: RESTEasy not responding
            fano

            Thanks for the response, i created a new seam project and just added the resteasy functionality to it and it is working as aspected.
            So it seems there is a problem with my other project....


            I will investigate a little bit further and let you know my results!

            • 3. Re: RESTEasy not responding
              fano

              Okay problem solved. I removed all resteasy jars, cleaned up the jboss tmp stuff, re-added the jars and re-deployed the application and it is finally working.