[jboss-user] [JBossWS] - Re: error using wsprovide

Fantagir do-not-reply at jboss.com
Tue Oct 9 09:51:51 EDT 2007


HI!

I've solved the error before. I execute the wsprovide in the build  directory instead of the build\service directory and change the command like this:

$c:\jboss\wsprovide -t -o generated  -w service. IContar service.Contar

But know I've got another error:
java.lang.NoClassDefFoundError: javax/ejb/Stateless

I don't implement EJB. This could be the problem?

I put here the code of my classes:

IContar
package service;
  | 
  | import java.rmi.Remote;
  | import java.rmi.RemoteException;
  | 
  | import javax.jws.WebMethod;
  | import javax.jws.WebResult;
  | import javax.jws.WebService;
  | import javax.jws.WebParam;
  | 
  | import org.osid.OsidContext;
  | 
  | import util.DatePalabra;
  | 
  | @WebService(
  | 		name="IContar",   // wsdl:portType
  | 		targetNamespace="urn:service" //wsdl:targetNamespace
  | 	   )
  | public interface IContar extends Remote {
  | 	
  | 	@WebMethod
  | 	@WebResult(name="IContar_darCuentaResponse")
  | 	public DatePalabra darCuenta(@WebParam(name = "ctx", partName ="ctx") OsidContext ctx) throws RemoteException;
  | }
  | 
  | 


Contar

package service;

import java.rmi.RemoteException;

import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

import org.osid.OsidContext;
import org.osid.OsidException;

import util.DatePalabra;

@WebService(
		serviceName="Contar",   // wsdl:service
		portName= "IContarPort", //wsdl:port name=... binding=...
		endpointInterface = "service.IContar", //nombre de la interficie del WebService
		targetNamespace="urn:service", //wsdl:targetNamespace
		wsdlLocation = "WEB-INF/wsdl/Contar.wsdl"  //nombre y ubicación en el proyecto del fichero .wsdl
			)
@SOAPBinding(
		style=SOAPBinding.Style.RPC,
		use=SOAPBinding.Use.LITERAL
			)
public class Contar implements IContar{

	public DatePalabra darCuenta(OsidContext ctx) throws RemoteException {
		DatePalabra dp = new DatePalabra();
		
		try {
			String str = (String) ctx.getContext("iduser");
			dp.setPalabra(str);
			dp.setLongitud(Integer.toString(str.length()));
			return dp;
		} catch (OsidException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			dp.setLongitud("0");
			dp.setPalabra("vacio");
			return dp;
		}
		
	}

}



Thanks

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

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




More information about the jboss-user mailing list