[jboss-user] [JBossWS] - Problem trying to use a jmx component to call my webservice

rickcr do-not-reply at jboss.com
Thu May 17 15:15:33 EDT 2007


I'm a bit confused what is going wrong here. I have a simple class that can call my webservice by creating a javax.xml.ws.Service and getting a handle to my endpoint interface. This works fine if I call this class from a servlet.

I know annotated this class so that it would show up as a JMX component and I'm trying to call the test method (echo) through the JMX console. When I try this, however,  I'll get an error back...

org.jboss.ws.WSException: Cannot load java type: com.foobar.edsf.example.ejb.webservices.jaxws.TestEchoExample

I'm not sure why I'm getting such an error. Apparently JBoss is trying to make this class in the package jaxws? (since I don't have that package named anywhere in my examples).

Here is the class I'm trying to use as a JMX component...


  | package com.foobar.edsf.example.client;
  | 
  | import java.net.URL;
  | 
  | import javax.xml.namespace.QName;
  | import javax.xml.ws.Service;
  | 
  | import org.apache.commons.logging.Log;
  | import org.apache.commons.logging.LogFactory;
  | import org.jboss.annotation.ejb.Management;
  | 
  | import com.foobar.edsf.example.ejb.webservices.Echo;
  | 
  | @org.jboss.annotation.ejb.Service(objectName="examples:service=TestEcho")
  | @Management(ITestEcho.class)
  | public class TestEchoExample implements ITestEcho {
  | 	private static Log log = LogFactory.getLog(TestEchoExample.class);
  | 
  | 	public String echo(String s) {
  | 		String retVal = "Failed";
  | 		try {
  | 				Service service = Service.create(
  | 				new URL("http://localhost:8080/edsf-1-edsf-examples-ejb/EchoBean?wsdl"),
  | 				new QName("http://webservices.ejb.example.edsf.foobar.com/", "EchoBeanService") );
  | 		    Echo echo = service.getPort(Echo.class);
  | 		    retVal = echo.testEchoExample(s);
  | 		    log.info("In TestEcho client. Echo response with call to echo: "+ retVal);
  | 		} catch (Exception e) {
  | 			e.printStackTrace();
  | 			retVal = e.toString();
  | 		}
  | 		return retVal;
  | 	}
  | }
  | [/CODE]

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

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



More information about the jboss-user mailing list