简体   繁体   English

Glassfish 2.11未在管理控制台中显示webservices

[英]Glassfish 2.11 is not showing webservices in the admin console

I am running glassfish 2.1.1 with openesb. 我用openesb运行glassfish 2.1.1。 I have a problem in that my web services are running correctly, but it is a requirement that the web service be registered in glassfish admin console. 我的问题在于我的Web服务正常运行,但要求在glassfish管理控制台中注册Web服务。 Unfortunately the admin console is not showing any of my web services. 不幸的是,管理控制台没有显示我的任何Web服务。 To clarify, when selecting "Web Services" in navigation the pane on the right shows "No Items Found" but the services are running just fine. 为了澄清,在导航中选择“Web服务”时,右侧窗格显示“找不到项目”,但服务运行正常。 I am completely at a loss on how to even troubleshoot this issue. 我完全不知道如何解决这个问题。 I have turned on finest logging but do not see anything that would help me identify this problem. 我打开了最好的日志,但没有看到任何可以帮助我识别这个问题的东西。 My project is a simple war application and I am not using any ejb's. 我的项目是一个简单的战争应用程序,我没有使用任何ejb。

Web.xml 在web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <listener>
        <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>ConsolidatedWS</servlet-name>
        <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>ConsolidatedWS</servlet-name>
        <url-pattern>/ConsolidatedWS</url-pattern>
    </servlet-mapping>
  <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>

Web Service 网络服务

@SchemaValidation(handler= SchemaValidationHandler.class)
@WebService(serviceName = "ConsolidatedWS", targetNamespace = "http://consolidatedapi/1.0", endpointInterface = "com.ConsolidatedWS")
@HandlerChain(file="/META-INF/SoapHandlerChain.xml")
public class ConsolidatedWSImpl implements ConsolidatedWS {

    @Override
    public CreateConsolidatedOrderResponse createConsolidatedOrder(ConsolidatedOrder order) {
        return new CreateConsolidatedOrderResponse();
    }
}

sun-jaxws.xml 太阳jaxws.xml

<?xml version="1.0" encoding="UTF-8"?>
<endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">
  <endpoint implementation="com.ConsolidatedWSImpl" name="ConsolidatedWS" url-pattern="/ConsolidatedWS"/>
</endpoints>

I think I figured it out, it was a combination of a couple of things. 我想我想出来了,这是几件事的结合。 Thanks to Paul because my web.xml now does not have the listener and servlets. 感谢Paul,因为我的web.xml现在没有监听器和servlet。

  1. I made the metro webservices-rt provided because this may have been messing with the Glassfish metro implementation. 我提供了metro webservices-rt,因为这可能会搞乱Glassfish的地铁实施。

     <dependency> <groupId>org.glassfish.metro</groupId> <artifactId>webservices-rt</artifactId> <version>2.1</version> <scope>provided</scope> </dependency> 
  2. As Paul recommended I removed the servlet mappings and listeners 正如保罗建议我删除了servlet映射和监听器

web.xml web.xml中

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>   

sun-javaws.xml 太阳javaws.xml

<?xml version="1.0" encoding="UTF-8"?>
<endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">
 </endpoints>

sun-web.xml sun-web.xml中

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
<sun-web-app error-url="">
    <context-root>/consolidated-api</context-root>  
    <class-loader delegate="true"/>
    <jsp-config>
        <property name="keepgenerated" value="true">
            <description>Keep a copy of the generated servlet class' java code.</description>
        </property>
    </jsp-config>
</sun-web-app>

I was facing the same issue with Glassfish 5. I removed web.xml from my project, built the application again, ran the server and it started showing as Webservice application on Glassfish console. 我遇到了与Glassfish 5相同的问题。我从我的项目中删除了web.xml ,再次构建了应用程序,运行了服务器,它开始在Glassfish控制台上显示为Webservice应用程序。

默认glassfish xml

Glassfish控制台截图

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

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