5 Replies Latest reply on Jul 23, 2010 5:23 AM by Dusan Banik

    Exception Could not create Component:

    Dusan Banik Newbie

      hi can sombody help me with this exception.


      11:26:23,153 ERROR [[/web]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.RuntimeException: Could not create Component: org.jboss.seam.transacti
      on.synchronizations
              at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1
      202)
              at org.jboss.seam.init.Initialization.installComponents(Initialization.j
      ava:1118)
              at org.jboss.seam.init.Initialization.init(Initialization.java:733)
              at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.j
      ava:36)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
      



      Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: org.jboss.seam.transaction.synchronizatio
      ns
              at org.jboss.seam.Component.getJndiName(Component.java:451)
              at org.jboss.seam.Component.<init>(Component.java:233)
              at org.jboss.seam.Component.<init>(Component.java:205)
              at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1
      186)





        • 2. Re: Exception Could not create Component:
          Dusan Banik Newbie
          <hibernate-configuration>
              
          <session-factory name= "java:/sessionFactory">
          .....
                   <property name="transaction.flush_before_completion">true</property>
                   <property name="connection.release_mode">after_statement</property>
                   <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
                   <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
                   <property name="connection.datasource">java:/hibernateSession</property>
          
          </session-factory>



          • 3. Re: Exception Could not create Component:
            Dusan Banik Newbie

            components.xml:



            <persistence:hibernate-session-factory name="sessionFactory"/>
                <persistence:managed-hibernate-session name="hibernateSession" session-factory-jndi-name="java:/sessionFactory" auto-create="true"/>
                <transaction:hibernate-transaction session = "#{hibernateSession}"/>




            • 4. Re: Exception Could not create Component:
              Stuart Douglas Master

              if you are in an EE environemnt you need something like this in your somponents.xml:


                  <core:init jndi-pattern="@jndiPattern@"  />
              
              


              refer to the seam docs for more info.


              If you are in a se environment you need to install



              <persistence:se-synchronizations/>
              

              • 5. Re: Exception Could not create Component:
                Dusan Banik Newbie

                hi i i added it and know i get following exception


                11:09:38,091 ERROR [[/web]] Exception sending context initialized event to liste
                ner instance of class org.jboss.seam.servlet.SeamListener
                org.jboss.seam.InstantiationException: Could not instantiate Seam component: sessionFactory



                Caused by: java.lang.ClassCastException: org.hibernate.validator.event.ValidateEventListener cannot be cast to org.hibernate.event.PreInsertEventListener
                
                11:09:38,091 ERROR [StandardContext] Error listenerStart