Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » java.lang. NoClassDefFoundError
java.lang. NoClassDefFoundError [message #496720] Wed, 11 November 2009 07:36 Go to next message
salamat  is currently offline salamat Friend
Messages: 9
Registered: October 2009
Junior Member
Hallo,

I have the plug-in "Hello world" as own project. in the same workspace I have another project. I try to call in the project "Hello World" the class from the other project and agree error: java.lang. NoClassDefFoundError Sad

has somebody idee?


thx
Re: java.lang. NoClassDefFoundError [message #496755 is a reply to message #496720] Wed, 11 November 2009 10:03 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hey,

at least a stacktrace would be useful. NoClassDefFoundError can be anything.
Regarding what you describe it sounds a little bit like you didn't
manage your dependencies trough OSGi (eg. Require-Bundle /
Import-Package) but rather with raw classpath depedencies. Running your
project on RAP you have use proper OSGi mechanisms.


Regards,
Ben

salamat wrote:
> Hallo,
>
> I have the plug-in "Hello world" as own project. in the same workspace I
> have another project. I try to call in the project "Hello World" the
> class from the other project and agree error: java.lang.
> NoClassDefFoundError :(
> has somebody idee?
>
>
> thx


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: java.lang. NoClassDefFoundError [message #496760 is a reply to message #496755] Wed, 11 November 2009 10:23 Go to previous messageGo to next message
salamat  is currently offline salamat Friend
Messages: 9
Registered: October 2009
Junior Member
Hallo,

Hier is my stacktrace:
at least a stacktrace would be useful. java.lang.NoClassDefFoundError: Test/hallo
at Test_RCP.Application.createUI(Application.java:23)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:231)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:119)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Test.hallo
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:494)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:398)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 5 more

the class Test is in another project than the project of RCP

thank u

Benjamin Muskalla wrote on Wed, 11 November 2009 05:03
Hey,

at least a stacktrace would be useful. NoClassDefFoundError can be anything.
Regarding what you describe it sounds a little bit like you didn't
manage your dependencies trough OSGi (eg. Require-Bundle /
Import-Package) but rather with raw classpath depedencies. Running your
project on RAP you have use proper OSGi mechanisms.


Regards,
Ben

salamat wrote:
> Hallo,
>
> I have the plug-in "Hello world" as own project. in the same workspace I
> have another project. I try to call in the project "Hello World" the
> class from the other project and agree error: java.lang.
> NoClassDefFoundError Sad
> has somebody idee?
>
>
> thx


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource

Re: java.lang. NoClassDefFoundError [message #496765 is a reply to message #496760] Wed, 11 November 2009 10:44 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi,

did you check if you use the proper OSGi way to define your
dependencies? (see first answer)

salamat wrote:
> Hallo,
>
> Hier is my stacktrace:
> at least a stacktrace would be useful. java.lang.NoClassDefFoundError:
> Test/hallo
> at Test_RCP.Application.createUI(Application.java:23)
> at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU
> I(EntryPointManager.java:92)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT
> LifeCycle.java:231)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont
> roller.run(RWTLifeCycle.java:119)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException: Test.hallo
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter
> nal(BundleLoader.java:494)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:410)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:398)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa
> dClass(DefaultClassLoader.java:105)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> ... 5 more
>
> the class Test is in another project than the project of RCP
>
> thank u
> Benjamin Muskalla wrote on Wed, 11 November 2009 05:03
>> Hey,
>>
>> at least a stacktrace would be useful. NoClassDefFoundError can be
>> anything.
>> Regarding what you describe it sounds a little bit like you didn't
>> manage your dependencies trough OSGi (eg. Require-Bundle /
>> Import-Package) but rather with raw classpath depedencies. Running
>> your project on RAP you have use proper OSGi mechanisms.
>>
>>
>> Regards,
>> Ben
>>
>> salamat wrote:
>> > Hallo,
>> > > I have the plug-in "Hello world" as own project. in the same
>> workspace I > have another project. I try to call in the project
>> "Hello World" the > class from the other project and agree error:
>> java.lang. > NoClassDefFoundError :(
>> > has somebody idee?
>> > > > thx
>>
>>
>> --
>> Benjamin Muskalla | EclipseSource Karlsruhe
>> http://www.eclipsesource.com | http://twitter.com/eclipsesource
>
>


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: java.lang. NoClassDefFoundError [message #496799 is a reply to message #496765] Wed, 11 November 2009 12:17 Go to previous messageGo to next message
salamat  is currently offline salamat Friend
Messages: 9
Registered: October 2009
Junior Member
Hi,
yes. everything is OK with the OSGI dependencies. the problem is that the class hallo normally java class (not plug-in)

java.lang.NoClassDefFoundError: Test/hallo
at Test_RCP.Application.createUI(Application.java:23)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU I(EntryPointManager.java:92)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT LifeCycle.java:231)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont roller.run(RWTLifeCycle.java:119)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Test.hallo
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:494)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:398)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 5 more
ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.1.R35x_v20090806
1 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
2 ACTIVE javax.servlet_2.5.0.v200806031605
3 ACTIVE org.mortbay.jetty.util_6.1.15.v200905182336
4 ACTIVE com.ibm.icu.base_4.0.1.v20090415
5 ACTIVE org.eclipse.rap.jface_1.2.1.20090813-1453
6 ACTIVE org.eclipse.core.databinding.property_1.2.0.M20090708-0800a
7 ACTIVE org.eclipse.core.contenttype_3.4.0.v20090429-1800
8 ACTIVE org.eclipse.equinox.http.registry_1.0.200.v20090520-1800
9 ACTIVE org.mortbay.jetty.server_6.1.15.v200905151201
10 ACTIVE org.eclipse.equinox.http.servlet_1.0.200.v20090520-1800
11 ACTIVE org.eclipse.core.databinding.beans_1.2.0.I20090525-2000
12 ACTIVE org.eclipse.rap.rwt_1.2.1.20090813-1453
Fragments=23
13 ACTIVE org.eclipse.equinox.app_1.2.0.v20090520-1800
14 ACTIVE org.eclipse.core.databinding.observable_1.2.0.I20090604-2000
15 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
16 ACTIVE org.eclipse.core.commands_3.5.0.I20090525-2000
17 ACTIVE org.eclipse.rap.ui.views_1.2.1.20090813-1453
18 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
19 ACTIVE org.eclipse.rap.ui.workbench_1.2.1.20090813-1453
20 ACTIVE org.eclipse.core.databinding_1.2.0.I20090604-2000
21 ACTIVE org.eclipse.equinox.preferences_3.2.300.v20090520-1800
22 ACTIVE Test_RCP_1.0.0.qualifier
23 RESOLVED org.eclipse.rap.rwt.q07_1.2.0.20090813-1453
Master=12
24 ACTIVE org.eclipse.rap.jface.databinding_1.2.1.20090813-1453
25 ACTIVE org.eclipse.core.expressions_3.4.100.v20090429-1800
26 ACTIVE org.eclipse.equinox.http.jetty_2.0.0.v20090520-1800
27 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
28 ACTIVE org.eclipse.equinox.common_3.5.0.v20090520-1800
29 ACTIVE org.apache.commons.logging_1.0.4.v200904062259
30 ACTIVE org.eclipse.rap.ui_1.2.1.20090813-1453

