NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

[platform-dev] Re: Module Installer NoClassDefFoundError referencing class in OSGi bundle

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Milos Kleint
Posted via mailing list.





PostPosted: Mon Jul 23, 2012 7:03 pm    Post subject: [platform-dev] Re: Module Installer NoClassDefFoundError referencing class in OSGi bundle Reply with quote

doesn't work for me either, no idea from top of my head how to fix it.
One suspicious point that occured to me is that the dependency in the
netbeans module is > 1.0.0 when referencing the osgi bundle, but then
the osgi's bundle version is 1.0.0-SNAPSHOT. I'm not sure if
co-developed modules and bundles were the well-tested usecase.
Alternatively the problem can be that ModuleInstall's method is called
before the osgi bundle is initialiated.

Milos

On Mon, Jul 23, 2012 at 6:28 PM, spdann <address-removed> wrote:
Quote:
Hi,

I have an OSGi Bundle that contains an interface and an associated
implementation and I have another Netbeans NBM Module that has been
configured with a module installer in the manifest file. I'm trying to call
a method on the interface in the OSGi module from within my overridden
ModuleInstall.restored() method but I'm getting the following
java.lang.NoClassDefFoundError when I launch my application:

org.netbeans.InvalidException:
StandardModule:com.mycompany.osgi.maven.project.sample jarFile:
C:\OSGiTest\osgi-maven-project\application\target\osgi_maven_project\idap\modules\com-mycompany-osgi-maven-project-sample.jar:
java.lang.NoClassDefFoundError: com/mycompany/osgibundle2/Interface2

I have set the <useOSGiDependencies> flag to TRUE in the nbm-maven-plugin
configuration and have added the OSGi bundle as a dependency in the POM, but
it is still failing to find the class at runtime. Can anyone help me
understand why this is the case and what I need to do to fix it?

I have attached a test system that can be used to reproduce the problem.
Running the "osgi-maven-project-app" module will display a dialog containing
the error.

I am using Netbeans 7.1 and maven 3.0.4.

http://netbeans-org.1045718.n5.nabble.com/file/n5712099/OSGiTest.zip
OSGiTest.zip

Thanks,
Steve



--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Module-Installer-NoClassDefFoundError-referencing-class-in-OSGi-bundle-tp5712099.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Mon Jul 23, 2012 7:06 pm    Post subject: [platform-dev] Re: Module Installer NoClassDefFoundError referencing class in OSGi bundle Reply with quote

please file an issue and attach the sample projects as attachment

Milos

On Mon, Jul 23, 2012 at 9:03 PM, Milos Kleint <address-removed> wrote:
Quote:
doesn't work for me either, no idea from top of my head how to fix it.
One suspicious point that occured to me is that the dependency in the
netbeans module is > 1.0.0 when referencing the osgi bundle, but then
the osgi's bundle version is 1.0.0-SNAPSHOT. I'm not sure if
co-developed modules and bundles were the well-tested usecase.
Alternatively the problem can be that ModuleInstall's method is called
before the osgi bundle is initialiated.

Milos

On Mon, Jul 23, 2012 at 6:28 PM, spdann <address-removed> wrote:
Quote:
Hi,

I have an OSGi Bundle that contains an interface and an associated
implementation and I have another Netbeans NBM Module that has been
configured with a module installer in the manifest file. I'm trying to call
a method on the interface in the OSGi module from within my overridden
ModuleInstall.restored() method but I'm getting the following
java.lang.NoClassDefFoundError when I launch my application:

org.netbeans.InvalidException:
StandardModule:com.mycompany.osgi.maven.project.sample jarFile:
C:\OSGiTest\osgi-maven-project\application\target\osgi_maven_project\idap\modules\com-mycompany-osgi-maven-project-sample.jar:
java.lang.NoClassDefFoundError: com/mycompany/osgibundle2/Interface2

I have set the <useOSGiDependencies> flag to TRUE in the nbm-maven-plugin
configuration and have added the OSGi bundle as a dependency in the POM, but
it is still failing to find the class at runtime. Can anyone help me
understand why this is the case and what I need to do to fix it?

I have attached a test system that can be used to reproduce the problem.
Running the "osgi-maven-project-app" module will display a dialog containing
the error.

I am using Netbeans 7.1 and maven 3.0.4.

http://netbeans-org.1045718.n5.nabble.com/file/n5712099/OSGiTest.zip
OSGiTest.zip

Thanks,
Steve



--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Module-Installer-NoClassDefFoundError-referencing-class-in-OSGi-bundle-tp5712099.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
spdann
Posted via mailing list.





PostPosted: Tue Jul 24, 2012 9:41 am    Post subject: [platform-dev] Re: Module Installer NoClassDefFoundError referencing class in OSGi bundle Reply with quote

Thanks for your reply Milos. I've created the following issue:

http://netbeans.org/bugzilla/show_bug.cgi?id=215859

Steve



--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Module-Installer-NoClassDefFoundError-referencing-class-in-OSGi-bundle-tp5712099p5712142.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Jaroslav Tulach
Posted via mailing list.





PostPosted: Tue Aug 07, 2012 8:16 am    Post subject: [platform-dev] Re: Module Installer NoClassDefFoundError referencing class in OSGi bundle Reply with quote

Maybe this worked in NetBeans 6.9, but in recent releases we changed the order of initialization. First of all we initialize the NetBeans infrastructure (including ModuleInstalls) and then we launch the OSGi container with its BundleActivators.

I do not plan to change the order. The safest way is to do your initialization code in BundleActivator (e.g. use OSGi bundle instead of NetBeans module) or delay the use of OSGi classes a bit.

NetBeans 7.2 has @OnStart and @OnShowing annotations. However I am afraid that @OnStart is also going to be executed too early. @OnShowing is going to be fine.

-jt

Dne Po 23. července 2012 09:28:56, spdann napsal(a):
Quote:
Hi,

I have an OSGi Bundle that contains an interface and an associated
implementation and I have another Netbeans NBM Module that has been
configured with a module installer in the manifest file. I'm trying to call
a method on the interface in the OSGi module from within my overridden
ModuleInstall.restored() method but I'm getting the following
java.lang.NoClassDefFoundError when I launch my application:

org.netbeans.InvalidException:
StandardModule:com.mycompany.osgi.maven.project.sample jarFile:
C:\OSGiTest\osgi-maven-project\application\target\osgi_maven_project\idap\mo
dules\com-mycompany-osgi-maven-project-sample.jar:
java.lang.NoClassDefFoundError: com/mycompany/osgibundle2/Interface2

I have set the <useOSGiDependencies> flag to TRUE in the nbm-maven-plugin
configuration and have added the OSGi bundle as a dependency in the POM, but
it is still failing to find the class at runtime. Can anyone help me
understand why this is the case and what I need to do to fix it?

I have attached a test system that can be used to reproduce the problem.
Running the "osgi-maven-project-app" module will display a dialog containing
the error.

I am using Netbeans 7.1 and maven 3.0.4.

http://netbeans-org.1045718.n5.nabble.com/file/n5712099/OSGiTest.zip
OSGiTest.zip

Thanks,
Steve



--
View this message in context:
http://netbeans-org.1045718.n5.nabble.com/Module-Installer-NoClassDefFoundE
rror-referencing-class-in-OSGi-bundle-tp5712099.html Sent from the Netbeans
RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo