已有51人关注
《java web开发实战》第24章 基于ssh2电子商城网站
发表在JavaWeb答疑区 2017-07-02
是否精华
版块置顶:

《java web开发实战》软件开发技术联盟编著,第24章 基于ssh2电子商城网站加载后报错,请帮助,感谢感谢!


报错如下:

七月 02, 2017 8:14:49 下午 org.apache.catalina.core.StandardContext startInternal

严重: One or more listeners failed to start. Full details will be found in the appropriate container log file

七月 02, 2017 8:14:49 下午 org.apache.catalina.core.StandardContext startInternal

严重: Context [/Shop] startup failed due to previous errors

20:14:49,842 ERROR ContextLoader:307 - Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.lyq.dao.DaoSupport.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [C:\Users\Administrator\workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Shop\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)

... 24 more

Caused by: java.lang.NullPointerException

at java.util.Hashtable.put(Hashtable.java:459)

at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.<init>(LocalSessionFactoryBuilder.java:101)

at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:244)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)

... 34 more

七月 02, 2017 8:14:49 下午 org.apache.catalina.core.ApplicationContext log

信息: Closing Spring root WebApplicationContext

七月 02, 2017 8:14:49 下午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["http-bio-8080"]

七月 02, 2017 8:14:49 下午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["ajp-bio-8009"]

七月 02, 2017 8:14:49 下午 org.apache.catalina.startup.Catalina start

信息: Server startup in 3837 ms


分享到:
精彩评论 1
无语_mrkj
学分:3155 LV11
2017-07-03
沙发

您确认一下,数据库连接时用的用户名和密码是否与书中要求的一致,如果不一致请修改一致,再试试。

另外,程序中所需的Jar包都放置了吗?


首页上一页 1 下一页尾页 1 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照