db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josef Wagner" <josef.wag...@on-ergy.de>
Subject AW: Problems running ddlutils in our eclipse RCP application
Date Fri, 19 May 2006 10:56:33 GMT
I have tested changing ClassLoader already. No Success.

This are the ClassLoaders before swapping:

Current Thread ClassLoader: 
org.eclipse.core.runtime.internal.adaptor.ContextFinder

getClass().getClassLoader():
org.eclipse.core.runtime.adaptor.EclipseClassLoader

I swap width: 
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

At the end, I get the following Exception:
java.lang.ClassNotFoundException: org.apache.ddlutils.model.Database
at org.apache.commons.betwixt.digester.ClassRule.begin(ClassRule.java:63)
...
..
.

nevertheless thank you


-----Urspr√ľngliche Nachricht-----
Von: Thomas Dudziak [mailto:tomdzk@gmail.com] 
Gesendet: Freitag, 19. Mai 2006 10:49
An: ddlutils-user@db.apache.org
Betreff: Re: Problems running ddlutils in our eclipse RCP application

On 5/19/06, Josef Wagner <josef.wagner@on-ergy.de> wrote:

> when I'm using ddlutils in my Eclipse RCP, I get NoClassDefFoundError and
> ClassNotFoundException.
> When running ddlutils in a standard java class with main-method, all works
> fine.
> I think the problem is the ClassLoader. I have had the same problem with
> ojb.
> There, I have fixt this problem with setting
> ojb.borker.util.ClassHelper.setClassLoader(getClass().getClassLoader())
> on startup.

I havn't used RCP yet, but this seems to be a known issue with Eclipse
RCP. Basically, you'll need to swap the plugin classloader and the lib
classloader for loading external resources and classes. Here's is a
HOWTO that might be of use:

http://gregluck.com/blog/archives/Eclipse%20OSGI%20Classloading%20Howto.pdf

Tom


Mime
View raw message