ssh整合::Initialization of bean failed; nested exception is org

Charles_k 2018-06-07 01:32:42
...全文
847 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Charles_k 2018-06-07
  • 打赏
  • 举报
回复
引用 4 楼 ilifetree 的回复:
史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM
我这是ssh框架的
Charles_k 2018-06-07
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:applicationContext.xml </param-value> </context-param> <filter> <filter-name>OpenSessionInViewFilter</filter-name> <filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>flushMode</param-name> <param-value>AUTO</param-value> </init-param> </filter> <filter-mapping> <filter-name>OpenSessionInViewFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> 配了呀
daojian_ 2018-06-07
  • 打赏
  • 举报
回复
web可否配置,可以用注解试试看是配置问题还是别的问题
Charles_k 2018-06-07
  • 打赏
  • 举报
回复
这是我的applicationcontent.xml文件,网上大部分说应该是注入接口,可是我这就是注入接口的啊 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns="http://www.springframework.org/schema/beans" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/library?useUnicode=true&characterEncoding=utf-8"/> <property name="driverClass" value="com.mysql.jdbc.Driver"/> <property name="user" value="root"/> <property name="password" value="123456"/> <property name="maxPoolSize" value="20"/> <property name="minPoolSize" value="2"/> <property name="initialPoolSize"> <value>10</value> </property> </bean> <bean name="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="mappingResources"> <list> <value>TbReader.hbm.xml</value> <value>TbBookinfo.hbm.xml</value> <value>TbBorrow.hbm.xml</value> <value>TbManager.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <value> hibernate.dialect=org.hibernate.dialect.MySQLDialect hibernate.show_sql=true hbm2ddl.auto=update </value> </property> </bean> <bean name="tbReaderDAOImpl" class="com.dhu.dao.TbReaderDAOImpl" > <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean name="tbBookinfoDAOImpl" class="com.dhu.dao.TbBookinfoDAOImpl" > <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean name="tbBorrowDAOImpl" class="com.dhu.dao.TbBorrowDAOImpl" > <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean name="tbManagerDAOImpl" class="com.dhu.dao.TbManagerDAOImpl" > <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean name="tbReaderServiceImpl" class="com.dhu.service.TbReaderServiceImpl"> <property name="tbReaderDAO" ref="tbReaderDAOImpl"/> </bean> <bean name="tbBookinfoServiceImpl" class="com.dhu.service.TbBookinfoServiceImpl"> <property name="tbBookinfoDAO" ref="tbBookinfoDAOImpl"/> </bean> <bean name="tbBorrowServiceImpl" class="com.dhu.service.TbBorrowServiceImpl"> <property name="tbBorrowDAO" ref="tbBorrowDAOImpl"> </property> </bean> <bean name="tbManagerServiceImpl" class="com.dhu.service.TbManagerServiceImpl"> <property name="tbManagerDAO" ref="tbManagerDAOImpl"> </property> </bean> <bean name="tbReaderActionBean" class="com.dhu.action.TbReaderAction" scope="prototype"> <property name="tbReaderService" ref="tbReaderServiceImpl"/> </bean> <bean name="tbBookinfoActionBean" class="com.dhu.action.TbBookinfoAction " scope="prototype"> <property name="tbBookinfoService" ref="tbBookinfoServiceImpl"/> </bean> <bean name="tbBorrowActionBean" class="com.dhu.action.TbBorrowAction" scope="prototype"> <property name="tbBorrowService" ref="tbBorrowServiceImpl"></property> </bean> <bean name="tbManagerActionBean" class="com.dhu.action.TbManagerAction" scope="prototype"> <property name="tbManagerService" ref="tbManagerServiceImpl"/> </bean> <bean id="loginAction" class="com.dhu.action.LoginAction" scope="prototype"> <property name="tbManagerService" ref="tbManagerServiceImpl"/> </bean> <bean id="txManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate5.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <tx:annotation-driven transaction-manager="txManager"/> </beans>

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