最近在研究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. mysql中时间计算函数SQL DATE_SUB()用法

    本文为博主原创,未经允许不得转载: 在写sql的时候,经常要在sql中传值时间,对时间进行计算并过滤.之前都是将时间在后台计算好,直接传值给sql, 今天发现,有一个更方便的sql函数,可以简化很多代 ...

  2. HTTP协议中TCP的三次握手 and HTTPS

    https://www.cnblogs.com/zxh930508/p/5432700.html https://www.cnblogs.com/digdeep/p/4832885.html

  3. 使Apache支持PHP

    1.用记事本打开Apache安装目录下conf文件夹中的httpd.conf文件,找到LoadModule部分的配置代码,在该部分添加下面的代码,将PHP模块加载到Apache服务中,使得Apache ...

  4. Testing Round #12 A,B,C 讨论,贪心,树状数组优化dp

    题目链接:http://codeforces.com/contest/597 A. Divisibility time limit per test 1 second memory limit per ...

  5. shell 脚本拼接

    var21=`echo $vvar|awk -F ',' '{print $1}'` echo $var21 var31=`echo $var21|awk -F ':' '{print $2}'` e ...

  6. Linux 安装iostat命令

    首先跟你的Linux系统有关 我用的是Red hat系统 记录下最快的安装iostat命令的方式 起初想查看iostat, 提示 iostat: command not found 于是,通过yum ...

  7. 解决MVC 时间序列化的方法

    1.全局处理 处理代码 publict static void SetSerializationJsonFormat(HttpConfiguration config) { // Web API co ...

  8. [ios]MKMapView中使用MKPolyline画线

    参考:http://blog.sina.com.cn/s/blog_9e8867eb0101dt76.html 首先在MapView.h中 #import <MapKit/MapKit.h> ...

  9. YOLO V1论文理解

    摘要 作者提出了一种新的物体检测方法YOLO.YOLO之前的物体检测方法主要是通过region proposal产生大量的可能包含待检测物体的 potential bounding box,再用分类器 ...

  10. 2018年全国多校算法寒假训练营练习比赛(第一场)E 恋与程序员

    https://www.nowcoder.com/acm/contest/67/E 思路: dfs 代码: #include<bits/stdc++.h> using namespace ...