facebook

what am I missing? MyEclipse 7, Weblogic 10, simple EJB3

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #293323 Reply

    freelong
    Member

    I followed the tutorial to create a very simple EJB3, and a client to test.
    Here is the client:

    
    package com.myeclipseide.ejb3;
    
    import javax.naming.InitialContext;
    import com.myeclipseide.ejb3.*;
    import javax.naming.Context;
    import java.util.*;
    
    public class MyBeanClient {
    
        /**
         * @param args
         */
        public static void main(String[] args) throws Exception {
            // TODO Auto-generated method stub
            Hashtable<String,String> prop=new Hashtable<String,String>();
            prop.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            prop.put(Context.PROVIDER_URL, "t3://localhost:7001");
             
            InitialContext ctx = new InitialContext(prop);
            MyBeanRemote bean = ( MyBeanRemote) ctx.lookup("MyBean123#com.myeclipseide.ejb3.MyBeanRemote");
            bean.doSomething(); 
        }
    
    }
    

    I deployed the EJB from MyEclipse on weblogic 10, and seems deployed correctly, here is the log file I got when weblogic started up.

    <Module SampleEJBProject of application _appsdir_SampleEJBProject_dir is transitioning from STATE_NEW to STATE_PREPARED on server AdminServer.>
    <EJB Deploying file: SampleEJBProject>
    <Module SampleEJBProject of application _appsdir_SampleEJBProject_dir successfully transitioned from STATE_NEW to STATE_PREPARED on server AdminServer.>
    <Module SampleEJBProject of application _appsdir_SampleEJBProject_dir is transitioning from STATE_PREPARED to STATE_ADMIN on server AdminServer.>
    <The EJB ‘MyBean(Application: _appsdir_SampleEJBProject_dir, EJBComponent: SampleEJBProject)’ has been successfully deployed. The following remote interfaces have been bound into JNDI with the specified JNDI names:>
    BEA-014022> <******** com.myeclipseide.ejb3.MyBeanRemote is bound with JNDI name:MyBean123#com.myeclipseide.ejb3.MyBeanRemote ********>
    <BEA-010009> <EJB Deployed EJB with JNDI name _appsdir_SampleEJBProject_dirSampleEJBProjectMyBean_Home.>
    <BEA-149060> <Module SampleEJBProject of application _appsdir_SampleEJBProject_dir successfully transitioned from STATE_PREPARED to STATE_ADMIN on server AdminServer.>

    However, when I run the client from MyBeanClient.java, right click, -> run as Java Application, I got this exception:

    Exception in thread “main” java.lang.AssertionError: java.lang.ClassNotFoundException: com.myeclipseide.ejb3.MyBeanRemote
    at weblogic.ejb.container.internal.RemoteBusinessIntfGenerator.generateRemoteInterface(RemoteBusinessIntfGenerator.java:57)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:205)
    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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:564)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
    at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:392)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at com.myeclipseide.ejb3.MyBeanClient.main(MyBeanClient.java:20)
    Caused by: java.lang.ClassNotFoundException: com.myeclipseide.ejb3.MyBeanRemote
    at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.getClassBytes(RemoteBizIntfClassLoader.java:151)
    at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.loadClass(RemoteBizIntfClassLoader.java:96)
    at weblogic.ejb.container.internal.RemoteBusinessIntfGenerator.generateRemoteInterface(RemoteBusinessIntfGenerator.java:54)
    … 26 more

    Anyone knows what is happening, do i missing some configuration, or classpath or something?

    BTW, here is what the MyBean.java looks like:

    
    package com.myeclipseide.ejb3;
    
    import javax.ejb.Stateless;
    
    @Stateless(name="MyBean", mappedName="MyBean123")
    public class MyBean implements MyBeanLocal, MyBeanRemote {
        public void doSomething() {
            System.out.println("Hello World");
        }
    }
    
    #293326

    freelong
    Member

    Anyone knows what is happening, and helps me?

    #293341

    freelong
    Member

    any idea about from which point I should check?
    Thanks a lot.

    #294042

    Fred
    Member

    I seem to have same problem.

    My client cant see the remote interface class.

    -Fred

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: what am I missing? MyEclipse 7, Weblogic 10, simple EJB3

You must be logged in to post in the forum log in