3 Replies Latest reply on Feb 14, 2013 8:20 AM by rhusar

    Failing to initialize jpa mapped class in a cluster

    grunlowen

      This problem is consistent in that it reoccurs, but only about 1 out of 3 times when we restart our servers. After the servers are up, if it works the first time, it will continue to work, and the same goes for failing.

       

      When we try to login, via Spring, the container fails to initialize our first hibernate mapped class. Here is the error:

       

      Error during getting UserLogin with username=7@7.com. Could not init

      ialize class colorado.dor.online.interlock.model.Applicant

      java.rmi.RemoteException: Error during getting UserLogin with username=7@7.com. Could not initialize class colorad

      o.dor.online.interlock.model.Applicant

              at colorado.dor.online.interlock.service.ejb.UserAdminServiceBean.getUserLogin(UserAdminServiceBean.java:7

      8)

              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.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)

              at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvoca

      tionWrapper.java:72)

              at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)

              at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)

              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.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.ja

      va:72)

              at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_18792704

      40.invoke(InvocationContextInterceptor_z_fillMethod_1879270440.java)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88

      )

              at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_1879270440.in

      voke(InvocationContextInterceptor_z_setup_1879270440.java)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)

              at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

              at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)

       

      Here's how the class is mapped:

      <hibernate-configuration>

       

        <session-factory>

          <property name="connection.datasource">java:/colorado-dor-online-interlock-ds</property>

          <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>

          <property name="hibernate.show_sql">true</property>

          <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

          <property name="hibernate.cache.use_second_level_cache">false</property>

          <property name="hibernate.current_session_context_class">thread</property>

         

          <!-- Mapping classes -->

          <mapping class="colorado.dor.online.interlock.model.Applicant" />

          ...etc...

       

      JBoss version: JBoss (Microcontainer) [5.1.0 (build: SVNTag=JBPAPP_5_1_0 date=201009150028)

       

      Hibernate version:

        <artifactId>hibernate-core</artifactId>
       

      <version>3.3.2.GA_CP03</version>

      and

        <artifactId>hibernate-annotations</artifactId>
        <version>3.4.0.GA_CP03</version>
        • 1. Re: Failing to initialize jpa mapped class in a cluster
          rhusar

          Just wildly guessing here, but instead of booting all the servers at the same time, can you boot them sequentially, 1-by-1? Looks like servers remotly try to communicate before some things may have been initialized.

          • 2. Re: Failing to initialize jpa mapped class in a cluster
            grunlowen

            Thanks for the reply.

             

            Yes, if I start the servers sequentially, then I do not see the issue. The problem is that I am one of many developers, and I have no control over how others restart the servers.

             

            After cleaning up the dependency tree, I am not seeing the issue, but it was not a predictable error and it might still occur. I'm a little surprised that it is not a more common error, but perhaps there is something unique (and maybe wrong) with the application or our environment.

            • 3. Re: Failing to initialize jpa mapped class in a cluster
              rhusar

              The problem is that I am one of many developers, and I have no control over how others restart the servers.

              Thats not a good practice in general to have anyone anytime restart the servers. I recommend bringing some systematic approach to administration.

               

              Right, good to clean the dep tree, no keep your eyes open if it happens next.