0 Replies Latest reply on Dec 7, 2009 4:15 PM by Jose Miguel Loor

    problem with seam remote

    Jose Miguel Loor Apprentice

      Hi


      I have a problem deploying several seam applications in the same jboss. The applications have two parts; a jar file wich has all the bussiness layer of the application (persistance and services) and a war file that has all the interface logic.


      In the /lib of the jboss server instance i had to include these libraries:


      jboss-el.jar
      jboss-seam.jar
      jboss-seam-debug.jar
      jboss-seam-ui-jar
      jsf-api.jar
      jsf-facelets.jar
      jsf-impl.jar
      richfaces-api-3.3.0.GA.jar
      richfaces-impl-3.3.0.GA.jar
      richfaces-ui-3.3.0.GA.jar
      amf-serializer-1.7.1.jar
      axis.jar
      flamingo-service-1.7.1.jar
      scannotation-1.0.2.jar


      that way, the jar and war files only have the classes, not the libraries.


      These are the configuration files included for each application:


      in the jar files:


      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
          xmlns:core="http://jboss.com/products/seam/core" xmlns:security="http://jboss.com/products/seam/security"
          xmlns:transaction="http://jboss.com/products/seam/transaction"
          xmlns:persistence="http://jboss.com/products/seam/persistence"
          xmlns:ui="http://jboss.com/products/seam/ui" xmlns:framework="http://jboss.com/products/seam/framework"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:mail="http://jboss.com/products/seam/mail"
          xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd
                       http://jboss.com/products/seam/ui http://jboss.com/products/seam/ui-2.1.xsd">
          <core:manager conversation-timeout="1800000"
              concurrent-request-timeout="500" conversation-id-parameter="cid" />
          <core:init name="initLipServicio" jndi-pattern="#{ejbName}/local"
              debug="true" />
          <transaction:ejb-transaction name="ejbLipServicio" />
          <persistence:managed-persistence-context
              name="lipEntityManager" auto-create="true" persistence-unit-jndi-name="java:/lipEntityManagerFactory" />
          <ui:entity-converter name="lipEntityConverter"
              entity-loader="#{lipEntityLoader}" />
          <ui:jpa-entity-loader name="lipEntityLoader"
              entity-manager="#{lipEntityManager}" />
         
          <mail:mail-session session-jndi-name="java:/Mail"/>
      </components>



      in the war files:



      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
          xmlns:core="http://jboss.com/products/seam/core" xmlns:security="http://jboss.com/products/seam/security"
          xmlns:transaction="http://jboss.com/products/seam/transaction"
          xmlns:persistence="http://jboss.com/products/seam/persistence"
          xmlns:framework="http://jboss.com/products/seam/framework" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
          <core:init jndi-pattern="#{ejbName}/local" debug="true" />
          <transaction:ejb-transaction name="ejbLipIntranet" />
          <core:resource-loader bundle-names="lipIntranetMessages" />
          <core:manager conversation-timeout="1800000"
              concurrent-request-timeout="500" conversation-id-parameter="cid"
              parent-conversation-id-parameter="pcid" />
          <event type="org.jboss.seam.security.notLoggedIn">
              <action execute="#{redirect.captureCurrentView}" />
          </event>
          <event type="org.jboss.seam.security.loginSuccessful">
              <action execute="#{redirect.returnToCapturedView}" />
          </event>
      </components>



      in the web.xml


      <filter>
              <filter-name>Seam Filter</filter-name>
              <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
          </filter>
      
      <filter-mapping>
              <filter-name>Seam Filter</filter-name>
              <url-pattern>/*</url-pattern>
          </filter-mapping>
      
      <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
          </servlet>
      
      <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.seam</url-pattern>
          </servlet-mapping>



      There are some fancy pages in the problematic applications that are developed with flex; so we used flamingo to glue the seam / flex part. these are the services-config.xml files




      <?xml version="1.0" encoding="UTF-8"?>
      <services-config>
          <services>
              <service id="[appPrefix]-remoting-service" class="flex.messaging.services.RemotingService"
                  messageTypes="flex.messaging.messages.RemotingMessage">
                        ............ [destinations]
              </service>
          </services>
      
          <channels>
              <channel-definition id="[appPrefix]-seam-amf"
                  class="mx.messaging.channels.AMFChannel">
                  <endpoint
                      uri="http://{server.name}:{server.port}/[appPrefix]Intranet/seam/resource/amf"
                      class="flex.messaging.endpoints.AMFEndpoint" />
              </channel-definition>
          </channels>
      
      </services-config>



      in the appPrefix part, we placed a prefix to differentiate each application configuration separately.


      The problem with this is that, if i deploy both applications that uses seam/flamingo/flex together, only the last one deployed works. The first one deployed, for some reason, cannot access the remote resources needed so it cannot work. That first deployed application fails with this exception:


      Java.lang.ClassNotFoundException: org.scannotation.ClasspathUrlFinder
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
          at org.jboss.seam.deployment.EntityScanner.scanEntities(EntityScanner.java:93)
          at org.jboss.seam.deployment.EntityScanner.getEntity(EntityScanner.java:83)
          at com.exadel.flamingo.service.seam.util.FlamingoUtils.findTargetClass(FlamingoUtils.java:230)
          at com.exadel.flamingo.service.seam.util.AMFSeamMethodInvoker.makeCall(AMFSeamMethodInvoker.java:57)
          at com.exadel.flamingo.service.seam.amf.process.AMF3RemotingMessageProcessor$AMFContextualRequest.process(AMF3RemotingMessageProcessor.java:104)
          at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
          at com.exadel.flamingo.service.seam.amf.process.AMF3RemotingMessageProcessor.process(AMF3RemotingMessageProcessor.java:71)
          at com.exadel.flamingo.service.seam.amf.process.AMF3MessageProcessor.process(AMF3MessageProcessor.java:58)
          at com.exadel.flamingo.flex.amf.process.AMF0MessageProcessor.process(AMF0MessageProcessor.java:53)
          at com.exadel.flamingo.service.seam.AMFToSeamRequestProcessor.process(AMFToSeamRequestProcessor.java:73)
          at com.exadel.flamingo.service.seam.AMFRemoteService.getResource(AMFRemoteService.java:79)
          at org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
          at java.lang.Thread.run(Thread.java:619)





      At first i thought that flamingo was the problem, but then, i tried to access the remote resources via xhtml pages with seam remote objects and it gave me the same problems, so i assume that seam is the problem here but i cannot figure out why and how to fix it


      please help


      thanks a lot