I'm quite new to CXF so bear with me.
I've tried to follow all guides and examples but I'm still failing with the
most basic task to deploy JAX-WS service on CXF.

I'm using Felix 4.0.1 with these bundles:
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.0.1)
    1|Active     |    1|Distributed OSGi Distribution Software Single-Bundle
Distribution (1.2.0)
    2|Active     |    1|Apache Felix Bundle Repository (1.6.6)
    3|Active     |    1|Apache Felix Gogo Command (0.12.0)
    4|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
    5|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    6|Active     |    1|Apache Felix Http Bundle (2.2.0)
    7|Active     |    1|Apache Felix Web Management Console (3.1.8)

I try to deploy bundle with WebService annotated classes.
The message I get is that there is no WebService annotation present.
/java.lang.IllegalArgumentException: class
org.area51.ws.DoubleItPortTypeImpl has neither @WebSerivce nor
@WebServiceProvider annotation/


Here's the interface/implementation
@WebService 
public interface DoubleItPortType {

    public int doubleIt(@WebParam(name = "number")int numberToDouble);

}

@WebService(serviceName="DoubleItService", 
            endpointInterface="org.area51.ws.DoubleItPortType")
public class DoubleItPortTypeImpl implements DoubleItPortType {

    public int doubleIt(int numberToDouble) {
        return numberToDouble * 2;
    }
}

I'm a bit unsure how to register the endpoint in CXF so I use a
BundleActivator:
public class EndpointActivator implements BundleActivator {

        public void start(BundleContext context) throws Exception {
                String address = "http://localhost:9000/helloWorld";;    
        
System.out.println(DoubleItPortTypeImpl.class.getAnnotation(WebService.class));
                Endpoint.publish(address,  new DoubleItPortTypeImpl());
                System.out.println("Published stuff on ["+address+"]");
        }

        public void stop(BundleContext context) throws Exception {
        }
}

Note that I print the WebService annotation before attempting to publish the
object.
In the log I can see my printout:

g! start file:"c:/dve_env/workspaces/eforge/JAX-WS
OSGi/target/JAX-WS-OSGi-0.0.1-SNAPSHOT.jar"
@javax.jws.WebService(wsdlLocation=, targetNamespace=, name=,
endpointInterface=org.area51.ws.DoubleItPortType, portName=,
serviceName=DoubleItService
)


What am I missing?

--
View this message in context: 
http://cxf.547215.n5.nabble.com/java-lang-IllegalArgumentException-class-xyz-has-neither-WebSerivce-nor-WebServiceProvider-annotation-tp5074774p5074774.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to