java - Exception on create JaxWsServerFactoryBean -


i have old maven project , need add clien-server module project.

i added dependencies:

  • cxf-rt-frontend-jaxws
  • cxf-rt-transports-http-jetty

after created next classes testing:

// ihelloworld.java  import javax.jws.webparam; import javax.jws.webservice;  @webservice public interface ihelloworld {   string sayhi(@webparam(name="text") string text); } 

and

// helloworldimpl.java  import javax.jws.webservice;  @webservice public class helloworldimpl implements ihelloworld {   public string sayhi(string name) {     system.out.println("sayhello called " + name);     return "hello " + name;   } } 

and

// server.java  import org.apache.cxf.jaxws.jaxwsserverfactorybean;  public class server {   public static void runserver(){     ihelloworld helloworld = new helloworldimpl();     jaxwsserverfactorybean factory = new jaxwsserverfactorybean();     factory.setserviceclass(ihelloworld.class);     factory.setaddress("http://localhost:9000/helloworld");     factory.setservicebean(helloworld);     factory.create();   } } 

and

// runsever.java public class runserver {   public static void main(string[] args) {     server.runserver();   } } 

after tried start server, code throw next exception on line factory.create();:

exception in thread "main" java.lang.arrayindexoutofboundsexception: 2     @ org.apache.cxf.ws.policy.policyannotationlistener.handleevent(policyannotationlistener.java:112)     @ org.apache.cxf.service.factory.abstractservicefactorybean.sendevent(abstractservicefactorybean.java:72)     @ org.apache.cxf.frontend.abstractwsdlbasedendpointfactory.createbindinginfo(abstractwsdlbasedendpointfactory.java:345)     @ org.apache.cxf.jaxws.jaxwsserverfactorybean.createbindinginfo(jaxwsserverfactorybean.java:179)     @ org.apache.cxf.frontend.abstractwsdlbasedendpointfactory.createendpointinfo(abstractwsdlbasedendpointfactory.java:252)     @ org.apache.cxf.frontend.abstractwsdlbasedendpointfactory.createendpoint(abstractwsdlbasedendpointfactory.java:147)     @ org.apache.cxf.frontend.serverfactorybean.create(serverfactorybean.java:159)     @ org.apache.cxf.jaxws.jaxwsserverfactorybean.create(jaxwsserverfactorybean.java:205)     @ experiment.server.runserver(server.java:18)     @ experiment.runserver.main(runserver.java:7) 

i tried create new clean maven project same dependencies , server classes , worked without problem. problem can in old project?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -