I am facing problem for passing support objects to and fro between client and EJB Bean.
1st:->
--------------------
pulic class entityEJB implements EntityBean{
public Aobj aobj;
public void getAobj(){
System.out.println(aobj);//aobj is not null and is a proper aobj instance.
return this.aobj;
}
}
public class client{
.....
.....
Aobj a =<remoteinterface>.getAobj();
System.out.println(a);
//a is null here.
}
Also:
public class Aobj implements java.io.Serializable {
**********************************************************
2nd:->
-------------------------
pulic class entityEJB implements EntityBean{
public int pk;
....;
.....;
public void ejbCreate(Sobj s){
System.out.println(s);
pk = s.id;
............;
........;
}
}
public class client{
Sobj sobj;
.....
sobj=new Sobj();
sobj.pk=5;
.......
.....
System.out.println(sobj);// sobj is proper Sobj instance.
<remoteinterface> ri =<homeinterface>.create(sobj);
//Error occurs here.
}
Also:
public class Sobj implements java.io.Serializable {
--------------------------------------
For 2nd the error it gives is:
javax.ejb.CreateException: A bean primary key field may not be null after ejbCreate has been called
at weblogic.ejb.internal.StatefulEJBObject.postCreate(StatefulEJBObject.java:227)
at storeBeanEOImpl.create(storeBeanEOImpl.java:60)
at storeBeanHomeImpl.create(storeBeanHomeImpl.java:32)
at storeBeanHomeImpl_WLSkel.invoke(storeBeanHomeImpl_WLSkel.java:98)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java, Compiled Code)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:69)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
********************************
Any help is appreciated.
Thanks.
kaustubh.
-
Moving objects between client and EJB. (2 messages)
- Posted by: kaustubh asai
- Posted on: August 16 2000 16:01 EDT
Threaded Messages (2)
- return declare and return value error! by gao longlin on August 16 2000 21:30 EDT
- return declare and return value error! by harish satya on August 23 2000 15:22 EDT
-
return declare and return value error![ Go to top ]
- Posted by: gao longlin
- Posted on: August 16 2000 21:30 EDT
- in response to kaustubh asai
First:
------
< public void getAobj(); >
The return can not be void! You should return the Aobj:
public Aobj getAobj();
Second:
-------
< public void ejbCreate(Sobj s)>
The return must not be void and you should return the primary key so that home object can find the object.
public integer ejbCreate(Sobj sj)
-
return declare and return value error![ Go to top ]
- Posted by: harish satya
- Posted on: August 23 2000 15:22 EDT
- in response to gao longlin
return the object, not the void!!