2017-05-18 11 views
0

私はEARをIBM WAS 8.5に配備しています MavenでビルドするときやWASにデプロイするときに問題はありませんでした。コンテキストの初期化に失敗しました - 自動従属依存のインジェクションが失敗しました

しかし、アプリケーションにアクセスしようとすると、例外が発生します。

私がログを掘ったとき、私は以下のトレースを見て、私に手がかりを与えません。

私には手がかりがありません。どうしたらいいですか。 依存関係の競合がないかどうかを確認しましたが、いずれもありませんでした。

[5/18/17 10:57:47:392 EDT] 0000022c SystemOut  O 2017-05-18 10:57:47 ERROR DispatcherServlet:492 - Context initialization failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dealerController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.mbusa.nseai.services.dealer.service.DealerService com.mbusa.nseai.services.dealer.controllers.DealerController.dealerService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dealerService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.mbusa.nseai.services.dealer.dao.DealerDao com.mbusa.nseai.services.dealer.service.impl.DealerServiceImpl.dealerDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dealerDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.mbusa.nseai.services.dealer.dao.impl.AbstractDao.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/nseaiws-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index; 
    at 
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.mbusa.nseai.services.dealer.service.DealerService com.mbusa.nseai.services.dealer.controllers.DealerController.dealerService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dealerService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.mbusa.nseai.services.dealer.dao.DealerDao com.mbusa.nseai.services.dealer.service.impl.DealerServiceImpl.dealerDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dealerDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.mbusa.nseai.services.dealer.dao.impl.AbstractDao.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/nseaiws-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index; 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508) 
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) 
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) 
    ... 39 more 

私をご案内ください。

のpom.xml:

<properties> 
    <java-version>1.6</java-version> 
    <org.springframework-version>4.0.5.RELEASE</org.springframework-version> 
    <org.aspectj-version>1.7.4</org.aspectj-version> 
    <org.slf4j-version>1.7.5</org.slf4j-version> 
    <hibernate.version>4.3.10.Final</hibernate.version> 
    <jackson.databind-version>2.2.3</jackson.databind-version> 
    <version.was>8.5</version.was> 
</properties> 
<repositories> 
    <repository> 
     <id>ProjectRepo</id> 
     <name>ProjectRepo</name> 
     <url>file://${project.basedir}/lib</url> 
    </repository> 
