This content has been marked as final.
Show 4 replies
-
1. Re: Local JNDI lookup in local JMX bean?
genman May 25, 2007 1:56 AM (in response to nappinc)"java:comp/env" is a context only provided to EJBs and Servlets, it's not available from your MBeans.
You need to use a different strategy to access your web client. For this particular service, I don't really know. But take a look at the JNDI tree through the JNDI viewer and see if it's also available under a different name. Or look for docs that explain how to use this client external to EJBs... -
2. Re: Local JNDI lookup in local JMX bean?
nappinc May 25, 2007 7:50 AM (in response to nappinc)"genman" wrote:
"java:comp/env" is a context only provided to EJBs and Servlets, it's not available from your MBeans.
You need to use a different strategy to access your web client. For this particular service, I don't really know. But take a look at the JNDI tree through the JNDI viewer and see if it's also available under a different name. Or look for docs that explain how to use this client external to EJBs...
Sounds like I've managed to find a corner case that J2EE 1.4 doesn't cope for...
The JNDIView MBean shows that my service-ref is not published under the java: or global JNDI contexts. Is there any way that I can do that, in addition to publishing it under the local java:comp/env context?
Alternatively I guess I'll have to revert to J2SE-style Service invocation, which seems bizarre and excessive given all this code is in the same .war file... ;( -
3. Re: Local JNDI lookup in local JMX bean?
nappinc May 29, 2007 6:41 AM (in response to nappinc)"nappinc" wrote:
The JNDIView MBean shows that my service-ref is not published under the java: or global JNDI contexts. Is there any way that I can do that, in addition to publishing it under the local java:comp/env context?
I assume from the lack of replies that this isn't possible?"nappinc" wrote:
Alternatively I guess I'll have to revert to J2SE-style Service invocation, which seems bizarre and excessive given all this code is in the same .war file... ;(
I'm trying this now, using the J2SE Dynamic Proxy style, and am struggling to get it to work in a JMX context in JBoss.
My web service client code is as follows:URL wsdl = servletContext.getResource("/WEB-INF/wsdl/gms.wsdl"); // debug the contents of the URL ServiceFactory factory = ServiceFactory.newInstance(); Service service = factory.createService( wsdl, new QName("..namespace..", "GMS")); GMSPort gms = (GMSPort) service.getPort( new QName("..namespace..", "GMSPort"), GMSPort.class);
However this fails with:java.io.FileNotFoundException at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:297) at java.net.URL.openStream(URL.java:1007) at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.getDocument(WSDLDefinitionsFactory.java:181) ... 44 more
Note that the URL (wsdl.toExternalForm()) is jndi:/localhost/pegasus/WEB-INF/wsdl/gms.wsdl, and a little debug code in the JMX bean is able to open this URL as an InputStream and output all the WSDL file's contents.
If I simply create a JAX-RPC Service instance without providing the wsdl URL, I get a "Unable to obtain Service Meta Data" error.
Can anyone suggest an alternative, preferably one that doesn't require hard-coding file locations on the app server?
This is using JBoss 4.0.4, with JBossWS 1.0.3GA and a version of JBossXB 1.0.0 CR6 (with JBoss patch JBAS-3581). -
4. Re: Local JNDI lookup in local JMX bean?
nappinc May 29, 2007 7:22 AM (in response to nappinc)"nappinc" wrote:
Note that the URL (wsdl.toExternalForm()) is jndi:/localhost/pegasus/WEB-INF/wsdl/gms.wsdl, and a little debug code in the JMX bean is able to open this URL as an InputStream and output all the WSDL file's contents.
If I simply create a JAX-RPC Service instance without providing the wsdl URL, I get a "Unable to obtain Service Meta Data" error.
If I change using servlet-context relative URLs for an external URL (http://someserver:someport/blah?WSDL) - not really something I want to do but there you go - I can still successfully debug the contents of the WSDL file but I get an error related to a method in the WSDL that I'm not even calling:org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://www.abm-uk.com/abmpegasus/v5.0/gms}>Search at org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataDoc(JSR109MetaDataBuilder.java:451) at org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:200) at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:208) at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:126) at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82) at org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:96) at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157) at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)