4 Replies Latest reply on Jun 16, 2003 1:58 PM by huangyufu

    EJB Client Error, Help.

    huangyufu

      I have both Session bean and Entity bean deployed to JBoss3.0+Tomcat4. When I tried to run my client program from the same PC, I got the following message:

      Got context

      javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalExcepti
      ing return; nested exception is:
      java.lang.ClassNotFoundException: org.jnp.interfaces.MarshalledValuePair
      r: RMI class loader disabled)]
      Press any key to continue . . .

      What was wrong? Do you need to add some libraries? Strangely it was working before.

        • 1. Re: EJB Client Error, Help.
          prabhakar

          Post your client code.

          -prabhakar

          • 2. Re: EJB Client Error, Help.
            huangyufu

            public class UserClientBean
            {

            public UserClientBean() {

            }


            public void startup () {
            System.setProperty("java.naming.factory.initial",
            "org.jnp.interfaces.NamingContextFactory");
            System.setProperty("java.naming.provider.url",
            "localhost:1099");

            try
            {
            InitialContext jndiContext = new InitialContext();
            System.out.println("Got context \n");

            Object ref = jndiContext.lookup("User");
            System.out.println("Got reference \n");

            UserHome home = (UserHome)
            PortableRemoteObject.narrow (ref,UserHome.class);

            home.create("user name", "role1", "111-112-1234", "111-112-1234",
            "111-112-1234", "Cell Number", "abc");
            home.create("useee eee", "role2", "333333333333", "888888888888",
            "999999999999", "Page Number", "abcccc");

            User user = home.findByPrimaryKey(new UserPK("user name"));
            System.out.println(user.getAlternativeEmail());

            }catch(Exception e) {
            System.out.println(e.toString());
            }
            }

            public static void main (String args[]) {
            UserClientBean user = new UserClientBean();
            user.startup();
            }
            }

            Thanks a lot.

            • 3. Re: EJB Client Error, Help.
              huangyufu

              Do I need to set CLASSPATH for all JARs of %JBOSS_HOME%\client? Thanks.

              • 4. Re: EJB Client Error, Help.
                huangyufu

                After I set some client jars path. I got this:

                Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
                at org.jnp.interfaces.NamingContext.(NamingContext.java:89)
                at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:42)
                at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
                at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
                at javax.naming.InitialContext.init(InitialContext.java:219)
                at javax.naming.InitialContext.(InitialContext.java:195)
                at UserClientBean.startup(UserClientBean.java:30)
                at UserClientBean.main(UserClientBean.java:54)

                Which JAR file I need to set?