社区
Java EE
帖子详情
ssh整合::Initialization of bean failed; nested exception is org
Charles_k
2018-06-07 01:32:42
...全文
847
5
打赏
收藏
ssh整合::Initialization of bean failed; nested exception is org
[图片]
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Charles_k
2018-06-07
打赏
举报
回复
引用 4 楼 ilifetree 的回复:
史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM
我这是ssh框架的
hi-face
2018-06-07
打赏
举报
回复
史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM
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>
com.springsource.
org
.objectweb.asm-3.2.0.jar
org
.springframework.
bea
ns.factory.
Bea
nCreation
Exception
: Error creating
bea
n with name 'customAreaService' defined in class path resource [applicationContext.xml]:
Initialization
of
bea
n
failed
;...
Instantiation of
bea
n
failed
;
nested
exception
is java.lang.NoClassDefFoundError
在maven项目中调用了一个类,没有报异常。但是运行的时候报出来Instantiation of
bea
n
failed
;
nested
exception
is java.lang.NoClassDefFoundError。 原因是这个类存在依赖。 将其引入pom解决问题。
Initialization
of
bea
n
failed
;
nested
exception
is java.lang.NoSuchMethodError:
org
.objectweb.asm
在使用hibernate 和spring 构架的框架中如果出现
Initialization
of
bea
n
failed
;
nested
exception
is java.lang.NoSuchMethodError:
org
.objectweb.asm
ssh
框架: Invocation of init method
failed
;
nested
exception
is
org
.hibernate.InvalidMapping
Exception
:
org
.springframework.
bea
ns.factory.
Bea
nCreation
Exception
: Error creating
bea
n with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method
failed
;...
ssh
中访问Action时报错Unable to instantiate Action,
Initialization
of
bea
n
failed
,
nested
exception
is xx
[JAVA-JSP-
SSH
]调试一个
SSH
小项目,给它添加一个Action,在页面中异步访问时,居然一直访问不了,页面没有异常信息,eclipse控制台也不见有错误信息,查看启动信息,发现Action也已经被spring托管到了。---------...
Java EE
67,513
社区成员
225,878
社区内容
发帖
与我相关
我的任务
Java EE
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
复制链接
扫一扫
分享
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章