新手用IntelliJ整合SSH框架报的错误,哪位大神指点?急!急!急 10C

04-Dec-2016 17:16:39.373 INFO [RMI TCP Connection(5)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started
04-Dec-2016 17:16:39.631 INFO [RMI TCP Connection(5)-127.0.0.1] org.springframework.context.support.AbstractApplicationContext.prepareRefresh Refreshing Root WebApplicationContext: startup date [Sun Dec 04 17:16:39 CST 2016]; root of context hierarchy
04-Dec-2016 17:16:39.734 INFO [RMI TCP Connection(5)-127.0.0.1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/bean.xml]
04-Dec-2016 17:16:40.433 INFO [RMI TCP Connection(5)-127.0.0.1] org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@75ff547c: defining beans [touristDAO,touristService,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,ht,dataSource,sessionFactory,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
04-Dec-2016 17:16:40.589 INFO [RMI TCP Connection(5)-127.0.0.1] com.mchange.v2.log.MLog. MLog clients using java 1.4+ standard logging.
04-Dec-2016 17:16:40.677 INFO [RMI TCP Connection(5)-127.0.0.1] com.mchange.v2.c3p0.C3P0Registry.banner Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
04-Dec-2016 17:16:41.795 INFO [RMI TCP Connection(5)-127.0.0.1] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@75ff547c: defining beans [touristDAO,touristService,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,ht,dataSource,sessionFactory,txManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
04-Dec-2016 17:16:41.811 SEVERE [RMI TCP Connection(5)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'touristDAO': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ht' defined in ServletContext resource [/WEB-INF/classes/bean.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/bean.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Unable to read XML这个事程序目录配置文件1配置文件2配置文件3这个事监听器和扫描器

4个回答

qq_35355549
qq_35355549 我的用的注解的,启动程序的时候去bean.xml加载Hibernate的配置文件的时候就是找不到
接近 3 年之前 回复

当然会报错呀,SSH整合的本质是 spring与hibernate spring与struts2.在web。xml中要有applicationcontext。xml的配置

    <!-- <property name="annotatedClasses"> -->
    <!-- 使用packagesToScan可以不用一个一个去列出实体类 -->
    <property name="packagesToScan">  
        <list>
            <value>com.yxty.domain</value>
        </list>
    </property>
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!