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.
Summary: | glassfish.javaee needs dependency on java.j2seplatform | ||
---|---|---|---|
Product: | serverplugins | Reporter: | davisn <davisn> |
Component: | GlassFish | Assignee: | issues@serverplugins <issues> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jtulach, tzezula, vkraemer |
Priority: | P2 | Keywords: | API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | Sun | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
messages.log
Provides/requires between glassfish.javaee and java.j2seplatform |
Description
davisn
2009-01-13 01:47:24 UTC
Created attachment 75732 [details]
messages.log
just to clarify... was this the 7.0 dev build or the nbjavaee6 dev build? It's a nbjavaee6 dev build. I build its myself issue 157287 seems like it is a related problem. so does issue 150486 The v3 module does not depend on the java cluster (since it is in the ide cluster). The j2se library type is in the java cluster... This allows the user to follow this path and end up with the result described here. if we make glassfish.javaee depend on java.j2seplatform the issue clears up... but that doesn't seem like the right fix. JavaEEServerModuleFactory.ensureCometSupport should be prepared for there to be no j2se library type defined. This would happen if the java cluster were not enabled. Perhaps the Java functionality is disabled due to the ergonomics cluster? If so, add ERGONOMICS keyword. Hmmm. on exception... add a property change listener to the library manager to try to create the library later on. the theory is that the j2se type will get defined and some other module will register a j2se library successfully. Once that happens, this library should register successfully. if I build the IDE and then clean the ergonomics jar from the build I cannot reproduce this issue. Following jglick's advice about the keyword. I will keep the issue assigned to me since there is still a problem with the plugin code. Probably the library is registered before the right declaration is parsed. checked in fix for symptom... but it doesn't address the fact that the j2se library type should be available at the point where the code to create the libraries is called. http://hg.netbeans.org/main/rev/4ce9ca68e094 Tomáši, we have a problem. The IAE from org.netbeans.api.project.libraries.LibraryManager.createLibrary(LibraryManager.java:274) is correct. The j2se library type is unknown. Of course, because j2se library type is defined in Java and Java is still disabled. Shall the IAE be changed to warning only? I can do that, if you tell me. Shall the code in glassfish.javaee.JavaEEServerModuleFactory be modified? Thanks in advance for your valuable insight. One thing that I noticed while working on this... There are a number of modules activated when the GF v3 module is activated... but java.j2seplatform is not one of them. When I looked at some of the project info in java.j2seplatform, I noticed that it is only expose apis to the two import projects... So, it kind of makes sense that the module isn't activated... If you can modify the module "glassfish.javaee" to have dependency on "java.j2seplatform", then I guess this problem will also be fixed. java.j2seplatform only exports to friends... so we would need to change both projects. I have already changed the serverplugin to avoid triggering the IAE... but that 'fix' is really kind of a hack. Integrated into 'main-golden', will be available in build *200901281643* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/4ce9ca68e094 User: Vince Kraemer <vkraemer@netbeans.org> Log: #156658 : don't throw exception if j2se library type isn't registered yet... try later "java.j2seplatform only exports to friends... so we would need to change both projects" - no, you need a runtime dep, not a compile-time dep. Friend packages apply only to compile-time deps. Any module can declare a runtime-only dep on any other module if it wants. Somewhat better style would be for java.j2seplatform to declare that it provides a token, say 'org.netbeans.spi.project.libraries.LibraryTypeProvider.j2se', and for glassfish.javaee (and any other module which needs to create j2se-type libraries) to require this token. Created attachment 76348 [details]
Provides/requires between glassfish.javaee and java.j2seplatform
Works. BTW I picked the name 'org.netbeans.spi.project.libraries.LibraryTypeProvider.j2se' because the prefix is the actual FQN of the service which is provided. Such a convention would help make token names less arbitrary. I agree with Jesse's name choice for the token. I agree as well (I prepared my patch before seeing Jesse's comment). Can you please integrate this patch, then? Thanks. /s/this/such/ I do not own java.j2seplatform, so that module's owner should export the token before I start to use it, right? Obviously, there needs to be changes to the architecture documents in both modules, too. The owner of java.j2seplatform would need to publish changes to the apichanges doc, too. Should be made as one Hg changeset. If you do not feel comfortable patching java.j2seplatform, assign to jjancura, jtulach, jglick, or just prepare a final patch including recommended token and arch.xml and ask for final review of impl. The DEFECT part of this is resolved... so I am going to convert this to an ENHANCEMENT. Are you sure there is no remaining defect? The exception is not thrown anymore, but the glassfish library is not going to be available in Library Manager, imho. closing |