最近在研究webservice,利用jdk来实现简单的webservice发布,但是运行时却发生了这样的异常,如下:

Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class webservice.jaxws.SayHi is not found. Have you run APT to generate them?
 at com.sun.xml.internal.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:256)
 at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:567)
 at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:514)
 at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:341)
 at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:227)
 at com.sun.xml.internal.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:308)
 at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:174)
 at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
 at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:439)
 at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
 at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:138)
 at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:90)
 at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
 at webservice.Test.main(Test.java:8)

最后发现原来是jdk的版本过低,我使用的是jdk1.6.10,而最低要求为1.6.22以上即可,故特此记录下来,谨防再次出错

另外,此种发布方法如下:

第一步:定义接口HelloWorld

package webservice;

import javax.jws.WebService;

@WebService public interface HelloWorld {

  String sayHi(String str);

}

第二步:实现类HelloWorldImpl

package webservice;

import javax.jws.WebService;

import javax.xml.ws.Endpoint;

@WebService(endpointInterface = "webservice.HelloWorld")

public class HelloWorldImpl implements HelloWorld {

  public String sayHi(String str) {

    System.out.println("我是webservice");

    return "Hello ," + str;

  }

   public static void main(String[] args) {

       Endpoint.publish("http://localhost:8088/hello", new HelloWorldImpl());

   }

}

第三步:运行HelloWorldImpl.java main方法

第四步:在浏览器地址栏输入:http://localhost:8088/hello?wsdl

第五步:查看响应xml文件:如成功返回如下:

 
 由

Wrapper class webservice.jaxws.SayHi is not found. Have you run APT to generate them?的更多相关文章

  1. Wrapper class package.jaxws.methodName is not found. Have you run APT to generate them?解决方案

    使用JAX-WS 2.X基于Web容器发布WebService报错,错误信息类似于: Wrapper class package.jaxws.methodName is not found. Have ...

  2. 调用webservice客户端方法 runtime modeler error: Wrapper class ××× is not found. Have you run APT to generate them?

    用wsimport生成webservice的客户端以后,调用客户端生成方法时总是出现 runtime modeler error: Wrapper class stardand.nrcms.nckin ...

  3. WebService:JAX-WS实现WebService

    WebService和Java核心技术中的RMI一样用于实现异构平台上的应用程序之间数据的交互,唯一不同的是这样的技术屏蔽了语言之间的差异.这也是其大行其道的原因. 实现WebService的技术多种 ...

  4. 使用Mulesoft建立webservice, jax-ws方式, wsdl first

    先创建wsdl,然后生成class 1. 下载 HRData.xsd 和 HRDataService.wsdl http://yunpan.cn/Q4zBXC4fvC74xhttp://yunpan. ...

  5. webservice jaxws header验证

    @WebService @HandlerChain public class UserService { ... } package com.xx.ws.header; import org.w3c. ...

  6. JAVA6开发WebService (一)

    转载自http://wuhongyu.iteye.com/blog/807470 WebService是SOA的一种较好的实现方式,它将应用程序的不同功能单元通过中立的契约(独立于硬件平台.操作系统和 ...

  7. JDK 1.6 写Webservice时,runtime modeler error: Wrapper class com.ws.jaxws.DoSomething is not found问题的解决办法

    转自:http://blog.csdn.net/forandever/article/details/5276038 1.问题如下: Exception in thread "main&qu ...

  8. Java WebService 简单实例

    前言:朋友们开始以下教程前,请先看第五大点的注意事项,以避免不必要的重复操作. 一.准备工作(以下为本实例使用工具) 1.MyEclipse10.7.1 2.JDK 1.6.0_22 二.创建服务端 ...

  9. Java WebService 简单实例[转]

    http://www.cnblogs.com/yisheng163/p/4524808.html?utm_source=tuicool 前言:朋友们开始以下教程前,请先看第五大点的注意事项,以避免不必 ...

随机推荐

  1. java中常量接口及实现常量接口的利与弊

    在所做的项目中,将程序中很多要用的常量放置在ServiceConstants的接口中,称其为常量接口,只要实现该接口,就可以 在项目中直接使用常量接口中的常量,通过上网搜索之后,将很好的两篇博客链接储 ...

  2. 用jQuery实现ajax总结以及跨域问题

    本文为作者原创,未经博主允许,不可转载 ajax请求的常用的参数设置: type:请求类型,"POST","GET",默认为geturl:发送请求的地址data ...

  3. LCA离线算法Tarjan详解

    离线算法也就是需要先把所有查询给保存下来,最后一次输出结果. 离线算法是基于并查集实现的,首先就是初始化P[i] = i. 接下来对于每个点进行dfs: ①首先判断是否有与该点有关的查询,如果当前该点 ...

  4. ASP.NET MVC 中使用Ckeditor4.5 编辑器

    一.在项目中添加Ckeditor4.5.11 (1) 新建 ASP.NET MVC5项目,解压缩ckeditor_4.5.11_standard.zip,在VS2015的解决方案资源管理器中将得到的“ ...

  5. Java中的垃圾回收机制

    1. 垃圾回收的意义 在C++中,对象所占的内存在程序结束运行之前一直被占用,在明确释放之前不能分配给其它对象:而在Java中,当没有对象引用指向原先分配给某个对象的内存时,该内存便成为垃圾.JVM的 ...

  6. python 集合元素添加

    #A new empty set color_set = set() color_set.add("Red") print(color_set) #Add multiple ite ...

  7. Python day13文件的读写

    # 文件操作 f=open("E:\\1.txt",encoding="GBK")#打开文件 print(f.writable())#是否可写 print(f. ...

  8. SqlServer和Oracle判断表和列是否存在

    SqlServer .判断表Users是否存在 if object_id(N'Users',N'U') is not null print '存在' else print '不存在' .判断表User ...

  9. html css 伪样式

    伪类的分类及作用: 引自W3School教程伪元素的分类及作用: 这里就不进行多的描述,原文地址:http://www.it165.net/design/html/201406/2643.html

  10. English trip -- VC(情景课)1 D

    Read 阅读 Welcome! Meet our new student. His first name is Ernesto.  欧内斯托 His last name is Delgado. 德尔 ...