0 Replies Latest reply on Aug 10, 2006 5:50 AM by Carsten Hoehne

    Hundreds of IllegalArgumentException: SessionFactory not fou

    Carsten Hoehne Master

      Hello,
      i am experience hundreds of exceptions, see below. Nevertheless the component bazDatabase gets initialized sometimes. So the app could access the database. Any ideas what went wrong.
      My app works with tomcat5.15
      hibernate is set up in the microcontainer (configuration after the exception trace.
      I use a version of seam from the CVS.

      11:21:03,765 DEBUG org.jboss.seam.Component: instantiating Seam component: bazDatabase
      11:21:03,765 DEBUG org.jboss.seam.Component: initializing new instance of: bazDatabase
      java.lang.IllegalArgumentException: SessionFactory not found
       at org.jboss.seam.core.ManagedHibernateSession.create(ManagedHibernateSession.java:61)
       at sun.reflect.GeneratedMethodAccessor388.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:45)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1475)
       at org.jboss.seam.Component.callCreateMethod(Component.java:1452)
       at org.jboss.seam.Component.newInstance(Component.java:1442)
       at org.jboss.seam.Component.getInstance(Component.java:1346)
       at org.jboss.seam.Component.getInstance(Component.java:1320)
       at org.jboss.seam.Component.getInstanceToInject(Component.java:1512)
       at org.jboss.seam.Component.injectFields(Component.java:1099)
       at org.jboss.seam.Component.inject(Component.java:842)
       at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:36)
       at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
       at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
       at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:58)
       at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
       at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
       at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:58)
       at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
       at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
       at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:34)
       at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
       at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
       at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalInterceptor.java:80)
       at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
       at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
       at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
       at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
       at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
       at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:40)
       at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
       at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
       at org.jboss.seam.ejb.SeamInterceptor.invokeInContexts(SeamInterceptor.java:134)
       at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:116)
       at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:93)
       at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
       at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
       at de.bafz.persistence.dao.PopulationDAO$$EnhancerByCGLIB$$1bb177b2.finalize(<generated>)
       at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
       at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
       at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
       at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
      Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.LocalOnlyContextFactory [Root exception is java.lang.ClassNotFoundException: org/jnp/interfaces/LocalOnlyContextFactory]
      11:21:03,765 DEBUG org.hibernate.jdbc.ConnectionManager: aggressively releasing JDBC connection
       at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
       at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
       at javax.naming.InitialContext.init(InitialContext.java:223)
       at javax.naming.InitialContext.<init>(InitialContext.java:197)
       at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
       at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
       at org.jboss.seam.core.ManagedHibernateSession.getSessionFactory(ManagedHibernateSession.java:97)
       at org.jboss.seam.core.ManagedHibernateSession.create(ManagedHibernateSession.java:57)
       ... 72 more
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: After render response, destroying contexts
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: destroying event context
      Caused by: java.lang.ClassNotFoundException: org/jnp/interfaces/LocalOnlyContextFactory
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:242)
       at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: destroying conversation context
       at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
       ... 79 more
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: destroying event context
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: destroying conversation context
      11:21:03,765 DEBUG org.jboss.seam.core.ManagedHibernateSession: destroying seam managed session for session factory: java:/bazDatabase
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: flushing server-side conversation context
      11:21:03,765 DEBUG org.jboss.seam.core.ManagedHibernateSession: destroying seam managed session for session factory: java:/bazDatabase
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: <<< End web request
      java.lang.NullPointerException
      11:21:03,765 DEBUG org.jboss.seam.jsf.AbstractSeamPhaseListener: No active conversation context
       at org.jboss.seam.core.ManagedHibernateSession.destroy(ManagedHibernateSession.java:91)
       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:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:16)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:45)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1472)
       at org.jboss.seam.Component.callDestroyMethod(Component.java:1460)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:189)
       at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:311)
       at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:72)
       at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:120)
       at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:93)
       at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
       at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
       at de.bafz.persistence.dao.PopulationDAO$$EnhancerByCGLIB$$1bb177b2.finalize(<generated>)
       at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
       at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
       at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
       at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: flushing server-side conversation context
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: <<< End call
      11:21:03,765 DEBUG org.jboss.seam.contexts.Lifecycle: >>> Begin call
      11:21:03,765 DEBUG org.jboss.seam.Component: instantiating Seam component: org.jboss.seam.core.manager
      11:21:03,781 DEBUG org.jboss.seam.Component: initializing new instance of: org.jboss.seam.core.manager
      11:21:03,781 DEBUG org.jboss.seam.Component: instantiating Seam component: bazDatabase
      11:21:03,781 DEBUG org.jboss.seam.Component: initializing new instance of: bazDatabase
      java.lang.IllegalArgumentException: SessionFactory not found
      


      jboss-beans.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
       xmlns="urn:jboss:bean-deployer">
      
       <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
      
       <bean name="TransactionManagerFactory" class="org.jboss.seam.microcontainer.TransactionManagerFactory"/>
       <bean name="TransactionManager" class="java.lang.Object">
       <constructor factoryMethod="getTransactionManager">
       <factory bean="TransactionManagerFactory"/>
       </constructor>
       </bean>
      
       <bean name="bazDatasourceFactory" class="org.jboss.seam.microcontainer.DataSourceFactory">
       <property name="driverClass">com.mysql.jdbc.Driver</property>
       <property name="connectionUrl">jdbc:mysql://localhost:3306/bazseam</property>
       <property name="userName">root</property>
       <property name="jndiName">java:/hibernateDatasource</property>
       <property name="minSize">0</property>
       <property name="maxSize">10</property>
       <property name="blockingTimeout">1000</property>
       <property name="idleTimeout">100000</property>
       <property name="transactionManager"><inject bean="TransactionManager"/></property>
       </bean>
       <bean name="bazDatasource" class="java.lang.Object">
       <constructor factoryMethod="getDataSource">
       <factory bean="bazDatasourceFactory"/>
       </constructor>
       </bean>
      
       <bean name="bazDatabaseFactory" class="org.jboss.seam.microcontainer.HibernateFactory"/>
       <bean name="bazDatabase" class="java.lang.Object">
       <constructor factoryMethod="getSessionFactory">
       <factory bean="bazDatabaseFactory"/>
       </constructor>
       <depends>bazDatasource</depends>
       </bean>
      
      </deployment>

      <components>
       <component name="org.jboss.seam.core.init">
       <property name="myFacesLifecycleBug">false</property>
       <property name="debug">true</property>
       </component>
      
       <!-- 120 second conversation timeout -->
       <component name="org.jboss.seam.core.manager">
       <property name="conversationTimeout">120000</property>
       </component>
      
      
       <!-- Bootstrap Hibernate -->
       <component name="bazDatabase" class="org.jboss.seam.core.ManagedHibernateSession" />
       <component class="org.jboss.seam.core.Hibernate" />
       <component class="org.jboss.seam.core.Microcontainer" installed="true" />
      
       <!-- Setup application components -->
       <component name="bazProject" class="org.jboss.seam.core.ManagedHibernateEntity">
       <property name="entityClass">de.bafz.lims.model.Project</property>
       <property name="session">#{bazDatabase}</property>
       <property name="id">#{bazProjectID}</property>
       <property name="idClass">java.lang.String</property>
       </component>
       <component name="bazExperiment" class="org.jboss.seam.core.ManagedHibernateEntity">
       <property name="entityClass">de.bafz.lims.model.Experiment</property>
       <property name="session">#{bazDatabase}</property>
       <property name="id">#{bazExperimentID}</property>
       <property name="idClass">java.lang.Long</property>
       </component>
      
      </components>