ClassCastException. PathClassLoader and BootClassLoaders.

Put your problem here if it does not fit any of the other categories.

ClassCastException. PathClassLoader and BootClassLoaders.

Postby x-files » Mon May 12, 2008 9:48 pm

I have trowable with objects which was loaded by differents loaders.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. CustomView[] view = new CustomView[3];
  2.  
  3. public init() {
  4.  
  5. View view = findViewById(R.id.custom_view1);
  6.  
  7. view[0] = (CustomView)view; //throws ClassCastException
  8.  
  9. }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


1) view.getClass().getName().equals(CustomView.class.getName()) - it's true
2) view instanceof CustomView - it's false
3) CustomView.class.getClassLoader().getClass().getName() return BootClassLoader
4) view.getClass().getClassLoader().getClass().getName() return PathClassLoader

How i can cast this objects?
Do you have some ideas?
x-files
Developer
Developer
 
Posts: 44
Joined: Fri Jan 11, 2008 10:27 am

Top

Postby Asgard » Tue May 13, 2008 10:21 am

Hi guys, we realy need to find solution :( Does anybody saw some solutions or similar problems at the intenet? :!:
Catch the moment
Asgard
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Dec 15, 2007 8:49 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests