2016-03-22 24 views
0
spring 4.1.6.RELEASE maven 
error: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.geekworld.service.AccountService org.geekworld.controller.AccountController.accountService; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.web.servlet.view.velocity.VelocityConfigurer] for bean with name 'velocityConfig' defined in class path resource [spring-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/ui/velocity/VelocityEngineFactory 

XML:NoClassDefFoundError, yay + hız

<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"> 
     <property name="resourceLoaderPath" value="/WEB-INF"/> 
     <property name="configLocation" value="classpath:velocity.properties"/> 
    </bean> 
    <bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver"> 
     <property name="suffix" value=".vm"/> 
     <property name="prefix" value="/"/> 
     <property name="exposeSpringMacroHelpers" value="true"/> 
     <property name="requestContextAttribute" value="content"/> 
     <property name="exposeRequestAttributes" value="true"/> 
     <property name="exposeSessionAttributes" value="true"/> 
     <property name="contentType" value="text/html;charset=UTF-8"/> 
     <property name="dateToolAttribute" value="dateTool"/> 
     <!-- velocity toolbox --> 
     <property name="toolboxConfigLocation" value="/WEB-INF/toolbox.xml"/> 
    </bean> 
+0

'java.lang.NoClassDefFoundError: org/springframework/ui/velocity/VelocityEngineFactory' eklenen kavanozlar var mı? – VinayVeluri

cevap

0
java.lang.NoClassDefFoundError: org/springframework/ui/velocity/VelocityEngineFactory 

kavanoz bağlam yüklenmesi için uygun olmadığını gösterir.

<!-- http://mvnrepository.com/artifact/org.apache.velocity/velocity --> 
    <dependency> 
     <groupId>org.apache.velocity</groupId> 
     <artifactId>velocity</artifactId> 
     <version>1.7</version> 
    </dependency> 

    <!-- http://mvnrepository.com/artifact/org.apache.velocity/velocity-tools --> 
    <dependency> 
     <groupId>org.apache.velocity</groupId> 
     <artifactId>velocity-tools</artifactId> 
     <version>2.0</version> 
    </dependency> 

Lütfen bu bağımlılıkların eklendiğinden emin olun. Ayrıca, vm dosyalarının yüklenmesi ve çalıştırılması için sınıf yolunda olması gerekir.