2014-03-26 1 views
1

안녕 내가 글래스 피시 내 응용 프로그램을 배포하고, 이java.lang.IllegalStateException : 서블릿 [ParticipantPortImpl]와 서블릿 [CoordinatorPortImpl] 같은 URL 패턴이 : [/ WSAT11Service]

여기에 위의 오류를주고있다을 웹 로직에서

java.lang.IllegalStateException: Servlet [ParticipantPortImpl] and Servlet [CoordinatorPortImpl] have the same url pattern: [/WSAT11Service]at [email protected] 

at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:487) 

at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:429) 

at com.sun.enterprise.deployment.archivist.WebArchivist.postAnnotationProcess(WebArchivist.java:358) 

at com.sun.enterprise.deployment.archivist.WebArchivist.postAnnotationProcess(WebArchivist.java:89) 

at com.sun.enterprise.deployment.archivist.Archivist.readRestDeploymentDescriptors(Archivist.java:406) 

at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:380) 

그것의 마이그레이션 프로젝트 내가 웹 애플리케이션 폴더에 글래스 피쉬 - web.xml에 추가 글래스 피쉬 할 수있는 스택 트레이스가

내 pom.xml 파일은

012입니다 두 서블릿 (ParticipantPortImpl 및 CoordinatorPortImpl)의 소스 코드에서 3,516,
<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org  /2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<artifactId>projectPartsListWar</artifactId> 
<name>PTL war</name> 
<packaging>war</packaging> 
<parent> 
    <groupId>com.bmw.au</groupId> 
    <artifactId>standardReportingParent</artifactId> 
    <version>1.0.0-SNAPSHOT</version> 
    <relativePath>../standardReportingParent/pom.xml</relativePath> 
</parent> 
<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    <webXmlPath>src/main/webapp/WEB-INF/web_int_prod.xml</webXmlPath> 
    <maven.skippAuthorization.setting>skippAuthorization=false</maven.skippAuthorization.setting> 
    <preassembly.dir>${basedir}/target/preassembly</preassembly.dir> 
    <sonar.dynamicAnalysis>false</sonar.dynamicAnalysis> 
    <sonar.java.source>1.5</sonar.java.source> 
    <sonar.java.target>1.5</sonar.java.target> 
</properties> 
<dependencies> 
    <dependency> 
     <groupId>com.bmw.au</groupId> 
     <artifactId>auReportingCommonsWeb</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>com.bmw.au</groupId> 
     <artifactId>au.core</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>trove</groupId> 
     <artifactId>trove</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.mockito</groupId> 
     <artifactId>mockito-core</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.bea.wls</groupId> 
     <artifactId>wlfullclient</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>${project.groupId}</groupId> 
     <artifactId>projectPartsListEjb</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.sun.facelets</groupId> 
     <artifactId>jsf-facelets</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>javax.faces</groupId> 
     <artifactId>jsf-api</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>commons-collections</groupId> 
     <artifactId>commons-collections</artifactId> 
     <!-- this should be overrided --> 
     <version>3.2.1</version> 
    </dependency> 
    <dependency> 
     <groupId>commons-logging</groupId> 
     <artifactId>commons-logging</artifactId> 
     <!-- this should be overrided --> 
     <version>1.1.1</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.faces</groupId> 
     <artifactId>jsf-impl</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.richfaces.ui</groupId> 
     <artifactId>richfaces-ui</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.richfaces.framework</groupId> 
     <artifactId>richfaces-impl</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>com.bmw.shared.grops</groupId> 
     <artifactId>grops</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>javax.xml</groupId> 
     <artifactId>webservices-api-osgi</artifactId> 
     <version>2.1-b07</version> 
    </dependency> 
    <dependency> 
     <groupId>org.glassfish.metro</groupId> 
     <artifactId>webservices-osgi</artifactId> 
     <version>2.1.1-b07</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax</groupId> 
     <artifactId>javaee-api</artifactId> 
     <version>6.0</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.glassfish.main.extras</groupId> 
     <artifactId>glassfish-embedded-all</artifactId> 
     <version>3.1.2.2</version> 
    </dependency> 
    <dependency> 
     <groupId>javaee</groupId> 
     <artifactId>javaee-api</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.persistence</groupId> 
     <artifactId>eclipselink</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <exclusions> 
      <exclusion> 
       <groupId>javax.mail</groupId> 
       <artifactId>mail</artifactId> 
      </exclusion> 
      <exclusion> 
       <groupId>javax.jms</groupId> 
       <artifactId>jms</artifactId> 
      </exclusion> 
      <exclusion> 
       <groupId>com.sun.jdmk</groupId> 
       <artifactId>jmxtools</artifactId> 
      </exclusion> 
      <exclusion> 
       <groupId>com.sun.jmx</groupId> 
       <artifactId>jmxri</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
