myeclise ssh 出现的问题,求解惑

问题描述

严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.UnsatisfiedDependencyException:Errorcreatingbeanwithname'sessionFactory'definedinServletContextresource[/WEB-INF/applicationContext.xml]:Unsatisfieddependencyexpressedthroughbeanproperty'eventListeners'::Errorcreatingbeanwithname'userDao'definedinServletContextresource[/WEB-INF/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCurrentlyInCreationException:Errorcreatingbeanwithname'sessionFactory':FactoryBeanwhichiscurrentlyincreationreturnednullfromgetObject;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'userDao'definedinServletContextresource[/WEB-INF/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCurrentlyInCreationException:Errorcreatingbeanwithname'sessionFactory':FactoryBeanwhichiscurrentlyincreationreturnednullfromgetObjectatorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1150)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1040)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4334)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)atorg.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)atorg.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)atorg.apache.catalina.core.StandardHost.start(StandardHost.java:719)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)atorg.apache.catalina.core.StandardService.start(StandardService.java:516)atorg.apache.catalina.core.StandardServer.start(StandardServer.java:710)atorg.apache.catalina.startup.Catalina.start(Catalina.java:566)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'userDao'definedinServletContextresource[/WEB-INF/applicationContext.xml]:Cannotresolvereferencetobean'sessionFactory'whilesettingbeanproperty'sessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCurrentlyInCreationException:Errorcreatingbeanwithname'sessionFactory':FactoryBeanwhichiscurrentlyincreationreturnednullfromgetObjectatorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1308)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:825)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:754)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:685)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1134)...37moreCausedby:org.springframework.beans.factory.BeanCurrentlyInCreationException:Errorcreatingbeanwithname'sessionFactory':FactoryBeanwhichiscurrentlyincreationreturnednullfromgetObjectatorg.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:157)atorg.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:109)atorg.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1387)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:244)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)...50more那位大虾帮我看看是什么错,我是初学者,搞不懂,谢谢

解决方案

解决方案二:
欢迎加我QQ交流:254971553
解决方案三:
可能是[/WEB-INF/applicationContext.xml中的问题
解决方案四:
那具体是哪里的问题呢
解决方案五:
有一个包导错了,就是在SessionFactory第一次出现的位置下面的那个包,你改改,就好了,org.springwork.jdbc.datasource.d.....可能写得不对,你点就出来了,忘了,
解决方案六:
该回复于2011-04-19 15:05:36被版主删除
解决方案七:
代码贴出来瞅瞅
解决方案八:
两种可能(1):userDao所在的实例类没提供get,set方法(2):spring配置文件与userDao属性对应实例类中名字不一样(userDao)。
解决方案九:
引用3楼yl521239的回复:

那具体是哪里的问题呢

代码贴出来呀
解决方案十:
<beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx.xsd"default-autowire="byType"><!--数据源--><beanid="dataSource"class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close"><propertyname="driverClassName"><value>com.mysql.jdbc.Driver</value></property><!--修改数据库用户名密码--><propertyname="url"><value>jdbc:mysql://localhost:3306/ssh</value></property><propertyname="username"><value>root</value></property><propertyname="password"><value>521239</value></property></bean><beanid="sessionFactory"class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"><propertyname="dataSource"><reflocal="dataSource"/></property><propertyname="mappingResources"><list><value>com/bean/User.hbm.xml</value></list></property><propertyname="hibernateProperties"><props><propkey="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop><propkey="hibernate.show_sql">true</prop></props></property></bean><!--dao--><beanid="userDao"class="com.dao.impl.UserDAOImpl"scope="singleton"><propertyname="sessionFactory"><reflocal="sessionFactory"/></property></bean><!--service--><beanid="userService"class="com.service.impl.UserServiceImpl"scope="singleton"><propertyname="userDao"><reflocal="userDao"/></property></bean><beanid="userAction"class="com.action.user.UserAction"scope="prototype"><propertyname="service"ref="userService"></property></bean></beans>
解决方案十一:
感觉LZ贴出来applicationContext.xml代码好熟悉啊、貌似是哪个网页里面的、、、
解决方案十二:
照到写的,其他都一样,怎么就错了??郁闷

时间: 2024-10-27 20:31:19

myeclise ssh 出现的问题,求解惑的相关文章

线程-volatile 关键字 作用结果求解惑

问题描述 volatile 关键字 作用结果求解惑 public class testVolatile { private int i = 0; // a线程调用 public void foo1() { try { while (true) { Thread.sleep(10); System.out.println(""第一个:"" + i); i++; } } catch (InterruptedException e) { // not to do; } }

源码-JDK1.7中java.lang.String类的toCharArray方法注释:不能用Arrays.copyOf实现?求解惑

问题描述 JDK1.7中java.lang.String类的toCharArray方法注释:不能用Arrays.copyOf实现?求解惑 JDK1.7重新设计了String类,各个String对象各自维护一个属于自身的char数组,下面是该类中的toCharArray方法的实现源码:public char[] toCharArray() { // Cannot use Arrays.copyOf because of class initialization order issues char

java关于PrintWriter调用write方法之后使用flush方法获取不到内容原因探究求解惑!

问题描述 java关于PrintWriter调用write方法之后使用flush方法获取不到内容原因探究求解惑! PrintWriter ps= new PrintWriter(socket.getOutputStream()); ps.write( "hello" ); ps.flush(); 服务端获取不到hello信息,看了下PrintWriter源码,flush()中调用的是BufferedWriter中的flush(),如果这样的话,应该能刷新缓冲得到结果.但是没有...网上

spring mvc-springmvc向jsp传值的问题,求解惑

问题描述 springmvc向jsp传值的问题,求解惑 我的项目是在springmvc下的,我要完成一个功能:当某一个设备上线的时候在页面右下角弹出提示框提示某某上线了. @Override public void event(ByteArrayWrap mn, Object event, Object message) 这是已经提供的设备事件接口:mn设备编号,event根据类的类型判断事件类型,message是Date类可以获取设备上线时间.一个设备对应一个地方,该设备上线就用对应的地方名来

单播-一个非常纠结网络实验问题,求解惑(系统层丢包问题,网络通信原理)?

问题描述 一个非常纠结网络实验问题,求解惑(系统层丢包问题,网络通信原理)? 实验一: HOSTA :192.168.80.4/24 gw: 192.168.2.1 HOSTB : 192.168.188.86/16 gw: 192.168.2.1 1) A ping B 1.1) 交换机网络:无法PING通 分析:因为找不到直接路由项,所有数据包通过默认默认路由转发:因为网络中不存在默认路由指定的路由器,故数据在发送端就无法发送出去. 1.2) 网络中存在正确的路由配置:可以PING通. 分析

