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

florencia liggerini florencialiggerini at hotmail.com
Mon Mar 9 13:23:52 PDT 2009




Hi!  I Already solved it. The problem
was that I was configuring the Database with the 
ClassLoader.getSystemClassLoader() before open it, now I use
this.getClass().getClassLoader() and works perfect!

Thanks a lot!


> From: protege at ontospace.net
> To: protege-discussion at mailman.stanford.edu
> Date: Mon, 9 Mar 2009 19:58:48 +0000
> Subject: Re: [protege-discussion] Java.lang.ClassCastException
> 
> 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
> >thanks!
> >
> >> Date: Sat, 7 Mar 2009 14:02:13 -0800
> >> From: csongor.nyulas at stanford.edu
> >> To: protege-discussion at lists.stanford.edu
> >> 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 <http://clk.atdmt.com/MRT/go/119462413/direct/01/>
> >> > ------------------------------------------------------------------------
> >> >
> >> > _______________________________________________
> >> > protege-discussion mailing list
> >> > protege-discussion at lists.stanford.edu
> >> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >> >
> >> > Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
> >> >   
> >> 
> >> _______________________________________________
> >> protege-discussion mailing list
> >> protege-discussion at lists.stanford.edu
> >> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >> 
> >> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
> >
> >_________________________________________________________________
> >Color coding for safety: Windows Live Hotmail alerts you to suspicious email.
> >http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_safety_112008
> 
> 
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> 
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 

_________________________________________________________________
See how Windows® connects the people, information, and fun that are part of your life
http://clk.atdmt.com/MRT/go/119463819/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20090309/25d787b5/attachment.html>


More information about the protege-discussion mailing list