Skip to main content

Webservice client is not getting the service reference from JNDI..

1 reply [Last post]
luke3168
Offline
Joined: 2007-03-28

Hi,

I have a web application which needs to talk to a service deployed in another glassfish server but it fails:

Please note these are JAX-RPC web services not JAX-WS 2.0 and I am using GF v2-b33e.

Here is the client code:

private Remote getPort(ServiceConfig config)
{
Remote clientPort;
try
{
Context ic = new InitialContext();

Service service = (Service) ic.lookup( config.getJndiEntry() );
clientPort = service.getPort( config.getSei() );
((Stub)clientPort)._setProperty( Stub.ENDPOINT_ADDRESS_PROPERTY,
config.getEndPointUrl() );
return clientPort;
} catch (Exception e)
{
throw new RuntimeException( errMsg, e);
}
}

Note:

1. config.getJndiEntry() returns "java:comp/env/service/MyServiceRef" from a config file.
2. config.getSei() return the com.xxxxx.ws.sei.MyServiceImpl_PortType class.

In the web.xml I have the service reference as follows:

service/MyServiceRef
javax.xml.rpc.Service
WEB-INF/wsdl/MyProcess.wsdl

WEB-INF/wsdl/MyProcessService-java-wsdl-mapping.xml

com.xxxx.ws.sei.MyServiceImpl_PortType

During startup of the web application I see the following which seems to me indicating that the JNDI name is bound:

[#|2007-03-28T09:54:03.968-0700|INFO|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=10;_ThreadName=main;java:comp/env/service/MyServiceRef;|naming.bind|#]

And here is the EXCEPTION when I try to access the service:

[#|2007-03-28T09:56:50.812-0700|WARNING|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=11;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=3ab829f0-4ae7-4445-9a2f-8b6568c1d52e;|
javax.xml.ws.WebServiceException: null is not a valid service
at com.sun.xml.ws.client.WSServiceDelegate.(WSServiceDelegate.java:171)
at com.sun.xml.ws.client.WSServiceDelegate.(WSServiceDelegate.java:159)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:82)
at javax.xml.ws.Service.(Service.java:56)
at javax.xml.ws.Service.create(Service.java:697)
at com.sun.enterprise.naming.NamingManagerImpl.getClientServiceObject(NamingManagerImpl.java:1161)
at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:978)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:313)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.xxxxx.common.service.ServiceFactory.getPort(ServiceFactory.java:66)

I even placed a sun-web.xml in the WEB-INF having the service reference as follows but with the same failure:

service/MyProcessRef

com.xxxxx.ws.sei.MyServiceImpl_PortType

What's could be happening here? Please let me know if you need any more information.

If I deploy this web app in Oracle server then it could talk to the glassfish server based web services.

Thanks,

luke3168

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
luke3168
Offline
Joined: 2007-03-28

Moving it up to the top of the list so that someone notices as the issue is not yet resolved.

Thanks.

Luke3168