8 Replies Latest reply on Sep 7, 2006 10:22 PM by Glenn

    Error RequiredException during finalize on @In components

    Glenn Newbie

      I upgraded Seam to CVS HEAD version on 9/5/2006 to get around a problem with back button pageflow redirects. Now the redirects work correctly but I am receiving exceptions in the log during object finialization.

      org.jboss.seam.RequiredException: In attribute requires value for component: tradeDetail.userPrincipal

        • 1. Re: Error RequiredException during finalize on @In component
          Glenn Newbie

          The Seam hibernate example exhibites the same exceptions after logging in. My app is also using pojos and Hibernate.

          • 2. Re: Error RequiredException during finalize on @In component
            Jim Hazen Expert

            Make sure there is a value for your @In tradeDetail.userPrincipal in scope. If not you'll get this error.

            Although I can't imagine you'd get this error while the GC is calling your finalize() method as this would happen outside of the JSF lifecycle and no bijection should be going on.

            • 3. Re: Error RequiredException during finalize on @In component
              Glenn Newbie

              It looks like it is trying to inject during finalize.
              Here is the error logged when running the Seam hibernate example. It all starts with the Finalizer and also the timing of the error is delayed.

              15:33:50,345 ERROR [STDERR] java.lang.IllegalArgumentException: SessionFactory not found
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.core.ManagedHibernateSession.create(ManagedHibernateSession.java:61)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,345 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,345 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:82)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.callComponentMethod(Component.java:1479)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.callCreateMethod(Component.java:1456)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.newInstance(Component.java:1446)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1350)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1324)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.getInstanceToInject(Component.java:1516)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.injectFields(Component.java:1103)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.Component.inject(Component.java:846)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:36)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,345 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,345 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:58)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,345 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,345 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:58)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,345 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,345 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,345 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
              15:33:50,345 ERROR [STDERR] at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:34)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,360 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,360 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalInterceptor.java:80)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,360 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,360 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,360 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,360 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
              15:33:50,360 ERROR [STDERR] at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:44)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,360 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,376 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,376 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.ejb.SeamInterceptor.invokeInContexts(SeamInterceptor.java:170)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:153)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:130)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.example.hibernate.RegisterAction$$EnhancerByCGLIB$$2188ed5a.finalize(<generated>)
              15:33:50,376 ERROR [STDERR] at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
              15:33:50,376 ERROR [STDERR] at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
              15:33:50,376 ERROR [STDERR] at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
              15:33:50,376 ERROR [STDERR] at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
              15:33:50,376 ERROR [STDERR] Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org/jnp/interfaces/NamingContextFactory]
              15:33:50,376 ERROR [STDERR] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
              15:33:50,376 ERROR [STDERR] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
              15:33:50,376 ERROR [STDERR] at javax.naming.InitialContext.init(InitialContext.java:223)
              15:33:50,376 ERROR [STDERR] at javax.naming.InitialContext.<init>(InitialContext.java:197)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.core.ManagedHibernateSession.getSessionFactory(ManagedHibernateSession.java:97)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.core.ManagedHibernateSession.create(ManagedHibernateSession.java:57)
              15:33:50,376 ERROR [STDERR] ... 80 more
              15:33:50,376 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: org/jnp/interfaces/NamingContextFactory
              15:33:50,376 ERROR [STDERR] at java.lang.Class.forName0(Native Method)
              15:33:50,376 ERROR [STDERR] at java.lang.Class.forName(Class.java:242)
              15:33:50,376 ERROR [STDERR] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
              15:33:50,376 ERROR [STDERR] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
              15:33:50,376 ERROR [STDERR] ... 87 more
              15:33:50,376 ERROR [STDERR] java.lang.NullPointerException
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.core.ManagedHibernateSession.destroy(ManagedHibernateSession.java:91)
              15:33:50,376 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              15:33:50,376 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              15:33:50,376 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              15:33:50,376 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:82)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.Component.callComponentMethod(Component.java:1476)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.Component.callDestroyMethod(Component.java:1464)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:189)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:341)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:84)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:157)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:130)
              15:33:50,376 ERROR [STDERR] at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
              15:33:50,392 ERROR [STDERR] at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
              15:33:50,392 ERROR [STDERR] at org.jboss.seam.example.hibernate.RegisterAction$$EnhancerByCGLIB$$2188ed5a.finalize(<generated>)
              15:33:50,392 ERROR [STDERR] at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
              15:33:50,392 ERROR [STDERR] at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
              15:33:50,392 ERROR [STDERR] at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
              15:33:50,392 ERROR [STDERR] at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
              15:33:50,392 WARN [Contexts] Could not destroy component: bookingDatabase
              java.lang.NullPointerException
               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:17)
               at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:82)
               at org.jboss.seam.Component.callComponentMethod(Component.java:1476)
               at org.jboss.seam.Component.callDestroyMethod(Component.java:1464)
               at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:189)
               at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:341)
               at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:84)
               at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:157)
               at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:130)
               at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
               at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
               at org.jboss.seam.example.hibernate.RegisterAction$$EnhancerByCGLIB$$2188ed5a.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)
              


              • 4. Re: Error RequiredException during finalize on @In component
                Jim Hazen Expert

                Whoa. What are you trying to do in your finalizer?

                • 5. Re: Error RequiredException during finalize on @In component
                  Glenn Newbie

                  That's just it, I'am not doing anything in the finalizer. And that stack trace is from the Seam Hibernate example.