Benjamin Muskalla wrote on Wed, 11 November 2009 05:44
Hi,

did you check if you use the proper OSGi way to define your
dependencies? (see first answer)

salamat wrote:
> Hallo,
>
> Hier is my stacktrace:
> at least a stacktrace would be useful. java.lang.NoClassDefFoundError:
> Test/hallo
> at Test_RCP.Application.createUI(Application.java:23)
> at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU
> I(EntryPointManager.java:92)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT
> LifeCycle.java:231)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont
> roller.run(RWTLifeCycle.java:119)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException: Test.hallo
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter
> nal(BundleLoader.java:494)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:410)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:398)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa
> dClass(DefaultClassLoader.java:105)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> ... 5 more
>
> the class Test is in another project than the project of RCP
>
> thank u
> Benjamin Muskalla wrote on Wed, 11 November 2009 05:03
>> Hey,
>>
>> at least a stacktrace would be useful. NoClassDefFoundError can be
>> anything.
>> Regarding what you describe it sounds a little bit like you didn't
>> manage your dependencies trough OSGi (eg. Require-Bundle /
>> Import-Package) but rather with raw classpath depedencies. Running
>> your project on RAP you have use proper OSGi mechanisms.
>>
>>
>> Regards,
>> Ben
>>
>> salamat wrote:
>> > Hallo,
>> > > I have the plug-in "Hello world" as own project. in the same
>> workspace I > have another project. I try to call in the project
>> "Hello World" the > class from the other project and agree error:
>> java.lang. > NoClassDefFoundError Sad
>> > has somebody idee?
>> > > > thx
>>
>>
>> --
>> Benjamin Muskalla | EclipseSource Karlsruhe
>> http://www.eclipsesource.com | http://twitter.com/eclipsesource
>
>


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource

