4 Replies Latest reply on Sep 25, 2009 11:51 AM by noushad siddiqui

    ejb-transaction - convert to 2.1 fails

    John McClain Newbie

      I have a seam project built with maven for seam 2.0.2.sp1. works fine. I do the following to convert over to seam 2.1.0.GA


      1) change version of jboss-seam to be 2.1.0.SP1


      2) change all schema locations in components.xml from 2.0.xsd to 2.1.xsd


      3) change pages.xml doctype from pages-2.0.dtd to 2.1.dtd


      The result is that at jboss 4.2.0.GA startup I get the below error. Is there some other conversion step I am missing?


      09:02:19,687 ERROR [ContainerBase] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.RuntimeException: error while reading /WEB-INF/components.xml
           at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:221)
           at org.jboss.seam.init.Initialization.create(Initialization.java:124)
           at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854
      .
      .
      .
      Caused by: java.lang.RuntimeException: Error loading element EjbTransaction with component name null and component class null
           at org.jboss.seam.init.Initialization.installComponentsFromXmlElements(Initialization.java:342)
      
      
      



      Here is my 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:framework="http://jboss.com/products/seam/framework"
           xmlns:persistence="http://jboss.com/products/seam/persistence"
           xmlns:security="http://jboss.com/products/seam/security"
           xmlns:transaction="http://jboss.com/products/seam/transaction"
           xmlns:mail="http://jboss.com/products/seam/mail"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:web="http://jboss.com/products/seam/web"
           xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
          http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
          http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
          http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
          http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd 
          http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.1.xsd
          http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd">
      
      
      
           <core:init debug="false" jndi-pattern="${earBaseName}/#{ejbName}/local" />
      
           <core:manager concurrent-request-timeout="500"
                                              conversation-timeout="120000" 
                                              conversation-id-parameter="cid" />
                
      
           
           <!-- Only needed when using Seam managed entityManager via @IN
           instead of just @PersistenceContext -->
           <persistence:managed-persistence-context 
                name="CamOracleEntityManager"
                auto-create="true"
                persistence-unit-jndi-name="java:/avmserviceOracleEntityManagerFactory" />
                
           <persistence:managed-persistence-context 
                name="ItTurboOracleEntityManager"
                auto-create="true"
                persistence-unit-jndi-name="java:/avmserviceITTurboEntityManagerFactory" />
                          
           <transaction:ejb-transaction/>
                
           <security:identity jaas-config-name="homeq-${pom.parent.artifactId}" />
           
           <!-- Needed to allow seam injection into servlets -->
           <web:context-filter url-pattern="/avm.seam/*"/>
           <web:redirect-filter />
      
      </components>
      




        • 1. Re: ejb-transaction - convert to 2.1 fails
          Christian Lischnig Newbie

          Hello!


          I have the same problem. Does anyone have a solution for that problem?


          I have also tried to update JBoss AS from 4.2.2.GA to 4.2.3.GA but nothing changed.


          My error was not EjbTransaction but Identity because it came before EjbTransaction in the components.xml. I also tried to change the order. Then I got the same exception but with EjbTransaction: name and class are null.


          Generally spoken: is the order in components.xml important?


          Could it be that this exception is thrown because components.xml is initialized before all components tagged with @Name are loaded??? This is only my opinion, perhaps it is absolutly wrong... :)


          Let's have a look in the source code, perhaps this will help...


          Nice greetings.

          • 2. Re: ejb-transaction - convert to 2.1 fails
            Clint Popetz Apprentice

            I got this once because I had jboss-seam.jar in two places...once in WEB-INF/lib, and once in the top level of the ear.  The @Namespace annotation class was found in the WEB-INF/lib one, and cached by the jdk annotations support,  and therefore the transaction pkg-info.class didn't look like it had a @Namespace annotation to the seam scanning code, so the namespace descriptor wasn't built correctly.



            • 3. Re: ejb-transaction - convert to 2.1 fails
              Christian Lischnig Newbie

              Hello again!


              Thank you very, very much. I had this issue with duplicated JAR files that often...
              Indeed, jboss.seam.2.1.0.SP1.jar was in my EAR file AND in lib folder of my WAR file. So I added exclusions for this dependency on the following dependencies of the pom-File in my WAR-Project:
              - my own EJB project (has also seam as dependency)
              - jboss-seam-ui
              - jboss-seam-mail
              - jboss-seam-pdf


              But then I got another error, because a certain class (sorry cant remember since yesterday, bad brain...) was not found during JBoss startup. I also had to add org.jboss.el.jboss-el.2.0.2.CR1 to my EAR file (I have JBoss 4.2.2.GA). I dont know exactly but I think this dependency exists  already in JBoss 4.2.3.GA.


              I hope this post was helpful also for others which are going to update to the new version.


              Nice greetings.

              • 4. Re: ejb-transaction - convert to 2.1 fails
                noushad siddiqui Newbie

                Hey, i have similar type of problem, but it is because of Error loading element HotDeployFilter with component name null and component class null


                I am using seam 2.1.0SP1 and jboss-4.2.3.GA


                jboss-seam.jar is only in ear


                stacktrace is




                15:05:01,352 INFO  [Initialization] reading /WEB-INF/components.xml
                15:05:01,381 ERROR [[/imsupport]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                java.lang.RuntimeException: error while reading /WEB-INF/components.xml
                        at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:221)
                        at org.jboss.seam.init.Initialization.create(Initialization.java:124)
                        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
                .
                .
                .
                
                Caused by: java.lang.RuntimeException: Error loading element HotDeployFilter with component name null and component class null
                        at org.jboss.seam.init.Initialization.installComponentsFromXmlElements(Initialization.java:342)
                        at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:217)
                        ... 138 more
                




                My component.xml is





                <?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:async="http://jboss.com/products/seam/async"
                            xmlns:jms="http://jboss.com/products/seam/jms"
                            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.1.xsd
                                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                                 http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
                
                   <core:init debug="@debug@" 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"/>
                   <web:rewrite-filter view-mapping="*.seam"/>
                
                   <persistence:managed-persistence-context name="entityManager" auto-create="true"
                                      persistence-unit-jndi-name="@puJndiName@"/>
                
                   <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"/>
                
                   <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 session-jndi-name="java:/Mail"/>
                   
                   <component name="gatewayMessageProcessor" auto-create="true"
                      class="org.jboss.seam.jms.ManagedQueueSender">
                      <property name="queueJndiName">queue/gatewayMessageQueue</property>
                   </component>
                   
                   <async:quartz-dispatcher />
                
                     <jms:managed-topic-publisher name="chatMessagePublisher"
                          auto-create="true" topic-jndi-name="topic/agentChatMessages" />
                
                    <component class="org.jboss.seam.remoting.messaging.SubscriptionRegistry" installed="true">
                        <property name="allowedTopics">agentChatMessages</property>
                    </component>
                
                    <component name="org.jboss.seam.core.manager">
                        <property name="conversationTimeout">120000</property>
                    </component>
                    
                    <component name="org.jboss.seam.remoting.remoting">
                      <property name="debug">false</property>
                      <property name="pollTimeout">2</property>
                      <property name="pollInterval">1</property>
                    </component>
                                   
                </components>
                



                Is there anything wrong with my component.xml ??