users@jax-ws.java.net

RE: JAX-WS: Problem experienced using _at_WebServiceProvider annotation...

From: Sajit - SDTPL <sajit.dayanandan_at_stpdomain.com>
Date: Fri, 8 Dec 2006 10:44:38 +0530

Hi Jitu,

We appreciate the response...


The change that you have suggested mentions replacement of the
annotation @WebService with @WebServiceProvider. Correct me if my
understanding is incorrect.


However, we already attempted that we used to encounter an error at the
time of Deployment (details have been mentioned in my communication
forwarded earlier.


Further, we have been making some more progress and seem to have found
the correct way of doing it... Will keep all posted once we conclude our
tests.


Meanwhile Jitu, in case you are aware of any source where we could get
examples with explanation of the implementation, it would be very
helpful... Thanks in advance.

Thanks and Regards,
Sajit
------------------------------------------------------------------------
------------------------------------------


-----Original Message-----
From: Jitendra.Kotamraju_at_Sun.COM [mailto:Jitendra.Kotamraju_at_Sun.COM]
Sent: Friday, December 08, 2006 1:29 AM
To: users_at_jax-ws.dev.java.net
Subject: Re: JAX-WS: Problem experienced using @WebServiceProvider
annotation...


Sajit - SDTPL wrote:

> Hi,
>
> We are evaluating using JAX-WS for development of a new solution
> which is based on components deployed in the form of Web Services.
>
> We are using NetBeans 5.5 for the development environment and Sun
> App Server 9 (Glassfish) is the app server being used.
>
> We tried developing a simple Web Service, which is based on some
> of the examples available along with JAX-WS. However, we are using
> NetBeans to create the same.
>
>
************************************************************************
***********************************
> package TestWS;
>
> import java.rmi.RemoteException;
> import java.util.Map;
> import javax.jws.WebMethod;
> import javax.jws.WebService;
> import javax.xml.soap.SOAPMessage;
> import javax.xml.ws.Provider;
> import javax.xml.ws.Service;
> import javax.xml.ws.ServiceMode;
> import javax.xml.ws.WebServiceProvider;
>
> /**
> *
> * @author Sajit_3
> */
>
> @WebService
> @ServiceMode(value=Service.Mode.MESSAGE)
> public class TestWS implements Provider<SOAPMessage>
> {
> /**
> * Web service operation
> */
> @WebMethod
> public SOAPMessage ReturnString (SOAPMessage inRequest)
> {
> // TODO implement operation
> return inRequest;
> }
>
> public SOAPMessage invoke (SOAPMessage inRequest)
> {
> return inRequest;
> }
>
> public SOAPMessage invoke(SOAPMessage inRequest,
> Map<String,Object> context)
> throws RemoteException {
> return inRequest;
> }
> }
>
This is a wrong Provider.invoke() method has only one argument

public SOAPMessage invoke(SOAPMessage inRequest, Map<String,Object>
context)

Try the following:

@WebServiceProvider
@ServiceMode(value=Service.Mode.MESSAGE)
public class TestWS implements Provider<SOAPMessage>
{
 
    public SOAPMessage invoke (SOAPMessage inRequest)
    {
        return inRequest;
    }
 
}

Jitu

>
> **********************************************************************
> *************************************
>
> The above test Web Service compiles successfully and is also
> deployed successfully.
>
> However, when we change the annotation from @WebService to
> @WebServiceProvider the deployment fails (though NetBeans does not
> show any compile time errors).
> Further note that we are not deploying directly through the IDE.
> We use the AppServer interface to locate the war file created
> (through NetBeans) and deploy the same.
>
>
> The AppServer errorlog shows the following messages.
>
> =================================================================
>
[#|2006-12-02T11:38:28.312+0530|WARNING|sun-appserver-pe9.0|org.apache.c
oyote.tomcat5.CoyoteRequest|_ThreadID=20;_ThreadName=httpWorkerThread-48
48-0;_RequestID=d2cd8e5b-f400-4480-b608-ebf1aeb6e7cc;|Unable
> to set character encoding UTF-8 because request parameters have
> already been read, or ServletRequest.getReader() has been
> called|#]
>
>
[#|2006-12-02T11:38:31.218+0530|WARNING|sun-appserver-pe9.0|javax.enterp
rise.system.tools.deployment|_ThreadID=23;_ThreadName=Thread-36;_Request
ID=7093522d-e469-456e-920f-f52a9c96aa0f;|DPL5035:Error
> while running ejbc
> com.sun.enterprise.deployment.backend.IASDeploymentException:
> Fatal Error from EJB Compiler -- null
> at
>
com.sun.enterprise.deployment.backend.WebServiceDeployer.doWebServiceDep
loyment(WebServiceDeployer.java:140)
> at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:855)
> at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:580)
> at
>
com.sun.enterprise.deployment.backend.EJBCompiler.preDeployModule(EJBCom
piler.java:413)
> at
>
com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.ja
va:226)
> at
>
com.sun.enterprise.deployment.backend.ModuleDeployer.runEJBC(ModuleDeplo
yer.java:1189)
> at
>
com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModule
Deployer.java:179)
> at
>
com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(Mod
uleDeployer.java:160)
> at
>
com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.jav
a:169)
> at
>
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deplo
ymentPhase.java:95)
> at
>
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(
PEDeploymentService.java:871)
> at
>
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeplo
ymentService.java:266)
> at
>
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeplo
ymentService.java:739)
> at
>
com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.ja
va:174)
> at
>
com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:
210)
> |#]
>
>
[#|2006-12-02T11:38:31.468+0530|SEVERE|sun-appserver-pe9.0|javax.enterpr
ise.system.tools.deployment|_ThreadID=23;_ThreadName=Thread-36;_RequestI
D=7093522d-e469-456e-920f-f52a9c96aa0f;|Exception
> occured in J2EEC Phase
> com.sun.enterprise.deployment.backend.IASDeploymentException:
> Error while running ejbc -- Fatal Error from EJB Compiler -- null
> at
>
com.sun.enterprise.deployment.backend.WebServiceDeployer.doWebServiceDep
loyment(WebServiceDeployer.java:140)
> at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:855)
> at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:580)
> at
>
com.sun.enterprise.deployment.backend.EJBCompiler.preDeployModule(EJBCom
piler.java:413)
> at
>
com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.ja
va:226)
> at
>
com.sun.enterprise.deployment.backend.ModuleDeployer.runEJBC(ModuleDeplo
yer.java:1189)
> at
>
com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModule
Deployer.java:179)
> at
>
com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(Mod
uleDeployer.java:160)
> at
>
com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.jav
a:169)
> at
>
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deplo
ymentPhase.java:95)
> at
>
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(
PEDeploymentService.java:871)
> at
>
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeplo
ymentService.java:266)
> at
>
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeplo
ymentService.java:739)
> at
>
com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.ja
va:174)
> at
>
com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:
210)
> |#]
> =================================================================
>
> Has anyone on this forum encountered something like this... Any
> help will be highly appreciated. If you feel that there is some
> other forum which will be able to help, please advice.
>
>
> Thanks in advance...
>
>
> Thanks,
>
> ** Sajit **
>
> ** **
>
> ----------------------------------------------------------------------
> --------------------------------------------
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
For additional commands, e-mail: users-help_at_jax-ws.dev.java.net