Java 7是否包含JAX-WS实现或仅包含API? [英] Does Java 7 include a JAX-WS implementation or just the API?

查看:79
本文介绍了Java 7是否包含JAX-WS实现或仅包含API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我Java 7应该包含JAX-WS,这样我就不需要像Apache CXF中的那些库。但是,官方文档说:

I am told that Java 7 is supposed to include JAX-WS such that I don't need libraries like those in Apache CXF. However, the official docs say:


此版本包含用于XML处理的Java API(JAXP)1.4.5,
支持XML绑定的Java体系结构(JAXB)2.2.3,并支持用于XML Web Services的
Java API (JAX-WS)2.2.4。

This release contains Java API for XML Processing (JAXP) 1.4.5, supports Java Architecture for XML Binding (JAXB) 2.2.3, and supports Java API for XML Web Services (JAX-WS) 2.2.4.

此外,上的JAXWS> Eclipse页面介绍了使用诸如Apache CXF,Sun Metro或Apache Axis之类的实现。我在JAX-WS上找到的每个示例/教程都使用了像CXF或Metro这样的库集。

Further, the Eclipse page on JAX-WS speaks of using implementations such as Apache CXF, Sun Metro, or Apache Axis. And every example/tutorial I can find on JAX-WS uses a library set like CXF or Metro.

我在Eclipse中有一个名为 Endpoint.publish(。 ..)上带有javax.jws.WebService批注的类。下面引用的WSDL文件位于Eclipse外部。该项目在Apache CXF库中运行良好(作为 Java应用程序)。一旦删除它们(以及Eclipse对Apache CXF的引用),它就会崩溃,但出现以下异常:

I have a project in Eclipse that calls "Endpoint.publish(...)" on a class with a javax.jws.WebService annotation. The WSDL file referenced below resides outside Eclipse. This project runs (as a "Java Application") fine with the Apache CXF libraries includes. As soon as I remove them (and Eclipse references to Apache CXF), it crashes with the following exception:

com.sun.xml.internal.ws.server.ServerRtException: [failed to localize] cannot.load.wsdl(http://localhost:8081/wsdl/csw.wsdl)
    at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.getPrimaryWsdl(EndpointImpl.java:313)

所以我要么做错了什么,或者Apache提供了JDK本身仅具有API的功能的实现。请指出是哪种情况,以及指向相关内容的常用链接。

So either I'm doing something wrong or Apache is supplying implementations of things to which the JDK itself only has APIs. Please point out which is the case, along with the usual link to something relevant.

推荐答案

Jdk 7(如6)包括一个

Jdk 7 (like 6) includes a metro based implementation.

您可以从异常中看到,内部实现正在运行 com.sun.xml.internal.ws.transport.http.server.EndpointImpl 。问题似乎是它不喜欢您的WsdlLocation(我相信jaxws期望使用本地资源,但是您给了它一个http资源)。

As you can see from your exception, the internal implementation is running "com.sun.xml.internal.ws.transport.http.server.EndpointImpl". The problem seems to be that it doesn't like your WsdlLocation (i believe jaxws is expecting a local resource, but you have given it a http resource).

这篇关于Java 7是否包含JAX-WS实现或仅包含API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