学习Sping遇到的问题

来源:互联网 发布:软件开发团队简介 编辑:程序博客网 时间:2024/05/22 12:33

1.

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager' defined in class path resource [applicationContext-bean.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut allAddMethod


JDK1.6与Spring2.0中的AspectJ不兼容,换成JDK1.5或者下载更高版本的Spring均可解决!

 

2.

2009-03-12 21:30:07,359 INFO [org.springframework.core.CollectionFactory] - JDK 1.4+ collections available

 

如果出现这句话,程序就不动了,是由于你的程序目录和工作空间目录的命名中含有中文,将他们全部改为字母即可解决!

 

3.

启动时报The prefix "aop" for element "aop:config" is not bound
我用的是spring2.5.2
已经把spring.jar,spring-aop.jar,spring-hibernate3.jar,spring-tx.jar,spring-core.jar,cglib-nodep-2.1_3.jar都放进来了 哪位朋友知道是什么原因造成的吗? 麻烦请告诉我谢谢!

 

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
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
                    http://www.springframework.org/schema/aop
                    http://www.springframework.org/schema/aop/spring-aop.xsd">

 

4.

[com.brilliance.struts.service.impl.InvestServiceImpl] for property 'fundService': no matching editors or conversion strategy found

 

是你的类没有实现接口,也可以使用CGLIB来实现类的动态代理,或者:

在spring事务时会出现。
解决办法是:
在事务中加上下面语句
<property name="proxyTargetClass" >
   <value>true</value>
</property>
表面proxy代理的是类而不是接口。

 

5.

spring2.5 怎么没有spring2.0中的
org.springframework.web.struts.DelegatingActionProxy

 

2.5对包重新分类了

你是不是直接用的那个2M多的总包

你要找的在spring-framework-2.5.6/dist/modules/spring-webmvc-struts.jar这里

官方spring-reference跟readme里都有说明

* "spring-webmvc-struts" (~35 KB)
- Contents: Struts 1.x action support, Tiles 1.x view support
- Dependencies: spring-web, Struts API, (spring-webmvc)

原创粉丝点击