NetBeans Forums

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

Maven NBM plugin CCE best practice

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





PostPosted: Wed Mar 10, 2010 8:32 am    Post subject: Maven NBM plugin CCE best practice Reply with quote

Hi all,


I'm an employee of a small company that develops applications on the NB RCP, amongst others. Right now I'm moving one of our RCP applications to maven and experience the well-known CCE exception at runtime. I'm aware of the problem because I read the notice on the NBM plugin site as well as the link NB prints on the console about arbitrary class loading. What I did not get is how do I address that issue. I'll explain my situation.


I've got:


A - a normal netbeans independent jar-packaged maven project
B - a netbeans module (nbm-packaged) maven project, that depends on A
C - a netbeans module (nbm-packaged) maven project, that depends on B and also (transitively) depends on A


So C uses classes of both A and B. NBM plugin tells me that I'll have to explicitly depend on A if I want to use its classes at runtime. Understood. But now I'm running into CCE at runtime since classes of A are loaded by B and C. That's clear to me, too. But I do not understand how to declare my dependencies and not run into CCE. Anyone with suggestions/best practices?


Thanks in advance.


Cheers,


Martin



-----------------------------------------------------
cismet GmbH
Martin Scholl, Dipl.Inf. (FH)
IT Park Saar - Geb
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Wed Mar 10, 2010 8:45 am    Post subject: Maven NBM plugin CCE best practice Reply with quote

On Wed, Mar 10, 2010 at 9:31 AM, Martin Scholl <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi all,


I'm an employee of a small company that develops applications on the NB RCP, amongst others. Right now I'm moving one of our RCP applications to maven and experience the well-known CCE exception at runtime. I'm aware of the problem because I read the notice on the NBM plugin site as well as the link NB prints on the console about arbitrary class loading. What I did not get is how do I address that issue. I'll explain my situation.


I've got:


A - a normal netbeans independent jar-packaged maven project
B - a netbeans module (nbm-packaged) maven project, that depends on A
C - a netbeans module (nbm-packaged) maven project, that depends on B and also (transitively) depends on A


So C uses classes of both A and B. NBM plugin tells me that I'll have to explicitly depend on A if I want to use its classes at runtime. Understood. But now I'm running into CCE at runtime since classes of A are loaded by B and C. That's clear to me, too. But I do not understand how to declare my dependencies and not run into CCE. Anyone with suggestions/best practices?





the other option is to have module B to include the packages from A as public packages (done in the nbm plugin configuration <publicPackages> element. In 6.9 this will be configurable from the UI AFAIK.


C will then only depend on B and will only declare the module dependency in manifest and not the Class-Path: entry for the A jar.


Milos
 
Quote:

Thanks in advance.


Cheers,


Martin



-----------------------------------------------------
cismet GmbH 
Martin Scholl, Dipl.Inf. (FH)
IT Park Saar - Gebäude D2
Altenkesseler Straße 17 - D2
66115 Saarbrücken


email: address-removed ([email]address-removed[/email])
phone/mobile/fax: 0700 cismet de (0700 247638 33)
web: http://www.cismet.de
-----------------------------------------------------




Back to top
Martin Scholl
Posted via mailing list.





PostPosted: Wed Mar 10, 2010 9:34 am    Post subject: Maven NBM plugin CCE best practice Reply with quote

Hm, you're right, I forgot about the public packages. This seems to work for me. However, "B" offers a hell of a lot of packages now since it is a utilities module but I think that's ok.

Thanks for your help!


Cheers,


Martin



-----------------------------------------------------
cismet GmbH
Martin Scholl, Dipl.Inf. (FH)
IT Park Saar - Geb
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Wed Mar 10, 2010 9:37 am    Post subject: Maven NBM plugin CCE best practice Reply with quote

if both B and C need the jar A, either B has to depend on C or vice versa or you create a simple wrapper module (D)  for A, that contains no code on it's own but only wraps around the jar and defines public packages. Then both B and C depend on D only.

Milos

On Wed, Mar 10, 2010 at 10:33 AM, Martin Scholl <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hm, you're right, I forgot about the public packages. This seems to work for me. However, "B" offers a hell of a lot of packages now since it is a utilities module but I think that's ok.

Thanks for your help!


Cheers,


Martin



-----------------------------------------------------
cismet GmbH 
Martin Scholl, Dipl.Inf. (FH)
IT Park Saar - Gebäude D2
Altenkesseler Straße 17 - D2
66115 Saarbrücken


email: address-removed ([email]address-removed[/email])
phone/mobile/fax: 0700 cismet de (0700 247638 33)
web: http://www.cismet.de
-----------------------------------------------------




Am 10.03.2010 um 09:45 schrieb Milos Kleint:


Quote:


On Wed, Mar 10, 2010 at 9:31 AM, Martin Scholl <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi all,


I'm an employee of a small company that develops applications on the NB RCP, amongst others. Right now I'm moving one of our RCP applications to maven and experience the well-known CCE exception at runtime. I'm aware of the problem because I read the notice on the NBM plugin site as well as the link NB prints on the console about arbitrary class loading. What I did not get is how do I address that issue. I'll explain my situation.


I've got:


A - a normal netbeans independent jar-packaged maven project
B - a netbeans module (nbm-packaged) maven project, that depends on A
C - a netbeans module (nbm-packaged) maven project, that depends on B and also (transitively) depends on A


So C uses classes of both A and B. NBM plugin tells me that I'll have to explicitly depend on A if I want to use its classes at runtime. Understood. But now I'm running into CCE at runtime since classes of A are loaded by B and C. That's clear to me, too. But I do not understand how to declare my dependencies and not run into CCE. Anyone with suggestions/best practices?





the other option is to have module B to include the packages from A as public packages (done in the nbm plugin configuration <publicPackages> element. In 6.9 this will be configurable from the UI AFAIK.


C will then only depend on B and will only declare the module dependency in manifest and not the Class-Path: entry for the A jar.


Milos
 
Quote:

Thanks in advance.


Cheers,


Martin



-----------------------------------------------------
cismet GmbH 
Martin Scholl, Dipl.Inf. (FH)
IT Park Saar - Gebäude D2
Altenkesseler Straße 17 - D2
66115 Saarbrücken


email: address-removed ([email]address-removed[/email])
phone/mobile/fax: 0700 cismet de (0700 247638 33)
web: http://www.cismet.de
-----------------------------------------------------












Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans 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