4

두 개의 모듈이 포함 된 Maven 프로젝트 "엔터프라이즈 응용 프로그램"이 있습니다. 첫 번째 모듈은 도메인, dao 및 비즈니스 계층이 포함 된 표준 Java 응용 프로그램입니다. 두 번째 모듈은 "java 웹 응용 프로그램"입니다. 여기 구성은 지금까지 설정 : - 표준 자바 애플리케이션 모듈 : 메인 클래스엔터프라이즈 응용 프로그램에서 스프링 부트 모듈 배포 : ImportManagementConfigurationSelector 인터페이스를 ImportSelector 인터페이스에 할당 할 수 없습니다.

:

@SpringBootApplication 
public class MobilepaymentDao { 
    public static void main(String[] args) { 
    SpringApplication.run(MobilepaymentDao.class, args); 
    } 

} 

의 pom.xml

<parent> 
     <groupId>com.nhit.dev</groupId> 
     <artifactId>mobilepayment</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 

    <groupId>com.nhit.dev</groupId> 
    <artifactId>mobilepayment-dao</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>mobilepayment-dao</name> 
    <description>Demo project for Spring Boot</description> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
     <java.version>1.8</java.version> 
    </properties> 

    <dependencies> 
     <!-- Spring --> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-data-jpa</artifactId> 
      <exclusions> 
       <exclusion> 
        <groupId>dom4j</groupId> 
        <artifactId>dom4j</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.postgresql</groupId> 
      <artifactId>postgresql</artifactId> 
         <scope>runtime</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
     <!-- JBehave --> 
     <dependency> 
      <groupId>org.jbehave</groupId> 
      <artifactId>jbehave-core</artifactId> 
      <version>4.0.5</version> 
     </dependency> 
     <dependency> 
      <groupId>org.jbehave</groupId> 
      <artifactId>jbehave-spring</artifactId> 
      <version>4.0.5</version> 
     </dependency> 
     <dependency> 
      <groupId>dom4j</groupId> 
      <artifactId>dom4j</artifactId> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.springframework.cloud</groupId> 
       <artifactId>spring-cloud-dependencies</artifactId> 
       <version>Brixton.SR5</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <build> 
     <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <configuration> 
       <executable>true</executable> 
       <classifier>exec</classifier> 
      </configuration> 
     </plugin> 
     <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <version>2.6</version> 
       <executions> 
        <execution> 
         <phase>validate</phase> 
         <goals> 
          <goal>copy</goal> 
         </goals> 
         <configuration> 
          <outputDirectory>${endorsed.dir}</outputDirectory> 
          <silent>true</silent> 
          <artifactItems> 
           <artifactItem> 
            <groupId>javax</groupId> 
            <artifactId>javaee-endorsed-api</artifactId> 
            <version>7.0</version> 
            <type>jar</type> 
           </artifactItem> 
          </artifactItems> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
</project> 
  • 자바 웹 애플리케이션 모듈 메인 클래스

    @SpringBootApplication (제외 = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class}) 공용 클래스 MobilepaymentApplication은 SpringBootServletInitializer를 확장합니다. { public static void main (String [] args) { SpringApplication.run (MobilepaymentApplication.class, args); System.out.println ("dans le main");

     } 
         @Override 
         protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 
          return application.sources(applicationClass); 
         } 
    
         private static Class<MobilepaymentApplication> applicationClass = MobilepaymentApplication.class; 
        } 
    

의 pom.xml

