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 224108

Summary: Error generating WSDL
Product: serverplugins Reporter: blake1024
Component: GlassFishAssignee: Jaroslav Tulach <jtulach>
Status: VERIFIED FIXED    
Severity: normal CC: digitalbugsy, jskrivanek, jtulach, jungi, kganfield, markiewb, mmirilovic, phejl, pjiricka, sj-nb, TomasKraus
Priority: P1 Keywords: REGRESSION
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Patched boot.jar

Description blake1024 2012-12-20 21:58:42 UTC
I am using NetBeans 7.3 Beta 2

I am attempting to build an application I build every day on NetBeans 7.1.

I get the following error when it tries to build the WSDLs:


Generating wsdl for AqDevImportOps
/Users/blake/NetBeansProjects-7.3/Backend/build.xml:165: The following error occurred while executing this line:
/Users/blake/NetBeansProjects-7.3/Backend/wsdlgenant.xml:14: 
java.lang.SecurityException: Dangerous reflection access to sun.misc.ClassLoaderUtil by class com.sun.istack.tools.ProtectedTask detected!
	at org.netbeans.TopSecurityManager.checkMemberAccess(TopSecurityManager.java:428)
	at java.lang.Class.checkMemberAccess(Class.java:2157)
	at java.lang.Class.getDeclaredMethod(Class.java:1934)
	at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:138)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:392)
	at org.apache.tools.ant.Target.performTasks(Target.java:413)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:392)
	at org.apache.tools.ant.Target.performTasks(Target.java:413)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:283)
	at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:541)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 58 seconds)
Comment 1 blake1024 2012-12-20 22:01:35 UTC
I am using the tomcat that comes with NetBeans
Comment 2 Denis Anisimov 2012-12-21 06:50:17 UTC
Regression is introduced by the 
http://hg.netbeans.org/web-main/rev/599d8df6ad83 commit as a fix 
for issue #220316.
Comment 3 Petr Jiricka 2012-12-21 11:08:33 UTC
Should this be assigned to GlassFish, when the user says he uses Tomcat? Cc'ing Petr Hejl and Tomas Kraus, assigning to Jarda to comment - thanks.
Comment 4 blake1024 2012-12-21 14:32:10 UTC
I get this error building, not running.  I don't know if tomcat/glassfish matters at all.
Comment 5 TomasKraus 2013-01-08 14:34:47 UTC
Assigning to myself and lowering to P4 because this is known Glassfish 3.1.2 issue which cannot be fixed. Rev. 599d8df6ad83 just changed the way how it crashes. Now it's only an exception, not whole NetBeans frozen.

Please don't use GlassFish 3.1.2 when working with web servises. There is known bug in JAX-WS which causes NetBeans crashes.

Upgrade to GlassFish 3.1.2.2 or later.
Comment 6 blake1024 2013-01-08 14:50:03 UTC
This is unrelated to Glassfish.  Please read the entire post - especially comment #2.  I use NetBeans all day every day and have been for years on one huge program.  I can't use NetBeans with this bug.
Comment 7 digitalbugsy 2013-01-08 20:40:05 UTC
I'm also having this trouble with a regular java application, no app servers at all. To reproduce, try creating a Web Service Client with jax-ws. Something that ws import does is causing the netbeans security exception to be thrown. It effecively means that it is impossible to create web service clients since Netbeans 7.2.
Comment 8 TomasKraus 2013-01-08 23:26:52 UTC
"creating a Web Service Client with jax-ws" - that's exactly source of your problems. You are using jax-ws affected by the same bug that is in Glassfish 3.1.2.

Original bug related to this issue was bug# 211962 where you can read everything that was done to handle this situation. Unfortunately we don't have any working solution until now.

Try to locate Metro library you are using and update it to at least 2.2.0.1.
Comment 9 Petr Jiricka 2013-01-09 12:52:13 UTC
I was trying to reproduce using the following steps, but it works fine for me:
1. Created a Java EE 6 web project called Service using Tomcat 7 as the target server
2. Created a web service in this project
3. Deployed the project
4. Created a Java EE 6 web project called Client using Tomcat 7 as the target server
5. Created a web service client in this project that calls the web service from the Service project

=> The IDE compiled the project without any issues

I noticed that the IDE does not add any libraries to my project customizer dialog (which it probably should), but the IDE-generated jaxws-build.xml file refers to the following property:
libs.jaxws21.classpath

