This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 106156 - Linkage errors in org.netbeans.modules.sun.manager.jbi.nodes.*
Summary: Linkage errors in org.netbeans.modules.sun.manager.jbi.nodes.*
Status: RESOLVED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: JBI Manager (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jun Qian
URL:
Keywords: ARCH
Depends on:
Blocks:
 
Reported: 2007-06-08 19:24 UTC by Jesse Glick
Modified: 2007-08-04 00:33 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Linkage errors (74.15 KB, text/plain)
2007-06-08 19:25 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-06-08 19:24:58 UTC
When running IDE with -J-Dnetbeans.preresolve.classes=true, I receive various
linkage errors (attached).
Comment 1 Jesse Glick 2007-06-08 19:25:56 UTC
Created attachment 43454 [details]
Linkage errors
Comment 2 _ ludo 2007-06-08 20:14:06 UTC
Not really a bug imo.

We have done an extension for the nbm class loading mechanism in the Sun AS
plugin in order to access classes defined in the App server Installation area.
This is a side effect of that.
No runtime impact at all.
If you still see this as an issue, then it would be a duplicate of one in NB NBM
system where you cannot access classes outside the nb known directories.
Comment 3 Jesse Glick 2007-06-08 20:22:08 UTC
It breaks nbbuild/build.xml#sanity-start.

If you want to have classes which need to link against external libraries, they
should not be in the module JAR proper. Place them in a separate JAR, e.g.
somewhere in modules/ext/*.jar (_not_ referred to via Class-Path from the module).
Comment 4 _ ludo 2007-06-08 20:30:57 UTC
In any case, I will not fix this.
I cannot put classes somewhere in NB cvs for legal reasons, and just for the
purpose a netbeans preresolve test.
I am also tired of the limitations/restrictions of NB modules and class loader
hells with respect to alien jars.

Maybe you should change the breakage of the test to a warning.
Comment 5 _ ludo 2007-06-08 20:31:07 UTC
In any case, I will not fix this.
I cannot put classes somewhere in NB cvs for legal reasons, and just for the
purpose a netbeans preresolve test.
I am also tired of the limitations/restrictions of NB modules and class loader
hells with respect to alien jars.

Maybe you should change the breakage of the test to a warning.
Comment 6 Jesse Glick 2007-06-08 20:35:02 UTC
I'm not sure what legal conditions you are referring to; this has nothing to do
with CVS source organization. All that is needed is to change the build script
to create two JARs rather than one. Should be rather simple. If you want me to
do it or help just let me know.

The sanity-start is not a test that can be broken; linkage errors just cause
stack traces. But persistent errors will obscure real problems which are created
in the future.
Comment 7 _ ludo 2007-06-08 20:47:19 UTC
Help.
Not sure which project to change, but
org.netbeans.modules.sun.manager.jbi.nodes.AppserverJBIMgmtLeafNode
needs to access the classes created by this project:
serverplugins/sun/appsrvbridge
which is not a NBM bug a jar that can access App Server jars.
We load this har via a special class loader that knows both NB classes and App
Server classes.

Comment 8 _ ludo 2007-06-08 20:47:36 UTC
Help.
Not sure which project to change, but
org.netbeans.modules.sun.manager.jbi.nodes.AppserverJBIMgmtLeafNode
needs to access the classes created by this project:
serverplugins/sun/appsrvbridge
which is not a NBM bug a jar that can access App Server jars.
We load this har via a special class loader that knows both NB classes and App
Server classes.

Comment 9 Jesse Glick 2007-06-08 21:52:39 UTC
Looks like the root of the evil is in
enterprise/compapp/jbimanager/nbproject/project.properties:

cp.extra=../../../nbbuild/netbeans/enterprise4/modules/ext/appsrvbridge.jar

Very likely this should be removed, the affected classes should be moved to a
separate source tree (which also helps prevent accidental "leakage" between the
bridge and the module code), and build.xml should build them into a new
location. Then of course whatever runtime code constructs the special
ClassLoader just needs to add an extra URL for the new JAR.
Comment 10 Jun Qian 2007-07-29 09:39:24 UTC
Linkage error is now fixed.

The dependency from JBI Manager to appsrvbridge had already been reduced to the NodeExtension class before this check-in. 

Since there are still other modules (e.x., Identity) depending on the appsrvbridge's NodeExtension SPI, a new interface
SimpleNodeExtenstionProvider (with no dependency on appsrvbridge) is introduced to allow the JBI Manager node to be
plugged into the appserver node without depending on the appsrvbridge. 

The new SimpleNodeExtensionProvider interface is temporarily added into serverplugins/sun/appsrv's API set. Since the
JBI runtime is now capable of running on Java SE (outside of GlassFish), it will be moved out of serverplugins in the
next step.


IDE:-------------------------------------------------
IDE: [7/28/07 11:24 PM] Committing Files started
cvs server: scheduling file `SimpleNodeExtensionProvider.java' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in nbproject/project.xml;
/cvs/serverplugins/sun/appsrv/nbproject/project.xml,v  <--  project.xml
new revision: 1.19; previous revision: 1.18
done
RCS file: /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/api/SimpleNodeExtensionProvider.java,v
done
Checking in src/org/netbeans/modules/j2ee/sun/api/SimpleNodeExtensionProvider.java;
/cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/api/SimpleNodeExtensionProvider.java,v  <-- 
SimpleNodeExtensionProvider.java
initial revision: 1.1
done
IDE: [7/28/07 11:24 PM] Committing Files finished


IDE:-------------------------------------------------
IDE: [7/28/07 11:24 PM] Committing "ContainerChildFactory.java" started
Checking in ContainerChildFactory.java;
/cvs/serverplugins/sun/appsrvbridge/src/org/netbeans/modules/j2ee/sun/util/ContainerChildFactory.java,v  <-- 
ContainerChildFactory.java
new revision: 1.8; previous revision: 1.7
done
IDE: [7/28/07 11:24 PM] Committing "ContainerChildFactory.java" finished


IDE:-------------------------------------------------
IDE: [7/28/07 11:25 PM] Committing Files started
cvs server: scheduling file `org/netbeans/modules/sun/manager/jbi/nodes/JBINodeExtensionProvider.java' for addition
cvs server: scheduling file `META-INF/services/org.netbeans.modules.j2ee.sun.api.SimpleNodeExtensionProvider' for addition
cvs server: use 'cvs commit' to add these files permanently
Checking in nbproject/project.xml;
/cvs/enterprise/compapp/jbimanager/nbproject/project.xml,v  <--  project.xml
new revision: 1.10; previous revision: 1.9
done
Checking in nbproject/project.properties;
/cvs/enterprise/compapp/jbimanager/nbproject/project.properties,v  <--  project.properties
new revision: 1.11; previous revision: 1.10
done
RCS file:
/cvs/enterprise/compapp/jbimanager/src/META-INF/services/org.netbeans.modules.j2ee.sun.api.SimpleNodeExtensionProvider,v
done
Checking in src/META-INF/services/org.netbeans.modules.j2ee.sun.api.SimpleNodeExtensionProvider;
/cvs/enterprise/compapp/jbimanager/src/META-INF/services/org.netbeans.modules.j2ee.sun.api.SimpleNodeExtensionProvider,v
 <--  org.netbeans.modules.j2ee.sun.api.SimpleNodeExtensionProvider
initial revision: 1.1
done
Removing src/META-INF/services/org.netbeans.modules.j2ee.sun.bridge.apis.NodeExtension;
/cvs/enterprise/compapp/jbimanager/src/META-INF/services/org.netbeans.modules.j2ee.sun.bridge.apis.NodeExtension,v  <--
 org.netbeans.modules.j2ee.sun.bridge.apis.NodeExtension
new revision: delete; previous revision: 1.6
done
RCS file: /cvs/enterprise/compapp/jbimanager/src/org/netbeans/modules/sun/manager/jbi/nodes/JBINodeExtensionProvider.java,v
done
Checking in src/org/netbeans/modules/sun/manager/jbi/nodes/JBINodeExtensionProvider.java;
/cvs/enterprise/compapp/jbimanager/src/org/netbeans/modules/sun/manager/jbi/nodes/JBINodeExtensionProvider.java,v  <-- 
JBINodeExtensionProvider.java
initial revision: 1.1
done
Removing src/org/netbeans/modules/sun/manager/jbi/nodes/NodeExtensionImpl.java;
/cvs/enterprise/compapp/jbimanager/src/org/netbeans/modules/sun/manager/jbi/nodes/NodeExtensionImpl.java,v  <-- 
NodeExtensionImpl.java
new revision: delete; previous revision: 1.4
done
IDE: [7/28/07 11:25 PM] Committing Files finished
Comment 11 Jun Qian 2007-07-29 09:57:50 UTC
Jesse, I'd like to create a new module in NetBeans source tree that contains only one Java interface (see below). Both
serverplugins and enterprise will need to depend on this module. Is there some guideline to create such a module? If it
is too much hassle to create a new module for only one class, can we stick the new interface into some existing module,
say, Nodes API, or UI Utilities?


public interface SimpleNodeExtensionProvider {    
    public org.openide.nodes.Node getExtensionNode(javax.management.MBeanServerConnection connection);
}
Comment 12 Jesse Glick 2007-07-30 18:32:01 UTC
There are no special guidelines for creating such a new module, except that in general (if it will be used across more
than one cluster) you should go through apireviews as usual, as you are introducing a new inter-cluster API.

Certainly it does not belong in the Nodes API.
Comment 13 Jun Qian 2007-08-04 00:33:42 UTC
Linkage error is fixed.