- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试启动应用程序时,它抛出堆栈跟踪中显示的异常。我正在使用:
我知道 PropertyTypeDescriptor
已从 spring 中删除。但我不知道如何处理这个问题,我从过去两天就陷入了这个困境。请提出建议。
2013-11-19 22:25:17 ERROR TestContextManager:324 - Caught exception
while allowing TestExecutionListener
[org.springframework.test.context.support.DependencyInjectionTestExecutionListener@109cdd5]
to prepare test instance
[test.clickbuff.controller.TestUserController@893f08]
java.lang.IllegalStateException: Failed to load ApplicationContext at
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308)
at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:220) at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:301)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:303)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.context.annotation.internalConfigurationAnnotationProcessor':
Instantiation of bean failed; nested exception is
java.lang.NoClassDefFoundError:
org/springframework/core/convert/support/PropertyTypeDescriptor at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:398)
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:594)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
at
org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
at
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
... 24 more Caused by: java.lang.NoClassDefFoundError:
org/springframework/core/convert/support/PropertyTypeDescriptor at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:960)
... 38 more Caused by: java.lang.ClassNotFoundException:
org.springframework.core.convert.support.PropertyTypeDescriptor at
java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:423) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
java.lang.
ClassLoader.loadClass(ClassLoader.java:356) ... 39 more
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:task="http://www.springframework.org/schema/task" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<import resource="application-config.xml" />
<import resource="spring-database.xml" />
<import resource="Spring-Mail.xml" />
<import resource="spring-security.xml" />
<!--Setting Context Annotation Driven -->
<context:annotation-config />
<!-- Controller's Base package -->
<context:component-scan base-package="training.impetus.tp" />
<!-- Scheduler Annotation Driven -->
<task:annotation-driven />
<!-- Spring MVC Annotation Driven -->
<mvc:annotation-driven />
<!-- Transaction Annotation Driven -->
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- Resource mapping for static resources -->
<mvc:resources mapping="/resources/**" location="/static/" />
<!-- File upload Bean -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
<!-- Transaction Manager -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="dataSource" ref="dataSource" />
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!-- Assigning jobs to scheduler -->
<bean id="schedulerJob" class="training.impetus.tp.scheduler.MailServiceJob"></bean>
<!-- processes PersistenceUnit and PersistenceContext annotations -->
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<!-- View Mapping to MVC -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp" />
</bean>
<!-- Exceptions Mapping to MVC -->
<bean
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="com.javabeat.ExampleException">
ExceptionPage
</prop>
</props>
</property>
<property name="defaultErrorView" value="error" />
</bean>
<!-- Message Resources -->
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>mymessages</value>
</list>
</property>
</bean>
<bean id="payCheckThread" class="training.impetus.tp.scheduler.PayCheckThread" scope="prototype"></bean>
</beans>
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:annotation-config />
<context:component-scan base-package="training.impetus.tp" />
<context:component-scan base-package="training.impetus.tp.controller" />
<bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"></bean>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="jacksonMessageConverter" />
</list>
</property>
</bean>
</beans>
Sprung数据库.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:annotation-config />
<context:component-scan base-package="training.impetus.tp" />
<context:property-placeholder location="classpath:datasource.properties" />
<context:component-scan base-package="training.impetus.tp" />
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${driver}" />
<property name="url" value="${url}" />
<property name="username" value="${user}" />
<property name="password" value="${password}" />
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true" />
<property name="generateDdl" value="true" />
<property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
</bean>
</property>
<property name="persistenceUnitName" value="default"></property>
<property name="dataSource" ref="dataSource" />
</bean>
</beans>
<context:component-scan base-package="training.impetus.tp.controller" />
<bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"></bean>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="jacksonMessageConverter" />
</list>
</property>
</bean>
</beans>
测试用例:
@ContextConfiguration(locations = {"classpath:mvc-config.xml"})
@TransactionConfiguration(defaultRollback = true)
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
public class TestUserController {
@Before
public void setUp() throws Exception {
}
@Test
public void testGetAllUsers() {
fail("Not yet implemented");
}
最佳答案
spring.security.version 3.0.5.RELEASE 依赖于 Spring core 3.0.3 版本。这就是应用程序上下文无法加载的原因。将此升级到更高版本。
您可以通过 https://mvnrepository.com/artifact/org.springframework.security/spring-security-core/3.0.5.RELEASE 进行验证(查找编译器依赖项)
关于java.lang.ClassNotFoundException : org. springframework.core.convert.support.PropertyTypeDescriptor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20077584/
我的应用在尝试访问外部依赖项时遇到 NoClassDefFoundError,但仅限于作为 jar 运行时。 使用 Intellij,我有一个带有主类的简单应用程序,其中包含一些对外部依赖项(例如 s
我收到以下异常: java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.servlet.ResteasyBootstr
我正在尝试使用eclipse和tomcat调试solr4.6源代码。我收到错误消息:HTTP 状态 500 - {msg=SolrCore 'collection1' 由于初始化失败而不可用:[sch
我是新来的,很抱歉我的英语不好;)。 我尝试使用以下代码在 java 中加载插件 jar: package testprogramm; import java.io.File; import java
我重新安装了 ADT Bundle,因为我在更新 eclipse 后遇到了一些问题。 现在,当我想测试我的应用程序时,出现以下异常: 06-05 10:33:35.770: E/AndroidRunt
我浏览过现有的帖子,这些帖子处理在 Eclipse 中的 Tomcat 下运行 Java Web 应用程序的 ClassNotFoundException。 我无法提供源代码和配置 Artifact
我忙于我的应用一个多星期,突然: 11-12 07:59:17.860 1653-1653/nl.test.myapp E/AndroidRuntime﹕ FATAL EXCEPTION: ma
我的应用程序有问题,昨天一切正常,但今天我更新了 sdk,现在当我尝试运行我的应用程序时,出现这样的错误 05-21 00:14:19.285: W/dalvikvm(7061): Unable t
我正在阅读 JPA docs在 Spring ,我正在尝试重组我的代码。 我现在所拥有的: BrewerRepository @Repository public class BrewerReposi
我想像 BalusC's example 一样实现 fileUpload . 不幸的是,我已经在努力声明 servlet。 Extensions Filter javax.faces
在某些机器上运行这个小程序不起作用,但在其他机器上它工作得很好。在所有情况下看起来都安装了 JRE 1.6.0_26。 var attributes = {codebase:'http://kas
我将跟随这个非常简单的教程(http://www.tutorialspoint.com/hadoop/hadoop_mapreduce.htm)一起学习,直到我尝试运行Java文件为止,一切运行良好。
我看到了帖子,并按照流程进行了操作。但这没有用。 ClassNotFoundException, while running example job of Hadoop 请帮助我。 创建的 mapre
我尝试在cloudera quickstart vm上为hadoop运行Mahout Kmeans示例。我在这里读link to clouudera block和这里stack overflow po
我有一个mapreduce程序,其中我使用Hcatalog从Hive表'A'中获取带有HcatInputFormat的详细信息,对其进行处理,然后使用HcatOutput格式将其写回到Hive表'B'
我是激发应用程序编程的新手,因此在这里为这个基本的编程而苦苦挣扎。 我有 scala ide 并附加了来自最新 hadoop 和 spark 发行版的相关 jar 文件。我正在使用的只有一个基本的 s
我正在尝试在本地模式下运行Spark示例,但是正在获取以下堆栈跟踪: Exception in thread "main" java.lang.NoClassDefFoundError: org/ap
我有以下代码: // Test TODO remove try { System.out.println(System.getProperties().getPrope
我有以下文件: src/my_proj/myns.clj: (ns my-proj.myns) (defrecord MyRecord [a b c]) 测试/my_proj/myns_test.c
我试图让应用程序动态加载某些类,然后调用启动方法,但问题是,由于 ClassLoader 不同,一个类无法调用另一个类的方法,但是正如我已经用 google 搜索的那样,我用父类创建了两个类加载器。这
我是一名优秀的程序员,十分优秀!