css3-CSS3的一个小问题,刚入门不太懂求解惑

问题描述 CSS3的一个小问题,刚入门不太懂求解惑 <div class="box"> <div class="cube1"></div> <div class="cube2"></div> </div> --------- .box { width: 100px; height: 100px; position: relative; margin: 100px auto;

sonar源码分析-在linnx环境下shell触发sonar进行项目的原码分析出现异常,求解惑

问题描述 在linnx环境下shell触发sonar进行项目的原码分析出现异常,求解惑 在我已配置的环境中前几次进行触发sonar分析服务没有问题,但最近不知道是不是服务器停过电,服务以外终止运行了,现再启动后再次触发分析服务,就出现了异常,错位内容提示如下: [ERROR] [11:33:10.265] It looks like an analysis of 'talkyun tone v2.0.0-SNAPSHOT' is already running (started about a

ssh整合jar包 求大神支招

问题描述 ssh整合jar包 求大神支招 想知道 asm-attrs.jar 和 asm.jar 这两个jar包的区别,同时使用时会出现异常

新人求助,类的封装问题,不知怎么下手,求解惑

问题描述 新人求助,类的封装问题,不知怎么下手,求解惑 写一个教师类,属性有 教龄,姓名,性别,年龄(封装成属性),有一个打印信息的方法,有一个有参数的构造函数 (1)要求从键盘输入->在测试类中创建一个对象,然后调用打印信息的方法 解决方案 class 教师 { private int 教龄; public void set教龄(int n) { 教龄 = n; } public int get教龄() { return 教龄; } // 其余属性类似 ... //有参构造函数 public

c c++ 迷茫 指点-两年的泥腿子c/c++程序员,迷茫。求解惑。

问题描述 两年的泥腿子c/c++程序员,迷茫.求解惑. 电子专业出身,在校接触学习c.之后进了现在的这个公司.由于没有专业基础,看了比较多的书,<c数据结构><c与指针>,<c专家编程>,<effective c++><more effective c++>,<设计结构模式>.工作主要是维ide编译器,主要涉及c/c++编程,涉及编译原理状态机.语法树.但是貌似与当前的技术相当之脱节,不知道该如何发展算比较适合自己.求大咖指点. 解决