java.lang.ClassCastException
Hello,
I am new to java> I have built a web page to query an oracle table and return rows of data. I have added a button to execute a delete method. When executing the delete method, I get the following error:
What is the problem and how do I correct it?
## Detail 0 ##
java.lang.ClassCastException
at oracle.apps.cust.xxdpOrgDesc.server.xxdpOrgDescAMI mpl.DeleteOrgDescRow(xxdpOrgDescAMImpl.java:59)
//*** ---- *** This is the row referenced in the error message *** ---- ****
Xxdp00OrgDescriptionsVORowImpl rowi = (Xxdp00OrgDescriptionsVORowImpl)row[i];
//*** ---- *** ----------------------------------------------- *** ---- ****
Error Explanation:
Thrown to indicate that the code has attempted to cast
an object to a subclass of which it is not an instance.
Here is the actual code in AM
Here is the actual code
Code:
package oracle.apps.cust.xxdpOrgDesc.server;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.cust.xxdpOrgDesc.webui.Xxdp00OrgDescriptionsVOImpl;
//import oracle.apps.fnd.framework.server.OAUtility.*;
import oracle.jbo.Row;
//import oracle.apps.fnd.framework.server.*;
//import oracle.apps.fnd.framework.*;
// ---------------------------------------------------------------
// --- File generated by Oracle Business Components for Java.
// ---------------------------------------------------------------
public class xxdpOrgDescAMImpl extends OAApplicationModuleImpl
{
/**
*
* This is the default constructor (do not remove)
*/
public xxdpOrgDescAMImpl()
{
}
/**
*
* Container's getter for Xxdp00OrgDescriptionsVO
*/
public Xxdp00OrgDescriptionsVOImpl getXxdp00OrgDescriptionsVO1()
// public Xxdp00OrgDescriptionsVOImpl getXxdp00OrgDescriptionsVO() /* orig */
{
// return (Xxdp00OrgDescriptionsVOImpl)findViewObject("Xxdp00OrgDescriptionsVO"); /* orig */
return (Xxdp00OrgDescriptionsVOImpl)findViewObject("Xxdp00OrgDescriptionsVO1");
}
/**
*
* Sample main for debugging Business Components code using the tester.
*/
public static void main(String[] args)
{
launchTester("oracle.apps.cust.xxdpOrgDesc.server", "xxdpOrgDescAMLocal");
}
/*
* Beginning of Delete Method - DeleteOrgDescRow
*/
public void DeleteOrgDescRow( String pAction, String pRowID )
{
System.out.println("xxDebug inside deleteOrgDescRow()") ;
// Xxdp00OrgDescriptionsVOImpl orgvo = getXxdp00OrgDescriptionsVO() ; /* orig */
Xxdp00OrgDescriptionsVOImpl orgvo = getXxdp00OrgDescriptionsVO1() ; /* test */
System.out.println("pAction IS: "+pAction) ;
System.out.println("ROW_ID IS: "+pRowID) ;
Row row[]=orgvo.getAllRowsInRange();
for ( int i=0;i<row.length;i++)
{
System.out.println("i IS: "+i) ;
System.out.println("i end IS: "+row.length) ;
//Xxdp00OrgDescriptionsVORowImpl rowi = (Xxdp00OrgDescriptionsVORowImpl)row[i];
Xxdp00OrgDescriptionsVORowImpl rowi = (Xxdp00OrgDescriptionsVORowImpl)row[i];
System.out.println("xxDebug Checking to delete RowID => " + rowi.getRowID());
if (rowi.getRowID().toString().equals(pRowID))
{
rowi.remove();
getOADBTransaction().commit();
return ;
}
}
/*
* End of Delete Method
*/
}
}
Thanks for your help.