Sping 构造方法注入 错误 java.lang.IllegalStateException: Failed to load ApplicationContext 5C

错误信息
Mon Oct 08 10:39:48 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Oct 08 10:39:48 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
10:39:48,985 ERROR TestContextManager:314 - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@d4602a] to prepare test instance [org.konghao.cms.service.TestIndexService@21ae6e73]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.IllegalArgumentException
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.core.LocalVariableTableParameterNameDiscoverer.inspectClass(LocalVariableTableParameterNameDiscoverer.java:110)
at org.springframework.core.LocalVariableTableParameterNameDiscoverer.getParameterNames(LocalVariableTableParameterNameDiscoverer.java:85)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1051)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:955)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:910)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:853)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1051)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:955)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
... 25 more

测试类代码

package org.konghao.cms.service;

import javax.inject.Inject;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.konghao.basic.model.SystemContext;
import org.konghao.cms.service.IIndexService;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/beans.xml")

public class TestIndexService {

@Inject
private IIndexService indexService;
private String  rp="D:\\teach_source\\class2\\j2EE\\cms2013\\cms-web\\src\\main\\webapp";

@Test
public void testGenerateTop() {
    SystemContext.setRealPath(rp);
    indexService.generateTop();
}

}

package org.konghao.cms.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import org.konghao.basic.model.SystemContext;
import org.konghao.basic.util.FreemarkerUtil;
import org.konghao.cms.model.Channel;
import org.konghao.cms.web.BaseInfoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("indexService")
public class IndexService implements IIndexService {
private String ftlPath;
private String outPath;
private FreemarkerUtil util;

@Autowired(required=true)
public IndexService(String ftlPath, String outPath) {
    super();
    if(util==null) {
        this.ftlPath = ftlPath;
        this.outPath = outPath;
        util=FreemarkerUtil.getInstance(ftlPath);
    }
}
private IChannelService channelService;

public IChannelService getChannelService() {
    return channelService;
}
@Inject
public void setChannelService(IChannelService channelService) {
    this.channelService = channelService;
}

@Override
public void generateTop() {

    List<Channel> cs = channelService.listTopNavChannel();
    Map<String, Object>root = new HashMap<String, Object>();
    root.put("navs", cs);
    String outfile =SystemContext.getRealPath()+outPath+"/top.jsp";
    util.fprint(root,"/top.ftl",outfile);       
}

}

bean.xml 文件

<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- 打开Spring的Annotation支持 -->

<!-- 设定Spring 去哪些包中找Annotation -->



<bean id="outPath" class="java.lang.String">
    <constructor-arg value="/jsp/template"/>
</bean>

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName" value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    <!-- 配置连接池的初始值 -->
    <property name="initialSize" value="1" />
    <!-- 连接池的最大值 -->
    <!-- <property name="maxActive" value="500"/> -->
    <!-- 最大空闲时,当经过一个高峰之后,连接池可以将一些用不到的连接释放,一直减少到maxIdle为止 -->
    <!-- <property name="maxIdle" value="2"/> -->
    <!-- 当最小空闲时,当连接少于minIdle时会自动去申请一些连接 -->
    <property name="minIdle" value="1" />
    <property name="maxActive" value="100" />
    <property name="maxIdle" value="20" />
    <property name="maxWait" value="1000" />
</bean>
<!--创建Spring的SessionFactory工厂 -->
<context:property-placeholder location="classpath:jdbc.properties" />
<!-- 
和hibernate4整合没有提供专门的针对Annotation的类,直接在LocalSessionFactoryBean中已经集成

-->
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<!-- 注入数据源 -->

<!-- 设置Spring取那个包中查找相应的实体类 -->

org.konghao.cms.model


<!-- hibernate.dialect=org.hibernate.dialect.HSQLDialect -->

org.hibernate.dialect.MySQLDialect
true
update
false


<!-- 配置Spring的事务处理 -->
<!-- 创建事务管理器-->
<bean id="txManager"
    class="org.springframework.orm.hibernate4.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
</bean>
<aop:config>
<!-- 设置pointCut表示哪些方法要加入事务处理 -->
<!-- 以下的事务是声明在DAO中,但是通常都会在Service来处理多个业务对象逻辑的关系,注入删除,更新等,此时如果在执行了一个步骤之后抛出异常
    就会导致数据不完整,所以事务不应该在DAO层处理,而应该在service,这也就是Spring所提供的一个非常方便的工具,声明式事务 -->
    <aop:pointcut id="allMethods"
    expression="execution(* org.konghao.cms.service.*.*(..))" />
    <!-- 通过advisor来确定具体要加入事务控制的方法 -->
    <aop:advisor advice-ref="txAdvice" pointcut-ref="allMethods" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="txManager">
    <tx:attributes>
    <!-- 让所有的方法都加入事务管理,为了提高效率,可以把一些查询之类的方法设置为只读的事务 -->
        <tx:method name="*" propagation="REQUIRED" read-only="true"/>
        <!-- 以下方法都是可能设计修改的方法,就无法设置为只读 -->
        <tx:method name="add*" propagation="REQUIRED"/>
        <tx:method name="del*" propagation="REQUIRED"/>
        <tx:method name="update*" propagation="REQUIRED"/>
        <tx:method name="save*" propagation="REQUIRED"/>
        <tx:method name="clear*" propagation="REQUIRED"/>
    </tx:attributes>
</tx:advice>

    <!-- <aop:config>
        <aop:aspect ref="indexService">
            <aop:pointcut id="generateTopPoint"
                expression="execution(* org.kongkao.cms.service.channelService.add*(..))||
                    execution(* org.konghao.cms.service.ChannelService.del*(..))||
                    execution(* org.konghao.cms.service.ChannelService.update*(..))"/>
            <aop:after method="generteTop" pointcut-ref="generateTopPoint"/>
        </aop:aspect>
    </aop:config> -->

3个回答

