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 162585 - Error when create JAX-RPC Web service client
Summary: Error when create JAX-RPC Web service client
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-RPC (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-14 13:19 UTC by Jaroslav Pospisil
Modified: 2009-05-04 13:20 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Pospisil 2009-04-14 13:19:04 UTC
Build 200904140201, JDK 1.6.0_13 / 1.5.0_18, Win Vista

Create new JAX-RPC web service on Glassfish v2.1 in web project (you need to install JAX-RPC plugin) and deploy
it.Create another web application and web service client on the service. Client is generated,Build Successfull,only down
left on the status bar,there's brief message: Error creating Java from WSDL file. Try to set HTTP Proxy. Also - there's
only wsdl's name as client's node, marked as Unregistered service (tooltip) and I can't Call Web service's operation
from index.jsp, because service's node can't be opened to list operations .
Comment 1 Milan Kuchtiak 2009-04-14 15:55:02 UTC
Probably a regression.
Comment 2 Milan Kuchtiak 2009-04-15 10:30:52 UTC
The wscompile, that is called from WS code, fails with the following error :

JDK1.6:
error: Bad service configuration file, or exception thrown while constructing Processor object:
javax.annotation.processing.Processor: Provider org.netbeans.modules.openide.modules.PatchedPublicProcessor could not be
instantiated: java.lang.ClassCastException
error: compilation failed, errors should have been reported

JDK1.5:
error: Exception thrown while constructing Processor object: javax/annotation/processing/AbstractProcessor
error: compilation failed, errors should have been reported

This is a regression since Netbeans 6.5. Should we implement something on web services site ?

I'd ask Jesse for help.
What is the roll of PatchedPublicProcessor ?

Could you please give me some glue, then possibly, reassign back to me. 

Thank You.
Comment 3 Jesse Glick 2009-04-15 18:37:02 UTC
I'm afraid there's not enough here for me to go on. If the problem occurs during an Ant task (when run inside the IDE
but not when run from the command line), I would want a ZIP of an Ant build script and any necessary supporting files
(JARs, sample sources, ...) so that I can reproduce without having to have all of these EE-related modules installed and
the complex setup run.

PatchedPublicProcessor is a JSR 269 annotation processor in openide.modules.

You could probably see the stack trace for the CCE if you set Ant to run in Verbose mode.

It is quite possible that the wscompile task does some tricks with ClassLoader's and gets it wrong.
Comment 4 Milan Kuchtiak 2009-04-15 20:41:15 UTC
JAX-RPC support in IDE calls programaticaly wscompile tool. The Ant task works without any problems.

The code is included in:
websvc.registry module, extsrc source root
org.netbeans.modules.websvc.registry.jaxrpc.Wsdl2Java#execute() method

Basically, JAX-RPC internal class : com.sun.xml.rpc.spi.tools.CompileTool is created and run() method called on that class.
IDE creates arguments for wscompile tool and passes those arguments to CompileTool.run(String[] args) method

I'll try to get more information from that tool. Yes, running wscompile with verbose="true" is a good idea.

This is the classpath we pass to wscompile tool:

        "modules/ext/jaxrpc16/activation.jar",
        "modules/ext/jaxrpc16/jax-qname.jar",
        "modules/ext/jaxrpc16/jaxp-api.jar",
        "modules/ext/jaxrpc16/FastInfoset.jar",
        "modules/ext/jaxrpc16/jaxrpc-api.jar",
        "modules/ext/jaxrpc16/jaxrpc-impl.jar",
        "modules/ext/jaxrpc16/jaxrpc-spi.jar",
        "modules/ext/jaxrpc16/jsr173_api.jar",
        "modules/ext/jaxrpc16/mail.jar",
        "modules/ext/jaxrpc16/relaxngDatatype.jar",
        "modules/ext/jaxrpc16/saaj-api.jar",
        "modules/ext/jaxrpc16/saaj-impl.jar",
        "modules/ext/jaxrpc16/xsdlib.jar"
Comment 5 Jesse Glick 2009-04-15 20:45:29 UTC
By "Verbose" mode I meant Tools > Options > Misc > Ant. This would show where the actual CCE occurs. The root problem is
probably that some code invoked by wscompile uses ClassLoader.getSystemClassLoader() when it should not: when running
Ant inside the IDE, CL.sCL will include openide.util, openide.modules, and o.n.bootstrap (i.e. -classpath lib/*.jar);
whereas the ClassLoader used to load ant.jar does not include these things (nor does ${java.class.path}).
Comment 6 Milan Kuchtiak 2009-04-15 21:52:23 UTC
I am not able to get more info from wscompile tool.

I am not sure com.sun.xml.rpc.spi.tools.CompileTool has something common with Ant.
As I said doing the same with Ant works fine.

JAX-RPC support has its own class loader (URLClassLoader).
That might be an issue. 

Comment 7 Quality Engineering 2009-04-16 08:06:46 UTC
Integrated into 'main-golden', will be available in build *200904160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3dcf8d99d4d3
User: mkuchtiak@netbeans.org
Log: #162585: don't need to consider jar files needed for jdk1.4
Comment 8 Milan Kuchtiak 2009-04-16 13:41:36 UTC
Fixed.
Problem was in ClassLoader. The code was really running under SystemClassLoader.
I've changed the code to use the specific class loader created in websvc.registry module. Thank You for help.

Details:
http://hg.netbeans.org/main?cmd=changeset;node=72c41f08c2b7
 
Comment 9 Quality Engineering 2009-04-17 08:42:37 UTC
Integrated into 'main-golden', will be available in build *200904170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/72c41f08c2b7
User: mkuchtiak@netbeans.org
Log: #162585: run wscompile tool in another class loader (Class Loader obtained from Wsdl2Java class), extend JAX-RPC 1.6 public packages
Comment 10 Jaroslav Pospisil 2009-05-04 13:20:08 UTC
ver.