This property is defined in the IDE's userdir. Blake, I would guess that in your case it refers to an older version of Metro from an older version of NetBeans, is that correct? The workaround should be to change this property to refer to the newest version from NetBeans 7.3, that should fix the problem. Can you please confirm?
Comment 10 woodpusher1000 2013-01-21 14:54:48 UTC
I can confirm i still get this error. 

Using NetBeans IDE 7.3 Beta 2 (Build 201211062253).

Attempting to create or refresh a web service client to a web service running
on glassfish 3.1.2.2.

I have adjusted the JAX-WS-ENDORSED.xml in the IDE userdir to use the 7.3 jars.

I can confirm in netbeans output that the jars being used on the classpath are the ones from 7.3. 

This all works fine in Netbeans 7.2. As others have indicated it seems the direct result of 

http://hg.netbeans.org/web-main/rev/599d8df6ad83 commit as a fix 
for issue #220316.

Given , i have the latest ...

Glassfish 3.1.2.2 

And Jaxws , Jaxb jars , which shipped with netbeans , i dont know how to get around this issue.
Comment 11 woodpusher1000 2013-01-21 15:48:24 UTC
(In reply to comment #10)

For what its worth in an effort to make sure that all jars are latest i have 

Updated glassfish to metro-2.2.1-1 using the xml update.

Updated netbeans JAXWS and JAXB libraries to 2.2.7

Still no change. Hopefully this will be fixed in 7.3 stable. For now though its back to 7.2
Comment 12 TomasKraus 2013-01-21 17:44:47 UTC
Thank you for your responses. This seems to be an evidence that this is not related to GF 3.1.2 JAX-WS bug.

Reopening and assigning back to Jaroslav because 599d8df6ad83 is a change in code maintained by him.
Comment 13 markiewb 2013-01-22 22:16:10 UTC
Have a look at #224958. The same stacktrace is shown when  generating a RESTful client. Reproducible. But perhaps only a duplicate.
Comment 14 Denis Anisimov 2013-01-23 08:39:45 UTC
*** Bug 224958 has been marked as a duplicate of this bug. ***
Comment 15 Petr Jiricka 2013-01-23 15:34:10 UTC
Created attachment 130539 [details]
Patched boot.jar

Unfortunately, the NetBeans team is not able to reproduce this problem. 
As noted above, the suspected cause of this problem is the following change:
http://hg.netbeans.org/web-main/rev/599d8df6ad83

I am attaching a patched boot.jar file, which reverts this change. Reporters, can you please try it out, by copying it into the platform/lib directory of a recent trunk build (ie. build from http://bits.netbeans.org/download/trunk/nightly/)? Please let us know whether this patched boot.jar fixed the problem for you. Thanks.
Comment 16 woodpusher1000 2013-01-23 16:01:46 UTC
Hi Petr,

I can confirm that , applying the attached boot.jar has resolved the issue on my build (Build 201211062253).

I can now create the web service successfully again.

As to whats causing the problem , maybe if the exception the original code change threw could identify the jar which the blacklisted class came from it might shed some light on whats going on. Maybe my system is somehow using the incorrect jaxb jar ( which seems to be where the com.sun.istack.tools.ProtectedTask class is from ).

As it is the only thing i can go on is the netbeans output showing me the javac classpath.

Thanks for the very quick resolution so far.
Comment 17 Jaroslav Tulach 2013-01-24 08:56:06 UTC
Need to find out where the broken code is comming from: ergonomics#dc919e0e133a - get latest daily build, find that out. Reopen.
Comment 18 Quality Engineering 2013-01-25 03:02:43 UTC
Integrated into 'main-golden', will be available in build *201301250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/dc919e0e133a
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #224108: Print out the location of the code source to help people diagnose who is making the dangerous call
Comment 19 Rotan Hanrahan 2013-01-26 19:07:00 UTC
Downloaded nightly 201301260001 because I also cannot build a Tomcat-only JAX-WS project using 7.3, and was curious to see the location of the culprit.

Result:

java.lang.SecurityException: Dangerous reflection access to sun.misc.ClassLoaderUtil by class com.sun.istack.tools.ProtectedTask detected!
code location: file:/C:/Program%20Files/NetBeans%20Dev%20201301260001/ide/modules/ext/jaxb/jaxb-xjc.jar
 at org.netbeans.TopSecurityManager.checkMemberAccess(TopSecurityManager.java:435)
 at java.lang.Class.checkMemberAccess(Class.java:2157)
 at java.lang.Class.getDeclaredMethod(Class.java:1934)
 at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:138)

This nightly did cause a few problems, probably not related, but I will mention two significant observations for completeness:


1. It displayed the following message when the project was opened:

Project *** contains JAX-RPC clients. You must download JAX-RPC support plugin.

(Which was then immediately downloaded and installed via the Plugins feature.)


2. Every 10 seconds, or even less, a dialog box appeared displaying this message:

java.lang.NullPointerException
 at org.netbeans.modules.java.navigation.BreadCrumbsNodeImpl$ChildrenFactoryImpl.createKeys(BreadCrumbsNodeImpl.java:375)
 at org.openide.nodes.SynchChildren.refresh(SynchChildren.java:86)
 at org.openide.nodes.SynchChildren.addNotify(SynchChildren.java:70)
 at org.openide.nodes.Children.callAddNotify(Children.java:575)
 at org.openide.nodes.EntrySupportDefault.getArray(EntrySupportDefault.java:650)
 at org.openide.nodes.EntrySupportDefault.getNodes(EntrySupportDefault.java:162)
 at org.openide.nodes.Children.getNodes(Children.java:501)
 at org.netbeans.modules.java.navigation.BreadCrumbsScanningTask.rootAndSelection(BreadCrumbsScanningTask.java:135)
 at org.netbeans.modules.java.navigation.BreadCrumbsScanningTask.run(BreadCrumbsScanningTask.java:103)
 at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)

