java调用 Myeclipse用jax-ws创建的webservice具体方法(二)

点击start启动tomcat服务器

1 启动服务器后,报如下错误:myeclipse10创建jax-ws方式的webservice(二)
解决方法:在项目的构建路径中加入jax-ws的相关jar包

myeclipse10创建jax-ws方式的webservice(二)

myeclipse10创建jax-ws方式的webservice(二) 
2 出现如下错误信息,表示.apt_generated源码包下没有自动生成jax-ws相应的类,所以提示是否已经用apt生成了。
信息: WSSERVLET12: JAX-WS context listener initializing
2012-3-1 21:58:41 com.sun.xml.ws.transport.http.servlet.WSServletContextListenercontextInitialized
严重: WSSERVLET11: failed to parse runtime descriptor: runtime modeler error: Wrapper class com.test.webservice.jaxws.Add is not found. Have you run APT to generate them?
com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.test.webservice.jaxws.Add is not found. Have you run APT to generate them?
如果生成了,部署到tomcat的项目文件中会在服务类下生成一个jaxws包:

myeclipse10创建jax-ws方式的webservice(二)
对本例而言,jaxws中有如下文件:

myeclipse10创建jax-ws方式的webservice(二)
解决办法:确保构建路径中的source选项卡中选择了.apt_generated,如果还没生成,clean下项目应该就没问题了

3 误删除了自动生成的.apt_generated源码包

When the Feature Pack for Web Services 1.0 facet is enabled, the .apt_generated folder is created in the Web project. If this folder is accidentally deleted, it is automatically restored, but it no longer has the properties of a source folder. Thus, the classes in this folder are not built into the class path for the Web project and ClassNotFound exceptions might occur after the Web project is deployed to the server.

Resolving the problemAfter the folder is deleted, it is not present in the Java™ 2 Platform, Enterprise Edition (J2EE) perspective. Follow these steps to restore the source folder:

解决办法:

1.Open the Resource perspective. You should see the .apt_generated folder, which is automatically regenerated.
2.Open the .settings/org.eclipse.wst.common.component file.
3.From the Source view, delete the following line:
<wb-resource deploy-path="/WEB-INF/classes" source-path="/.apt_generated"/>
4.Right-click the project and select Properties > Java Build Path
5.On the Source tab, add .apt_generated to the list of Source folders.



发布成功后,在浏览器输入:

http://localhost:8100/wsDemo/CounterPort


不要忘记Port

会出现如下界面:

myeclipse10创建jax-ws方式的webservice(二)

至此服务器端编写完毕。下面请看客户端调用此webservice。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值