學習Sping遇到的問題

來源:互聯網
上載者:User

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)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.