facebook

re: problem running testSimpleBean java source

  1. MyEclipse IDE
  2.  > 
  3. Comments
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #214753 Reply

    tester333
    Member

    Hi, I am working on the ejb xdoclet tutorial(\EJB xDoclet Value Object Bug.html) and have the following problems:

    problem descriptions:
    1. The compilation of the simplebean.java and deployment to jboss3.2.5
    is working fine.

    2. Upon running the testSimpleBean.java code, it says the following:

    java.rmi.NoSuchObjectException: Entity not found: primaryKey=dd79f8aac0a8016400871dcc5b63a813; nested exception is:
    javax.ejb.NoSuchEntityException: Entity not found: primaryKey=dd79f8aac0a8016400871dcc5b63a813

    The following is my TestSimpleBean.java:

    ////////////////////////////////////////////////////
    /*
    * Created on Sep 8, 2004
    *
    * TODO To change the template for this generated file go to
    * Window – Preferences – Java – Code Style – Code Templates
    */
    package com.tutoria.teststub;

    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    /* import com.tutorial.simpleBean.interfaces.SimpleBean;
    import com.tutorial.tutorial.simpleBean.interfaces.SimpleBeanHome;
    */
    import com.tutorial.interfaces.*;

    /**
    * @author HS
    * 24.06.2004
    */
    public class TestSimpleBean {

    public static void main(String[] args) {
    try {
    Context context = new InitialContext();
    Object object = context.lookup(SimpleBeanHome.JNDI_NAME);
    SimpleBeanHome simpleBeanHome = (SimpleBeanHome)
    PortableRemoteObject.narrow(object,SimpleBeanHome.class);
    // use the interfaces not the class itself !!!!
    SimpleBean simpleBean = simpleBeanHome.create();
    simpleBean.setName(“Karl Heinz”);
    System.out.println(simpleBean.getPrimaryKey());
    System.out.println(simpleBean.getName());
    }
    catch (NamingException e) {
    e.printStackTrace();
    }
    catch (RemoteException e) {
    e.printStackTrace();
    }
    catch (CreateException e) {
    e.printStackTrace();
    }

    }
    }

    #214786 Reply

    Riyad Kalla
    Member

    EJB question, moving to Random Thoughts so others can help.

    #214857 Reply

    tester333
    Member

    does anybody know what can be done to fix the problem ?

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: re: problem running testSimpleBean java source

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