使用intellij创建webservices项目时,glassfish中的视图端点不可见

时间:2015-10-27 12:19:58

标签: java web-services intellij-idea java-ee-7 glassfish-4.1

我是Java EE的新手,作为我的第一个项目,我根据描述的here方法在Intellij中创建了一个webservices项目。当我运行项目并使用glassfish进行部署并在http://localhost:4848/中查看应用程序时,当我单击部署的应用程序时,我无法在网格模块和组件中看到 view endpoint 链接。知道我的方法可能有什么问题吗?

2 个答案:

答案 0 :(得分:0)

在默认包中添加您的网络服务? 我遇到了同样的问题,当我将Web服务传递给自定义包并重新部署它时,视图端点出现了..

答案 1 :(得分:0)

我今天遇到了同样的问题,但是我使用Eclipse Oxygen和Glassfish 5.0和JDK1.8.0_151:它错过了这个截图底部数组的最后一行:

enter image description here

经过大量的搜索和测试,我发现了一个博客(http://meveekay.blogspot.fr/2016/09/view-endpoint-is-not-available-on.html),提出了以下文件的内容:

WEB-INF / web.xml中

事实上,您只需要更新旧内容。

解释

情况1 :当我根据原型" webapp&#34 ;;从Eclipse Oxygen打开一个新的Maven项目时该项目包含一个较旧的web.xml。内容再次使用DTD进行声明。

Create new Maven project (m2e) from Eclipse Oxygen with webap archetype

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>
</web-app>

情况2 :当我从Eclipse Oxygen打开一个新的JavaEE项目时,web.xml内容使用XML模式进行声明。

最后,今天的好web.xml内容就是这个:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
    http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    id="WebApp_ID" version="3.1">

  <display-name>Archetype Created Web Application</display-name>

</web-app>

&#34; mvn clean install&#34;重新生成war文件,重新部署它并使用&#34;查看端点&#34;来限制该行。链接出现...享受!!!

enter image description here