<parent> 
     <groupId>com.nhit.dev</groupId> 
     <artifactId>mobilepayment</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 

    <groupId>com.nhit.dev</groupId> 
    <artifactId>mobilepayment-web</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>war</packaging> 

    <name>mobilepayment-web</name> 

    <properties> 
     <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
      <exclusions> 
       <exclusion> 
        <groupId>org.apache.tomcat.embed</groupId> 
        <artifactId>tomcat-embed-core</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>org.apache.tomcat.embed</groupId> 
        <artifactId>tomcat-embed-websocket</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-tomcat</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.cxf</groupId> 
      <artifactId>cxf-rt-frontend-jaxws</artifactId> 
      <version>3.1.7</version> 
      <exclusions> 
       <exclusion> 
        <groupId>org.apache.cxf</groupId> 
        <artifactId>cxf-core</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>org.apache.cxf</groupId> 
        <artifactId>cxf-rt-bindings-soap</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>org.apache.cxf</groupId> 
        <artifactId>cxf-rt-bindings-xml</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.cxf</groupId> 
      <artifactId>cxf-rt-transports-http</artifactId> 
      <version>3.1.7</version> 
      <exclusions> 
       <exclusion> 
        <groupId>org.apache.cxf</groupId> 
        <artifactId>cxf-core</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
      <version>2.5</version> 
     </dependency> 
     <dependency> 
      <groupId>${project.groupId}</groupId> 
      <artifactId>mobilepayment-dao</artifactId> 
      <version>${project.version}</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.cxf</groupId> 
      <artifactId>cxf-rt-bindings-xml</artifactId> 
      <version>3.1.7</version> 
      <!--   <scope>provided</scope>--> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.cxf</groupId> 
      <artifactId>cxf-rt-bindings-soap</artifactId> 
      <version>3.1.7</version> 
      <!--   <scope>provided</scope>--> 
     </dependency> 
     <dependency> 
      <groupId>javax</groupId> 
      <artifactId>javaee-web-api</artifactId> 
      <version>7.0</version> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.6</version> 
      <executions> 
       <execution> 
        <phase>validate</phase> 
        <goals> 
         <goal>copy</goal> 
        </goals> 
        <configuration> 
         <outputDirectory>${endorsed.dir}</outputDirectory> 
         <silent>true</silent> 
         <artifactItems> 
          <artifactItem> 
           <groupId>javax</groupId> 
           <artifactId>javaee-endorsed-api</artifactId> 
           <version>7.0</version> 
           <type>jar</type> 
          </artifactItem> 
         </artifactItems> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
</plugins> 
    </build> 

</project> 

- 엔터프라이즈 애플리케이션 모듈 (된 .ear) 의 pom.xml

<parent> 
     <artifactId>mobilepayment</artifactId> 
     <groupId>com.nhit.dev</groupId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 
    <groupId>com.nhit.dev</groupId> 
    <artifactId>mobilepayment-ear</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>ear</packaging> 
    <name>mobilepayment-ear</name> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 
     <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.1</version> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-ear-plugin</artifactId> 
       <version>2.8</version> 
       <configuration> 
        <version>6</version> 
        <defaultLibBundleDir>lib</defaultLibBundleDir> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
    <dependencies> 
     <dependency> 
      <groupId>com.nhit.dev</groupId> 
      <artifactId>mobilepayment-dao</artifactId> 
      <version>0.0.1-SNAPSHOT</version> 
      <type>jar</type> 
     </dependency> 
     <dependency> 
      <groupId>com.nhit.dev</groupId> 
      <artifactId>mobilepayment-web</artifactId> 
      <version>0.0.1-SNAPSHOT</version> 
      <type>war</type> 
     </dependency> 
    </dependencies> 
</project> 

- 멀티 모듈 Maven 프로젝트 : pom.xml

내가 실행을 클릭하여 넷빈즈에서 엔터프라이즈 응용 프로그램 프로젝트를 배포 411,, 나는이 예외를 얻을 :

Deploying C:\wildfly-10.0.0.Final\standalone\deployments\mobilepayment-ear-0.0.1-SNAPSHOT.ear 
{"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./mobilepayment-web" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./mobilepayment-web: java.lang.RuntimeException: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$TransactionManagementConfiguration]; nested exception is java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector 
    Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$TransactionManagementConfiguration]; nested exception is java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector 
    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$TransactionManagementConfiguration]; nested exception is java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector 
    Caused by: java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector"}} 
+0

에서 거래에 관련된 일을 사용하지 않기 때문에 내 응용 프로그램에서 같은 오류가 있음을 적용했다. 해결책을 찾았습니까? 그렇다면 답변으로 게시하십시오. – sola

답변

0

그것은 꽤 오래지만 난 그냥 같은 문제를 가로 질러 와서 내가

을 추가하여 해결책을 발견
@EnableAutoConfiguration(exclude = {TransactionAutoConfiguration.class} 

는하지만 난 내 응용 프로그램