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
----- Original Message -----
Sent: Tuesday, June 12, 2001 6:41 PM
Subject: RE: [JBoss-user] jBoss cannot handle char primitive type

Kar,
 
Could you post the code for this, it looks as if it is looking for an Object of type Char not the primative type char. The object wrapper for char is the class java.lang.Character.
 
Paul
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kar YEOW
Sent: 12 June 2001 01:13
To: [EMAIL PROTECTED]
Subject: [JBoss-user] jBoss cannot handle char primitive type

I got and exception when calling an EJB with methods that uses char primitive type.  May be I have done something wrong.
I have attached the EJB code.  Anyone?
 
My work around is to use Integer but it would be nice if 'char' works.
Kar
 
---------------------------
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
 javax.transaction.TransactionRolledbackException: java/lang/Char; nested exception is:
 java.lang.NoClassDefFoundError: java/lang/Char
 
javax.transaction.TransactionRolledbackException: java/lang/Char; nested exception is:
 java.lang.NoClassDefFoundError: java/lang/Char
 
java.lang.NoClassDefFoundError: java/lang/Char
 
 at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
 
 at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
 
 at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
 
 at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown Source)
 
 at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:248)
 
 at $Proxy0.create(Unknown Source)
 
 at au.com.apir.test.EJBTester.main(EJBTester.java:44)
 
Exception in thread "main"

Reply via email to