File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes get a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "get a "ArrayIndexOutOfBounds"When I access a CMP" Watch "get a "ArrayIndexOutOfBounds"When I access a CMP" New topic
Author

get a "ArrayIndexOutOfBounds"When I access a CMP

lyo Yashnoo
Ranch Hand

Joined: Sep 15, 2003
Posts: 50
Hello everyone:

I deploy a EJB(CMP) successfully in weblogic8.But I get a Exception "ArrayIndexOutOfBoundsException" When I invoke it using code:
////////////////////////invokeejb.jsp/////////////////////////////////

I have a record in MySQL Database and I have already mapping the record to the cmp field.
My EJB home interface is:
/////////////////////////////////////////

Why it arrayoutofbound ?
lyo Yashnoo
Ranch Hand

Joined: Sep 15, 2003
Posts: 50
Anyone can help me?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Better paste the Exception stack trace here.


Groovy
lyo Yashnoo
Ranch Hand

Joined: Sep 15, 2003
Posts: 50
The exception is:
////////////////////////////////////////////////////////////
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:805)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:790)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObjectReplacer.java:199)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:911)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1655)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.rmi.internal.CBVInputStream.readObjectInternal(CBVInputStream.java:67)
at weblogic.rmi.internal.CBVInputStream.readObject(CBVInputStream.java:61)
at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:97)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:285)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
at weblogic.jndi.internal.ServerNamingNode_811_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at jsp_servlet.__ejb._jspService(__ejb.java:130)
...................................................
...................................................
Caused by: java.lang.ArrayIndexOutOfBoundsException: 13
at lyo.cmp.customer.CustomerEJB_6i2zhv_HomeImpl_811_WLStub.ensureInitialized(Unknown Source)
at lyo.cmp.customer.CustomerEJB_6i2zhv_HomeImpl_811_WLStub.(Unknown Source)
... 37 more
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Failed to generate class for lyo.cmp.customer.CustomerEJB_6i2zhv_HomeImpl_811_WLStub ] - with nested exception:
[java.lang.reflect.InvocationTargetException - with target exception:
[java.lang.ArrayIndexOutOfBoundsException: 13]]
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:807)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:790)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObjectReplacer.java:199)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:911)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1655)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.rmi.internal.CBVInputStream.readObjectInternal(CBVInputStream.java:67)
at weblogic.rmi.internal.CBVInputStream.readObject(CBVInputStream.java:61)
////////////////////////////////////////////////////////////////
My EJB home interface is:
/////////////////////////////////////////
code:
--------------------------------------------------------------------------------
public interface CustomerHomeRemote extends EJBHome{
public CustomerRemote create(Integer id)throws CreateException,RemoteException;
public CustomerRemote findByPrimaryKey(Integer id)throws FinderException,CreateException,RemoteException;
--------------------------------------------------------------------------------
My CustomerBean is:
----------------------------------------------------------------------------
public abstract class CustomerBean implements EntityBean{
public Integer ejbCreate(Integer id){
this.setId(id);
return null;
}
public void ejbPostCreate(Integer id){}
/* Lyo create ejb method*/
public abstract Integer getId();
public abstract void setId(Integer id);
public abstract String getFirstName();
public abstract void setFirstName(String fname);
public abstract String getLastName();
public abstract void setLastName(String lname);
/* End Lyo create*/
...................................................
................................
----------------------------------------------------------------------------
My CustomerRemote interface is:
---------------------------------------------------------------------------
public interface CustomerRemote extends EJBObject{
public void setFirstName(String fname)throws RemoteException;
public String getFirstName()throws RemoteException;
public void setLastName(String lname)throws RemoteException;
public String getLastName()throws RemoteException;
}

Why it arrayoutofbound ? Help
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: get a "ArrayIndexOutOfBounds"When I access a CMP