Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Java.lang.ClassCastException

Len Yabloko protege at
Mon Mar 9 12:58:48 PDT 2009

Hi Florencia, 

It sounds to me like you are dynamically loading some classes at runtime using something like Class.forName() construct. When called from jar it uses the same urlClassLoader for protege.jar and your plugin jars. However, when called by protege a separate class loader is used for plug-in which has no access to classes loaded by Class.forName(). Only generic (staticly loaded) class is recognized, but not its dynamic sub-class. I had similar situation with custom JDBC drivers - they had to be located in root directory of protege to be loaded. Hope this helps. 

> Hi,
>I don`t think the problem is a conflict of classes because I tried putting all my project together in one jar : protege.jar, unicode_pane.jar, looks-2.1.3.jar, the jar of the DataBase (db4o) and the classes of the Create Project plugin and when I execute this jar it runs ok. But when I make a jar only with the classes of the plugin and the database, and put into the folder of protege plugins is when the plugin fails. I think maybe can be a problem of the classLoader?? Because I configure the Database with the  system ClassLoader before open it.
>I´m using the Protege_3.3.1
>I´m sorry if my english is not good
>> Date: Sat, 7 Mar 2009 14:02:13 -0800
>> From: csongor.nyulas at
>> To: protege-discussion at
>> Subject: Re: [protege-discussion] Java.lang.ClassCastException
>> Hi Florencia,
>> Did you put the necessary jar files in your plugin folder? If yes (and 
>> this is recommended), then you have to remove those and any other jar 
>> files containing conflicting classes from your system CLASSPATH, because 
>> Protege will add all the jar files residing in all the Protege plugin 
>> directories to its CLASSPATH.
>> Also it would help if you could tell us which Protege are you using, 
>> respectively if you use the same Protege version in eclipse as the one 
>> you are trying to test on.
>> I hope this helps,
>> Csongor
>> florencia liggerini wrote:
>> > Hi,
>> >
>> > I´m developing a createProject plugin in eclipse using a Object Oriented
>> > DataBase(db4o 6.4).When I run the application from eclipse it works 
>> > well. But
>> > when I create the jar and put into the plugins folder it throws the 
>> > following error:
>> >
>> > Java.lang.ClassCastException: com.db4o.reflect.generic.genericObject 
>> > cannot be
>> > cast to com.db4o.ext.Db4oDatabase.
>> >
>> > I can´t find out which is the problem.
>> >
>> > Thanks a lot!
>> >
>> > ------------------------------------------------------------------------
>> > Stay up to date on your PC, the Web, and your mobile phone with 
>> > Windows Live <>
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > protege-discussion mailing list
>> > protege-discussion at
>> >
>> >
>> > Instructions for unsubscribing: 
>> >   
>> _______________________________________________
>> protege-discussion mailing list
>> protege-discussion at
>> Instructions for unsubscribing: 
>Color coding for safety: Windows Live Hotmail alerts you to suspicious email.

More information about the protege-discussion mailing list