</dependencies> 
<profiles> 
    <profile> 
     <id>TEST</id> 
     <properties> 
      <webXmlPath>src/main/webapp/WEB-INF/web.xml</webXmlPath> 
      <maven.skippAuthorization.setting>skippAuthorization=true</maven.skippAuthorization.setting> 
     </properties> 
    </profile> 
    <profile> 
     <id>DEV</id> 
     <properties> 
      <webXmlPath>src/main/webapp/WEB-INF/web.xml</webXmlPath> 
      <maven.skippAuthorization.setting>skippAuthorization=true</maven.skippAuthorization.setting> 
     </properties> 
    </profile> 
</profiles> 
<build> 
    <plugins> 
     <plugin> 
      <!-- Use different web,xml depending on environment. Use profiles to 
       set web.xml to use. Antbuild also sets profile dependeing on environment. --> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <configuration> 
       <webXml>${webXmlPath}</webXml> 
       <webResources> 
        <resource> 
         <!-- copy resources from this folder into the webapp before packaging --> 
         <directory>${preassembly.dir}</directory> 
        </resource> 
       </webResources> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>com.google.code.maven-replacer-plugin</groupId> 
      <artifactId>replacer</artifactId> 
      <version>1.5.2</version> 
      <executions> 
       <execution> 
        <phase>process-classes</phase> 
        <goals> 
         <goal>replace</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <file>${project.build.directory}/classes/au_reporting_web.properties</file> 
       <replacements> 
        <replacement> 
         <token>skippAuthorization=true</token> 
         <value>${maven.skippAuthorization.setting}</value> 
        </replacement> 
       </replacements> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-antrun-plugin</artifactId> 
      <executions> 
       <execution> 
        <!-- do some processing on your resources files --> 
        <phase>process-resources</phase> 
        <configuration> 
         <tasks> 
          <echo message="processing files..." /> 
          <!-- copy the file to be processed --> 
          <property name="preassembly.dir" value="${basedir}/target/preassembly" /> 
          <property name="resourceDir" value="${basedir}/src/main/webapp/templates" /> 
          <property name="resource" value="default-footer.xhtml" /> 
          <copy file="${resourceDir}/${resource}" todir="${preassembly.dir}/templates" /> 
          <ant antfile="./replaceproperties.xml" target="replaceproperties" /> 
         </tasks> 
        </configuration> 
        <goals> 
         <goal>run</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

답변

1

봐. 동일한 URL 패턴을 지정하는 주석이 모두 @WebServlet 개 있다는 것을 알 수 있습니다. 둘 이상의 서블릿을 URL 패턴에 매핑하는 것은 허용되지 않으므로 어느 것을 변경하고 변경해야하는지 파악해야합니다.

2

내가 (잘 나를 위해 일한)이이 문제를 해결할 수 있다고 생각한다

내가 RegistrationService을 포함하는 매우 유사한 오류가 발생했습니다. 원인 제공을 설정하려면 글래스 피쉬 - 임베디드 모든 및 솔루션에 대한 종속성했다

출처 : https://blogs.oracle.com/....

이러한 설정을 시도해보십시오

<dependency> 
    <groupId>org.glassfish.main.extras</groupId> 
    <artifactId>glassfish-embedded-all</artifactId> 
    <version>3.1.2.2</version> 
    <scope>provided</scope> 
</dependency>