Re: java.lang. NoClassDefFoundError [message #496820 is a reply to message #496799] Wed, 11 November 2009 13:50 Go to previous message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi,

you cannot access classes that are not part of any bundle due to the
classloader architecture of OSGi. Please convert your project to a
bundle and add is as dependency to your plugin.

Regards,
Ben

salamat wrote:
> Hi,
> yes. everything is OK with the OSGI dependencies. the problem is that
> the class hallo normally java class (not plug-in)
>
> java.lang.NoClassDefFoundError: Test/hallo
> at Test_RCP.Application.createUI(Application.java:23)
> at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU
> I(EntryPointManager.java:92)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT
> LifeCycle.java:231)
> at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont
> roller.run(RWTLifeCycle.java:119)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException: Test.hallo
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter
> nal(BundleLoader.java:494)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:410)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:398)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa
> dClass(DefaultClassLoader.java:105)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> ... 5 more
> ss
>
> Framework is launched.
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.5.1.R35x_v20090806
> 1 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
> 2 ACTIVE javax.servlet_2.5.0.v200806031605
> 3 ACTIVE org.mortbay.jetty.util_6.1.15.v200905182336
> 4 ACTIVE com.ibm.icu.base_4.0.1.v20090415
> 5 ACTIVE org.eclipse.rap.jface_1.2.1.20090813-1453
> 6 ACTIVE
> org.eclipse.core.databinding.property_1.2.0.M20090708-0800a
> 7 ACTIVE org.eclipse.core.contenttype_3.4.0.v20090429-1800
> 8 ACTIVE org.eclipse.equinox.http.registry_1.0.200.v20090520-1800
> 9 ACTIVE org.mortbay.jetty.server_6.1.15.v200905151201
> 10 ACTIVE org.eclipse.equinox.http.servlet_1.0.200.v20090520-1800
> 11 ACTIVE org.eclipse.core.databinding.beans_1.2.0.I20090525-2000
> 12 ACTIVE org.eclipse.rap.rwt_1.2.1.20090813-1453
> Fragments=23
> 13 ACTIVE org.eclipse.equinox.app_1.2.0.v20090520-1800
> 14 ACTIVE
> org.eclipse.core.databinding.observable_1.2.0.I20090604-2000
> 15 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
> 16 ACTIVE org.eclipse.core.commands_3.5.0.I20090525-2000
> 17 ACTIVE org.eclipse.rap.ui.views_1.2.1.20090813-1453
> 18 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
> 19 ACTIVE org.eclipse.rap.ui.workbench_1.2.1.20090813-1453
> 20 ACTIVE org.eclipse.core.databinding_1.2.0.I20090604-2000
> 21 ACTIVE org.eclipse.equinox.preferences_3.2.300.v20090520-1800
> 22 ACTIVE Test_RCP_1.0.0.qualifier
> 23 RESOLVED org.eclipse.rap.rwt.q07_1.2.0.20090813-1453
> Master=12
> 24 ACTIVE org.eclipse.rap.jface.databinding_1.2.1.20090813-1453
> 25 ACTIVE org.eclipse.core.expressions_3.4.100.v20090429-1800
> 26 ACTIVE org.eclipse.equinox.http.jetty_2.0.0.v20090520-1800
> 27 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
> 28 ACTIVE org.eclipse.equinox.common_3.5.0.v20090520-1800
> 29 ACTIVE org.apache.commons.logging_1.0.4.v200904062259
> 30 ACTIVE org.eclipse.rap.ui_1.2.1.20090813-1453
>
> Benjamin Muskalla wrote on Wed, 11 November 2009 05:44
>> Hi,
>>
>> did you check if you use the proper OSGi way to define your
>> dependencies? (see first answer)
>>
>> salamat wrote:
>> > Hallo,
>> > > Hier is my stacktrace:
>> > at least a stacktrace would be useful.
>> java.lang.NoClassDefFoundError: > Test/hallo
>> > at Test_RCP.Application.createUI(Application.java:23)
>> > at
>> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createU >
>> I(EntryPointManager.java:92)
>> > at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWT >
>> LifeCycle.java:231)
>> > at
>> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadCont >
>> roller.run(RWTLifeCycle.java:119)
>> > at java.lang.Thread.run(Unknown Source)
>> > Caused by: java.lang.ClassNotFoundException: Test.hallo
>> > at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInter >
>> nal(BundleLoader.java:494)
>> > at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund >
>> leLoader.java:410)
>> > at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund >
>> leLoader.java:398)
>> > at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa >
>> dClass(DefaultClassLoader.java:105)
>> > at java.lang.ClassLoader.loadClass(Unknown Source)
>> > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> > ... 5 more
>> > > the class Test is in another project than the project of RCP
>> > > thank u
>> > Benjamin Muskalla wrote on Wed, 11 November 2009 05:03
>> >> Hey,
>> >>
>> >> at least a stacktrace would be useful. NoClassDefFoundError can be
>> >> anything.
>> >> Regarding what you describe it sounds a little bit like you didn't
>> >> manage your dependencies trough OSGi (eg. Require-Bundle / >>
>> Import-Package) but rather with raw classpath depedencies. Running >>
>> your project on RAP you have use proper OSGi mechanisms.
>> >>
>> >>
>> >> Regards,
>> >> Ben
>> >>
>> >> salamat wrote:
>> >> > Hallo,
>> >> > > I have the plug-in "Hello world" as own project. in the same >>
>> workspace I > have another project. I try to call in the project >>
>> "Hello World" the > class from the other project and agree error: >>
>> java.lang. > NoClassDefFoundError :(
>> >> > has somebody idee?
>> >> > > > thx
>> >>
>> >>
>> >> -- >> Benjamin Muskalla | EclipseSource Karlsruhe
>> >> http://www.eclipsesource.com | http://twitter.com/eclipsesource
>> > >
>>
>> --
>> Benjamin Muskalla | EclipseSource Karlsruhe
>> http://www.eclipsesource.com | http://twitter.com/eclipsesource
>
>


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Previous Topic:Actions & ActionBarAdvisor
Next Topic:Changing the font and setting image as background
Goto Forum:
  


Current Time: Thu Apr 25 16:47:27 GMT 2024

Powered by FUDForum. Page generated in 0.03728 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top