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.
Build: NetBeans IDE Dev (Build 201307312300) VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b12 OS: Mac OS X User Comments: abien: Happened during opening a standalone project Stacktrace: java.lang.AssertionError at org.netbeans.api.java.project.classpath.ProjectClassPathModifier.findExtensible(ProjectClassPathModifier.java:364) at org.netbeans.api.java.project.classpath.ProjectClassPathModifier.addLibraries(ProjectClassPathModifier.java:93) at org.netbeans.modules.glassfish.javaee.Hk2JavaEEPlatformImpl$JaxRsStackSupportImpl.addJsr311Api(Hk2JavaEEPlatformImpl.java:837) at org.netbeans.modules.javaee.specs.support.api.JaxRsStackSupport.addJsr311Api(JaxRsStackSupport.java:124) at org.netbeans.modules.websvc.rest.spi.RestSupport.ensureRestDevelopmentReadyImpl(RestSupport.java:251) at org.netbeans.modules.websvc.rest.spi.RestSupport.access$200(RestSupport.java:93)
Created attachment 138183 [details] stacktrace
In the ProjectClassPathModifier.addLibraries the projectArtifact should not be null. Called from org.netbeans.modules.glassfish.javaee.Hk2JavaEEPlatformImpl$JaxRsStackSupportImpl.addJsr311Api(Hk2JavaEEPlatformImpl.java:837)
Hk2JavaEEPlatformImpl#getSourceRoot(Project project) can return null in some cases. This is part of plugin maintained by Dennis before he left so UI have to get deeper into it first. Here is how it was getting projectArtifact FileObject from Project. private FileObject getSourceRoot(Project project) { SourceGroup[] sourceGroups = ProjectUtils.getSources(project) .getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); if (sourceGroups == null || sourceGroups.length < 1) { return null; } return sourceGroups[0].getRootFolder(); } I don't know if it's correct or not.
I need some reproduction scenario for this. What project did you use? Can you create some minimal project to reproduce this and attach it to this bug?
See that Hk2JavaEEPlatformImpl#extendsJerseyProjectClasspath method has additional test: FileObject sourceRoot = getSourceRoot(project); if (sourceRoot == null) { return false; } to handle null value and avoid assertion error. I'm adding this into Hk2JavaEEPlatformImpl#addJsr311Api to avoid assertion error there too.
Well, return false is not necessary here. I made this code more foolproof. Checked into GF Tooling Library: -------------------------------- changeset: 638:b65bd0bfebda summary: Bug# 233840 - Return full version string Checked into NetBeans web-main: ------------------------------- changeset: 260237:ec6a36c3c7f3 summary: #233840 - Code formating changeset: 260238:78842f5dfc65 summary: #233840 - Fix AssertionError and add GF4 support
Adding Jiri into cc list: Jiri, wou were probably testing changes that Dennis was doing in the GF plugin. Do you remember how can I trigger execution of org.netbeans.modules.javaee.specs.support.api.JaxRsStackSupport.addJsr311Api? Well, I'll close this bug after push because assertion issue is fixed. But addJsr311Api should be rewritten to get rid of hard-coded JARs in next release. That's why I need some use-case to be able to see this method with debugger.
Pushich changes into web-main, AssertionError error should be fixed.
Integrated into 'main-silver', will be available in build *201308042300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ec6a36c3c7f3 User: Tomas Kraus <TomasKraus@netbeans.org> Log: #233840 - Code formating
(In reply to comment #7) > Jiri, wou were probably testing changes that Dennis was doing in the GF plugin. > Do you remember how can I trigger execution of > org.netbeans.modules.javaee.specs.support.api.JaxRsStackSupport.addJsr311Api? I don't know. Try to look at source code where it is used.