Spring

SpringFramework 3.0.0.M2

がリリースされてたので、ビルドしてみました。antでPermGen spaceでエラーがでてたので、ANT_OPTS=-Xmx1024mを設定して実行して見たら、 BUILD FAILED C:\develop\spring-framework\spring-framework-3.0.0.M2\spring-build\multi-bundle\quality.xml:23: T…

JUnitでSpringのScopeがSessionやRequestのオブジェクトが取れない。

Springで作ったアプリケーションのユニットテストを実装してるんだけど、スコープがSessionやRequestのオブジェクトが取れない。 java.lang.IllegalStateException: No Scope registered for scope 'session' at org.springframework.beans.factory.support.…

SpringMVCでのHttpServletRequestのインジェクション

HttpServletRequestなオブジェクトをアクションにインジェクション使用とすると @Autowired private HttpServletRequest request; でも @Resource private HttpServletRequest request; でも起動時にエラーになるけど、動くのは動く。う〜ん。HttpServletRes…

Beanの自動登録

名前を省略した@ComponentでのBean自動登録ではどうもパッケージ名は考慮されない模様。パッケージが異なってクラス名が同一の場合衝突してる。そうなると結局 クラス名を重複させない @Componentを使う場合はvalueを省略しない のいずれかでやらないと混乱…

@Componentでvalue値を重複させると

SpringFramework2.5からはアノテーションでコンポーネントの登録が可能です。そこで色々お試し中。まず、@Componentのvalue値が重複していた場合は以下のようにエラーになります。Annotation-specified bean name 'loginService' for bean class [sample.ser…