java webservice 注解_一个类上的@WebService和@Transactional注释

我有一个Transnational类,我想启用Web服务:

我试过了:

@WebService(serviceName = "searchSth")

@Transactional

public class A{

public Sth getSth(){

do sth here...

}

}

但我努力工作,我也尝试过:

@WebService(serviceName = "searchSth")

public class B{

private A a;

public seta(A a){

this.a =a;

}

public Sth getSth(){

a.getSth();

}

}

@Transactional

public class A{

public Sth getSth(){

do sth here...

}

}

当我运行它时,我得到:

线程“main”org.springframework.beans.factory.BeanCreationException中的异常:在类路径资源[remote-application.xml]中定义名称为'cre-remoting'的bean时出错:init方法的调用失败;嵌套异常是java.lang.IllegalArgumentException:类com.sun.proxy . $ Proxy22在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1589)既没有@WebService也没有@WebServiceProvider批注 . springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554)位于org.springframework.beans.factory.support的org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) . 位于org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java)的org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)中的AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:306) :302)org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)位于org.springframework.context.support.AbstractApplicationContext的org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759)位于org.springframework.context.support.ClassPathXmlApplicationContext . (ClassPathXmlApplicationContext.java:139)的.refresh(AbstractApplicationContext.java:542)位于com.mycompany的org.springframework.context.support.ClassPathXmlApplicationContext . (ClassPathXmlApplicationContext.java:83) . crmproject.server.RmiServer.main(RmiServer.java:18)引起:java.lang.IllegalArgumentException:类com.sun.proxy . $ Proxy22在com.sun.xml.internal.ws上既没有@WebService也没有@WebServiceProvider注释.server.EndpointFactory.verifyImplementorClass(EndpointFactory.java:424)at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.getPrimaryWsdl(EndpointImpl.java) :367)com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:315)at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish (EndpointImpl.java:231)位于org.springframework的org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter.publishEndpoint(SimpleJaxWsServiceExporter.java:68)org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter.publishEndpoints(AbstractJaxWsServiceExporter.java:171) . 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean的org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1648)中的remoting.jaxws.AbstractJaxWsServiceExporter.afterPropertiesSet(AbstractJaxWsServiceExporter.java:142) AbstractAutowireCapableBeanFactory.java:1585)......还有12个

有什么办法可以解决吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值