(Which was repeatedly dismissed so that I could continue with the test.)


Finally I did a clean, then build, and got the trace mentioned at the top of this submission. I do *not* have GF installed on the test machine. When installing the nightly, I allowed it to import custom settings from 7.2 (which I would consider to be the most normal action for anyone upgrading). The path in the trace suggests the location of the problem is within the nightly that was just installed, not some resource elsewhere.

Hope this helps.

---Rotan
Comment 20 Petr Jiricka 2013-01-26 20:49:44 UTC
Thanks Rotan for the stack trace. Looking at the jar file (ide/modules/ext/jaxb/jaxb-xjc.jar), it's built on May 16, 2012, and the manifest is the following:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.1
Created-By: 1.6.0_27-b07 (Sun Microsystems Inc.)
Specification-Title: Java Architecture for XML Binding
Specification-Version: 2.2.6
Specification-Vendor: Oracle Corporation
Implementation-Title: JAXB Reference Implementation 
Implementation-Version: 2.2.5-2
Implementation-Vendor: Oracle Corporation
Implementation-Vendor-Id: com.sun
Extension-Name: com.sun.tools.xjc
Build-Id: hudson-jaxb-ri-2.2.5u2-promote-release-5
Main-Class: com.sun.tools.xjc.XJCFacade
Class-Path: jaxb-api.jar jaxb-impl.jar jsr173_1.0_api.jar activation.j
 ar

Cc'ing Lukas Jungmann - Lukas, can you please confirm if bug [1] is present in this build, or whether this jar is not affected by it? Thanks.

[1] http://java.net/jira/browse/JAX_WS-1059
Comment 21 Lukas Jungmann 2013-01-28 09:59:50 UTC
(In reply to comment #20)
> Cc'ing Lukas Jungmann - Lukas, can you please confirm if bug [1] is present in
> this build, or whether this jar is not affected by it? Thanks.
> 
> [1] http://java.net/jira/browse/JAX_WS-1059

no, referenced bug is not present in given JAXB.

Call to sun.misc.ClassLoaderUtil is still there but should be invoked on JDK 6 only
Comment 22 Lukas Jungmann 2013-01-28 10:02:02 UTC
btw: the fix for that issue is in getting to the correct CL in the chain and not to the root one ("caused by": https://issues.apache.org/bugzilla/show_bug.cgi?id=35436)
Comment 23 Rotan Hanrahan 2013-01-28 10:23:35 UTC
If it helps, I ran the test while using JDK 6 (specifically build 1.6.0_20-b02) in a 64 bit configuration.

The target deployment environment uses Java 6 and unlikely to change any time soon. Hence the development/test environment is also Java 6.

---Rotan.
Comment 24 Jaroslav Tulach 2013-01-29 07:24:16 UTC
The right way to get the sources is 
$ svn co https://svn.java.net/svn/jaxb~version2/tags/jaxb-2_2_5u2
I guess.
Comment 25 Jaroslav Tulach 2013-01-29 09:28:17 UTC
Please verify my fix: ergonomics#6ba97f4980ae
Comment 26 Quality Engineering 2013-01-30 03:41:38 UTC
Integrated into 'main-golden', will be available in build *201301300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6ba97f4980ae
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #224108: Allowing com.sun.istack.tools.ProtectedTask to call sun.misc.ClassLoaderUtil methods
Comment 27 blake1024 2013-01-30 15:44:33 UTC
I tried clean/build 201301290001 and got:

Building StandardWizardBenefitWizardOps because /Users/blake/NetBeansProjects-7.3/ArahantBackend/./build/generated/wsgen/service/StandardWizardBenefitWizardOps.wsdl didn't exist.
Building StandardWizardLoginReportOps because /Users/blake/NetBeansProjects-7.3/ArahantBackend/./build/generated/wsgen/service/StandardWizardLoginReportOps.wsdl didn't exist.
Building StandardWizardWizardPayrollExportOps because /Users/blake/NetBeansProjects-7.3/ArahantBackend/./build/generated/wsgen/service/StandardWizardWizardPayrollExportOps.wsdl didn't exist.
dowsdls.arahant-wsgen:
Created dir: /Users/blake/NetBeansProjects-7.3/ArahantBackend/build/generated/wsgen/service
Created dir: /Users/blake/NetBeansProjects-7.3/ArahantBackend/build/generated/wsgen/binaries
Generating wsdl for AqDevImportOps
/Users/blake/NetBeansProjects-7.3/ArahantBackend/build.xml:165: The following error occurred while executing this line:
/Users/blake/NetBeansProjects-7.3/ArahantBackend/wsdlgenant.xml:14: 
java.lang.SecurityException: Dangerous reflection access to sun.misc.ClassLoaderUtil by class com.sun.istack.tools.ProtectedTask detected!
code location: file:/Applications/NetBeans/NetBeans%20Dev%20201301290001.app/Contents/Resources/NetBeans/ide/modules/ext/jaxb/jaxb-xjc.jar
	at org.netbeans.TopSecurityManager.checkMemberAccess(TopSecurityManager.java:435)
	at java.lang.Class.checkMemberAccess(Class.java:2157)
	at java.lang.Class.getDeclaredMethod(Class.java:1934)
	at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:138)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:392)
	at org.apache.tools.ant.Target.performTasks(Target.java:413)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:392)
	at org.apache.tools.ant.Target.performTasks(Target.java:413)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:283)
	at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:541)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 55 seconds)
Comment 28 Petr Jiricka 2013-01-30 16:05:24 UTC
See previous comment, it says the fix will be available in build 201301300001, you are using an earlier build. Unfortunately build 201301300001, so could you please instead use this build to verify? 
http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastSuccessfulBuild/artifact/nbbuild/dist/
Comment 29 blake1024 2013-01-30 17:20:46 UTC
Sorry.  Will test with the correct build and post a response.
Comment 30 Rotan Hanrahan 2013-01-30 17:50:54 UTC
Downloaded NetBeans-dev-nbms-and-javadoc-10202-on-20130130-full.zip from Hudson.

Clean. Build. Build Successful.

Confirm that in my case this looks "resolved".

---Rotan

(Dev build has horrible breadcrumbs NPEs every few seconds, but that issue is already being tracked.)
Comment 31 blake1024 2013-01-31 02:02:57 UTC
I rebuilt my app with 201301300001.  The main problem I had seems to work now.  I am getting some debug output as follows:

Generating wsdl for StandardCrmSalesTasksOps
classLoader = java.net.URLClassLoader@1e99335a
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@1fa9af53
Generating wsdl for StandardCrmStandardProspectImportOps
classLoader = java.net.URLClassLoader@4f478b11
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@1fa9af53
Generating wsdl for StandardCrmVisitorTrackImportOps
classLoader = java.net.URLClassLoader@789545bb
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@1fa9af53
...


So, the classLoader and SharedSecrets lines are debug info.  Ultimately won't need it.

Thanks!
Comment 32 Jaroslav Tulach 2013-02-01 12:24:31 UTC
changeset:   2d7e2aed8389
branch:      release73
tag:         tip
parent:      0721f38a62f4
parent:      6ba97f4980ae
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Fri Feb 01 13:23:41 2013 +0100
summary:     Merge of #224108 for 7.3
Comment 33 Quality Engineering 2013-02-04 01:16:10 UTC
Integrated into 'releases', will be available in build *201302032200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/6ba97f4980ae
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #224108: Allowing com.sun.istack.tools.ProtectedTask to call sun.misc.ClassLoaderUtil methods
Comment 34 Jiri Skrivanek 2013-02-04 11:13:54 UTC
Verified that the fix is inserted in release73 repository. In spite I was not able to reproduce original problem, I am verifying that the fix not caused any other regression so far.
Comment 35 Sergey Petrov 2013-04-15 10:38:36 UTC
Is it in 7.3.1? I can see smth similar to this one right now on javaee branch