Hi ,
I am deploying an entity bean using jetace and admin console, with oracle database, when i ever I access that bean thro' client, the create and find method are working fine, but when i try to display the field values or access any business method I am getting FETCH EXCEPTION as shown below, I have also given the client code also, Is there any condition that order of columns in table should be similar to one in xml file, if so can anybody explain.
Caught an unexpected exception!
java.rmi.ServerException: RemoteException occurred in server
thread; nested exception is:
com.ibm.ejs.persistence.EJSPersistenceException: java.sql.SQLException: ORA-01002: fetch out of sequence
; nested exception is:
java.sql.SQLException: ORA-01002: fetch out of sequence
com.ibm.ejs.persistence.EJSPersistenceException: java.sql.SQLException: ORA-01002: fetch out of sequence
; nested exception is:
java.sql.SQLException: ORA-01002: fetch out of sequence
java.sql.SQLException: ORA-01002: fetch out of sequence
CLIENT SOURCE CODE:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.util.*;
import dept.*;
public class MyDeptClient {
public static void main(
String[] args) {
try {
Properties props = System.getProperties();
props.put( javax.naming.Context.PROVIDER_URL, "iiop://localhost:900" );
props.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory" );
Context initial = new InitialContext(props);
//HelloHome home =(HelloHome) initial.lookup("HelloHome");
Object objref =initial.lookup("MyDept");
MyDeptHome home =
(MyDeptHome)PortableRemoteObject.narrow(objref, MyDeptHome.class);
MyDept a = home.create( new MyDeptKey(30),"");
//Enumeration e = home.findLargeMyAccounts(199999.0f);
/* if ( e == null )
System.out.println( "NULL"+e.hasMoreElements() );
else
System.out.println( "Not NULL"+e.hasMoreElements() );*/
// MyAccount a = home.create(new MyAccountKey(1001), 1, 1000.00f);
System.out.println( "DeptName " + (a.getRecord())[0]);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}