简体   繁体   English

不支持基于https协议的地址-javax.xml.ws.Endpoint

[英]https protocol based address is not supported - javax.xml.ws.Endpoint

I'm trying to create a web service independent or Tomcat of any other Application Server, works well with http, but with https I get the error below. 我正在尝试创建一个独立于Web服务或任何其他Application Server的Tomcat,它与http配合良好,但是与https一起出现以下错误。 Seems all the documentation relates either to a client example or application server example. 似乎所有文档都与客户端示例或应用程序服务器示例有关。 A link to a good tutorial would be great. 一个好的教程的链接将是很棒的。

Thanks! 谢谢!

Exception in thread "main" java.lang.IllegalArgumentException: https protocol based address is not supported   
     at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:149)           
     at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:107)            

     at javax.xml.ws.Endpoint.publish(Endpoint.java:181)    

If you used something like 如果您使用类似

Endpoint.publish("https://localhost:9999/abc", new YourEndpoint());

to publish your web service endpoint, and got specified exception - looks like internal JDK web server does not support HTTPS. 发布您的Web服务端点,并得到指定的异常-看起来内部JDK Web服务器不支持HTTPS。

Please refer here for more information: JAX-WS2 and HTTPS . 请参考这里以获取更多信息: JAX-WS2和HTTPS
And this page has Jetty related information, but it is useful as well: Jetty Webservice - https protocol based address is not supported . 并且此页面包含Jetty相关信息,但它也很有用: 不支持Jetty Webservice-基于https协议的地址

If you don't want to mess with "heavy" Tomcat server, you can use something lightweight. 如果您不想弄乱“沉重的” Tomcat服务器,则可以使用轻巧的东西。
These pages have good examples of doing it: Java Webservice using HTTPS part 1 and How to develop a standalone SSL web service . 这些页面提供了很好的示例: 使用HTTPS第1部分的Java Webservice如何开发独立的SSL Web服务

It does not answer question to not use any application server at all, but hope it helps. 根本不使用任何应用程序服务器不会回答问题,但希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM