Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-21-2008, 10:38 PM
Member
 
Join Date: May 2008
Posts: 2
wrwelden is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-21-2008, 11:34 PM
Zosden's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 386
Zosden is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-22-2008, 07:58 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
danielstoner is on a distinguished road
It seems row[i] doesn't contain an instance of Xxdp00OrgDescriptionsVORowImpl. Can you show the actual code leading to this line?
__________________
Daniel @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-22-2008, 04:15 PM
Member
 
Join Date: May 2008
Posts: 2
wrwelden is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-22-2008, 05:43 PM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 191
danielstoner is on a distinguished road
What is the signature for this method: orgvo.getAllRowsInRange(); ?
__________________
Daniel @ [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String) baltimore New To Java 2 09-18-2008 09:30 AM
ClassCastException in TreeSet pHew New To Java 2 01-16-2008 02:20 AM
Problem with vector, java.lang.ClassCastException paul New To Java 1 07-16-2007 06:31 PM
ClassCastException Ed New To Java 2 07-04-2007 07:26 AM
ClassCastException Felissa New To Java 2 07-04-2007 07:06 AM


All times are GMT +3. The time now is 10:31 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org