</repositories> 
<dependencies> 
    <!-- Spring JDBC Support --> 
    <dependency> 
     <groupId>com.mbusa</groupId> 
     <artifactId>mefeai</artifactId> 
     <version>1.0.3</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>${org.springframework-version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
     <version>${org.springframework-version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-oxm</artifactId> 
     <version>${org.springframework-version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-orm</artifactId> 
     <version>${org.springframework-version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.json</groupId> 
     <artifactId>json</artifactId> 
     <version>20090211</version> 

    </dependency> 
    <dependency> 
     <groupId>net.sf.json-lib</groupId> 
     <artifactId>json-lib-ext-spring</artifactId> 
     <version>1.0.2</version> 
    </dependency> 

    <!-- Caching --> 

    <dependency> 
     <groupId>net.sf.ehcache</groupId> 
     <artifactId>ehcache</artifactId> 
     <version>2.8.3</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context-support</artifactId> 
     <version>4.0.5.RELEASE</version> 
    </dependency> 

    <!-- Caching --> 
    <!-- Hibernate --> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>${hibernate.version}</version> 
    </dependency> 


    <!-- Hibernate --> 
    <!-- Jackson --> 
    <dependency> 
     <groupId>com.fasterxml.jackson.core</groupId> 
     <artifactId>jackson-databind</artifactId> 
     <version>${jackson.databind-version}</version> 
    </dependency> 
    <!-- Spring --> 


    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>${org.springframework-version}</version> 
     <exclusions> 
      <!-- Exclude Commons Logging in favor of SLF4j --> 
      <exclusion> 
       <groupId>commons-logging</groupId> 
       <artifactId>commons-logging</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency>  

    <!-- AspectJ --> 
    <dependency> 
     <groupId>org.aspectj</groupId> 
     <artifactId>aspectjrt</artifactId> 
     <version>${org.aspectj-version}</version> 
    </dependency> 

    <!-- Logging --> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>${org.slf4j-version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>jcl-over-slf4j</artifactId> 
     <version>${org.slf4j-version}</version> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-log4j12</artifactId> 
     <version>${org.slf4j-version}</version> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <version>1.2.15</version> 
     <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> 
     <scope>compile</scope> 
    </dependency> 

    <!-- @Inject --> 
    <dependency> 
     <groupId>javax.inject</groupId> 
     <artifactId>javax.inject</artifactId> 
     <version>1</version> 
    </dependency> 

    <!-- Servlet --> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>servlet-api</artifactId> 
     <version>2.5</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.servlet.jsp</groupId> 
     <artifactId>jsp-api</artifactId> 
     <version>2.1</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
    </dependency> 


    <dependency> 
     <groupId>com.mbusa.nseai</groupId> 
     <artifactId>NSEAIMS</artifactId> 
     <version>1.0</version> 
    </dependency> 
    <!-- Test --> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.7</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>com.ibm.websphere</groupId> 
     <artifactId>runtime</artifactId> 
     <version>${version.was}</version> 
     <scope>system</scope> 
     <systemPath>C:\Maven_Custom_Lib\com.ibm.ws.runtime.jar</systemPath> 
    </dependency> 

</dependencies> 

<build> 

<finalName>nseaiws</finalName> 
<!-- Filter configuration start --> 
<filters> 
    <filter>${basedir}/src/main/filters/config-${env}.properties</filter> 
    </filters> 
    <resources> 
    <resource> 
     <directory>${basedir}/src/main/resources</directory> 
     <filtering>true</filtering> 
    </resource> 


    </resources> 

    <!-- Filter configuration end --> 


    <plugins> 
     <plugin> 
      <artifactId>maven-eclipse-plugin</artifactId> 
      <version>2.9</version> 
      <configuration> 
       <additionalProjectnatures> 
        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> 
       </additionalProjectnatures> 
       <additionalBuildcommands> 
        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand> 
       </additionalBuildcommands> 
       <downloadSources>true</downloadSources> 
       <downloadJavadocs>true</downloadJavadocs> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.5.1</version> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
       <compilerArgument>-Xlint:all</compilerArgument> 
       <showWarnings>true</showWarnings> 
       <showDeprecation>true</showDeprecation> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>exec-maven-plugin</artifactId> 
      <version>1.2.1</version> 
      <configuration> 
       <mainClass>org.test.int1.Main</mainClass> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.1.1</version> 
      <configuration> 
       <webResources> 
         <resource> 
          <filtering>true</filtering> 
          <directory>src/main/webapp</directory> 
          <includes> 
          <include>**/*.xml</include> 
          <!-- include any other file types you want to filter --> 
          </includes> 
         </resource> 
         </webResources>      
      </configuration> 
     </plugin> 
    </plugins> 
+0

がJaiwo99 @あなたの '/ WEB-INF/nseaiws-servlet.xml' – Jaiwo99

+0

を投稿私が評判未満10 :( – user7391890

+0

を持っているように私は、コードの2つのブロックを掲示させないことだ:

この依存関係を追加少なくともセッション定義の定義を投稿してください。 – Jaiwo99

答えて

0

ログがjava.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Indexを言いますが、あなたが休止状態4.3以降を使用していると仮定すると、あなたのクラスパスにJPA 2.0を持っているようだ、解決すべき、あなたがクラスパス上JPA 2.1を持っていることを確認してください。あなたの問題。

<dependency> 
    <groupId>org.hibernate.javax.persistence</groupId> 
    <artifactId>hibernate-jpa-2.1-api</artifactId> 
    <version>1.0.0.Final</version> 
</dependency> 
+0

お願いします。私を助けてください。 – user7391890

+0

試してみてください – user7391890

+0

まだ同じエラーがあります:( – user7391890

関連する問題