0 Replies Latest reply on Feb 26, 2004 8:22 AM by biebel1975

    java.lang.NoSuchMethodError in stateful session bean

    biebel1975

      Hi,

      We have a big problem with the creation of an object in the ejbCreate method
      of our bean (yComboDataBean). We construct an object that makes a database
      connection (yServerCtx). This object is then used in methods of the bean as
      a way to access the database.

      Constructing the bean fails, because creating the server context object
      fails. The org.jboss.mx.loading.UnifiedClassLoader3 could not load yTools.Server.yServerCtx.

      The error we get is the following (our JBoss server tells us:)
      ERROR [LogInterceptor] Unexpected Error:
      java.lang.NoSuchMethodError:
      yTools.Server.yServerCtx.(LyTools/yUserProfile;)V
      at yToolsBeans.yComboDataBean.ejbCreate(yComboDataBean.java:25)


      There are no problems with deployment, only execution. The code is as
      follows:

      // The bean (simplified)
      // ...
      public class yComboDataBean implements SessionBean
      { SessionContext sessionContext;
      yServerCtx serverCtx;

      public void ejbCreate(yUserProfile userProfile) throws CreateException
      { try {
      serverCtx = new yServerCtx( userProfile );
      }
      catch(Exception e)
      { /*...*/ }
      }
      // ...
      }

      // The server context class (simplified)
      package yTools.server;
      public class yServerCtx
      { private yUserProfile userProfile;
      public DatabaseOps dbOps = new DatabaseOps();

      public yServerCtx(yUserProfile userProfile) throws Exception
      { this.userProfile = userProfile; }
      }

      The yUserProfile class is a simple data class.

      We are absolutely baffled. The code compiles and deploys without problems,
      but execution tells us "NoSuchMethodError"??? The bean is stateful,
      bean-managed session bean. The environment is JBoss 3.2.1 / JBuilder 9 /
      Windows2k.

      Does anyone have a clue as to what is going wrong here?

      Tom & Bart.
      Upsilon SA (Luxembourg)