wood burning stoves 2.0*
The moose likes Web Services and the fly likes HandlerChain annotation name attribute deprecated.  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "HandlerChain annotation name attribute deprecated.  " Watch "HandlerChain annotation name attribute deprecated.  " New topic
Author

HandlerChain annotation name attribute deprecated.

satyanarayana bnv
Greenhorn

Joined: Aug 07, 2008
Posts: 12
Hi All,

I am using @HandlerChain(file="HandlerConfig.xml") annotation to configure a SOAPMessageHandler in my Impl file. This annotation contains a deprecated "name" attribute. When I am not specifying "name" attribute in the annotation, JWSC task is throwing "Null Pointer Exception" while creating the war of the service. This is probably because the HandlerConfig.xml contains handler-chain-name element and the annotation doesn't contain "name" attribute. When I am specifying name attribute in the annotation everything is fine. Please help me in resolving the problem without "name" attribute.

This is the code I am having:

SubmitApplicationServiceImpl.java:

package com.project.webservices.submitappservice;
import javax.jws.WebService;
import weblogic.jws.WLHttpTransport;
import javax.jws.HandlerChain;

@HandlerChain(file = “SubmitAppHandlerChain.xml”)
@WebService(serviceName = "SubmitApplicationService", targetNamespace = "http://project.com/ SubmitApplicationService", endpointInterface = "com.project.webservices.submitappservice.SubmitApplicationServiceSoap")
@WLHttpTransport(contextPath = "SubmitApplicationService", serviceUri = "SubmitApplicationService", portName = "SubmitApplicationServiceSoapSoapPort")
public class SubmitApplicationServiceSoapImpl implements
SubmitApplicationServiceSoap {
public SubmitApplicationRes submitApplication(
SubmitApplicationReq submitApplicationRq) {
// Our business logic here.
return submitApplicationRes;
}
}



This is my handler configuration file in the same package:

SubmitAppHandlerChain.xml:

<?xml version='1.0' encoding='UTF-8'?>
<jwshc:handler-config xmlns:jwshc="http://www.bea.com/xml/ns/jws"
xmlns="http://java.sun.com/xml/ns/j2ee" >

<jwshc:handler-chain>
<jwshc:handler-chain-name>HandlerChain</jwshc:handler-chain-name>
<jwshc:handler>
<handler-name>AppServiceHandler</handler-name>
<handler-class>com.project.webservices.submitappservice.AppServiceHandler</handler-class>
</jwshc:handler>
</jwshc:handler-chain>

</jwshc:handler-config>




This is the build target that creates war of the service:

<taskdef name="jwsc"
classname="weblogic.wsee.tools.anttasks.JwscTask"
classpathref="compile.classpath" />

<target name="create-appservice-war>
<jwsc srcdir="${basedir}/project/src" destdir="${basedir}/projectEAR/build">
<jws file="com/project/webservices/submitappservice/SubmitApplicationServiceSoapImpl.java"/>
<classpath refid="jwsant.classpath" />
</jwsc>
</target>



Thanks,
Satya
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42918
    
  68
Usually the javadocs of a class (here: HandlerChain) mention what should be used instead of deprecated features.

If the attribute works fine for you, what's the need to avoid it?
satyanarayana bnv
Greenhorn

Joined: Aug 07, 2008
Posts: 12
Hi,

Thanks for replying. I am not supposed to use deprecated attributes.

Thanks,
Satya.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42918
    
  68
I am not supposed to use deprecated attributes.

As a hard and fast rule, that doesn't make sense. There's no harm in using this, but there is (obviously, in this case) harm in NOT using it, so I'd say that's a good reason to use it.

Maybe there's a newer version of the JWSC task that knows about this deprecation?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HandlerChain annotation name attribute deprecated.