[jboss-user] [Management, JMX/JBoss] - Re: Local JNDI lookup in local JMX bean?

nappinc do-not-reply at jboss.com
Tue May 29 06:41:36 EDT 2007


"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).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049249#4049249

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049249



More information about the jboss-user mailing list