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 167858 - jax-ws webservice handler file not found
Summary: jax-ws webservice handler file not found
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker with 7 votes (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-30 09:01 UTC by rbelatamas
Modified: 2013-08-20 15:00 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
wsdl file to test (3.79 KB, application/octet-stream)
2012-12-21 07:03 UTC, Denis Anisimov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rbelatamas 2009-06-30 09:01:05 UTC
After you set a jax-ws webservice handler this exception thrown

com.sun.xml.ws.util.UtilException: Could not find handler chain file WSKiszolgaloAlrendszerService_handler.xml for class
xmlsema.hu.wfs.ur.szerver.ws.WSKiszolgaloAlrendszerService
        at com.sun.xml.ws.util.HandlerAnnotationProcessor.getFileAsStream(HandlerAnnotationProcessor.java:215)
        at com.sun.xml.ws.util.HandlerAnnotationProcessor.buildHandlerChainsModel(HandlerAnnotationProcessor.java:145)
        at com.sun.xml.ws.client.HandlerConfigurator$AnnotationConfigurator.<init>(HandlerConfigurator.java:132)
        at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:252)
        at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:176)
        at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104)
        at javax.xml.ws.Service.<init>(Service.java:56)
        at xmlsema.hu.wfs.ur.szerver.ws.WSKiszolgaloAlrendszerService.<init>(WSKiszolgaloAlrendszerService.java:44)
        at hu.wfs.ur.kliens.ws.WSKiszolgalo.init(WSKiszolgalo.java:53)
        at hu.wfs.ur.kliens.gui.AlkAblak.inditas(AlkAblak.java:370)
        at hu.wfs.ur.kliens.gui.AlkAblak.access$1200(AlkAblak.java:40)
        at hu.wfs.ur.kliens.gui.AlkAblak$13.run(AlkAblak.java:353)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Java Result: -1

if you add manualy the handler file(WSKiszolgaloAlrendszerService_handler) to the default package (root) the problem
will solved
Comment 1 Milan Kuchtiak 2009-11-10 03:09:36 UTC
Please describe the problem in detail.
What did you do actually. I tried to reproduce the issue with no success.

Questions:

- what project type do you use (web project, J2SE project)
- are you configuring handler on service side or client side ?
- what jdk version do you use ?
- have you tested Netbeans 6.8 Bata ?

Basically, what you need is to 
- create either LogicalHandler or MessageHandler subclass.
- use "Configure Handlers" action to attach handler to service (or client)

For me everything works fine.
Comment 2 acooper 2009-11-16 15:34:23 UTC
Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15

SOAP client service:  
web project
JAX-WS 2.1 library
Protocol handler pointing to class which implements SOAPHandler<SOAPMessageContext>

SOAP server service:
web project
JAX-WS 2.1 library
**** IMPORTANT ****  JAXB Binding
Protocol handler which points to class which implements SOAPHandler<SOAPMessageContext>

I will try to create a generic simple test case.
Comment 3 mgarrison 2009-11-30 12:34:39 UTC
I also have this problem.  I reproduce it easily using NB 6.7.1.   

I have a handler class that implements javax.xml.ws.handler.LogicalHandler.  I add it to my *web service client* (maybe it is client specific?), and then upon build/run get the error saying "could not find handler chain file..."

As a workaround, I can hand copy the xml file to the build directory...but this used to work.

meg
Comment 4 Denis Anisimov 2010-11-02 08:51:01 UTC
Cannot reproduce.
Comment 5 kovica 2012-12-20 12:24:15 UTC
I'm using NetBeans IDE 7.2 (Build 201207171143) with all updates applied.

I'm also seeing this bug.
Steps:
- create maven based web application
- create web service WS1
- create web service client WS2 (this is a client generated from a WSDL file)
- create Web Service Message Handler
- under "Web Service References" you will have reference to WS2. Right click it and set this created Message Handler
- build
- try to deploy resulting WAR file
Comment 6 kovica 2012-12-20 13:14:08 UTC
The problem is that files containig jws:handler-chain element are not copied to the web service client classes directories
Comment 7 Denis Anisimov 2012-12-20 18:43:41 UTC
Thank you for exact steps.
I'm able to reproduce.
The issue is specific to maven web project.
Ant based project works fine.
handler xml file is created in the package structure of the main WebServiceClient
service but its root is project directory.
As result it is not copied into the correct directory in the package.
Comment 8 Denis Anisimov 2012-12-21 07:02:32 UTC
I need a help from Maven experts.
The issue is a consequence of wired work "jaxws-maven-plugin".
pom.xml has a plugin :
<plugin>
    <groupId>org.jvnet.jax-ws-commons</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>2.2</version>

With execution:
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlFiles>
                                <wsdlFile>StockService.wsdl</wsdlFile>
                            </wsdlFiles>
                            <wsdlLocation>file:/C:/tmp/StockService.wsdl</wsdlLocation>
                            <staleFile>${project.build.directory}/jaxws/stale/StockService.stale</staleFile>
                            <bindingDirectory>${basedir}/src/jaxws-bindings</bindingDirectory>
                            <bindingFiles>
                                <bindingFile>StockService_handler.xml</bindingFile>
                            </bindingFiles>                            
                        </configuration>
                        <id>wsimport-generate-StockService</id>
                        <phase>generate-sources</phase>
                    </execution>

wsimport (see f.e. http://mojo.codehaus.org/jaxws-maven-plugin/wsimport-mojo.html ) generates java class file sources which compiled into the target/classes folder inside project directory.
This is the value of the ${project.build.outputDirectory}.
The latter property value have to be used for handler xml file as well.
But it is not used.
There is "destDir" parameter plugin which could be used to set output directory.
If I use <destDir>${project.build.directory}</destDir> then handler xml is copied into the "target" folder directly with its package structure. So it works as expected. But it copies handler.xml file inside project directory (with its package structure)  if I use <destDir>${project.build.directory}/classes</destDir> ( which is default value for ${project.build.outputDirectory} ).
So it works as expected for any destDir option value except ${project.build.directory}/classes.
Is it a bug in the wsimport maven plugin or smth else ?
Comment 9 Denis Anisimov 2012-12-21 07:03:05 UTC
Created attachment 129608 [details]
wsdl file to test
Comment 10 Denis Anisimov 2012-12-21 07:04:44 UTC
I've attached wsdl file to test with.
Please evaluate.
Comment 11 Milos Kleint 2012-12-21 08:04:31 UTC
I have no idea, sorry. Most likely has to do with inner workings of the plugin itself. Adding mgrebac@netbeans.org on CC, he appears to be one of the current developers of the plugin over at glassfish.
Comment 12 Martin Grebac 2012-12-21 08:10:38 UTC
Adding Lukas, current plugin owner.
Comment 13 Milan Kuchtiak 2013-08-20 15:00:19 UTC
Works fine with updated maven-jaxws-plugin, version 2.3.
See bug 229913.

Likely, there was an issue with maven-jaxws-plugin, version 2.2