Results 1 to 5 of 5
Thread: java.lang.ClassCastException
- 05-21-2008, 08:38 PM #1
Member
- Join Date
- May 2008
- Posts
- 2
- Rep Power
- 0
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.
- 05-21-2008, 09:34 PM #2
Sounds like your trying to make one object be another object. For example you can not in java make a class called Car and try to cast it to a fruit. It won't let you.
My IP address is 127.0.0.1
- 05-22-2008, 05:58 AM #3
It seems row[i] doesn't contain an instance of Xxdp00OrgDescriptionsVORowImpl. Can you show the actual code leading to this line?
Daniel @ [www.littletutorials.com]
Language is froth on the surface of thought
- 05-22-2008, 02:15 PM #4
Member
- Join Date
- May 2008
- Posts
- 2
- Rep Power
- 0
Here is the actual code in AM
Here is the actual code
Thanks for your help.Java 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 */ } }
- 05-22-2008, 03:43 PM #5
What is the signature for this method: orgvo.getAllRowsInRange(); ?
Daniel @ [www.littletutorials.com]
Language is froth on the surface of thought
Similar Threads
-
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String)
By baltimore in forum New To JavaReplies: 2Last Post: 09-18-2008, 07:30 AM -
ClassCastException in TreeSet
By pHew in forum New To JavaReplies: 2Last Post: 01-16-2008, 12:20 AM -
Problem with vector, java.lang.ClassCastException
By paul in forum New To JavaReplies: 1Last Post: 07-16-2007, 04:31 PM -
ClassCastException
By Ed in forum New To JavaReplies: 2Last Post: 07-04-2007, 05:26 AM -
ClassCastException
By Felissa in forum New To JavaReplies: 2Last Post: 07-04-2007, 05:06 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks