2 Replies Latest reply on Feb 27, 2008 12:22 PM by Pete Muir

    Migrating from Seam 1.2.1 to 2.0.1

    Toni Beckman Novice

      Hi,


      I'm trying to upgrade our application from Seam 1.2.1 to Seam 2.0.1, but the webapplication is not working as expected and I have a hard time figuring out what's wrong.


      The problem seems to be that all my SFSBs disappear at the end of the request-response cycle, even though I start a long running conversation through a page event.


      I figured this, because the SFSBs do not show up in the current conversation, when looking at the debug.seam page. Furthermore the application starts to work, if I change the scope of the SFSB the SESSION scope.


      Then I see them in the session and everything is working. This is really weird and I don't know what to do. Has anybody experienced such kind of behaviour?


      Here is the exception and the config files:


      2008-02-26 18:23:38,152 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preRemoveVariable.campaignMessageAction
      2008-02-26 18:23:38,152 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
      2008-02-26 18:23:38,152 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
      2008-02-26 18:23:38,152 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
      2008-02-26 18:23:38,153 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
      2008-02-26 18:23:38,153 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
      2008-02-26 18:23:38,153 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
      2008-02-26 18:23:38,153 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postRemoveVariable.campaignMessageAction
      2008-02-26 18:23:38,153 DEBUG [org.jboss.seam.ejb.RemoveInterceptor] Stateful component was removed: campaignMessageAction
      2008-02-26 18:23:38,153 ERROR [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception
      javax.el.ELException: javax.ejb.EJBTransactionRolledbackException
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
              at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
              at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
              at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
              at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:173)
              at org.jboss.seam.navigation.Pages.callAction(Pages.java:636)
              at org.jboss.seam.navigation.Pages.preRender(Pages.java:289)
              at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:549)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:460)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:144)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              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:179)
              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.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
              at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.ejb.EJBTransactionRolledbackException
              at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
              at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
              at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
              at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
              at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
              at $Proxy148.list(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
              at org.javassist.tmp.java.lang.Object_$$_javassist_1.list(Object_$$_javassist_1.java)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
              ... 49 more
      Caused by: java.lang.NullPointerException
              at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.isRef(ManagedEntityIdentityInterceptor.java:140)
              at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.entityRefsToIds(ManagedEntityIdentityInterceptor.java:91)
              at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:51)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
              at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
              at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
              ... 83 more
      




      web.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4"
               xmlns="http://java.sun.com/xml/ns/j2ee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      
        <!-- Seam -->
      
         <listener>
            <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
         </listener>
      
          <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>Seam Resource Servlet</servlet-name>
            <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
         </servlet>
      
         <servlet-mapping>
            <servlet-name>Seam Resource Servlet</servlet-name>
            <url-pattern>/seam/resource/*</url-pattern>
         </servlet-mapping>
      
         <!-- Facelets development mode (disable in production) -->
      
         <context-param>
            <param-name>facelets.DEVELOPMENT</param-name>
            <param-value>true</param-value>
         </context-param>
      
         <!-- JSF -->
      
         <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>
      
      </web-app>
      



      components.xml


      <?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:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
                       http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
      
        <!--component name="org.jboss.seam.core.init">
          <property name="myFacesLifecycleBug">false</property>
          <property name="jndiPattern">calc/#{ejbName}/local</property>
        </component-->
      
        <core:init debug="true" jndi-pattern="calc/#{ejbName}/local"/>
      
        <core:manager concurrent-request-timeout="500" conversation-timeout="120000" conversation-id-parameter="cid"/>
      
        <!--component name="org.jboss.seam.core.dispatcher"
                    class="org.jboss.seam.core.Dispatcher" /-->
        <security:identity authenticate-method="#{authenticator.authenticate}"/>
      
      
        <persistence:managed-persistence-context name="entityManager"
                                           auto-create="false"
                            persistence-unit-jndi-name="java:/calcEntityManagerFactory"/>
      
        <!--transaction:ejb-transaction/-->
      
      
        
        <!--component name="entityManager" class="org.jboss.seam.core.ManagedPersistenceContext">
          <property name="persistenceUnitJndiName">java:/calcEntityManagerFactory</property>
        </component-->
      
        <!--component class="org.jboss.seam.selectitems.SelectItemsConfig">
          <property name="persistenceUnitJndiName">java:/calcEntityManagerFactory</property>
        </component-->
      
        <!--component class="org.jboss.seam.core.Ejb" installed="false"/-->
      
        <!--component name="org.jboss.seam.core.manager">
          <property name="org.jboss.seam.core.manager.concurrentRequestTimeout">120000</property>    
        </component-->
      
        <!--  60 0 000 ms conversation timeout = 10 minuten -->
        <!--  120 0 000 ms conversation timeout = 20 minuten -->
        <!--component name="org.jboss.seam.core.manager">
            <property name="conversationTimeout">1200000</property>
        </component-->
      
      </components>
      



      part of faces-config.xml


      <?xml version='1.0' encoding='UTF-8'?>
      <faces-config version="1.2"
                    xmlns="http://java.sun.com/xml/ns/javaee"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
      
        <application>
          <locale-config>
            <default-locale>de</default-locale>
          </locale-config>
        </application>
      
        <navigation-rule>
          <navigation-case>
            <from-outcome>urldisplayer</from-outcome>
            <to-view-id>/urlDisplayer.jsp</to-view-id>
          </navigation-case>
      ....
      



      part of pages.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <pages xmlns="http://jboss.com/products/seam/pages"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd">
      
         <!--    login-view-id="/login.seam"-->
      
      
      
        <page view-id="/clients.jsp">
          <begin-conversation join="true"/>
        </page>
      
        <page view-id="/partners.jsp" action="#{partnerAction.update}">
          <begin-conversation join="true"/>
        </page>
        <page view-id="/keyValueExtractors.jsp" action="#{keyValueExtractorAction.update}">
          <begin-conversation join="true"/>
        </page>
        <!--page view-id="*.jsp" login-required="true">
          <begin-conversation join="true"/>
        </page-->
      
      .....
        
        <exception class="org.jboss.seam.security.NotLoggedInException">
          <redirect view-id="/login.seam">
              <message>Please log in first</message>
          </redirect>
        </exception>
      
      </pages>
      




        • 1. Re: Migrating from Seam 1.2.1 to 2.0.1
          Toni Beckman Novice

          Here is are the jars and xml files in the exploded jar:


          calc.ear/calc.war/WEB-INF/web.xml
          calc.ear/calc.war/WEB-INF/lib/selectitems-ui.jar
          calc.ear/calc.war/WEB-INF/lib/richfaces-impl.jar
          calc.ear/calc.war/WEB-INF/lib/selectitems.jar
          calc.ear/calc.war/WEB-INF/lib/commons-beanutils.jar
          calc.ear/calc.war/WEB-INF/lib/jboss-seam-mail.jar
          calc.ear/calc.war/WEB-INF/lib/jsf-facelets.jar
          calc.ear/calc.war/WEB-INF/lib/jboss-seam-remoting.jar
          calc.ear/calc.war/WEB-INF/lib/jboss-seam-ioc.jar
          calc.ear/calc.war/WEB-INF/lib/jboss-seam-ui.jar
          calc.ear/calc.war/WEB-INF/lib/richfaces-ui.jar
          calc.ear/calc.war/WEB-INF/lib/jboss-seam-pdf.jar
          calc.ear/calc.war/WEB-INF/lib/jboss-seam-debug.jar
          calc.ear/calc.war/WEB-INF/lib/commons-digester.jar
          calc.ear/calc.war/WEB-INF/components.xml
          calc.ear/calc.war/WEB-INF/pages.xml
          calc.ear/calc.war/WEB-INF/faces-config.xml
          calc.ear/calc.war/WEB-INF/jboss-web.xml
          calc.ear/calc.jar
          calc.ear/calc.jar/META-INF/ejb-jar.xml
          calc.ear/calc.jar/META-INF/persistence.xml
          calc.ear/META-INF/ejb-jar.xml
          calc.ear/META-INF/application.xml
          calc.ear/META-INF/jboss-app.xml
          calc.ear/lib/core.jar
          calc.ear/lib/jbpm-jpdl.jar
          calc.ear/lib/drools-core.jar
          calc.ear/lib/janino.jar
          calc.ear/lib/mvel14.jar
          calc.ear/lib/antlr-runtime.jar
          calc.ear/lib/jboss-el.jar
          calc.ear/lib/drools-compiler.jar
          calc.ear/lib/richfaces-api.jar
          calc.ear/jboss-seam.jar
          
          

          • 2. Re: Migrating from Seam 1.2.1 to 2.0.1
            Pete Muir Master

            You'll need to use your debugger to find out what is null to cause the NPE.