- This topic has 2 replies, 2 voices, and was last updated 20 years, 3 months ago by tester333.
-
AuthorPosts
-
tester333MemberHi, 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=dd79f8aac0a8016400871dcc5b63a813The 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();
}}
}
Riyad KallaMemberEJB question, moving to Random Thoughts so others can help.
tester333Memberdoes anybody know what can be done to fix the problem ?
-
AuthorPosts