|
By the way I use JBoss-2.2.1 and JDK1.3. The
codes is nothing fancy, as it happened to my 'real' code I wrote a tester to
make sure that was the problem.
Anyway, here is the codes:
___________Bean_______________
public class EntityBean implements
javax.ejb.EntityBean {
private javax.ejb.EntityContext ctx; public String id; public String s; public char c; public void unsetEntityContext()
{
ctx = null; } public void
setEntityContext(javax.ejb.EntityContext ctx)
{
this.ctx = ctx; } public String ejbCreate(String
id) throws CreateException, RemoteException
{
this.id = id; return null; } public void ejbPostCreate(String
id) throws CreateException {
} public void setString(String s)
{
this.s = s; } public String getString() { return s; } public void setChar(char c)
{
this.c = c; } public char getChar()
{
return c; } public void ejbStore()
{
} public void ejbRemove()
{
} public void ejbPassivate()
{
} public void ejbLoad()
{
} public void ejbActivate()
{
} } ___________Remote_________________
public interface Entity extends javax.ejb.EJBObject
{
public String getString() throws java.rmi.RemoteException; public void setString(String s) throws java.rmi.RemoteException; public void setChar(char c) throws java.rmi.RemoteException; public char getChar() throws java.rmi.RemoteException; } __________Home_________________
public interface EntityHome extends
javax.ejb.EJBHome {
Entity create(String s) throws java.rmi.RemoteException, javax.ejb.CreateException; Entity findByPrimaryKey(String id) throws java.rmi.RemoteException, javax.ejb.FinderException; Collection findAll() throws java.rmi.RemoteException, javax.ejb.FinderException; } _________Client_______________
au.com.apir.test.EntityHome home = (au.com.apir.test.EntityHome) ....look up
here (I remove the code because I use a
wrapper)....
au.com.apir.test.Entity entity = home.create("hello"); entity.setChar('c'); // <------ i dies either here or System.out.println(entity.getChar()); // <-- here
|
