首页 > 解决方案 > 无法部署 Intellij 项目

问题描述

我基本上是在 Intellij 上运行一个 Java Web 应用程序,当我尝试部署和运行它时它运行良好。

当我从源代码管理中提取同事的代码以获取最新更改时,我无法启动我的项目并引发此错误:

 Artifact Application:ear exploded: java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while deploying the app [Application-9.7.0] : Servlet [RegistrationCoordinatorPortTypePortImpl] and Servlet [RegistrationRequesterPortTypePortImpl] have the same url pattern: [/RegistrationService_V10]. Related annotation information: annotation [@javax.jws.WebService(wsdlLocation=/wsdls/wsc10/wscoor.wsdl, targetNamespace=http://schemas.xmlsoap.org/ws/2004/10/wscoor, name=, endpointInterface=com.sun.xml.ws.tx.coord.v10.types.RegistrationRequesterPortType, portName=RegistrationRequesterPortTypePort, serviceName=RegistrationService_V10)] on annotated element [class com.sun.xml.ws.tx.coord.v10.endpoint.RegistrationRequesterPortTypePortImpl] of type [TYPE]. Please see server.log for more details.

在 Glassfish 日志中,它说:

Caused by: java.lang.IllegalArgumentException: Servlet [RegistrationCoordinatorPortTypePortImpl] and Servlet [RegistrationRequesterPortTypePortImpl] have the same url pattern: [/RegistrationService_V10]
    at org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl.addWebComponentDescriptor(WebBundleDescriptorImpl.java:362)
    at org.glassfish.webservices.connector.annotation.handlers.WebServiceHandler.processAnnotation(WebServiceHandler.java:461)
    at com.sun.enterprise.deployment.annotation.factory.SJSASFactory$LazyAnnotationHandler.processAnnotation(SJSASFactory.java:148)
    at org.glassfish.apf.impl.AnnotationProcessorImpl.process(AnnotationProcessorImpl.java:350)
    ... 60 more
]]

我已经在这个线程中查看了其他有类似问题的人,但它不适用于我的情况。更重要的是,为什么会发生这种情况?

这个问题的原因是什么,我该如何解决它或看什么?

标签: javaintellij-idea

解决方案


从堆栈跟踪看起来您有两个具有相同路径的 servlet:

"/RegistrationService_V10"

此类错误只能在运行时出现。通常,您的路径在整个项目中应该是不同的。


推荐阅读