spring和hibernate整合是,不联网就报错,一链接网络,就可以,求高手解答 20
Exceptioninthread"main"org.springframework.beans.factory.BeanCreationException:Errorc...
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager' defined in file [D:\学习工具\Eclipse\eclipse\JAVA-HOME\spring_hibernate_1\bin\applicationContext-beans.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 file [D:\学习工具\Eclipse\eclipse\JAVA-HOME\spring_hibernate_1\bin\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Could not parse configuration: file:/D:/%e5%ad%a6%e4%b9%a0%e5%b7%a5%e5%85%b7/Eclipse/eclipse/JAVA-HOME/spring_hibernate_1/bin/hibernate.cfg.xml
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method) 展开
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method) 展开
3个回答
展开全部
呵呵,我比较确定的猜跟你的中文路径有关。
log中前面是D:\学习工具,后面hibernate解析就变成乱码。file:/D:/%e5%ad%a6%e4%b9%a0%e5%b7%a5%e5%85%b7/Eclipse/eclipse/JAVA-HOME/spring_hibernate_1/bin/hibernate.cfg.xml
明显hibernate没有识别转义的中文。可能在联网环境中 ,这个file:/D:/%e5%ad%a6%e4%b9%a0%e5%b7%a5%e5%85%b7能被转义解析,才能被识别。
经验总结,无论如何不要使用中文或有空格的路径环境。
log中前面是D:\学习工具,后面hibernate解析就变成乱码。file:/D:/%e5%ad%a6%e4%b9%a0%e5%b7%a5%e5%85%b7/Eclipse/eclipse/JAVA-HOME/spring_hibernate_1/bin/hibernate.cfg.xml
明显hibernate没有识别转义的中文。可能在联网环境中 ,这个file:/D:/%e5%ad%a6%e4%b9%a0%e5%b7%a5%e5%85%b7能被转义解析,才能被识别。
经验总结,无论如何不要使用中文或有空格的路径环境。
展开全部
好像是说sessionFactory不能创建成功,是不是该对象创建时涉及到了其它IP计算机上的服务
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是说sessionFactory不能创建成功,是不是该对象创建时涉及到了其它IP计算机上的服务
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询