使用@RunWith(SpringRunner.class)
@SpringBootTest

哥们儿,先把mysql的配置文件修改一下,useSSL=true这个配置要加上,还有就是@ContextConfiguration("/beans.xml")这个注解中引用的配置文件的路径需要加上classpath,否则会找不到,尝试一下,看看能不能搞定

还是这个错误 9:12:03,192 ERROR TestContextManager:314 - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@4e6d7365] to prepare test instance [org.konghao.cms.service.TestIndexService@7c0da600]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.IllegalArgumentException
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.core.LocalVariableTableParameterNameDiscoverer.inspectClass(LocalVariableTableParameterNameDiscoverer.java:110)
at org.springframework.core.LocalVariableTableParameterNameDiscoverer.getParameterNames(LocalVariableTableParameterNameDiscoverer.java:85)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1051)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:955)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:910)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:853)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1051)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:955)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
... 25 more

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java.lang.IllegalStateException: Failed to load ApplicationContext
[size=10px][align=left]java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308)rn atorg.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)rn at org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests.runBare(AbstractJUnit38SpringContextTests.java:205)rn at junit.framework.TestResult$1.protect(TestResult.java:110)rn at junit.framework.TestResult.runProtected(TestResult.java:128)rn at junit.framework.TestResult.run(TestResult.java:113)rn at junit.framework.TestCase.run(TestCase.java:124)rn at junit.framework.TestSuite.runTest(TestSuite.java:232)rn at junit.framework.TestSuite.run(TestSuite.java:227)rn at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [F:\Documents and Settings\Administrator\workspace\ms3\WebRoot\WEB-INF\classes\applicationContext-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPoolrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:308)rn at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:947)rn at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:701)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:377)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)rn at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)rn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)rn ... 17 morernCaused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPoolrn at java.lang.Class.getDeclaredConstructors0(Native Method)rn at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)rn at java.lang.Class.getDeclaredConstructors(Unknown Source)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:191)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:859)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:831)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn ... 33 more[/align][/size]
java.lang.IllegalStateException: Failed to load ApplicationContext求解决
java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)rn at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:363)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'LunBoService': Unsatisfied dependency expressed through field 'mapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lunboMapper' defined in file [E:\MyEclipse工作空间\module1\target\classes\com\xhkj\dao\LunboMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\MyEclipse工作空间\module1\target\classes\com\xhkj\mapper\BaoxiuMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.xhkj.dao.BaoxiuMapper.BaseResultMaprn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:592)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:251)rn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)rn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)rn ... 25 morernCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lunboMapper' defined in file [E:\MyEclipse工作空间\module1\target\classes\com\xhkj\dao\LunboMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\MyEclipse工作空间\module1\target\classes\com\xhkj\mapper\BaoxiuMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.xhkj.dao.BaoxiuMapper.BaseResultMaprn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1486)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1231)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)rn at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)rn ... 43 morernrnrnrn
求助:Failed to load ApplicationContext
java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:333)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:220)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:301)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:303)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:300)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/NetWen/Config/DataSourceConfig.class]: Initialization of bean failed; nested exception is java.lang.NullPointerExceptionrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)rn at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)rn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)rn ... 24 morernCaused by: java.lang.NullPointerExceptionrn at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:128)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)rn ... 36 morernrn
junit测试Failed to load ApplicationContext
java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) [spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288) [spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na]rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290) [spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) [spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) [junit-4.11.jar:na]rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na]rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na]rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na]rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na]rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na]rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) [spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na]rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) [spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) [.cp/:na]rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) [.cp/:na]rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) [.cp/:na]rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) [.cp/:na]rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) [.cp/:na]rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'charConvertRead' defined in class path resource [META-INF/spring/applicationContextLogic.xml]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class jp.co.jip.rod.dao.dbutils.CharConvertRead]: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.aop.framework.adapter.UnknownAdviceTypeException: Advice object [null] is neither a supported subinterface of [org.aopalliance.aop.Advice] nor an [org.springframework.aop.Advisor]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925) ~[spring-context-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472) ~[spring-context-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.support.DelegatingSmartContextLoader.loadContext(DelegatingSmartContextLoader.java:228) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148) ~[spring-test-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn ... 24 common frames omittedrnCaused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class jp.co.jip.rod.dao.dbutils.CharConvertRead]: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.aop.framework.adapter.UnknownAdviceTypeException: Advice object [null] is neither a supported subinterface of [org.aopalliance.aop.Advice] nor an [org.springframework.aop.Advisor]rn at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:213) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:477) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ~[spring-beans-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn ... 37 common frames omittedrnCaused by: org.springframework.aop.framework.adapter.UnknownAdviceTypeException: Advice object [null] is neither a supported subinterface of [org.aopalliance.aop.Advice] nor an [org.springframework.aop.Advisor]rn at org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry.getInterceptors(DefaultAdvisorAdapterRegistry.java:88) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.aop.framework.DefaultAdvisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice(DefaultAdvisorChainFactory.java:61) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:482) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at org.springframework.aop.framework.Cglib2AopProxy$ProxyCallbackFilter.accept(Cglib2AopProxy.java:772) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.java:887) ~[cglib-nodep-2.2.2.jar:na]rn at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:498) ~[cglib-nodep-2.2.2.jar:na]rn at net.sf.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33) ~[cglib-nodep-2.2.2.jar:na]rn at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[cglib-nodep-2.2.2.jar:na]rn at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) ~[cglib-nodep-2.2.2.jar:na]rn at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) ~[cglib-nodep-2.2.2.jar:na]rn at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285) ~[cglib-nodep-2.2.2.jar:na]rn at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:201) ~[spring-aop-3.1.4.RELEASE.jar:3.1.4.RELEASE]rn ... 44 common frames omittedrn
spring+Junit测试 Failed to load ApplicationContext
这是一个例子程序,我直接导入了eclipse,但是老是加载不了applicationContext,尝试了很多办法,没用。麻烦各位看下,什么原因?rn[img=https://img-bbs.csdn.net/upload/201702/22/1487748549_454044.png][/img]rn报错如下:rn2017-02-22 15:21:45,040 DEBUG [main] (DefaultSingletonBeanRegistry.java:488) - Retrieved dependent beans for bean '(inner bean)': [txAdvice]rn2017-02-22 15:21:45,040 DEBUG [main] (DisposableBeanAdapter.java:275) - Invoking destroy method 'close' on bean with name 'dataSource'rn2017-02-22 15:21:45,041 ERROR [main] (TestContextManager.java:324) - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@13e7444] to prepare test instance [com.baobaotao.service.TestUserService@a26d77]rnjava.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in file [D:\masterSpring\chapter2\WebRoot\WEB-INF\classes\com\baobaotao\service\UserService.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancerrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)rn at org.springframework.test.context.support.DelegatingSmartContextLoader.loadContext(DelegatingSmartContextLoader.java:228)rn at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)rn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)rn ... 24 morernCaused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancerrn at org.springframework.aop.framework.Cglib2AopProxy.createEnhancer(Cglib2AopProxy.java:229)rn at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:171)rn at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:476)rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362)rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn ... 37 morern2017-02-22 15:21:45,061 DEBUG [main] (DirtiesContextTestExecutionListener.java:113) - After test class: context [[TestContext@3bf400 testClass = TestUserService, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1f03bb1 testClass = TestUserService, locations = 'classpath:applicationContext.xml', classes = '', activeProfiles = '', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader']]], dirtiesContext [false].
junit测试报Failed to load ApplicationContext
需要测试src里面的service、action等;新建了个src文件夹命名为“testCase”,和src同级;applicationContext.xml文件在src里面,不太清楚除了需要加载这个配置文件还需要啥,看了网上例子用了如下的代码:rn@ContextConfiguration(locations="classpath:applicationContext.xml") rnrn执行test报:rnlog4j:WARN No such property [maxFileSize] in org.apache.log4j.DailyRollingFileAppender.rnlog4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.rn2013-09-24 16:56:39 [org.springframework.test.context.TestContextManager.retrieveTestExecutionListeners(TestContextManager.java:185)]-[INFO] @TestExecutionListeners is not present for class [class loginTest]: using defaults.rn2013-09-24 16:56:39 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:315)]-[INFO] Loading XML bean definitions from class path resource [applicationContext.xml]rn2013-09-24 16:56:39 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:315)]-[INFO] Loading XML bean definitions from class path resource [sdmob-gis.xml]rn2013-09-24 16:56:39 [org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:456)]-[INFO] Refreshing org.springframework.context.support.GenericApplicationContext@1bd0dd4: startup date [Tue Sep 24 16:56:39 CST 2013]; root of context hierarchyrn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.checkCandidate(MapperScannerConfigurer.java:453)]-[WARN] Skipping MapperFactoryBean with name 'alarmInfoDao' and 'com.nr.sd.mob.dao.AlarmInfoDao' mapperInterface. Bean already defined with the same name!rn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.checkCandidate(MapperScannerConfigurer.java:453)]-[WARN] Skipping MapperFactoryBean with name 'attemperGraphDao' and 'com.nr.sd.mob.dao.AttemperGraphDao' mapperInterface. Bean already defined with the same name!rn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.checkCandidate(MapperScannerConfigurer.java:453)]-[WARN] Skipping MapperFactoryBean with name 'curveDao' and 'com.nr.sd.mob.dao.CurveDao' mapperInterface. Bean already defined with the same name!rn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.checkCandidate(MapperScannerConfigurer.java:453)]-[WARN] Skipping MapperFactoryBean with name 'damCtrlFloodDao' and 'com.nr.sd.mob.dao.DamCtrlFloodDao' mapperInterface. Bean already defined with the same name!rn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.checkCandidate(MapperScannerConfigurer.java:453)]-[WARN] Skipping MapperFactoryBean with name 'mobMenuDao' and 'com.nr.sd.mob.dao.MobMenuDao' mapperInterface. Bean already defined with the same name!rn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.checkCandidate(MapperScannerConfigurer.java:453)]-[WARN] Skipping MapperFactoryBean with name 'mobUserDao' and 'com.nr.sd.mob.dao.MobUserDao' mapperInterface. Bean already defined with the same name!rn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.checkCandidate(MapperScannerConfigurer.java:453)]-[WARN] Skipping MapperFactoryBean with name 'reportSrhDao' and 'com.nr.sd.mob.dao.ReportSrhDao' mapperInterface. Bean already defined with the same name!rn2013-09-24 16:56:40 [org.mybatis.spring.mapper.MapperScannerConfigurer$Scanner.doScan(MapperScannerConfigurer.java:397)]-[WARN] No MyBatis mapper was found in 'com.nr.sd.mob.dao' package. Please check your configuration.rn2013-09-24 16:56:40 [org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:555)]-[INFO] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@530cf2: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,weatherImageAction,monitorAction,weatherImageJobDetail,monitorJobDetail,simpleTrigger,monitorTrigger,scheduleFactory,dataSource,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,mobUserDao,mobUserLoginAction,mobUserService,mobMenuDao,mobMenuAction,mobMenuService,damCtrlFloodDao,damCtrlFloodService,DamConfigAction,DamQueryAction,WaterRegimeAction,SingleFetchAction,QueryFetchAction,curveDao,curveService,CurveQueryAction,attemperRuleService,AttemperRuleAction,attemperGraphDao,attemperGraphService,AttemperGraphAction,alarmInfoDao,alarmInfoAction,alarmInfoService,TopologyGraphAction,HydroOverviewAction,TestInterfaceAction,reportSrhDao,reportSrhAction,reportSrhService,readHyDispXmlAction,readHyDispXmlService,LonlatAction,StationAction,readHyDispRFLXmlAction,readHyDispRFLXmlService,getZoomLevelAction,getZoomLevelService,querySubStreamAction,querySubStreamService,querySubStreamDao,getSubStreamRFLAction,getIsoLinePicAction,getIsoLinePicService,getIsoLinePicDao]; root of factory hierarchyrn2013-09-24 16:56:40 [org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:422)]-[INFO] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@530cf2: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,weatherImageAction,monitorAction,weatherImageJobDetail,monitorJobDetail,simpleTrigger,monitorTrigger,scheduleFactory,dataSource,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,mobUserDao,mobUserLoginAction,mobUserService,mobMenuDao,mobMenuAction,mobMenuService,damCtrlFloodDao,damCtrlFloodService,DamConfigAction,DamQueryAction,WaterRegimeAction,SingleFetchAction,QueryFetchAction,curveDao,curveService,CurveQueryAction,attemperRuleService,AttemperRuleAction,attemperGraphDao,attemperGraphService,AttemperGraphAction,alarmInfoDao,alarmInfoAction,alarmInfoService,TopologyGraphAction,HydroOverviewAction,TestInterfaceAction,reportSrhDao,reportSrhAction,reportSrhService,readHyDispXmlAction,readHyDispXmlService,LonlatAction,StationAction,readHyDispRFLXmlAction,readHyDispRFLXmlService,getZoomLevelAction,getZoomLevelService,querySubStreamAction,querySubStreamService,querySubStreamDao,getSubStreamRFLAction,getIsoLinePicAction,getIsoLinePicService,getIsoLinePicDao]; root of factory hierarchyrn2013-09-24 16:56:40 [org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:324)]-[ERROR] Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@814013] to prepare test instance [loginTest@195d4fe]rnjava.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:220)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:301)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:303)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:300)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'weatherImageAction' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.nr.sd.mob.action.WeatherImageAction]: Constructor threw exception; nested exception is java.lang.NullPointerExceptionrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)rn at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)rn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)rn ... 25 morernCaused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.nr.sd.mob.action.WeatherImageAction]: Constructor threw exception; nested exception is java.lang.NullPointerExceptionrn at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)rn ... 39 morernCaused by: java.lang.NullPointerExceptionrn at com.nr.sd.mob.service.impl.WeatherImageServiceImpl.readImageXML(WeatherImageServiceImpl.java:261)rn at com.nr.sd.mob.service.impl.WeatherImageServiceImpl.initFormate(WeatherImageServiceImpl.java:83)rn at com.nr.sd.mob.service.impl.WeatherImageServiceImpl.(WeatherImageServiceImpl.java:36)rn at com.nr.sd.mob.action.WeatherImageAction.(WeatherImageAction.java:26)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)rn ... 41 more
Spring mvc与 mybatis 整合 Failed to load ApplicationContext
初次尝试整合框架,Junit跑的时候出现问题 ,不知道怎么解决。。rn[org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [spring-mybatis.xml]rn [org.springframework.context.support.GenericApplicationContext] - Refreshing org.springframework.context.support.GenericApplicationContext@59e84876: startup date [Wed Mar 29 22:40:00 CST 2017]; root of context hierarchyrn [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] - Loading properties file from class path resource [jdbc.properties]rn [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] - JSR-330 'javax.inject.Inject' annotation found and supported for autowiringrn [org.springframework.test.context.TestContextManager] - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@6b927fb] to prepare test instance [com.ning.test.TestMyBatis@3e58a80e]rn java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)rn at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:319)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:212)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.ning.oasystem.dao.IUserDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)rnRelated cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IUserDAO' defined in file [D:\ee\OAsystem\target\classes\com\ning\oasystem\dao\IUserDAO.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:com/cn/hnust/mapping/*.xml]: class path resource [com/cn/hnust/mapping/] cannot be resolved to URL because it does not existrn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:307)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:121)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250)rn at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)rn at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)rn ... 25 morernCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.ning.oasystem.dao.IUserDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1100)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:960)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:855)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:441)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:419)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:544)rn at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:304)rn ... 41 morernrnrn
Failed to load ApplicationContext怎么解决??求大神
java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)rn at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pubUserService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.servlet.http.HttpSession com.ztesoft.itos.service.pub.impl.UserServiceImpl.session; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpSession] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250)rn at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)rn at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)rn ... 25 morernCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.servlet.http.HttpSession com.ztesoft.itos.service.pub.impl.UserServiceImpl.session; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpSession] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)rn ... 41 morernCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.http.HttpSession] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1103)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:963)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:858)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)rn ... 43 morernrn测试文件:rn[code=java]package com.ztesoft.itos.test;rnrnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.test.context.ContextConfiguration;rnimport org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;rnimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;rnimport org.springframework.test.context.transaction.TransactionConfiguration;rnimport org.springframework.transaction.annotation.Transactional;rnrnrnrn@RunWith(SpringJUnit4ClassRunner.class)rn@ContextConfiguration(locations="classpath:spring.xml")rn@TransactionConfiguration(transactionManager="transactionManager", defaultRollback=false)rn@Transactionalrnpublic class ActivitiTest extends AbstractTransactionalJUnit4SpringContextTestsrnrn @Testrn public void test()rn System.out.println ("test"); rn rn rn[/code]
maven集成SSM,提示Failed to load ApplicationContext
每次运行都报的Failed to load ApplicationContext...rnrn因为没有头绪,所以只能把代码都贴上来,麻烦各位大神多费眼,感激不尽rnrn运行环境rnrn工具:Eclipse photonrnrnJDK版本:1.8rnrnSpring版本:5.0.2rnrnMybatis:3.4.5rnrnrn整个代码结构如下图:rnrn![图片说明](https://img-ask.csdn.net/upload/201906/02/1559407466_222419.png)rnrn=================rnrn测试类代码片段:rnrn```rnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.test.context.ContextConfiguration;rnimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;rnrnimport com.Leo.Mapper.UserMapper;rnrn@RunWith(SpringJUnit4ClassRunner.class)rn@ContextConfiguration(locations="classpath:applicationContext.xml")rnpublic class App rn @Autowiredrn private UserMapper usermapper;rn @Testrn public void testSelectAll() throws Exceptionrn usermapper.selectAll().forEach(System.out::println);rn rnrn```rn==============================rnrnapplicationContext.xml配置如下rnrn```rnrnrn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn lazyLoadingEnabled=truern rn aggressiveLazyLoading=falsern rn lazyLoadTriggerMethods=clonern rn rn rn rn rn rn rn rn rn rn rn rnrn```rnrnrnMaven的pom.xml配置:rnrn```rnrn 4.0.0rn com.leorn ssmDemorn 0.0.1-SNAPSHOTrn rn rn rn UTF-8rn 5.0.2.RELEASErn 3.4.5rn rnrn rnrn rn rn org.springframeworkrn spring-contextrn $spring.versionrn compilern rn rn org.springframeworkrn spring-jdbcrn $spring.versionrn compilern rn rn org.springframeworkrn spring-webmvcrn $spring.versionrn compilern rn rn org.springframeworkrn spring-testrn $spring.versionrn compilern rn rn rn org.mybatisrn mybatisrn $mybatis.versionrn rn rn rn org.mybatisrn mybatis-springrn 1.3.0rn rnrn rn rn mysqlrn mysql-connector-javarn 5.1.38rn compilern rn rn rn com.alibabarn druidrn 1.0.26rn rnrn rn rn org.aspectjrn aspectjweaverrn 1.8.7rn rnrn rn rn com.fasterxml.jackson.corern jackson-databindrn 2.9.5rn rn rn rn junitrn junitrn 4.12rn compilern rnrn rn rn javax.servletrn javax.servlet-apirn 3.0.1rn compilern rnrnrn rn rn jstlrn jstlrn 1.2rn rnrnrn rn rn org.slf4jrn slf4j-apirn 1.7.21rn rn rn org.slf4jrn slf4j-log4j12rn 1.7.21rn rnrn rn rn org.projectlombokrn lombokrn 1.16.6rn compilern rn rn rn rn rn rn org.apache.maven.pluginsrn maven-compiler-pluginrn 3.5.1rn rn 1.8rn 1.8rn UTF-8rn rn rn rn rn org.apache.tomcat.mavenrn tomcat7-maven-pluginrn 2.2rn rn UTF-8rn /rn 80rn rn rn rn rnrnrn```
mvn打包报错:Failed to load ApplicationContext
![图片说明](https://img-ask.csdn.net/upload/201605/12/1463049953_501952.png)nApplicationContext中扫描的包:nn n n n springmvc.xml中扫描的包:n
Failed to load ApplicationContext求大神帮助
package com.huashao.sm_test.test;rnrnimport java.util.Date;rnrnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.test.context.ContextConfiguration;rnimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;rnrnimport com.huashao.sm_test.bean.User;rnimport com.huashao.sm_test.mapper.UserMapper;rnrnrn@RunWith(SpringJUnit4ClassRunner.class)//使用Spring的测试框架rn@ContextConfiguration("/beans.xml")//加载spring的配置文件beans.xmlrnpublic class SMTest rn rn @Autowiredrn private UserMapper userMapper;rn @Testrn public void testAdd()rn User user = new User(-1,"huashao",new Date(),123456);rn userMapper.save(user);rn rn rnrnrnrnrnrnrnrn rn rn rn rn rn rn rn rnrn rn rn rn rn rnrn rn rn rn rn rnrn rn rn rn rn rn rn rnrnrnrnrnrnrn
maven+spring+Juint 测试,异常:Failed to load ApplicationContext
异常如下:rn[code=csharp]rnTests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.836 sec <<< FAILURE!rntestLogin(com.zggk.services.impl.TestLoginImpl) Time elapsed: 0.01 sec <<< ERROR!rnjava.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)rn at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:259)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:261)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:219)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)rn at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)rn at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)rn at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:497)rn at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)rn at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)rn at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)rn at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)rn at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.zggk.dao.ICommonDao com.zggk.services.impl.LoginImpl.commonDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public org.hibernate.SessionFactory com.zggk.dao.impl.CommonDaoImpl.sf; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.hibernate.SessionFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn[/code]rnrn测试类如下“rn[code=csharp]rn@RunWith(SpringJUnit4ClassRunner.class)rn@ContextConfiguration(locations = "classpath:applicationContext-test.xml" )rnrnpublic class TestLoginImpl rnrn @Autowiredrn private ILogin login;rnrn @Testrn // 需要使用@Test注解,否则不会执行rn public void testLogin() rn String sql = "select count(1) from userinfo where UserName='1' and Password='2'";rn int rst = login.Login("1", "2");rn System.out.println("Rst:" + rst);rn rnrn[/code]rnrnapplicationContext-test.xml如下:rn[code=csharp]rnrnrnrn rnrnrn[/code]rn请问,这个如何解决?rn
spring+mybatis+mysql中事务管理报如下错: Failed to load ApplicationContext
java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)rn at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:230)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:249)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:363)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-mybatis.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:252)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadBeanDefinitions(AbstractGenericContextLoader.java:253)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:122)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)rn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)rn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)rn ... 25 morernCaused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:760)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)rn at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)rn at java.net.URLClassLoader.access$100(URLClassLoader.java:73)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:368)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:362)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:361)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:424)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:357)rn at org.springframework.transaction.config.TxAdviceBeanDefinitionParser.getBeanClass(TxAdviceBeanDefinitionParser.java:71)rn at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:66)rn at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:61)rn at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)rn at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1411)rn at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:168)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)rn ... 38 morernCaused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptorrn at java.net.URLClassLoader.findClass(URLClassLoader.java:381)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:424)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:357)rn ... 61 morern请问是什么原因?rn
Spring+Data+JPA持久层的使用及注意事项(三)——Failed to load ApplicationContext无法加载配置文件
Failed to load ApplicationContext这个问题是有很多的,我的检查过程是这样:1,检查web.xml中对于spring的listener的配置是否有问题,因为我这是一键生成的,所以主要是看路径问题,也就是location有没有配对    &amp;lt;!-- needed for ContextLoaderListener --&amp;gt; &amp;lt;context-param&amp;g...
Maven项目下整合spring和mybatis后用Junit测试 Failed to load ApplicationContext 报错
测试的代码:rnimport static org.junit.Assert.*;rnrnimport javax.annotation.Resource;rnrnimport org.apache.log4j.Logger;rnimport org.junit.Before;rnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.context.ApplicationContext;rnimport org.springframework.context.support.ClassPathXmlApplicationContext;rnimport org.springframework.test.context.ContextConfiguration;rnimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;rnrnimport com.zw.wei.bean.User;rnimport com.zw.wei.service.UserService;rnrn@RunWith(SpringJUnit4ClassRunner.class) rn@ContextConfiguration(locations = "classpath:/spring/spring-mybatis.xml") rnpublic class TestMybatis rn private static Logger logger = Logger.getLogger(TestMybatis.class); rn @Resourcern private UserService userService=null;rn// @Beforern// public void setUp() throws Exception rn// ApplicationContext applicationContext = new ClassPathXmlApplicationContext(rn// "spring/applicationContext.xml");rn// userService = (UserService) applicationContextrn// .getBean("userServiceImpl");rn// rnrn rn @Testrn public void test() rn User user = userService.getUserById(1); rn // System.out.println(user.getUsername()); rn // logger.info("值:"+user.getUsername()); rn // logger.info(JSON.toJSONString(user));rn rnrnrn运行后报错,代码在回复里
spring boot 项目使用junit报错 Failed to load ApplicationContext
测试代码片段:rnpackage test;rnrnimport org.junit.Assert;rnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.test.context.ContextConfiguration;rnimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;rnimport org.springframework.test.context.web.WebAppConfiguration;rnrnimport com.ifohoo.pofos17.etl.Application;rnimport com.ifohoo.pofos17.etl.service.EtlFromNecipsService;rnrn/**rn * CreatTime:2018年1月16日 下午1:43:27 ProjectName:pofos17-etlrn * rn * @author Frank ClassExplain:rn */rn@RunWith(SpringJUnit4ClassRunner.class)rn@ContextConfiguration(classes = Application.class)rn@WebAppConfigurationrnpublic class JunitTest rn @Autowiredrn EtlFromNecipsService necipsService;rnrn @Testrn public void testRun() rn try rn Assert.assertEquals("hello",necipsService.getEnterpriseList("科技"));rn catch (Exception e) rn e.printStackTrace();rn rn rnrnrn[color=#FF0000][b]错误信息:[/b][/color]rnjava.lang.IllegalStateException: Failed to load ApplicationContextrnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).rn at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)rn at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1128)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056)rn at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)rn at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)rn ... 52 common frames omittedrnCaused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)rn at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)rn ... 65 common frames omittedrnCaused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).rn at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:229)rn at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:174)rn at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:42)rn at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Tomcat.dataSource(DataSourceConfiguration.java:53)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:498)rn at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)rn ... 66 common frames omittedrn14:28:33.464 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - After test class: context [DefaultTestContext@7b98f307 testClass = JunitTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@4802796d testClass = JunitTest, locations = '', classes = 'class com.ifohoo.pofos17.etl.Application', contextInitializerClasses = '[]', activeProfiles = '', propertySourceLocations = '', propertySourceProperties = '', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@ef9296d, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@7e0b85f9, org.springframework.test.context.web.socket.MockServerContainerContextCustomizer@6a28ffa4], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.test.context.web.WebDelegatingSmartContextLoader', parent = [null]]], class annotated with @DirtiesContext [false] with mode [null].rnrnrn急求大神解决啊!万分感谢!
spring mybatis单元测试报Failed to load ApplicationContext错
WARN [main] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userSvimpl': Unsatisfied dependency expressed through field 'userm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [F:\Neon-Workplace\Heaven-lh\target\classes\site\lh_heaven\dao\UserMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'maxActive' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'maxActive' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rnDEBUG [main] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2805c96b: defining beans [userSvimpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,mvcResourceUrlProvider,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,mvcPathMatcher,mvcUrlPathHelper,mvcCorsConfigurations,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#1,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#2,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#2,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#3,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#3,org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0,multipartResolver,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,loginAction,mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter,mvcUriComponentsContributor,org.springframework.web.servlet.handler.MappedInterceptor#1,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,viewResolver,forumMapper,imgIconMapper,imgLandscapeMapper,imgPostsMapper,imgReplyMapper,landscapeMapper,postsMapper,reply2Mapper,replyMapper,userMapper,videoPostsMapper]; root of factory hierarchyrnERROR [main] - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@224edc67] to prepare test instance [test.Test@13deb50e]rnjava.lang.IllegalStateException: Failed to load ApplicationContextrnrnCaused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userSvimpl': Unsatisfied dependency expressed through field 'userm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [F:\Neon-Workplace\Heaven-lh\target\classes\site\lh_heaven\dao\UserMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'maxActive' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'maxActive' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rnrnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [F:\Neon-Workplace\Heaven-lh\target\classes\site\lh_heaven\dao\UserMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'maxActive' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'maxActive' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rnrnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'maxActive' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'maxActive' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rnrnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'maxActive' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'maxActive' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rnrnCaused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'maxActive' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'maxActive' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn
java.lang.IllegalStateException错误?
java.lang.IllegalStateException:Cannot forward after response has been committedrnrnjava.lang.IllegalStateException:getOutputStream() has already been called for this responsernrn这两个错误一般在什么情况下出现,解决办法是什么?rnrn有谁遇到过相同的情况吗,你是怎么解决的?
构造方法注入
Spring是现在为流行的技术开发框架,其核心为DI(依赖注入)与AOP(面向切面编程),而后基于这两者基础上可以整合大量主流的开发框架。官方QQ群:612148723。
构造方法的注入
Spring是一个开放源代码的设计层面框架,他解决的是业务逻辑层和其他各层的松耦合问题,因此它将面向接口的编程思想贯穿整个系统应用。Spring是于2003 年兴起的一个轻量级的Java 开发框架
sping 的注入问题 急!!!
我现在用 sping的注解方式(Autowired)为Action 注入bean rn 如:@Autowiredrn private QuestionManager questionManager;rnrn先在有个问题:在不同的包下有两个QuestionManager 请问该如何注入?
s2sh 中的sping注入
[code=Java]rnpublic class WordProjectinfoAction extends BaseAction implements ServletConfigAware rn rnrn private ServletConfig servletconfig;rn public void setServletConfig(ServletConfig servletconfig) rn this.servletconfig=servletconfig;rn rn rnrn。。。。。。。rnrnrn[/code]rn这里我实现了 ServletConfigAware 我用的是smartuplad上传 需要初始化servletconfig rn 而我实现了这个接口 怎么报错 说servletconfig 为null 我该则么解决啊 rn 谢谢大家
sping 注入问题
我在action中为什么拿不到我xml中注入的action里的userServicernactionrn[code=Java]rnpublic class SaveAction extends Action rn /*rn * Generated Methodsrn */rnrn private IUserService userService; rn rn public IUserService getUserService() rn return userService;rn rnrn public void setUserService(IUserService userService) rn this.userService = userService;rn rn rn /** rn * Method executern * @param mappingrn * @param formrn * @param requestrn * @param responsern * @return ActionForwardrn */rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn SaveForm loginForm = (SaveForm) form;// TODO Auto-generated method stubrn User user = new User();rn user.setName(loginForm.getName());rn this.userService.save(user); //插入的方法 rn return null;rn rnrn[/code]rnapplicationContext.xmlrn[code=XML]rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.SQLServerDialectrn rn rn rn rn rn com/xxxx/hibernate/xml/User.hbm.xmlrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code]rnrnuserService无法注入
开机出现failed to load kernel library错误
如题
水晶报表出现Load report failed 错误
报表在VS2008上运行正常,但是发布到另一台机器上IIS6.0上,就会出现Load report failed 错误,并且只有一张报表出现这个问题其他报表都正常,请大哥们帮忙解决一下,百度和谷歌的方法我都试过了,没有解决。
sping applicationcontext中的一些例子demo
sping applicationcontext中的一些例子demo 关于AbstractApplicationContext 以及它的几个常用子类的一些demo
Spring(06)——单例注入多例之ApplicationContext
6 单例注入多例之注入ApplicationContext Spring bean容器中的bean有单例bean,也有多例bean。当我们需要给一个单例beanA注入一个单例beanB,或者给一个多例beanA注入一个多例或单例beanB时,都可以通过配置让Spring的bean容器帮我们完成。但如果我们需要给一个单例beanA注入一个多例be...
JUnit调试时出现错误 Failed to load ApplicationContext 的解决方法(不一定适合所有人)
在我写一个小型的ssm框架的系统是,调试运行出现如下结果: 九月 01, 2017 3:56:28 下午 org.springframework.test.context.support.DefaultTestContextBootstrapper getDefaultTestExecutionListenerClassNames 信息: Loaded default TestExecutio
Load report failed
最近我在vb.net 2005环境下做crystal report ,我不知道为什么会报这有时会出现"Load report failed "错rn[color=#FF0000]当运行到红色代码时[/color],这个问题时好时坏rn下面是我的代码:rnrn Dim report As New report '厨rn Dim R45Data As New R45Data '璸衡amount摸rn Dim dataset As New DataSetrn Dim sql As Stringrnrn connectionDB() '连接数据库rn sql = strSql.returnR45TdcInSql(businessDate, businessDate)rn SqlDataAdapter = New SqlDataAdapter(sql, con)rn SqlDataAdapter.Fill(dataset, "R45TDC") rn colseDB()rnrn R45Data.setReportDataSet(dataset) '统计dataset数据rn R45Data.account() '开始计算rn [color=#FF0000] report.SetDataSource(R45Data.saveData()) 'R45Data.saveData()是反回一个计算好后的
python DLL load failed
今天我安装了statsmodels 模块 而且安装了很多次,但是每次我输入以下命令的时候就会出现如下错误,完全是新手,也不知道该怎么解决,希望能够得到回答。rnrnimport statsmodels.api as smrnrnrnrn[code=python]rnTraceback (most recent call last):rn File "", line 1, in rn import statsmodels.api as smrn File "C:\Python27\lib\site-packages\statsmodels-0.6.1-py2.7-win-amd64.egg\statsmodels\__init__.py", line 8, in rn from .tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning,rn File "C:\Python27\lib\site-packages\statsmodels-0.6.1-py2.7-win-amd64.egg\statsmodels\tools\__init__.py", line 1, in rn from .tools import add_constant, categoricalrn File "C:\Python27\lib\site-packages\statsmodels-0.6.1-py2.7-win-amd64.egg\statsmodels\tools\tools.py", line 8, in rn from scipy.linalg import svdvalsrn File "C:\Python27\lib\site-packages\scipy\linalg\__init__.py", line 161, in rn from .misc import *rn File "C:\Python27\lib\site-packages\scipy\linalg\misc.py", line 5, in rn from . import blasrn File "C:\Python27\lib\site-packages\scipy\linalg\blas.py", line 155, in rn from scipy.linalg import _fblasrnImportError: DLL load failed: 找不到指定的模块。[/code]
Failed to load viewstate 的问题
页面在本地是好的,传到服务器出现了rnrnFailed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request. rnrnrn页面有几个用户控件回传的...
Load report failed 急急!!!
最近我在vb.net 2005环境下做crystal report ,我不知道为什么会报这有时会出现"Load report failed "错rn[color=#FF0000]当运行到红色代码时[/color],这个问题时好时坏rn下面是我的代码:rnrn Dim report As New report '厨rn Dim R45Data As New R45Data '璸衡amount摸rn Dim dataset As New DataSetrn Dim sql As Stringrnrn connectionDB() '连接数据库rn sql = strSql.returnR45TdcInSql(businessDate, businessDate)rn SqlDataAdapter = New SqlDataAdapter(sql, con)rn SqlDataAdapter.Fill(dataset, "R45TDC") rn colseDB()rnrn R45Data.setReportDataSet(dataset) '统计dataset数据rn R45Data.account() '开始计算rn [color=#FF0000] report.SetDataSource(R45Data.saveData()) 'R45Data.saveData()是反回一个计算好后的dataset[/color]rn report.SetParameterValue("Datadate", busDate2)rn
Load "crpe32.dll" failed
Crystal Report9.2.3300rn 在win2k server上部署沒問題,但在win2k pro上部署運行時出現如下錯: Load "crpe32.dll" failed.rnrn 照csdn一朋友的文章所言exclude dotnetcrystalreports.msm後也是這樣. rnrn敬請各位支招!!!!!!!!!!!!!!1
警告: Failed to load the sqljdbc_auth.dll
2010-11-22 16:39:40 com.microsoft.sqlserver.jdbc.AuthenticationJNI rn警告: Failed to load the sqljdbc_auth.dllrncom.microsoft.sqlserver.jdbc.SQLServerException: 没有为集成身份验证配置驱动程序。rn如题rn我的操作系统 win7 64位rn把sqljdbc_auth.dllrn复制到 system32 中没用rn求解决
头大了 load crpe32.dll failed
看了下面的没有 不知道怎么搞的 我用的是Crystal.Reports.v9.2.2.667.CHSrn5、load crpe32.dll failedrn下面是cr9net_deployment.pdf说明中的部署Crystal Report 9的步骤:rn打开 Windows 应用程序。 rn在解决方案资源管理器中,右击 Windows 应用程序解决方案,指向“添加”,然后单击“新建项目”。 rn在“添加新项目”对话框中,选择“项目类型”窗格中的“安装和部署项目”,然后选择“模板”窗格中的“安装项目”。单击“确定”按钮。 rn在解决方案资源管理中,右击安装项目,指向“添加”,然后单击“项目输出”。 rn在“添加项目输出组”中,选择“主输出”,然后单击“确定”。 rn将自动添加所有依赖项,如 dotnetfxredist_x86_enu.msm和dotnetcrystalreports.msm。rn需要将dotnetcrystalreports.msm排除在项目之外,在解决方案资源管理器中右击这个模块的右键,选择“排除”。 rn在解决方案资源管理器中,右击安装项目,指向“添加”,然后单击“合并模块”。 rn在“添加模块”对话框中,选择下列要添加到安装项目的合并模块,然后单击“打开”: rnreportengine.msm, crnetruntime.msm, license.msmrnmapping.msm (可选,当在报表中使用了geographic maps时) rnVC_CRT.msm、VC_STL.msm( 如果您部署的 Windows 应用程序使用 ADO.NET 数据集,则还需要包括 VC_CRT 和 VC_STL 合并模块)rn在解决方案资源管理器中,右击 license.msm 文件,然后选择“属性”。 rn在“属性”窗口中,展开 MergeModuleProperties,然后在“许可证密钥”属性框中输入一个有效的许可证密钥。 rn注意 每当部署 Crystal Reports 应用程序时,必须提供许可证密钥。 rn从“生成”菜单中,选择“生成解决方案”以生成应用程序。rnrn-----------------------------rnrn不知道什么原因啊 请教各位了!rn
资源视图load failed
当我把.rc文件打开后,资源视图就打不开了,这怎么解决啊,谢谢了
Load Report Failed的问题
VS2003上用水晶报表9开发报表,部署在Windows 2003上,最近一直报Load Report Failed,时好时坏,目录的权限全部都开了,还是不行,用Debug Diagnostics Tool追踪了一下,出现这种错误,大家帮忙看看:rnWARNING - DebugDiag was not able to locate debug symbols for ExportModeller.dll, so the information below may be incomplete.rnrnrnrnIn w3wp__PID__2756__Date__09_17_2007__Time_09_13_00AM__808__Second_Chance_Exception_C0000005.dmp the assembly instruction at ExportModeller!DllUnregisterServer+1aad6 in C:\Program Files\Common Files\Crystal Decisions\1.0\Bin\ExportModeller.dll has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 52rnrn大家帮一下忙啊~
Failed to load the sqljdbc_auth.dll
我用SSH框架,可是在启动服务器时,报警告Failed to load the sqljdbc_auth.dllrnrnERROR org.hibernate.util.JDBCExceptionReporter - Cannot create PoolableConnectionFactory (没有为集成身份验证配置驱动程序。)rnrn我从网上搜索说让把sqljdbc_auth.dll复制到c:/windows/system32下我已经复制进去了,但是还是报这错误,请各位高手帮忙解决下,先在此谢谢各位了!!
resourceview显示load failed
我的resourceview显示load failed.双击出现this filw alreadly open in editorrn我在使用过程中的一次编译中出现资源错误,然后就变成这样。重启问题公然存在
JUnit调试时出现错误 Failed to load ApplicationContext 的一个可能原因和解决方法
在spring和hibernate进行整合时,JUnit调试时出现错误 : Failed to load ApplicationContext 后查明原因,在applicationContext中写hibernate.cfg.xml相关配置信息时,key=“ ”中没有加入hibernate.这个前缀 以下为相关xml代码 &lt;bean name="sessionFactory" class="...
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表