谁解决,本人愿意奉上1000分:ssh2整合的项目中,我只要一旦往数据库进行操作,就会报出这个异常问题

hepeng19861212 2009-03-13 09:28:55
谁解决,本人愿意奉上1000分,绝不食言!
ssh2整合项目:
我只要一旦往数据库进行操作,就会报出这个异常问题
我是专门试过了的,后来我只是执行了一条grant语句(我先前直接到mysql中执行了一下,是正常的),但是在我程序中执行这条sql语句时,就报错了

我估计是三个框架之间整合 问题导致的。

异常提示中说的很模糊,问题根源很难定位,只知道是执行了数据库操作就会报出这个异常。

DefaultListableBeanFactory - No bean named 'org.apache.struts2.dispatcher.ServletDispatcherResult' found in org.springframework.beans.factory.support.DefaultListableBeanFactory@1594ba3: defining beans [user,project,projectDAO,usersDAO,addProjectService,loginService,registerService,login,register,add
Project,sessionFactory]; root of factory hierarchy

DefaultListableBeanFactory - Ignoring constructor [public org.apache.struts2.dispatcher.ServletDispatcherResult(java.lang.String)] of bean 'org.apache.struts2.dispatcher.ServletDispatcherResult': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.struts2.dispatcher.ServletDispatcherResult': Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: : No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean
CachedIntrospectionResults - Getting BeanInfo for class [org.apache.struts2.dispatcher.ServletDispat
cherResult]
CachedIntrospectionResults - Caching PropertyDescriptors for class [org.apache.struts2.dispatcher.Se
rvletDispatcherResult]
...全文
658 38 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
38 条回复
切换为时间正序
请发表友善的回复…
发表回复
hepeng19861212 2009-03-19
  • 打赏
  • 举报
回复
原来是互不相干的两个问题:
1.配置事务的问题;
2.ServletDispatcherResult异常。但是问题2不影响系统。

由于这两个问题发生的位置太近了,我误把他们合并为一个问题了,错误认为:ServletDispatcherResult异常导致了无法插入数据的问题。

结贴!
zhj92lxs 2009-03-17
  • 打赏
  • 举报
回复
mark下
hepeng_waistcoat 2009-03-17
  • 打赏
  • 举报
回复
借用马甲顶一下
为什么千元大奖没有人想拿呢?
hepeng19861212 2009-03-17
  • 打赏
  • 举报
回复
the answer is:spring和hibernate整合,必须要配置事务
hepeng_waistcoat 2009-03-15
  • 打赏
  • 举报
回复
各位还有别的建议吗?
Defonds 2009-03-14
  • 打赏
  • 举报
回复
mark,关注千元大奖花落谁家?
Landor2004 2009-03-14
  • 打赏
  • 举报
回复
贴一下struts2和spring的配置文件,struts2的代码吧
笑的自然 2009-03-14
  • 打赏
  • 举报
回复
这儿才是高手云集的地方啊!

羡慕啊。。。
笑的自然 2009-03-14
  • 打赏
  • 举报
回复
这儿才是高手云集的地方啊!

羡慕啊。。。
hepeng19861212 2009-03-14
  • 打赏
  • 举报
回复
[Quote=引用 24 楼 lijiaof16 的回复:]
<context-param>
<param-name>contextConfigLocation </param-name>
<param-value>classpath:applicationContext.xml </param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>


web.xml少个spring的配置文件吧??需要指定spring文件的路径!
[/Quote]
如果不指定,spring会自动去web-inf目录下找。
hepeng19861212 2009-03-14
  • 打赏
  • 举报
回复
[Quote=引用 23 楼 javabull 的回复:]
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>

<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
[/Quote]无法解决
彩虹咖啡 2009-03-14
  • 打赏
  • 举报
回复
我感觉是你返回的值类型和你的bean值类型不符合
hepeng19861212 2009-03-14
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 wj_18 的回复:]
LZ struts2的包加全没 ?xwork ognl 等也都是必须的
[/Quote]全加了
hepeng19861212 2009-03-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 Mr_Von 的回复:]
你的项目中有没有spring.jar?  估计是缺少某个包引起的
[/Quote]我这里已经加了spring.jar
zidasine 2009-03-14
  • 打赏
  • 举报
回复
debug一下 action ,dao看下具体哪一句出了错误
看异常好像没有找到 那个bean的定义
看看struts.xml中各个属性有没有写错
loginSuccess 2009-03-14
  • 打赏
  • 举报
回复
System.out.println("顶下先");
Study_Work_2009 2009-03-14
  • 打赏
  • 举报
回复
up
lijiaof16 2009-03-14
  • 打赏
  • 举报
回复
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>


web.xml少个spring的配置文件吧??需要指定spring文件的路径!
javabull 2009-03-14
  • 打赏
  • 举报
回复
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>

<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
javabull 2009-03-14
  • 打赏
  • 举报
回复
web.xml里面少SPRING的配置文件信息
加载更多回复(14)

67,549

社区成员

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

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