Migration Guide 5.0.0_ja - terasolunaorg/terasoluna-gfw GitHub Wiki

1.0.x から 5.0.0 への移行について

.. only:: html

 .. contents:: 目次
    :depth: 2
    :local:

5.0.0 での主な変更点

5.0.0 での主な変更点。

  • Spring Framework 4.1へ更新
  • Spring Security 3.2へ更新
  • Spring IO Platform 1.1.1で管理されるライブラリのバージョンを更新
  • Spring IO Platform 1.1.1以外で管理されているライブラリのバージョンを更新
  • 新機能としてMyBatis 3.2を追加
  • バグの修正に伴い、共通ライブラリの一部仕様を変更
  • 改善対応に伴い、共通ライブラリの一部仕様を変更
  • MyBatis3のために新たにblank project追加
  • blank projectの改善

Spring Framework 4.1へ更新

5.0.0から、Spring Framework 4.1.4.RELEASEへ更新しました。

1.0.1(Spring Framework 3.2.10)からの移行における考慮事項は以下の通りになります。

  • Jackson 1.xは未サポート。
  • ViewResolver のXML namespaceが追加
  • RESTful Web Serviceの為に @RestController がアノテーションとして追加

その他詳細な修正内容については、下記のSpring Framework Reference Documentationを参照してください。

Spring Security 3.2へ更新

5.0.0から、Spring Security 3.2.5.RELEASEへ更新しました。

1.0.x(Spring Security 3.1.xとSpring Security 3.2-RC版のCSRF対策機能)からの移行における考慮事項は以下の通りになります。

  • CSRF対策機能の改善
  • WEBセキュリティ強化機能がHTTPヘッダーに追加
  • Spring MVCと統合する為、@AuthenticationPrincipal が追加
  • CsrfRequestDataValueProcessor のAPI仕様が変更
  • Spring MVCと統合する為、CsrfRequestDataValueProcessor を改善

Note

1.0.xのCSRF対策機能について

1.0.1では、Spring Security 3.2-RC版のCSRF対策機能が組み込まれた。

その他詳細な修正内容については、下記のSpring Security Referenceを参照してください。

Spring IO Platform 1.1.1で管理されるライブラリのバージョンを更新

5.0.0から、依存関係のバージョン管理の為にSpring IO Platform 1.1.1を適用しています。

1.0.xからの移行における懸念事項は以下の通りになります。

  • Jacksonが1.9.7から2.4.4に更新
  • Apache Tilesが2.2.2から3.0.5に更新
  • Hibernate Validatorが4.3.1.Finalから5.1.3.Finalに更新(Bean Validationが1.0から1.1に更新)
  • Joda-Timeが2.2から2.5に更新
  • Apache Commons DBCPが1.2.2.patch_DBCP264_DBCP372から2.0.1に更新
  • Hibernate ORMが4.2.3.Finalから4.3.7.Finalに更新(Java Persistence APIが2.0から2.1に更新)

Spring IO Platform 1.1.1以外で管理されているライブラリのバージョンを更新

5.0.0から、一部のライブラリが更新されました。

1.0.xからの移行における考慮事項は特にありません。

新機能としてMyBatis 3.2を追加

5.0.0から、MyBatis 3.2.8はデータベースアクセスの新機能として追加されます。

O / RマッパーとしてMyBatis3を使用する場合は、テンプレートプロジェクトから新しい開発プロジェクトを生成してください。

Note

org.tarasoluna.gfw:tarasoluna-gfw-mybatis3について

5.0.0から、MyBatis3のMavenアーティファクト( org.tarasoluna.gfw:tarasoluna-GFW-mybatis3)が依存するライブラリを解決するために追加されました。 つまり、クラスファイルを提供していません。

Warning

MyBatis2(iBatis)について

MyBatis2(iBatis)は、5.0.0からサポートされていません。

バグの修正に伴い、共通ライブラリの一部仕様を変更

5.0.0から、共通ライブラリ内の一部の仕様が1.0.1.RELEASEで以下のバグの修正に伴い変更されました。

  • [#16] default message code in @ExistInCodeList is not standard form
  • [#148] QueryEscapeUtils does not work on Oracle 11g Release2(11.2) later
  • [#149] f:u() (EL Function) perform wrong encoding for query parameter
  • [#167] Modify CompositeRequestDataValueProcessor
  • [#256] ValidationMessages.properties should not be included in terasoluna-gfw-common

改善対応に伴い、共通ライブラリの一部仕様を変更

5.0.0から、共通ライブラリ内の一部の仕様が1.0.1.RELEASEから以下の改善対応に伴い変更されました。

  • [#13] When clicked current page link of pagination, pagination request is submitted
  • [#14] When clicked disabled page link of pagination, moved the top in current page
  • [#24] Support the ResultMessages.warning() as new message type (ResultMessages.warn() is deprecated)
  • [#224] Separate Joda-Time

blank projectのバグ修正

5.0.0から、blank projectにおける一部の設定ファイルが1.0.1.RELEASEで以下のバグの修正に伴い変更されました。

[アプリケーションの設定ファイル]

  • [multi#50] TilesViewResolver and BeanNameViewResolver is same order(priority)
  • [single#39] ResultMessagesLoggingInterceptor does not define in domain.xml
  • [single#45] Remove removeValue settings in UserIdMDCPutFilter

[プロジェクトの設定ファイル(POM,etc...)]

blank projectの改善

5.0.0から、blank projectにおける一部の設定ファイルが改善されました。

[アプリケーションの設定ファイル]

[プロジェクトの設定ファイル(POM,etc...)]

  • [multi#76] Modify scope of artifact dependency
  • [multi#78] Polish parent pom.xml
  • [multi#92] Improve JDBC driver dependency settings
  • [single#6] add dependencies to support unit test!
  • [single#60] Modify scope of artifact dependency

1.0.1から5.0.0への移行手順

移行手順は以下の通りになります。

Note

Legend

Required : 必須手順
Required by case : 条件付き必須手順
Optional : 推奨手順
- : 必要なし

[全般]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
依存ライブラリを更新 Required Required Required

[Spring Framework]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
ViewResolver のXML namespaceを使用する設定に修正 Optional Optional Optional
@RestController を使用するようにアプリケーションを修正 Optional Optional Optional

[Spring Security]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
CsrfRequestDataValueProcessor の設定を修正 Required by case Required by case Required by case
CSRF(<sec:csrf>)のXML namespaceを使用する設定に修正 Required by case Required by case Required by case
ログアウトリクエストにて POST メソッドに修正 Required by case Required by case Required by case
Concurrent Session Control(<sec:concurrency-control>)のXML namespaceを使用する設定に修正 Optional Optional Optional
Spring Securityの推奨されないAPIを置換 Required by case Required by case Required by case
GET メソッドを使用している場合、 <form:form> タグにJSPを修正 Optional Optional Optional
@AuthenticationPrincipal を使用するようにアプリケーションを修正 Optional Optional Optional
<sec:csrfInput> タグを使用するようにJSPを修正 Optional Optional Optional
<sec:csrfMetaTags > タグを使用するようにJSPを修正 Optional Optional Optional

[Jackson]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
Jackson 2.4を使用する設定に更新 Required by case Required by case Required by case
Jackson 2.4を使用するようにアプリケーションを修正 Required by case Required by case Required by case

[Tiles]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
Tiles 3.0用の ViewResolver を使用する設定に修正 Required by case Required by case Required by case
Tiles 3.0を使用する為にtiles設定ファイルを修正 Required by case Required by case Required by case
JSPのtaglibをTiles 3.0用に修正 Required by case Required by case Required by case

[Bean Validation(Hibernate Validator)]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
ValidationMessages.properties でデフォルトメッセージを上書き Required by case Required by case Required by case
Bean Validationの非推奨APIを置き換え Required by case Required by case Required by case

[Joda Time]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
Joda Timeの非推奨APIを置き換え Required by case Required by case Required by case

[Commons DBCP]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
BasicDataSourceのApache Commons DBCP 2を置き換え Required by case Required by case Required by case

[共通ライブラリ]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
@ExistInCodeList の仕様変更を適用 Required by case Required by case Required by case
QueryEscapeUtils のメソッドの仕様変更を適用 Required by case Required by case Required by case
f:u() の仕様変更を適用 Required by case Required by case Required by case
CompositeRequestDataValueProcessor の仕様変更を適用 Required by case Required by case Required by case
プロジェクトに ValidationMessages.properties を追加 Required by case Required by case Required by case

[共通ライブラリの改善]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
アクティブなページのリンクの仕様変更を適用 Required by case Required by case Required by case
無効なページのリンクの仕様変更を適用 Required by case Required by case Required by case
ResultMessages.warn() の代わりに ResultMessages.warning() を使用するようにアプリケーションを変更 Optional Optional Optional
依存関係の定義にterasoluna-gfw-jodatimeを追加 Required by case Required by case Required by case
DateFactory の代わりに JodaTimeDateFactory を使用するようにアプリケーションを変更 Required by case Required by case Required by case

[Blank projectのバグ修正]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
spring-mvc.xml に設定している ViewResolver の修正を適用 Required by case - -
xxx-domain.xmlResultMessagesLoggingInterceptor の設定追加を適用 - Required by case Required by case
spring-security.xml に設定している UserIdMDCPutFilter の修正を適用 - Required by case Required by case
pom.xml に設定している <distributionManagement> の修正を適用 Optional - -
pom.xml に設定している <relativePath> の修正を適用 Optional Optional -

[Blank projectの改善]

.. tabularcolumns:: |p{0.10\linewidth}|p{0.30\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|p{0.20\linewidth}|
Step Procedure MavenMultiple Projects MavenSingle Project EclipseWTP Project
xxx-codelist.xml に設定している JdbcCodeList の修正を適用 Optional Optional Optional
xxx-domain.xml にインポート設定するコードリストの修正の適用 Optional Optional Optional
spring-mvc.xml に設定している CodeListInterceptor の修正を適用 Optional Optional Optional
pom.xml (マルチ) の変更を適用 Required - -
pom.xml に設定しているJDBC driverの依存関係の修正を適用 Optional - -
pom.xml (シングル) の変更を適用 - Optional -
pom.xml のテスト用の依存関係設定の修正を適用 - Optional Optional
pom.xml に設定している依存スコープの修正を適用 - Optional -

[Step 1] 依存ライブラリの更新

TERASOLUNA Server Framework for Java (5.x)の共通ライブラリと依存ライブラリを更新してください。

Note

O / RマッパーとしてMyBatis3を使用する場合は、テンプレートプロジェクトから新しい開発プロジェクトを生成してください。(つまり、MyBatis3の移行手順が提供されていません。)

.. tabularcolumns:: |p{0.35\linewidth}|p{0.25\linewidth}|p{0.25\linewidth}|p{0.15\linewidth}|
Library Name From version To version Remarks
TERASOLUNA Server Framework for Java (5.x) Common Library 1.0.1.RELEASE 5.0.0.RELEASE  
Spring Framework 3.2.10.RELEASE 4.1.4.RELEASE  
Spring Data Commons 1.6.4.RELEASE 1.9.1.RELEASE  
Spring Security 3.1.4.RELEASE 3.2.5.RELEASE  
Hibernate 4.2.3.Final 4.3.7.Final  
Hibernate Commons Annotations 4.0.2.Final 4.0.5.Final  
Java Persistence API 2.0 1.0.1.Final - Changed
Java Persistence API 2.1 - 1.0.0.Final Changed
Javassist 3.15.0-GA 3.18.1-GA  
Java Annotation Indexer - 1.1.0.Final Added
JBoss Logging I18n Annotations - 1.2.0.Final Added
Java Transaction API 1.1 1.0.1.Final - Changed
Java Transaction API 1.2 - 1.0.0.Final Changed
Spring Data JPA 1.4.3.RELEASE 1.7.1.RELEASE  
AspectJ 1.7.4 1.8.4  
Logback 1.0.13 1.1.2  
SLF4J 1.7.5 1.7.8  
Jackson 1.9.7 2.4.4  
Bean Validation API 1.0.0.GA 1.1.0.Final  
Hibernate Validator 4.3.1.Final 5.1.3.Final  
JBoss Logging 3 3.1.0.GA 3.1.3.GA  
Apache Commons BeanUtils 1.8.3 1.9.2  
Dozer 5.4.0 5.5.1  
Apache Commons Lang 3.1 3.3.2  
Joda Time 2.2 2.5  
Jadira Usertype 3.0.0.GA 3.2.0.GA  
Apache Commons DBCP 1.2.2.patch_DBCP264 _DBCP372 2.0.1  
Apache Commons Pool 1.6 2.2  
Commons Digester 2.0 2.1  
Tiles 2.2.2 3.0.5  
Tiles Autotag Core - 1.1.0 Added
Tiles Request - 1.0.6 Added
Guava 13.0.1 17.0  

[手順の必要なケース]

この対応は必須になります。

[Step 1-1] Maven Multiple Projectsの場合

この mvn archetype を使用して生成したプロジェクトの更新手順はこちらの方法を使用します。

親プロジェクトのpomファイルを更新します。 ($YOUR_MULTIPLE_PROJECT_ROOT/pom.xml)

<!-- omitted -->
<parent>
    <groupId>org.terasoluna.gfw</groupId>
    <artifactId>terasoluna-gfw-parent</artifactId>
    <version>5.0.0.RELEASE</version> <!-- ### Need to edit ### -->
</parent>
<!-- omitted -->

[Step 1-2] Maven Single Projectの場合

この mvn archetype を使用して生成したプロジェクト、もしくは release site からダウンロードしたプロジェクトの更新手順はこちらの方法を使用します。

プロジェクトのpomファイルを更新します。($YOUR_SINGLE_PROJECT/pom.xml)

<!-- omitted -->
<parent>
    <groupId>org.terasoluna.gfw</groupId>
    <artifactId>terasoluna-gfw-parent</artifactId>
    <version>5.0.0.RELEASE</version> <!-- ### Need to edit ### -->
</parent>
<!-- omitted -->

[Step 1-3] Eclipse WTP Projectの場合

この release site からEclipse WTP Project用にダウンロードしたプロジェクトの更新手順はこちらの方法を使用します。

更新手順については Update libraries for using Eclipse WTP Project を参照してください。

[Step 2] ViewResolver のXML namespaceを使用する設定に修正

5.0.0から(Spring Framework 4.1から)、 ViewResolver 定義のXML名前空間が追加されました。 ViewResolver 定義のXML名前空間を使用することを推奨します。

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

[変更方法(推奨スタイル)]

以下の通り、修正してください。

  • <mvc:view-resolvers> タグを使用
  • <mvc:tiles-configurer> タグを使用

以下のいずれかファイルを修正します。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
<mvc:view-resolvers>
    <mvc:bean-name />
    <mvc:tiles />
    <mvc:jsp prefix="/WEB-INF/views/" />
</mvc:view-resolvers>

<mvc:tiles-configurer>
    <mvc:definitions location="/WEB-INF/tiles/tiles-definitions.xml" />
</mvc:tiles-configurer>

[別の方法(参考)]

この方法は従来のスタイルになります。

<bean class="org.springframework.web.servlet.view.BeanNameViewResolver">
    <property name="order" value="0" />
</bean>

<bean
    class="org.springframework.web.servlet.view.tiles3.TilesViewResolver">
    <property name="order" value="1" />
</bean>

<bean id="viewResolver"
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/views/" />
    <property name="suffix" value=".jsp" />
    <property name="order" value="2" />
</bean>

<bean class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/tiles/tiles-definitions.xml</value>
        </list>
    </property>
</bean>

[Step 3] @RestController を使用するようにアプリケーションを修正

5.0.0から(Spring Framework 4.0から)、 @RestController は、RESTのAPI(RESTfulなWebサービス)を開発するために追加されました。 REST APIを開発する場合、 @RestController@Controller 代わりに使用することを推奨します。

[手順の必要なケース]

この手順は任意です。 必要な場合、次の修正を行ってください。

[変更方法(推奨スタイル)]

@Controller の代わりに @RestController を使用するように修正します。 @RestController を使用している場合、 @ResponseBody はメソッドアノテーションとしての記載を省略することができます。

@RequestMapping("members")
@RestController // ### Need to specify instead of @Controller ###
public class MemberRestController {

    @RequestMapping(value = "{memberId}", method = RequestMethod.GET)
    @ResponseStatus(HttpStatus.OK)
    public MemberResource getMember( // ### Can omit @ResponseBody ###
              @PathVariable("memberId") String memberId) {
        // ...
    }

}

[参考]

この方法は従来のスタイルになります。

@RequestMapping("members")
@Controller
public class MemberRestController {

    @RequestMapping(value = "{memberId}", method = RequestMethod.GET)
    @ResponseStatus(HttpStatus.OK)
    @ResponseBody
    public MemberResource getMember(
              @PathVariable("memberId") String memberId) {
        // ...
    }

}

[Step 4] CsrfRequestDataValueProcessor の設定を修正

CsrfRequestDataValueProcessor のAPI仕様に、5.0.0(From Spring Security 3.2)から変更があります。 具体的には、 create メソッド(ファクトリメソッド)が削除されました。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • CsrfRequestDataValueProcessor を使用している場合

[変更方法]

CsrfRequestDataValueProcessor のBean定義から factory-method を削除してください。

以下のいずれかのファイルを修正してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
<bean id="requestDataValueProcessor"
    class="org.terasoluna.gfw.web.mvc.support.CompositeRequestDataValueProcessor">
    <constructor-arg>
        <util:list>
            <!-- ### Need to edit(remove factory-method="create") ### -->
            <bean
                class="org.springframework.security.web.servlet.support.csrf.CsrfRequestDataValueProcessor" />
            <!-- ... -->
        </util:list>
    </constructor-arg>
</bean>

[参考]

この設定は、5.0.0から無効になります。

<bean id="requestDataValueProcessor"
    class="org.terasoluna.gfw.web.mvc.support.CompositeRequestDataValueProcessor">
    <constructor-arg>
        <util:list>
            <bean
                class="org.springframework.security.web.servlet.support.csrf.CsrfRequestDataValueProcessor"
                factory-method="create" />
            <!-- ... -->
        </util:list>
    </constructor-arg>
</bean>

[Step 5] CSRF(<sec:csrf>)のXML namespaceを使用する設定に修正

5.0.0から(Spring Security 3.2から)、CSRF対策のためのXML名前空間が追加されました。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • Spring SecurityのCSR対策を使用している場合

[変更方法]

  • <sec:csrf> を使用するように変更してください。 <sec:csrf> を使用している場合、CSRF対策のためのコンポーネントが自動的に有効になります。
  • HttpSessionCsrfTokenRepository
  • CsrfFilter
  • CsrfAuthenticationStrategy
  • CSRFエラー処理をした場合は、 AccessDeniedHandler (<sec:access-denied-handler>)の設定を変更または追加してください。

以下のいずれかのファイルを修正します。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/META-INF/spring/spring-security.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-security.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-security.xml

(例:5.0.0用のblank projectの設定)

<sec:http auto-config="true" use-expressions="true">
    <!-- ... -->
    <sec:csrf /> <!-- ### Need to modify ### -->
    <sec:access-denied-handler ref="accessDeniedHandler"/> <!-- ### If handling the CSRF error, need to modify or add ### -->
    <!-- ... -->
</sec:http>

<!-- ... -->

<!-- ### If handling the CSRF error, need to modify or add ### -->
<bean id="accessDeniedHandler"
    class="org.springframework.security.web.access.DelegatingAccessDeniedHandler">
    <constructor-arg index="0">
        <map>
            <!-- ### Setting for detecting a invalid CSRF token ### -->
            <entry
                key="org.springframework.security.web.csrf.InvalidCsrfTokenException">
                <bean
                    class="org.springframework.security.web.access.AccessDeniedHandlerImpl">
                    <property name="errorPage"
                        value="/WEB-INF/views/common/error/invalidCsrfTokenError.jsp" />
                </bean>
            </entry>
            <!-- ### Setting for detecting a invalid session(if can not load a CSRF token from HttpSession) ### -->
            <entry
                key="org.springframework.security.web.csrf.MissingCsrfTokenException">
                <bean
                    class="org.springframework.security.web.access.AccessDeniedHandlerImpl">
                    <property name="errorPage"
                        value="/WEB-INF/views/common/error/missingCsrfTokenError.jsp" />
                </bean>
            </entry>
        </map>
    </constructor-arg>
    <!-- ### Setting for detect a invalid access to protected page ### -->
    <constructor-arg index="1">
        <bean
            class="org.springframework.security.web.access.AccessDeniedHandlerImpl">
            <property name="errorPage"
                value="/WEB-INF/views/common/error/accessDeniedError.jsp" />
        </bean>
    </constructor-arg>
</bean>

Note

上記の設定は、5.0.0用のblank projectの設定と同じになります。

詳細はガイドラインのCSRF対策を参照してください。(English または Japanese).

[参考]

この方法は従来のスタイルになります。(例:1.0.1用のblank projectの設定)

<sec:http auto-config="true" use-expressions="true">
    <sec:custom-filter ref="csrfFilter" before="LOGOUT_FILTER"/>
    <!-- ... -->
    <sec:session-management session-authentication-strategy-ref="sessionAuthenticationStrategy" />
</sec:http>

<bean id="csrfTokenRepository"
    class="org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository" />

<bean id="csrfFilter" class="org.springframework.security.web.csrf.CsrfFilter">
    <constructor-arg index="0" ref="csrfTokenRepository" />
    <property name="accessDeniedHandler">
        <bean
            class="org.springframework.security.web.access.AccessDeniedHandlerImpl">
            <property name="errorPage" value="/WEB-INF/views/common/error/csrfTokenError.jsp" />
        </bean>
    </property>
</bean>

<bean id="sessionAuthenticationStrategy"
    class="org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy">
    <constructor-arg index="0">
        <list>
            <bean
                class="org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy" />
            <bean
                class="org.springframework.security.web.csrf.CsrfAuthenticationStrategy">
                <constructor-arg index="0"
                    ref="csrfTokenRepository" />
            </bean>
        </list>
    </constructor-arg>
</bean>

[Step 6] ログアウトリクエストにて POST メソッドに修正

5.0.0から(From Spring Security 3.2)、ログアウトリクエストの仕様が変更されました。 具体的には、ログアウトリクエストで POST メソッドを使用する必要があります。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • Spring SecurityのCSRF対策を使用している場合
  • ログアウトリクエストで GET メソッドを使用している場合

[変更方法]

ログアウトリクエストを送信するHTMLやJSPファイルを POST メソッドに修正してください。

[Step 7] Concurrent Session Control(<sec:concurrency-control>)のXML namespaceを使用する設定に修正

5.0.0から、Concurrent Session Control(<sec:concurrency-control>)のためのXML namespaceの使用を推奨します。

[手順の必要なケース]

この手順はオプションですが、適用することを推奨します。 以下のケースとすべて一致し、かつ必要な場合、次の修正を行ってください。

  • Spring SecurityのConcurrent Session Controlを使用している場合
  • <sec:concurrency-control> タグを使用せずに、Concurrent Session Controlのコンポーネントを定義する場合

[変更方法]

<sec:concurrency-control> タグを使用するように変更してください。 <sec:concurrency-control> を使用している場合、Concurrent Session Controlのためのコンポーネントが自動的に有効になります。

  • ConcurrentSessionFilter
  • SessionRegistryImpl
  • ConcurrentSessionControlAuthenticationStrategy
  • RegisterSessionAuthenticationStrategy
  • (SessionFixationProtectionStrategy または ChangeSessionIdAuthenticationStrategy)

Note

ConcurrentSessionControlStrategy はSpring Security 3.2から非推奨になりました。 ConcurrentSessionControlStrategyConcurrentSessionControlAuthenticationStrategyRegisterSessionAuthenticationStrategy に分離されます。

<sec:http auto-config="true" >
    <sec:session-management>
        <sec:concurrency-control error-if-maximum-exceeded="true" />
    </sec:session-management>
</sec:http>

[参考]

この設定は、従来のスタイルと非推奨のスタイル(例:1.0.1の開発ガイドラインに記述されている構成法)になります。

Warning

ConcurrentSessionControlStrategy はSpring Security 3.2から非推奨になりました。 移行後に <sec:concurrency-control> タグを使用せずにConcurrent Session Controlのためのコンポーネントを定義する場合は、"[ステップ8] Spring Securityの推奨されないAPIを置換"が必要になります。

<sec:http auto-config="true" >
    <!-- omitted -->
    <sec:custom-filter
        position="CONCURRENT_SESSION_FILTER" ref="concurrencyFilter" />
    <sec:session-management
        session-authentication-strategy-ref="sessionAuthenticationStrategy" />
    <!-- omitted -->
</sec:http>

<bean id="sessionRegistry"
    class="org.springframework.security.core.session.SessionRegistryImpl" />

<bean id="concurrencyFilter"
   class="org.springframework.security.web.session.ConcurrentSessionFilter">
   <constructor-arg index="0" ref="sessionRegistry" />
</bean>

<bean id="sessionAuthenticationStrategy"
    class="org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy">
    <constructor-arg index="0">
        <list>
            <!-- omitted -->
            <bean class="org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy">
                <constructor-arg index="0" ref="sessionRegistry" />
                <property name="exceptionIfMaximumExceeded" value="true" />
            </bean>
            <!-- omitted -->
        </list>
    </constructor-arg>
</bean>

<!-- omitted -->

[Step 8] Spring Securityの推奨されないAPIを置き換え

5.0.0から(Spring Security 3.2)、 ConcurrentSessionControlStrategy は推奨されません。

Note

ConcurrentSessionControlStrategy はスプリングセキュリティ3.2から非推奨になりました。 ConcurrentSessionControlStrategyConcurrentSessionControlAuthenticationStrategyRegisterSessionAuthenticationStrategy に分離されます。

Note

"[Step 7] Concurrent Session Control(<sec:concurrency-control>)のXML namespaceを使用する設定に修正"の手順を適用した場合、この手順をスキップしてください。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • Spring SecurityのConcurrent Session Controlを使用している場合
  • 移行後に <sec:concurrency-control> タグを使用せずにConcurrent Session Controlのためのコンポーネントを定義する場合

[変更方法]

ConcurrentSessionControlStrategy の代わりに ConcurrentSessionControlAuthenticationStrategyRegisterSessionAuthenticationStrategy を使用するように変更してください。

Note

ConcurrentSessionControlAuthenticationStrategyRegisterSessionAuthenticationStrategy の間に SessionFixationProtectionStrategy を定義してください。

<!-- omitted -->

<bean id="sessionAuthenticationStrategy"
    class="org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy">
    <constructor-arg index="0">
        <list>
            <!-- omitted -->
            <bean class="org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy">
                <constructor-arg index="0" ref="sessionRegistry" />
                <property name="exceptionIfMaximumExceeded" value="true" />
            </bean>
            <bean class="org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy" />
            <bean class="org.springframework.security.web.authentication.session.RegisterSessionAuthenticationStrategy">
                <constructor-arg index="0" ref="sessionRegistry" />
            </bean>
            <!-- omitted -->
        </list>
    </constructor-arg>
</bean>

<!-- omitted -->

[参考]

この設定は非推奨なスタイルになります(例:1.0.1の開発ガイドラインに記述されている構成法)。

<!-- omitted -->

<bean id="sessionAuthenticationStrategy"
    class="org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy">
    <constructor-arg index="0">
        <list>
            <!-- omitted -->
            <bean class="org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy">
                <constructor-arg index="0" ref="sessionRegistry" />
                <property name="exceptionIfMaximumExceeded" value="true" />
            </bean>
            <!-- omitted -->
        </list>
    </constructor-arg>
</bean>

<!-- omitted -->

[Step 9] GET メソッドを使用している場合、 <form:form> タグにJSPを修正

5.0.0から(Spring Security 3.2 + Spring Framework 4.0から)、 CsrfRequestDataValueProcessor の振る舞いが改善されました。 具体的には、 <form:form method="GET"> を使用する場合に、CSRFトークン値はhiddenタグとして出力がされません。 (つまり、CSRFトークン値は、クエリ文字列に含まれません)

[手順の必要なケース]

この手順は任意になります。 以下のケースとすべて一致し、かつ必要な場合、次の修正を行ってください。

  • Spring SecurityのCSRF対策を使用している場合
  • HTML標準の <form> タグと GET リクエストでの <spring:nestedPath> タグの組み合わせで使用している場合

[変更手順]

GET リクエストで <form:form method="GET"> を使用するように変更してください。

<!-- ### Need to modify ### -->
<form:form method="GET" modelAttribute="xxxForm" action="...">
    <%-- ... --%>
</form:form>

Note

<form:form> タグのメソッド属性を省略した場合、 POST メソッドが適用されます。

[参考]

このコードは従来のスタイルになります。

<form method="GET" action="...">
    <spring:nestedPath path="xxxForm">
        <%-- ... --%>
    </spring:nestedPath>
</form>

または

<form action="...">
    <spring:nestedPath path="xxxForm">
        <%-- ... --%>
    </spring:nestedPath>
</form>

Note

HTML標準の <form> タグのメソッド属性を省略した場合、 GET が適用されます。

[Step 10] @AuthenticationPrincipal を使用するようにアプリケーションを修正

5.0.0から(Spring Security 3.2から)、 @AuthenticationPrincipal はコントローラクラスのメソッドに UserDetails を引き渡すために追加されました。 @AuthenticationPrincipal を使用することを推奨します。

[手順の必要なケース]

この手順は任意になります。必要な場合、次の変更を実行してください。

[変更方法(推奨スタイル)]

<mvc:argument-resolvers> タグに AuthenticationPrincipalArgumentResolver を追加してください。

次のいずれかのファイルを変更してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
<mvc:annotation-driven>
    <mvc:argument-resolvers>
        <!-- ... -->
        <!-- ### Need to add ### -->
        <bean
            class="org.springframework.security.web.bind.support.AuthenticationPrincipalArgumentResolver" />
    </mvc:argument-resolvers>
</mvc:annotation-driven>

Controllerクラスでは メソッド引数として、 org.springframework.security.core.userdetails.UserDetails クラスと @AuthenticationPrincipal アノテーションを指定してください。

@RequestMapping(method = RequestMethod.GET)
public String view(
        @AuthenticationPrincipal CustomUserDetails userDetails, // ### Need to modify ###
        Model model) {
    // ...
}

[参考]

このコードは従来のスタイルになります。

@RequestMapping(method = RequestMethod.GET)
public String view(Principal principal, Model model) {
    Authentication authentication = (Authentication) principal;
    CustomUserDetails userDetails = (CustomUserDetails) authentication.getPrincipal();
    // ...
}

[Step 11] <sec:csrfInput> タグを使用するようにJSPを修正

5.0.0から(Spring Security 3.2から)、 <sec:csrfInput> はhiddenタグとしてCSRFトークン値を埋め込むために追加されました。

[手順の必要なケース]

この手順は任意です。以下のケースとすべて一致し、かつ必要な場合、次の修正を行ってください。

  • Spring SecurityのCSRF対策を使用している場合
  • JSP( <form:form> タグを使用せずに)に、hiddenタグとしてCSRFトークン値を埋め込むロジックを実装する場合

[変更方法(推奨スタイル)]

<sec:csrfInput> を使用するように修正してください。

<form method="POST" action="...">
    <%-- ... --%>
    <sec:csrfInput />
</form>

[参考]

このコードは従来のスタイルになります。

<form method="POST" action="...">
    <%-- ... --%>
    <input type="hidden" name="${f:h(_csrf.parameterName)}" value="${f:h(_csrf.token)}"/>
</form>

[Step 12] <sec:csrfMetaTags > タグを使用するようにJSPを修正

5.0.0から(Spring Security 3.2から)、 <sec:csrfMetaTags> は、 <meta> タグとしてCSRFトークン値を組み込むために追加されました。

[手順の必要なケース]

この手順は任意です。次のケースをすべて満たし、かつ必要性がある場合、次の修正を行ってください。

  • Spring SecurityのCSRF対策を使用している場合
  • JSPに、 <meta> タグとしてCSRFトークン値を組み込むロジックを実装する場合

[変更方法(推奨スタイル)]

<sec:csrfMetaTags> を使用するように修正してください。

<head>
    <sec:csrfMetaTags />
</head>

Note

<meta>タグのname属性について

<sec:csrfMetaTags> を使用する場合、 <meta> タグのname属性に注意すること。( <sec:csrfMetaTags> で出力するタグは以下の通り)

<meta name="_csrf_parameter" content="_csrf" />
<meta name="_csrf_header" content="X-CSRF-TOKEN" />
<meta name="_csrf" content="102fbad9-7d4f-42d2-a506-6a47120b5f36" />

Javascriptで違ったnameを使用している場合、修正する必要がある。

[参考]

このコードは従来のスタイルになります。

<head>
    <meta name="_csrf_parameter" content="${f:h(_csrf.parameterName)}" />
    <meta name="_csrf_header" content="${f:h(_csrf.headerName)}"/>
    <meta name="_csrf" content="${f:h(_csrf.token)}"/>
</head>

[Step 13] Jackson 2.4を使用する設定に更新

5.0.0から(Spring Security 4.1から)、Jackson 1.xはサポートされていません。 その為、Jacksonを使用する場合、Jackson 2.4を使用する設定に修正する必要があります。

[手順の必要なケース]

以下のケースと一致する場合、次の変更を行ってください。

  • <mvc:message-converters> タグに MappingJacksonHttpMessageConverter をカスタマイズする場合

[変更方法]

以下の通り、修正してください。

  • HttpMessageConverter のクラス名を変更します (MappingJacksonHttpMessageConverter -> MappingJackson2HttpMessageConverter)
  • JacksonのAPIのパッケージ名を変更します ("org.codehaus -> com.fasterxml)

以下のいずれかファイルを修正してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
<bean id="jsonMessageConverter"
    class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <!-- ### Need to edit ### -->
    <property name="objectMapper">
        <bean id="objectMapper" class="com.fasterxml.jackson.databind.ObjectMapper"> <!-- ### Need to edit ### -->
            <property name="dateFormat">
                <bean class="com.fasterxml.jackson.databind.util.StdDateFormat" /> <!-- ### Need to edit ### -->
            </property>
        </bean>
    </property>
    <!-- ... -->
</bean>

<mvc:annotation-driven>
    <mvc:message-converters register-defaults="false">
        <ref bean="jsonMessageConverter" />
    </mvc:message-converters>
    <!-- ... -->
</mvc:annotation-driven>

Note

他のプロパティを定義している場合、必要に応じて修正してください。

[参考]

この設定は5.0.0から無効になります。

<bean id="jsonMessageConverter"
    class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
    <property name="objectMapper">
        <bean id="objectMapper" class="org.codehaus.jackson.map.ObjectMapper">
            <property name="dateFormat">
                <bean class="org.codehaus.jackson.map.util.StdDateFormat" />
            </property>
        </bean>
    </property>
    <!-- ... -->
</bean>

<mvc:annotation-driven>
    <mvc:message-converters register-defaults="false">
        <ref bean="jsonMessageConverter" />
    </mvc:message-converters>
    <!-- ... -->
</mvc:annotation-driven>

[Step 14] Jackson 2.4を使用するようにアプリケーションを修正

5.0.0から(Spring Security 4.1から)、Jackson 1.xのは、サポートされていません。 Jackson 1.xのを使用してのであれば、修正するアプリケーションは、Jackson 2.4のクラスを使用する必要があります。

[手順の必要なケース]

以下のいずれかのケースと一致する場合、次の変更を行ってください。

  • シリアライズまたはデシリアライズをカスタマイズするJackson 1.xのアノテーションを使用している場合
  • Jackson 1.xより提供されるインタフェース(または拡張クラス)を実装する場合

[変更方法]

Jackson 2.4のクラスを使用するように変更してください。

Note

Root packageは以下の通りになります。

  • 1.x : org.codehaus
  • 2.4 : com.fasterxml

サブパッケージ構成も色々変更されています。

For examples,

  • org.codehaus.jackson.map.ObjectMapper -> com.fasterxml.jackson.databind.ObjectMapper
  • org.codehaus.jackson.map.util.StdDateFormat -> com.fasterxml.jackson.databind.util.StdDateFormat
  • more ...

@JsonSerialize.include ( @JsonSerialize.include は非推奨になりました)代わりに @JsonInclude 使用するように変更してください

@JsonInclude(JsonInclude.Include.NON_NULL) // ### Need to change ###
private String password;

[参考]

このコードは5.0.0から非推奨なスタイルになります。

@JsonSerialize(include = Inclusion.NON_NULL)
private String password;

[Step 15] Tiles 3.0用の ViewResolver を使用する設定に修正

5.0.0から、Spring IO Platform 1.1.0.RELEASEは依存ライブラリのバージョン管理のために適用されています。 その為、Tilesは3.0.5に更新されました。

[手順の必要なケース]

以下のケースと一致する場合、次の変更を行ってください。

  • ビューを解決するためにTilesを使用している場合

[変更方法(推奨スタイル)]

Tiles 3.0ためのクラスを使用するように変更してください。 <mvc:tiles> タグと <mvc:tiles-configurer> タグを使用することを推奨します。

以下のいずれかのファイルを修正してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
<mvc:view-resolvers>
    <!-- ... -->
    <mvc:tiles /> <!-- ### Need to replace ### -->
    <!-- ... -->
</mvc:view-resolvers>

<!-- ### Need to replace ### -->
<mvc:tiles-configurer>
    <mvc:definitions location="/WEB-INF/tiles/tiles-definitions.xml" />
</mvc:tiles-configurer>

[別の方法(参考)]

この設定は従来のスタイルになります。

<bean
    class="org.springframework.web.servlet.view.tiles3.TilesViewResolver">
    <property name="order" value="1" />
</bean>

<bean class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/tiles/tiles-definitions.xml</value>
        </list>
    </property>
</bean>

[参考]

この設定は5.0.0から無効になります。

<bean
    class="org.springframework.web.servlet.view.tiles2.TilesViewResolver">
    <property name="order" value="1" />
</bean>

<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/tiles/tiles-definitions.xml</value>
        </list>
    </property>
</bean>

[Step 16] Tiles 3.0を使用する為にtiles設定ファイルを修正

5.0.0から、Spring IO Platform 1.1.0.RELEASEは依存ライブラリのバージョン管理のために適用されています。 その為Tilesは3.0.5に更新されたので、Tiles 3.0から、dtdファイルが更新されました。

[手順の必要なケース]

以下のケースと一致する場合、次の変更を行ってください。

  • ビューを解決するためにTilesを使用している場合

[変更方法]

dtdファイルをTiles 3.0を使用するように修正してください。

以下のいずれかのファイルを修正してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/webapp/META-INF/tiles/tiles-definitions.xml
  • $YOUR_SINGLE_PROJECT/src/main/webapp/META-INF/tiles/tiles-definitions.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/webapp/META-INF/tiles/tiles-definitions.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
   "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
   "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"> <!-- ### Need to edit ### -->

<tiles-definitions>
    <!-- ... -->
</tiles-definitions>

[参考]

この設定は5.0.0から無効になります。

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
   "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
   "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">

<tiles-definitions>
    <!-- ... -->
</tiles-definitions>

[Step 17] JSPのtaglibをTiles 3.0用に修正

5.0.0から、Spring IO Platform 1.1.0.RELEASEは依存ライブラリのバージョン管理のために適用されています。 その為、Tilesは3.0に更新されたので、 Tiles 3.0から、 tags-tiles-extras はJSPタグライブラリとして追加されています。

[手順の必要なケース]

以下のケースと一致する場合、次の変更を行ってください。

  • ビューを解決するためにTilesを使用している場合
  • <tiles:useAttribute> タグを使用している場合

[変更方法]

tags-tiles-extras をtaglibに追加してください。

以下のいずれかのファイルを修正してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/webapp/META-INF/views/common/include.jsp
  • $YOUR_SINGLE_PROJECT/src/main/webapp/META-INF/views/common/include.jsp
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/webapp/META-INF/views/common/include.jsp
<%-- ... --%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles-extras" prefix="tilesx"%> <!-- ### Need to add ### -->
<%-- ... --%>

そして、新しいJSPタグライブラリ(<tilesx:useAttribute>)を使用するようにJSPの変更が必要になります。

<%-- ... --%>
<tilesx:useAttribute id="cssList" name="cssList" classname="java.util.List" /> <!-- ### Need to edit ### -->
<%-- ... --%>

[参考]

この設定は5.0.0から無効になります。

<%-- ... --%>
<tiles:useAttribute id="cssList" name="cssList" classname="java.util.List" />
<%-- ... --%>

[Step 18] ValidationMessages.properties でデフォルトメッセージを上書き

5.0.0から、Spring IO Platform 1.1.0.RELEASEは依存ライブラリのバージョン管理のために適用されています。 その為、Hibernate Validatorは5.1.3に更新されました。 Tiles 5.1.3から、以下のデフォルトのメッセージの変更とバグ(HV-949)が含まれています。

  • @DecimalMax メッセージ定義の変更(Expression Languageを使用するように修正)
  • @DecimalMin メッセージ定義の変更(Expression Languageを使用するように修正)
  • 新しいメッセージ定義を追加
  • 新しいメッセージ定義のバグ(HV-949)

[手順の必要なケース]

以下のいずれかのケースと一致する場合、次の変更を行ってください。

  • @javax.validation.constraints.DecimalMax を使用している場合
  • @javax.validation.constraints.DecimalMin を使用している場合
  • 移行後の新しいメッセージ定義を使用する場合

[変更方法]

以下を実施してください:

  • 4.3と 5.1に違いを確認
  • application messagesとの違いを対応
  • 新しいアノテーションか @CreditCardNumber を使用している場合、メッセージ定義を修正

以下のいずれかのファイルを修正する。(ファイルがない場合は追加する)

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/ValidationMessages.properties
  • $YOUR_SINGLE_PROJECT/src/main/resources/ValidationMessages.properties
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/ValidationMessages.properties

[Step 19] Bean Validationの非推奨APIを置き換え

5.0.0から、Spring IO Platform 1.1.0.RELEASEは依存ライブラリのバージョン管理のために適用されています。 その為、Bean Validationは1.1に更新された。 Bean Validation 1.1から、一部のAPIは非推奨になりました。

[手順の必要なケース]

以下のいずれかのケースと一致する場合、次の変更を行ってください。

  • javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.addNode(String) を使用している場合
  • javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext.addNode(String) を使用している場合
  • javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext.addNode(String) を使用している場合
  • javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder.addNode(String) を使用している場合

[変更方法]

Bean Validation 1.1から追加されたAPI(addPropertyNode, addBeanNode, addParameterNode)に置き換えてください。 非推奨となったAPIの詳細は こちら を参照してください。

[Step 20] Joda Timeの非推奨APIを置き換え

5.0.0から、Spring IO Platform 1.1.0.RELEASEは依存ライブラリのバージョン管理のために適用されています。 その為、Joda Timeは2.5に更新されました。 Bean Validation 1.1から、一部のAPIは非推奨になりました。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • org.joda.time.DateMidnight を使用している場合

[変更方法]

タイムゾーンを必要としない場合は、 org.joda.time.LocalDate を使用してください。

LocalDate currentLocalDate  = new LocalDate();

または

タイムゾーンが必要な場合は、 org.joda.time.DateTime.withTimeAtStartOfDay() を使用して、一日の開始時に設定されている org.joda.time.DateTime を使用してください。

DateTime currentDateTimeAtStartOfDay = new DateTime().withTimeAtStartOfDay();

[参考]

この設定は5.0.0から非推奨なスタイルになります。

DateMidnight currentDateMidnight = new DateMidnight();

[Step 21] BasicDataSourceのApache Commons DBCP 2を置き換え

5.0.0から、Spring IO Platform 1.1.0.RELEASEは依存ライブラリのバージョン管理のために適用されています。 その為、Apache Commons DBCPは2.0に更新されました。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • org.apache.commons.dbcp.BasicDataSource を使用している場合

[変更方法]

以下の通り、修正してください。

  • BasicDataSource のパッケージ名を org.apache.commons.dbcp から org.apache.commons.dbcp2 に修正
  • idle状態とactive状態の同時接続数を設定するプロパティ名を maxActive から maxTotal に変更
  • connection poolからexceptionをスローするまでの最大wait時間(ミリ秒)を設定するプロパティ名を maxWait から maxWaitMillis に変更

以下のいずれかのファイルを修正してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-env/src/main/resources/META-INF/spring/xxx-env.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/xxx-env.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/xxx-env.xml
<bean id="realDataSource" class="org.apache.commons.dbcp2.BasicDataSource"
    destroy-method="close"> <!-- ### Need to edit ### -->
    <property name="driverClassName" value="${database.driverClassName}" />
    <property name="url" value="${database.url}" />
    <property name="username" value="${database.username}" />
    <property name="password" value="${database.password}" />
    <property name="defaultAutoCommit" value="false" />
    <property name="maxTotal" value="${cp.maxActive}" /> <!-- ### Need to edit ### -->
    <property name="maxIdle" value="${cp.maxIdle}" />
    <property name="minIdle" value="${cp.minIdle}" />
    <property name="maxWaitMillis" value="${cp.maxWait}" /> <!-- ### Need to edit ### -->
</bean>

Note

以下のプロパティを使用した場合、必要に応じて修正してください。

  • removeAbandoned を使用している場合、 removeAbandonedOnBorrow または removeAbandonedOnMaintenance または両方を使用してください。

[参考]

<bean id="realDataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName" value="${database.driverClassName}" />
    <property name="url" value="${database.url}" />
    <property name="username" value="${database.username}" />
    <property name="password" value="${database.password}" />
    <property name="defaultAutoCommit" value="false" />
    <property name="maxActive" value="${cp.maxActive}" />
    <property name="maxIdle" value="${cp.maxIdle}" />
    <property name="minIdle" value="${cp.minIdle}" />
    <property name="maxWait" value="${cp.maxWait}" />
</bean>

[Step 22] @ExistInCodeList の仕様変更を適用

5.0.0から、 @ExistInCodeList のメッセージキーの仕様は、バグ修正のために変更されました。 バグ情報について GitHub issues#16 参照してください。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • @ExistInCodeList のデフォルトのメッセージをオーバーライドする場合。

[変更方法]

@ExistInCodeList のメッセージキーに .message を追加してください。

次のいずれかのファイルを変更してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/ValidationMessages.properties
  • $YOUR_SINGLE_PROJECT/src/main/resources/ValidationMessages.properties
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/ValidationMessages.properties
org.terasoluna.gfw.common.codelist.ExistInCodeList.message = Custom message for your application

[参考]

この設定は5.0.0から非推奨なスタイルになります。

org.terasoluna.gfw.common.codelist.ExistInCodeList = Custom message for your application

[Step 23] QueryEscapeUtils のメソッドの仕様変更を適用

5.0.0から、 QueryEscapeUtils のメソッドの仕様は、バグ修正のために変更されました。 バグ情報について GitHub issues#148 を参照してください。 この仕様変更により、SQL(またはJPQL)でLIKE句のワイルドカード文字での誤ったエスケープ問題が解決されます。

Note

ワイルドカード文字について(エスケープ対象文字)

1.0.1までは、ワイルドカード文字は、以下のとおりです:

  • % , _ , , _

5.0.0以降、デフォルトのワイルドカード文字は、以下のとおりです:

  • % , _

[手順の必要なケース]

以下のケースとすべて一致する場合、次の修正を行ってください。

  • ワイルドカード文字をエスケープするために QueryEscapeUtils のメソッドを使用している場合。
  • '%' と '_' をワイルドカード文字(全角ワイルドカード文字)としてサポートするデータベースを使用している場合。例:Oracle 11g。

[変更方法]

オプション(1.0.1との互換性オプション)を使用するように変更してください。

  • QueryEscapeUtils.withFullWidth() メソッドを使用して全角ワイルドカード文字をエスケープするため、 LikeConditionEscape インスタンスを取得。
  • QueryEscapeUtils と同じシグネチャのメソッドを呼び出。

変更されたコードは以下のようになります:

String escapedWord = QueryEscapeUtils.withFullWidth().toLikeCondition(query);

[Step 24] f:u() の仕様変更を適用

5.0.0から、 f:u() の仕様は、バグ修正のため変更されました。 バグの詳細について GitHub issues#149 を参照してください。 この仕様変更により、クエリ文字列のパラメータ値での誤ったURLエンコードの問題が解決されます。

Note

エンコード対象について

  • 1.0.1まで f:u() はURIをエンコードするEL関数でした(例: http://localhost:8080/path?param=value#fragment)。
  • 5.0.0(および1.0.2)以降、 f:u() はリクエストパラメータ値をエンコードするためのEL関数になります。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を行ってください。

  • URIのエンコードを使用している場合(例: http://localhost:8080/path?param=value#fragment)。

[変更方法]

以下のJSPタグライブラリを使うように修正してください。

  • <c:url>
  • <spring:url>
<a href="<c:url value="${url}" />">Link Name</a>

[Step 25] CompositeRequestDataValueProcessor の仕様変更を適用

5.0.0から、 CompositeRequestDataValueProcessor#getExtraHiddenFields のメソッドの仕様は、バグ修正のため変更されました。 バグの詳細について GitHub issues#167 を参照してください。

Note

RequestDataValueProcessor によって生成された隠されたタグの出力順について

この仕様変更により、 RequestDataValueProcessor (CSRFトークン、トランザクショントークン、等...)によって生成されたhiddenタグの出力順序は変更される可能性があります。

[手順の必要なケース]

以下のいずれかのケースと一致する場合、次の変更を行ってください。

  • RequestDataValueProcessor によって生成されたhiddenタグに、JavaScriptを使用してアクセスしている場合。
  • RequestDataValueProcessor によって生成されたhiddenタグに、自動化されたE2Eテストケース(Seleniumなど...)でアクセスしている場合。

[変更方法]

hiddenタグの出力順序に関連して発生した問題の場合、
RequestDataValueProcessor によって生成されたhiddenタグへのアクセス方法に変更してください。

[Step 26] プロジェクトに ValidationMessages.properties を追加

5.0.0から、 ValidationMessages.properties は、terasoluna-gfw-commonのJARファイルからバグ修正のため除外されています。 バグの詳細について GitHub issues#256 を参照してください。

関連する問題は [multi#99], [single#75].

Note

表示されるメッセージについて

この変更により、 @ExistInCodeList のデフォルトメッセージは表示されていない(代わりに、メッセージキーが表示されている)可能性があります。

[手順の必要なケース]

以下のケースとすべて一致する場合、次の修正を行ってください。

  • Beanの検証として、 @ExistInCodeList のアノテーションを使用している場合。
  • terasoluna-gfw-commonのJARファイル内の ValidationMessages.properties@ExistInCodeList のデフォルトのメッセージを使用している場合。

[変更方法]

以下のいずれかのファイルに @ExistInCodeList のメッセージ定義を追加してください。(プロジェクト内のファイルが存在しない場合は、プロジェクトにファイルを追加してください)

  • YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/ValidationMessages.properties
  • $YOUR_SINGLE_PROJECT/src/main/resources/ValidationMessages.properties
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/ValidationMessages.properties
org.terasoluna.gfw.common.codelist.ExistInCodeList.message = Does not exist in {codeListId}

[Step 27] アクティブなページのリンクの仕様変更を適用

5.0.0から、 <pagination> タグの改善のためアクティブなページのリンク(現在のページのリンク)の仕様が変更されました。 バグの詳細について GitHub issues#13 を参照してください。

Note

アクティブなページのリンクのについて仕様

1.0.1までは, 以下のような仕様:

  • アクティブリンクが有効になっていました。これは、アクティブページリンクをクリックすると、現在のページを再読み込みするのためのリクエストしたことを意味します。

5.0.0以降, 以下のような仕様:

  • アクティブリンクが無効になります。これは、アクティブページリンクをクリックすると、現在のページを再読み込みするのためのリクエストがされないことを意味します。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を適用してください。

  • アクティブなページのリンクがクリックされたときに、現在のページをリロードする必要がある場合。

[変更方法]

アクティブなページのリンクを有効にするには <pagination> タグに enableLinkOfCurrentPage="true" を設定してください

<t:pagination
    page="${page}"
    enableLinkOfCurrentPage="true" /> <!-- ### Need to set the 'enableLinkOfCurrentPage' attribute ### -->

[Step 28] 無効なページのリンクの仕様変更を適用

5.0.0から、 <pagination> タグの改善のため、無効なページリンクの仕様が変更されました。 バグの詳細について GitHub issues#14 を参照してください。

Note

無効なページリンクについての仕様

1.0.1までは, 以下のような仕様:

  • 無効リンクのhrefに "#" を設定していました。これは、無効なページのリンクをクリックすると、ページ位置が現在のページの先頭に移動していたことを意味します。

5.0.0以降, 以下のような仕様:

  • 無効リンクのhrefに "javascript:void(0)" を設定します。これは、無効なページのリンクをクリックすると、ページ位置が現在のページの先頭に移動しないことを意味します。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を適用してください。

  • この動作(例:JavaScriptを使用して)がアプリケーションですでに適用されてしまい解決したい場合。

[変更方法]

1.0.1と同じ動作を適用するには <pagination> タグに disabledHref="#" を設定してください。

<t:pagination
    page="${page}"
    disabledHref="#" /> <!-- ### Need to set the 'disabledHref' attribute ### -->

Note

アプリケーションの措置が5.0.0と同じである場合( <pagination> タグに disabledHref="javascript:void(0)" を設定していた場合)、アプリケーションの措置は削除することを推奨します。

[Step 29] ResultMessages.warn() の代わりに ResultMessages.warning() を使用するようにアプリケーションを変更

5.0.0から、 the alert component of the Bootstrap との互換性をサポートするための ResultMessages.warn() メソッドの代わりに ResultMessages.warning() メソッドが追加されています。 この変更により、 ResultMessages.warn() は非推奨なメソッドとなりました。

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

Note

アプリケーションが本番環境にリリースされていない場合、次の変更が推奨されます。

[変更方法]

ResultMessages.warn() の代わりに ResultMessages.warning() を使用するようにアプリケーションを変更してください。それと必要に応じて、CSSファイルを変更してください。

[Step 30] 依存関係の定義にterasoluna-gfw-jodatimeを追加

5.0.0から、terasoluna-gfw-jodatimeはJoda Timeに依存するコンポーネントを提供するための代わりに追加されています。(terasoluna-gfw-commonからJoda Timeに依存するコンポーネントを分離するため)

[手順の必要なケース]

以下のケースと一致する場合、次の修正を適用してください。

  • DateFactory を使用している場合

[変更方法]

以下のファイルの依存関係の定義に、terasoluna-gfw-jodatimeアーティファクトを追加してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-domain/pom.xml
  • $YOUR_SINGLE_PROJECT/pom.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/.classpath
  • $YOUR_ECLIPSE_WTP_PROJECT/build.xml

pom.xml (Mavenプロジェクトのみ)

<!-- ### Need to add ### -->
<dependency>
    <groupId>org.terasoluna.gfw</groupId>
    <artifactId>terasoluna-gfw-jodatime</artifactId>
</dependency>

.classpath (WTPプロジェクトのみ)

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/terasoluna-gfw-jodatime-5.0.0.RELEASE.jar"
    sourcepath="libsrc/terasoluna-gfw-jodatime-5.0.0.RELEASE-sources.jar" /> <!-- ### Need to add ### -->

build.xml (WTPプロジェクトのみ)

<path id="build.classpath">
    <!-- ... -->
    <pathelement location="${lib.dir}/terasoluna-gfw-jodatime-5.0.0.RELEASE.jar"/> <!-- ### Need to add ### -->
    <!-- ... -->
</path>

[Step 31] DateFactory の代わりに JodaTimeDateFactory を使用するようにアプリケーションを変更

5.0.0から、terasoluna-gfw-commonからJoda Timeに依存するコンポーネントを分離するため DateFactory の代わりに JodaTimeDateFactory が追加されています。 この変更により、 DateFactory は非推奨なメソッドとなりました。

Note

これらの変更は、将来的にJava 8から追加されたDate/Time API(JSR-310)をサポートできるようになります。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を適用してください。

  • DateFactory を使用している場合

Note

非推奨の DataFactory クラスは、今後のリリースで除去されます。

Note

アプリケーションが本番環境にリリースされていない場合、次の変更が推奨されます。

[変更方法]

DateFactory の代わりに JodaTimeDateFactory を追加して使用するようにアプリケーションを変更してください。

Java file :

public class XxxServiceImpl implements XxxService {
    @Inject
    JodaTimeDateFactory dateFactory; // ### Need to edit###
    // ...
}

Bean定義ファイル :

  • $YOUR_MULTIPLE_PROJECT_ROOT/src/main/resources/META-INF/spring/xxx-env.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/xxx-env.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/xxx-env.xml
<bean id="dateFactory"
    class="org.terasoluna.gfw.common.date.jodatime.DefaultJodaTimeDateFactory" /> <!-- ### Need to edit ### -->
.. tabularcolumns:: |p{0.50\linewidth}|p{0.50\linewidth}|
Correspondence table for replace class
1.0.1 (Deprecated APIs) 5.0.0 (Recommended APIs)
org.terasoluna.gfw.common.date.
DefaultDateFactory
org.terasoluna.gfw.common.date.jodatime.
DefaultJodaTimeDateFactory
org.terasoluna.gfw.common.date.
JdbcAdjustedDateFactory
org.terasoluna.gfw.common.date.jodatime.
JdbcAdjustedJodaTimeDateFactory
org.terasoluna.gfw.common.date.
JdbcFixedDateFactory
org.terasoluna.gfw.common.date.jodatime.
JdbcFixedJodaTimeDateFactory

[Step 32] spring-mvc.xml に設定している ViewResolver の修正を適用

5.0.0から、 BeanNameViewResolverTilesViewResolverBeanNameViewResolver と同じこと回避するために変更されました。 バグの詳細について GitHub multi/issues#50 を参照してください。

Note

"[Step 2] ViewResolver のXML namespaceを使用する設定に修正"の手順を適用させている場合, この手順をスキップしてください。

定義の順序は以下の通りになります:

<mvc:view-resolvers>
    <mvc:bean-name />
    <mvc:tiles />
    <mvc:jsp prefix="/WEB-INF/views/" />
</mvc:view-resolvers>

[手順の必要なケース]

以下のケースとすべて一致する場合は、次の修正を適用してください。

  • レイアウトエンジンとしてApacheのTileを使用している場合
  • BeanNameViewResolver を使用している場合
  • TilesViewResolverBeanNameViewResolver 同じ順序で設定している場合(そのままblank projectを使用している場合)

[変更方法]

以下のファイルで、 BeanNameViewResolver の順序を TilesViewResolver の順序より低く変更してください。

  • YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/src/main/resources/META-INF/spring/spring-mvc.xml
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver">
    <property name="order" value="0" /> <!-- ### Need to edit value attribute ### -->
</bean>

[Step 33] xxx-domain.xmlResultMessagesLoggingInterceptor の設定追加を適用

5.0.0から、 ResultMessagesLoggingInterceptorxxx-domain.xml に追加されました。 バグの詳細について GitHub single/issues#39 を参照してください。 この変更により、 ResultMessages を保持する例外が記録されます。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を適用してください。

  • JPAのための単一のblank projectから生成されたプロジェクトを使用している場合

[変更方法]

以下のいずれかのファイルに ResultMessagesLoggingInterceptor 定義を追加してください。

  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/xxx-domain.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/xxx-domain.xml
<bean id="resultMessagesLoggingInterceptor"
    class="org.terasoluna.gfw.common.exception.ResultMessagesLoggingInterceptor">
    <property name="exceptionLogger" ref="exceptionLogger" />
</bean>
<aop:config>
    <aop:advisor advice-ref="resultMessagesLoggingInterceptor"
        pointcut="@within(org.springframework.stereotype.Service)" />
</aop:config>

[Step 34] spring-security.xml に設定している UserIdMDCPutFilter の修正を適用

5.0.0から、 spring-security.xmlUserIdMDCPutFilter の設定を変更しました。 バグの詳細について GitHub single/issues#45 を参照してください。 この変更により、 それはSpring Securityの処理を終えた後のログに、ログインユーザ名を含めることが可能となります。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を適用してください。

  • 認証と承認の処理などでSpring Securityを使用している場合

[変更方法]

以下のいずれかのファイルから UserIdMDCPutFilterremoveValue プロパティを削除してください。

  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-security.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-security.xml
<bean id="userIdMDCPutFilter" class="org.terasoluna.gfw.security.web.logging.UserIdMDCPutFilter">
    <!-- ### Need to remove the 'removeValue' property ### -->
</bean>

[Step 35] pom.xml に設定している <distributionManagement> の修正を適用

1.0.2から、 pom.xml から <distributionManagement> の設定が削除されます。 バグの詳細について GitHub multi/issues#8 を参照してください。

[手順の必要なケース]

この手順はオプションですが、次の修正を適用することを推奨します。

[変更方法]

以下のファイルから、 <distributionManagement> の設定を削除するか、 <distributionManagement> の設定からterasolunaorgリポジトリ(terasoluna-gfw-releases, terasoluna-gfw-snapshots)を削除してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/pom.xml
<distributionManagement>
    <!-- ### Need to remove terasolunaorg repositories ### -->
    <!--
    <repository>
        <id>terasoluna-gfw-releases</id>
        <url>http://repo.terasoluna.org/nexus/content/repositories/terasoluna-gfw-releases/</url>
    </repository>
    <snapshotRepository>
        <id>terasoluna-gfw-snapshots</id>
        <url>http://repo.terasoluna.org/nexus/content/repositories/terasoluna-gfw-snapshots/</url>
    </snapshotRepository>
    -->
</distributionManagement>

[Step 36] pom.xml に設定している <relativePath> の修正を適用

5.0.0から、 <relativePath />pom.xml に追加されました。 バグの詳細について GitHub multi/issues#36GitHub single/issues#46 を参照してください。 この変更により、 STSの最初のインポートとのトラブルを避けることができるようになりました。

[手順の必要なケース]

この手順はオプションですが、次の修正を適用することを推奨します。

[変更方法]

以下のいずれかのファイルに、 <parent> の子要素として <relativePath /> 要素を追加してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/pom.xml
  • $YOUR_SINGLE_PROJECT/pom.xml
<parent>
    <groupId>org.terasoluna.gfw</groupId>
    <artifactId>terasoluna-gfw-parent</artifactId>
    <version>5.0.0.RELEASE</version>
    <relativePath /> <!-- ### Need to add ### -->
</parent>

[Step 37] xxx-codelist.xml に設定している JdbcCodeList の修正を適用

5.0.0から、 JdbcCodeList のための jdbcTemplate のBean定義は xxx-codelist.xml に追加されています。 バグの詳細について GitHub multi/issues#39 を参照してください。 この変更により、 select文にフェッチサイズを指定することが可能となりました。

[手順の必要なケース]

以下のケースと一致する場合、次の修正を適用することを推奨します。

  • JdbcCodeList として大量のレコードを使用している場合

[変更方法]

以下のファイルに JdbcCodeList の抽象Bean & jdbcTemplate のBean定義を追加してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/src/main/resources/META-INF/spring/xxx-domain.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/xxx-domain.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/xxx-domain.xml
<bean id="jdbcTemplateForCodeList" class="org.springframework.jdbc.core.JdbcTemplate">
    <property name="dataSource" ref="dataSource" />
    <property name="fetchSize" value="${codelist.jdbc.fetchSize:1000}" />
</bean>

<bean id="AbstractJdbcCodeList"
      class="org.terasoluna.gfw.common.codelist.JdbcCodeList" abstract="true">
    <property name="jdbcTemplate" ref="jdbcTemplateForCodeList" />
</bean>

それと JdbcCodeList Bean定義に抽象Beanを適用するための手順を実行してください。

  • class 属性の代わりに parent 属性に抽象Bean IDを指定
  • dataSource プロパティを削除。
<bean id="CL_SAMPLE" parent="AbstractJdbcCodeList"> <!-- ### Need to edit ### -->
    <property name="querySql" value="SELECT code, code_name FROM t_sample_codes ORDER BY code" />
    <property name="valueColumn" value="code" />
    <property name="labelColumn" value="code_name" />
    <!-- ### Need to remove the 'dataSource' property ### -->
</bean>

[Step 38] xxx-domain.xml にインポート設定するコードリストの修正の適用

5.0.0から、 ワイルドカードインポートは xxx-domain.xml に複数のコードリストの定義ファイルをインポートするために使用されています。 バグの詳細について GitHub multi/issues#66GitHub single/issues#71 を参照してください。 この変更により、 ネストされたディレクトリから複数のファイルをインポートすることが可能となる。

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

[変更方法]

以下のいずれかのファイルにワイルドカードのインポートを使用するように変更してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/src/main/resources/META-INF/spring/xxx-domain.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/xxx-domain.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/xxx-domain.xml
<import resource="classpath*:META-INF/spring/**/*-codelist.xml" /> <!-- ### Need to edit ### -->

[Step 39] spring-mvc.xml に設定している CodeListInterceptor の修正を適用

1.0.2から、 CodeListInterceptorspring-mvc.xml に追加されました。 バグの詳細について GitHub multi/issues#77GitHub single/issues#62 を参照してください。 この変更により、 CodeList はビューコンポーネント(例:JSP)からアクセスすることができます。

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

[変更方法]

以下のいずれかのファイルに CodeListInterceptor 定義を追加してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_SINGLE_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
  • $YOUR_ECLIPSE_WTP_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml
<mvc:interceptors>

    <!-- omit -->

    <mvc:interceptor>
        <mvc:mapping path="/**" />
        <mvc:exclude-mapping path="/resources/**" />
        <mvc:exclude-mapping path="/**/*.html" />
        <bean class="org.terasoluna.gfw.web.codelist.CodeListInterceptor">
            <property name="codeListIdPattern" value="CL_.+" />
        </bean>
    </mvc:interceptor>

    <!-- omit -->

</mvc:interceptors>

[Step 40] 親 pom.xml (マルチ) の変更を適用

5.0.0から、Spring IO Platform 1.1.1.RELEASEは依存ライブラリのバージョン管理のため適用されています。 この変更により、ビルド設定はblank projectに変更されました。

[手順の必要なケース]

この手順の一部は必要になります。

[変更方法]

blank projectの変更を適用してください。

[Step 40-1] $YOUR_MULTIPLE_PROJECT_ROOT/pom.xml

Note

変更内容の詳細は comparing page with 1.0.1.RELEASE and 5.0.0.RELEASE を参照してください。

  • "Files changed" のタブを選択
  • "32 changed files" のリンクをクリック (ファイルの一覧を開く)
  • "pom.xml" のリンクをクリック (ファイルの差分に移動)

不要な場合は、 <build>/<extensions>/<extension> を削除してください。 (推奨手順)

  • org.apache.maven.archetype:archetype-packaging
  • org.apache.maven.wagon:wagon-ssh
  • org.apache.maven.archetype:archetype-packaging

不要な場合は、 <build>/<pluginManagement> を削除してください。 (推奨手順)

  • org.apache.maven.plugins:maven-compiler-plugin

不要な場合は、 <reporting> を削除してください。 (推奨手順)

  • org.apache.maven.plugins:maven-checkstyle-plugin
  • org.apache.maven.plugins:maven-javadoc-plugin
  • org.apache.maven.plugins:maven-project-info-reports-plugin
  • org.apache.maven.plugins:maven-resources-plugin
  • org.apache.maven.plugins:maven-site-plugin
  • org.apache.maven.plugins:maven-surefire-report-plugin
  • org.apache.maven.plugins:maven-jxr-plugin
  • org.codehaus.mojo:emma-maven-plugin
  • org.codehaus.mojo:findbugs-maven-plugin

<dependencyManagement> から dependencies managed by the Spring IO Platform を削除してください。 (推奨手順)

  • org.apache.tomcat:tomcat-servlet-api
  • org.apache.tomcat:tomcat-jsp-api
  • etc ...

<properties> 設定から不必要なプロパティを削除してください。 (推奨手順)

[Step 40-2] $YOUR_MULTIPLE_PROJECT_ROOT/xxx-domain/pom.xml

Note

変更内容の詳細は comparing page with 1.0.1.RELEASE and 5.0.0.RELEASE を参照してください。

  • "Files changed" のタブを選択
  • "32 changed files" のリンクをクリック (ファイルの一覧を開く)
  • "projectName-domain/pom.xml" のリンクをクリック (ファイルの差分に移動)

org.mockito:mockito-core を使用するように変更してください (必須手順)

  • org.mockito:mockito-all -> org.mockito:mockito-core

<dependencies> 設定にユニットテストのための新しいライブラリを追加してください。 (条件付き必須手順)

  • org.apache.tomcat.embed:tomcat-embed-el:test (Bean検証をテストする場合は、このライブラリが必要です)
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-el</artifactId>
    <scope>test</scope>
</dependency>

依存関係の設定にスコープを指定してください。 (条件付き必須手順)

  • ユニットテストでライブラリを使用している場合のみ、 test スコープが必要です。
  • アプリケーションサーバが提供するライブラリを使用している場合は、 provided スコープが必要です。
  • アプリケーション実行時にライブラリを使用している場合は、 runtime スコープが必要です。

[Step 40-3] $YOUR_MULTIPLE_PROJECT_ROOT/xxx-env/pom.xml

Note

変更内容の詳細は comparing page with 1.0.1.RELEASE and 5.0.0.RELEASE を参照してください。

  • "Files changed" のタブを選択
  • "32 changed files" のリンクをクリック (ファイルの一覧を開く)
  • "projectName-env/pom.xml" のリンクをクリック (ファイルの差分に移動)

不要な場合は、 <build>/<plugins> の設定を削除してください。

  • org.apache.maven.plugins:maven-eclipse-plugin

[Step 40-4] $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/pom.xml

Note

変更内容の詳細は comparing page with 1.0.1.RELEASE and 5.0.0.RELEASE を参照してください。

  • "Files changed" のタブを選択
  • "32 changed files" のリンクをクリック (ファイルの一覧を開く)
  • "projectName-web/pom.xml" のリンクをクリック (ファイルの差分に移動)

<dependencies> 設定にユニットテストのための新しいライブラリを追加してください。 (条件付き必須手順)

  • org.apache.tomcat.embed:tomcat-embed-el:test (Bean検証をテストする場合は、このライブラリが必要です)
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-el</artifactId>
    <scope>test</scope>
</dependency>

依存関係の設定にスコープを指定してください。 (条件付き必須手順)

  • ユニットテストでライブラリを使用している場合のみ、 test スコープが必要です。
  • アプリケーションサーバが提供するライブラリを使用している場合は、 provided スコープが必要です。
  • アプリケーション実行時にライブラリを使用している場合は、 runtime スコープが必要です。

[Step 41] pom.xml に設定しているJDBC driverの依存関係の修正を適用

5.0.0からは、JDBCドライバの設定は pom.xml で改善されました。 バグ情報について GitHub multi/issues#92 を参照してください。

改善は以下の通りになります。

  • ローカルプロファイルでのみH2 Databaseを使用することができるように改善 (つまり、製造やテストのためにwarファイルにH2 Databaseのjarファイルを除外するように改善)
  • WebプロジェクトからJDBCドライバを削除する改善

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

[変更方法]

以下のファイルのすべてに改善を適用してください。

  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-domain/pom.xml
  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-env/pom.xml
  • $YOUR_MULTIPLE_PROJECT_ROOT/xxx-web/pom.xml

まず、 xxx-domain/pom.xml からH2 Databaseの依存関係の定義を削除してください。

<!-- ### Need to remove the H2 Database ###
<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <scope>runtime</scope>
</dependency>
-->

xxx-env/pom.xml のローカルプロファイルにH2 Databaseの依存関係の定義を追加してください。

<profile>
    <id>local</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <resource.directory>src/main/resources</resource.directory>
        <buildFinalName>${project.artifactId}-${project.version}</buildFinalName>
    </properties>
    <!-- ### Need to add H2 Database dependency ### -->
    <dependencies>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
</profile>

xxx-web/pom.xmldefault のプロファイル設定を変更してください。

  • default から default へプロファイルIDを変更
  • XXX-env.jarを含むwarファイルを生成するために、warpack-with-env プロファイルを追加 (Note: H2 databaseは除外)
<profiles>
    <profile>
        <id>local</id> <!-- ### Need to edit ### -->
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <dependencies>
            <dependency>
                <groupId>com.example</groupId>
                <artifactId>xxx-env</artifactId>
            </dependency>
        </dependencies>
    </profile>
    <profile>
        <id>warpack</id>
        <dependencies>
        </dependencies>
    </profile>
    <!-- ### Need to add warpack-with-env ### -->
    <profile>
        <id>warpack-with-env</id>
        <dependencies>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>xxx-env</artifactId>
                <exclusions>
                    <exclusion>
                        <groupId>com.h2database</groupId>
                        <artifactId>h2</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </profile>
</profiles>

Note

<groupId><artifactId> の値を設定することについて

プロジェクト設定によって、 <groupId><artifactId> の値を設定してください。

最後に、 xxx-web/pom.xml からJDBCドライバの依存関係を削除してください。

[Step 42] 親 pom.xml (シングル) の変更を適用

5.0.0から、Spring IO Platform 1.1.1.RELEASEは、依存ライブラリのバージョン管理のために適用います。 この変更により、ビルド設定はblank projectで変更されました。

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

[変更方法]

以下のファイルから dependency managed by the Spring IO Platform のバージョンタグを削除してください。

  • $YOUR_SINGLE_PROJECT/pom.xml

例:)

<dependency>
    <!-- omit -->

    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-jsp-api</artifactId>
    <!-- ### Remove version tag ### -->
    <scope>provided</scope>

    <!-- omit -->
</dependency>

[Step 43] pom.xml のテスト用の依存関係設定の修正を適用

5.0.0から、 pom.xml にユニットテストのための依存関係が追加されました。 バグ情報について GitHub single/issues#6 を参照してください。

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

[変更方法]

以下のファイルのようにユニットテストの依存関係を追加してください。

  • $YOUR_SINGLE_PROJECT/pom.xml
</dependencies>

    <!-- omit -->

    <!-- ### Need to add dependencies for unit testing ### -->
    <!-- Unit Test -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-el</artifactId>
        <scope>test</scope>
    </dependency>

</dependencies>
  • $YOUR_ECLIPSE_WTP_PROJECT/.classpath
<!-- ### Need to add dependencies for unit testing ### -->
<classpathentry kind="lib"
    path="testlib/hamcrest-core-1.3.jar"
    sourcepath="libsrc/hamcrest-core-1.3-sources.jar" />
<classpathentry kind="lib"
    path="testlib/junit-4.11.jar"
    sourcepath="libsrc/junit-4.11-sources.jar" />
<classpathentry kind="lib"
    path="testlib/mockito-core-1.10.8.jar"
    sourcepath="libsrc/mockito-core-1.10.8-sources.jar" />
<classpathentry kind="lib"
    path="testlib/objenesis-2.1.jar"
    sourcepath="libsrc/objenesis-2.1-sources.jar" />
<classpathentry kind="lib"
    path="testlib/spring-test-4.1.4.RELEASE.jar"
    sourcepath="libsrc/spring-test-4.1.4.RELEASE-sources.jar" />
<classpathentry kind="lib"
    path="testlib/tomcat-embed-el-7.0.57.jar"
    sourcepath="libsrc/tomcat-embed-el-7.0.57-sources.jar" />

Note

jarファイルは Eclipse WTP Project of 5.0.0.RELEASE からダウンロードしたzipファイルに含まれています。

  • $YOUR_ECLIPSE_WTP_PROJECT/build.xml
<path id="build.test.classpath">
    <path refid="build.classpath" />
    <pathelement location="${testlib.dir}/hamcrest-core-1.3.jar"/>
    <pathelement location="${testlib.dir}/junit-4.11.jar"/>
    <pathelement location="${testlib.dir}/mockito-core-1.10.8.jar"/>
    <pathelement location="${testlib.dir}/objenesis-2.1.jar"/>
    <pathelement location="${testlib.dir}/spring-test-4.1.4.RELEASE.jar"/>
    <pathelement location="${testlib.dir}/tomcat-embed-el-7.0.57.jar"/>
</path>

[Step 44] pom.xml に設定している依存スコープの修正を適用

5.0.0から、pom.xml のJDBCドライバの依存スコープは変更されました。 バグ情報について GitHub single/issues#60 を参照してください。

[手順の必要なケース]

この手順は任意です。必要な場合、次の修正を行ってください。

[変更方法]

以下のファイルのようにJDBCドライバの依存関係のスコープを compile から runtime へ変更してください。

  • $YOUR_SINGLE_PROJECT/pom.xml
</dependencies>

    <!-- omit -->

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope> <!-- ### Need to edit ### -->
    </dependency>

    <!-- omit -->

</dependencies>

Appendix

Eclipse WTP プロジェクトを使っている場合のライブラリの更新

release site から ダウンロードされたEclipse WTP プロジェクトの更新手順は以下の通り。

Note

O / RマッパーとしてMyBatis3を使用している場合は、Eclipse WTPのためのblank projectsを使用して、新しい開発プロジェクトを生成してください。 (つまり、MyBatis3の移行手順が提供されていない)

Note

Legend

[Table Header]
Non : Blank project for none O/R Mapper
MB3 : Blank project for MyBatis 3
JPA : Blank project for JPA
[Marks]
* : 対応対象

[Step 1]

Eclipse WTP Project of 5.0.0.RELEASE からダウンロードします。

[Step 2]

Eclipseが起動している場合、Eclipseを終了します。

[Step 3]

$YOUR_ECLIPSE_WTP_PROJECT/src/main/webapp/WEB-INF/lib のjarファイルを更新します(削除して追加します)。

.. tabularcolumns:: |p{0.25\linewidth}|p{0.30\linewidth}|p{0.30\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|
Library Name Delete File Add File Non MB3 JPA
TERASOLUNA Server Framework for Java (5.x) Common Library terasoluna-gfw-common-1.0.1.RELEASE.jar terasoluna-gfw-common-5.0.0.RELEASE.jar * - *
  terasoluna-gfw-web-1.0.1.RELEASE.jar terasoluna-gfw-web-5.0.0.RELEASE.jar * - *
  terasoluna-gfw-security-core-1.0.1.RELEASE.jar terasoluna-gfw-security-core-5.0.0.RELEASE.jar * - *
  terasoluna-gfw-security-web-1.0.1.RELEASE.jar terasoluna-gfw-security-web-5.0.0.RELEASE.jar * - *
  terasoluna-gfw-jpa-1.0.1.RELEASE.jar terasoluna-gfw-jpa-5.0.0.RELEASE.jar   - *
  - terasoluna-gfw-jodatime-5.0.0.RELEASE.jar * - *
Spring Framework spring-aop-3.2.10.RELEASE.jar spring-aop-4.1.4.RELEASE.jar * - *
  spring-aspects-3.2.10.RELEASE.jar spring-aspects-4.1.4.RELEASE.jar * - *
  spring-beans-3.2.10.RELEASE.jar spring-beans-4.1.4.RELEASE.jar * - *
  spring-context-3.2.10.RELEASE.jar spring-context-4.1.4.RELEASE.jar * - *
  spring-context-support-3.2.10.RELEASE.jar spring-context-support-4.1.4.RELEASE.jar * - *
  spring-core-3.2.10.RELEASE.jar spring-core-4.1.4.RELEASE.jar * - *
  spring-expression-3.2.10.RELEASE.jar spring-expression-4.1.4.RELEASE.jar * - *
  spring-jdbc-3.2.10.RELEASE.jar spring-jdbc-4.1.4.RELEASE.jar * - *
  spring-orm-3.2.10.RELEASE.jar spring-orm-4.1.4.RELEASE.jar * - *
  spring-tx-3.2.10.RELEASE.jar spring-tx-4.1.4.RELEASE.jar * - *
  spring-web-3.2.10.RELEASE.jar spring-web-4.1.4.RELEASE.jar * - *
  spring-webmvc-3.2.10.RELEASE.jar spring-webmvc-4.1.4.RELEASE.jar * - *
Spring Data Commons spring-data-commons-1.6.4.RELEASE.jar spring-data-commons-1.9.1.RELEASE.jar * - *
Spring Security spring-security-acl-3.1.4.RELEASE.jar spring-security-acl-3.2.5.RELEASE.jar * - *
  spring-security-config-3.1.4.RELEASE.jar spring-security-config-3.2.5.RELEASE.jar * - *
  spring-security-core-3.1.4.RELEASE.jar spring-security-core-3.2.5.RELEASE.jar * - *
  spring-security-taglibs-3.1.4.RELEASE.jar spring-security-taglibs-3.2.5.RELEASE.jar * - *
  spring-security-web-3.1.4.RELEASE.jar spring-security-web-3.2.5.RELEASE.jar * - *
Hibernate hibernate-core-4.2.3.Final.jar hibernate-core-4.3.7.Final.jar   - *
  hibernate-entitymanager-4.2.3.Final.jar hibernate-entitymanager-4.3.7.Final.jar   - *
Hibernate Commons Annotations hibernate-commons-annotations-4.0.2.Final.jar hibernate-commons-annotations-4.0.5.Final.jar   - *
Java Persistence API 2.0 hibernate-jpa-2.0-api-1.0.1.Final.jar -   - *
Java Persistence API 2.1 - hibernate-jpa-2.1-api-1.0.0.Final.jar   - *
Javassist javassist-api-3.15.0-GA.jar javassist-api-3.18.1-GA.jar   - *
Java Annotation Indexer - jandex-1.1.0.Final.jar   - *
JBoss Logging I18n Annotations - jboss-logging-annotations-1.2.0.Final.jar   - *
Java Transaction API 1.1 jboss-transaction-api_1.1_spec-1.0.1.Final.jar -   - *
Java Transaction API 1.2 - jboss-transaction-api_1.2_spec-1.0.0.Final.jar   - *
Spring Data JPA spring-data-jpa-1.4.3.RELEASE.jar spring-data-jpa-1.7.1.RELEASE.jar   - *
AspectJ aspectjrt-1.7.4.jar aspectjrt-1.8.4.jar * - *
  aspectjweaver-1.7.4.jar aspectjweaver-1.8.4.jar * - *
Logback logback-classic-1.0.13.jar logback-classic-1.1.2.jar * - *
  logback-core-1.0.13.jar logback-core-1.1.2.jar * - *
SLF4J jcl-over-slf4j-1.7.5.jar jcl-over-slf4j-1.7.8.jar * - *
  slf4j-api-1.7.5.jar slf4j-api-1.7.8.jar * - *
Jackson jackson-core-asl-1.9.7.jar - * - *
  jackson-mapper-asl-1.9.7.jar - * - *
  - jackson-annotations-2.4.4.jar * - *
  - jackson-core-2.4.4.jar * - *
  - jackson-databind-2.4.4.jar * - *
  - jackson-datatype-joda-2.4.4.jar * - *
Bean Validation API validation-api-1.0.0.GA.jar validation-api-1.1.0.Final.jar * - *
Hibernate Validator hibernate-validator-4.3.1.Final.jar hibernate-validator-5.1.3.Final.jar * - *
JBoss Logging 3 jboss-logging-3.1.0.GA.jar jboss-logging-3.1.3.GA.jar * - *
Apache Commons BeanUtils commons-beanutils-1.8.3.jar commons-beanutils-1.9.2.jar * - *
Dozer dozer-5.4.0.jar dozer-5.5.1.jar * - *
  - dozer-spring-5.5.1.jar * - *
Apache Commons Lang commons-lang3-3.1.jar commons-lang3-3.3.2.jar * - *
Joda Time joda-time-2.2.jar joda-time-2.5.jar * - *
Jadira Usertype usertype.core-3.0.0.GA.jar usertype.core-3.2.0.GA.jar   - *
  usertype.spi-3.0.0.GA.jar usertype.spi-3.2.0.GA.jar   - *
Apache Commons DBCP commons-dbcp-1.2.2 .patch_DBCP264_DBCP372.jar commons-dbcp2-2.0.1.jar * - *
Apache Commons Pool commons-pool-1.6.jar commons-pool2-2.2.jar * - *
Commons Digester commons-digester-2.0.jar commons-digester-2.1.jar * - *
Tiles tiles-api-2.2.2.jar tiles-api-3.0.5.jar * - *
  tiles-core-2.2.2.jar tiles-core-3.0.5.jar * - *
  tiles-jsp-2.2.2.jar tiles-jsp-3.0.5.jar * - *
  tiles-servlet-2.2.2.jar tiles-servlet-3.0.5.jar * - *
  tiles-template-2.2.2.jar tiles-template-3.0.5.jar * - *
Tiles Autotag Core - tiles-autotag-core-runtime-1.1.0.jar * - *
Tiles Request - tiles-request-servlet-1.0.6.jar * - *
  - tiles-request-api-1.0.6.jar * - *
  - tiles-request-jsp-1.0.6.jar * - *
Guava guava-13.0.1.jar guava-17.0.jar * - *

[Step 4]

$YOUR_ECLIPSE_WTP_PROJECT/src/main/webapp/WEB-INF/libsrc のsource jarファイルを更新します(削除して追加します)。

.. tabularcolumns:: |p{0.25\linewidth}|p{0.30\linewidth}|p{0.30\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|
Library Name Delete File Add File Non MB3 JPA
TERASOLUNA Server Framework for Java (5.x) Common Library terasoluna-gfw-common-1.0.1.RELEASE-sources.jar terasoluna-gfw-common-5.0.0.RELEASE-sources.jar * - *
  terasoluna-gfw-web-1.0.1.RELEASE-sources.jar terasoluna-gfw-web-5.0.0.RELEASE-sources.jar * - *
  terasoluna-gfw-security-core-1.0.1.RELEASE-sources.jar terasoluna-gfw-security-core-5.0.0.RELEASE-sources.jar * - *
  terasoluna-gfw-security-web-1.0.1.RELEASE-sources.jar terasoluna-gfw-security-web-5.0.0.RELEASE-sources.jar * - *
  terasoluna-gfw-jpa-1.0.1.RELEASE-sources.jar terasoluna-gfw-jpa-5.0.0.RELEASE-sources.jar   - *
  - terasoluna-gfw-jodatime-5.0.0.RELEASE-sources.jar * - *
Spring Framework spring-aop-3.2.10.RELEASE-sources.jar spring-aop-4.1.4.RELEASE-sources.jar * - *
  spring-aspects-3.2.10.RELEASE-sources.jar spring-aspects-4.1.4.RELEASE-sources.jar * - *
  spring-beans-3.2.10.RELEASE-sources.jar spring-beans-4.1.4.RELEASE-sources.jar * - *
  spring-context-3.2.10.RELEASE-sources.jar spring-context-4.1.4.RELEASE-sources.jar * - *
  spring-context-support-3.2.10.RELEASE-sources.jar spring-context-support-4.1.4.RELEASE-sources.jar * - *
  spring-core-3.2.10.RELEASE-sources.jar spring-core-4.1.4.RELEASE-sources.jar * - *
  spring-expression-3.2.10.RELEASE-sources.jar spring-expression-4.1.4.RELEASE-sources.jar * - *
  spring-jdbc-3.2.10.RELEASE-sources.jar spring-jdbc-4.1.4.RELEASE-sources.jar * - *
  spring-orm-3.2.10.RELEASE-sources.jar spring-orm-4.1.4.RELEASE-sources.jar * - *
  spring-tx-3.2.10.RELEASE-sources.jar spring-tx-4.1.4.RELEASE-sources.jar * - *
  spring-web-3.2.10.RELEASE-sources.jar spring-web-4.1.4.RELEASE-sources.jar * - *
  spring-webmvc-3.2.10.RELEASE-sources.jar spring-webmvc-4.1.4.RELEASE-sources.jar * - *
Spring Data Commons spring-data-commons-1.6.4.RELEASE-sources.jar spring-data-commons-1.9.1.RELEASE-sources.jar * - *
Spring Security spring-security-acl-3.1.4.RELEASE-sources.jar spring-security-acl-3.2.5.RELEASE-sources.jar * - *
  spring-security-config-3.1.4.RELEASE-sources.jar spring-security-config-3.2.5.RELEASE-sources.jar * - *
  spring-security-core-3.1.4.RELEASE-sources.jar spring-security-core-3.2.5.RELEASE-sources.jar * - *
  spring-security-taglibs-3.1.4.RELEASE-sources.jar spring-security-taglibs-3.2.5.RELEASE-sources.jar * - *
  spring-security-web-3.1.4.RELEASE-sources.jar spring-security-web-3.2.5.RELEASE-sources.jar * - *
Hibernate hibernate-core-4.2.3.Final-sources.jar hibernate-core-4.3.7.Final-sources.jar   - *
  hibernate-entitymanager-4.2.3.Final-sources.jar hibernate-entitymanager-4.3.7.Final-sources.jar   - *
Hibernate Commons Annotations hibernate-commons-annotations-4.0.2.Final-sources.jar hibernate-commons-annotations-4.0.5.Final-sources.jar   - *
Java Persistence API 2.0 hibernate-jpa-2.0-api-1.0.1.Final-sources.jar -   - *
Java Persistence API 2.1 - hibernate-jpa-2.1-api-1.0.0.Final-sources.jar   - *
Javassist javassist-api-3.15.0-GA-sources.jar javassist-api-3.18.1-GA-sources.jar   - *
Java Annotation Indexer - jandex-1.1.0.Final-sources.jar   - *
JBoss Logging I18n Annotations - jboss-logging-annotations-1.2.0.Final-sources.jar   - *
Java Transaction API 1.1 jboss-transaction-api_1.1_spec-1.0.1.Final-sources.jar -   - *
Java Transaction API 1.2 - jboss-transaction-api_1.2_spec-1.0.0.Final-sources.jar   - *
Spring Data JPA spring-data-jpa-1.4.3.RELEASE-sources.jar spring-data-jpa-1.7.1.RELEASE-sources.jar   - *
AspectJ aspectjrt-1.7.4-sources.jar aspectjrt-1.8.4-sources.jar * - *
  aspectjweaver-1.7.4-sources.jar aspectjweaver-1.8.4-sources.jar * - *
Logback logback-classic-1.0.13-sources.jar logback-classic-1.1.2-sources.jar * - *
  logback-core-1.0.13-sources.jar logback-core-1.1.2-sources.jar * - *
SLF4J jcl-over-slf4j-1.7.5-sources.jar jcl-over-slf4j-1.7.8-sources.jar * - *
  slf4j-api-1.7.5-sources.jar slf4j-api-1.7.8-sources.jar * - *
Jackson jackson-core-asl-1.9.7-sources.jar - * - *
  jackson-mapper-asl-1.9.7-sources.jar - * - *
  - jackson-annotations-2.4.4-sources.jar * - *
  - jackson-core-2.4.4-sources.jar * - *
  - jackson-databind-2.4.4-sources.jar * - *
  - jackson-datatype-joda-2.4.4-sources.jar * - *
Bean Validation API validation-api-1.0.0.GA-sources.jar validation-api-1.1.0.Final-sources.jar * - *
Hibernate Validator hibernate-validator-4.3.1.Final-sources.jar hibernate-validator-5.1.3.Final-sources.jar * - *
JBoss Logging 3 jboss-logging-3.1.0.GA-sources.jar jboss-logging-3.1.3.GA-sources.jar * - *
Apache Commons BeanUtils commons-beanutils-1.8.3-sources.jar commons-beanutils-1.9.2-sources.jar * - *
Dozer dozer-5.4.0-sources.jar dozer-5.5.1-sources.jar * - *
  - dozer-spring-5.5.1-sources.jar * - *
Apache Commons Lang commons-lang3-3.1-sources.jar commons-lang3-3.3.2-sources.jar * - *
Joda Time joda-time-2.2-sources.jar joda-time-2.5-sources.jar * - *
Jadira Usertype usertype.core-3.0.0.GA-sources.jar usertype.core-3.2.0.GA-sources.jar   - *
  usertype.spi-3.0.0.GA-sources.jar usertype.spi-3.2.0.GA-sources.jar   - *
Apache Commons DBCP commons-dbcp-1.2.2 .patch_DBCP264_DBCP372-sources.jar commons-dbcp2-2.0.1-sources.jar * - *
Apache Commons Pool commons-pool-1.6-sources.jar commons-pool2-2.2-sources.jar * - *
Commons Digester commons-digester-2.0-sources.jar commons-digester-2.1-sources.jar * - *
Tiles tiles-api-2.2.2-sources.jar tiles-api-3.0.5-sources.jar * - *
  tiles-core-2.2.2-sources.jar tiles-core-3.0.5-sources.jar * - *
  tiles-jsp-2.2.2-sources.jar tiles-jsp-3.0.5-sources.jar * - *
  tiles-servlet-2.2.2-sources.jar tiles-servlet-3.0.5-sources.jar * - *
  tiles-template-2.2.2-sources.jar tiles-template-3.0.5-sources.jar * - *
Tiles Autotag Core - tiles-autotag-core-runtime-1.1.0-sources.jar * - *
Tiles Request - tiles-request-servlet-1.0.6-sources.jar * - *
  - tiles-request-api-1.0.6-sources.jar * - *
  - tiles-request-jsp-1.0.6-sources.jar * - *
Guava guava-13.0.1-sources.jar guava-17.0-sources.jar * - *

[Step 5]

置換文字列を使用して、以下のすべてのファイルで参照されるライブラリを更新します。

  • $YOUR_ECLIPSE_WTP_PROJECT/.classpath
  • $YOUR_ECLIPSE_WTP_PROJECT/build.xml
.. tabularcolumns:: |p{0.25\linewidth}|p{0.30\linewidth}|p{0.30\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|
Library Name Before After Non MB3 JPA
TERASOLUNA Server Framework for Java (5.x) Common Library terasoluna-gfw-common-1.0.1.RELEASE terasoluna-gfw-common-5.0.0.RELEASE * - *
  terasoluna-gfw-web-1.0.1.RELEASE terasoluna-gfw-web-5.0.0.RELEASE * - *
  terasoluna-gfw-security-core-1.0.1.RELEASE terasoluna-gfw-security-core-5.0.0.RELEASE * - *
  terasoluna-gfw-security-web-1.0.1.RELEASE terasoluna-gfw-security-web-5.0.0.RELEASE * - *
  terasoluna-gfw-jpa-1.0.1.RELEASE terasoluna-gfw-jpa-5.0.0.RELEASE   - *
Spring Framework spring-aop-3.2.10.RELEASE spring-aop-4.1.4.RELEASE * - *
  spring-aspects-3.2.10.RELEASE spring-aspects-4.1.4.RELEASE * - *
  spring-beans-3.2.10.RELEASE spring-beans-4.1.4.RELEASE * - *
  spring-context-3.2.10.RELEASE spring-context-4.1.4.RELEASE * - *
  spring-context-support-3.2.10.RELEASE spring-context-support-4.1.4.RELEASE * - *
  spring-core-3.2.10.RELEASE spring-core-4.1.4.RELEASE * - *
  spring-expression-3.2.10.RELEASE spring-expression-4.1.4.RELEASE * - *
  spring-jdbc-3.2.10.RELEASE spring-jdbc-4.1.4.RELEASE * - *
  spring-orm-3.2.10.RELEASE spring-orm-4.1.4.RELEASE * - *
  spring-tx-3.2.10.RELEASE spring-tx-4.1.4.RELEASE * - *
  spring-web-3.2.10.RELEASE spring-web-4.1.4.RELEASE * - *
  spring-webmvc-3.2.10.RELEASE spring-webmvc-4.1.4.RELEASE * - *
Spring Data Commons spring-data-commons-1.6.4.RELEASE spring-data-commons-1.9.1.RELEASE * - *
Spring Security spring-security-acl-3.1.4.RELEASE spring-security-acl-3.2.5.RELEASE * - *
  spring-security-config-3.1.4.RELEASE spring-security-config-3.2.5.RELEASE * - *
  spring-security-core-3.1.4.RELEASE spring-security-core-3.2.5.RELEASE * - *
  spring-security-taglibs-3.1.4.RELEASE spring-security-taglibs-3.2.5.RELEASE * - *
  spring-security-web-3.1.4.RELEASE spring-security-web-3.2.5.RELEASE * - *
Hibernate hibernate-core-4.2.3.Final hibernate-core-4.3.7.Final   - *
  hibernate-entitymanager-4.2.3.Final hibernate-entitymanager-4.3.7.Final   - *
Hibernate Commons Annotations hibernate-commons-annotations-4.0.2.Final hibernate-commons-annotations-4.0.5.Final   - *
Javassist javassist-api-3.15.0-GA javassist-api-3.18.1-GA   - *
Spring Data JPA spring-data-jpa-1.4.3.RELEASE spring-data-jpa-1.7.1.RELEASE   - *
AspectJ aspectjrt-1.7.4 aspectjrt-1.8.4 * - *
  aspectjweaver-1.7.4 aspectjweaver-1.8.4 * - *
Logback logback-classic-1.0.13 logback-classic-1.1.2 * - *
  logback-core-1.0.13 logback-core-1.1.2 * - *
SLF4J jcl-over-slf4j-1.7.5 jcl-over-slf4j-1.7.8 * - *
  slf4j-api-1.7.5 slf4j-api-1.7.8 * - *
Bean Validation API validation-api-1.0.0.GA validation-api-1.1.0.Final * - *
Hibernate Validator hibernate-validator-4.3.1.Final hibernate-validator-5.1.3.Final * - *
JBoss Logging 3 jboss-logging-3.1.0.GA jboss-logging-3.1.3.GA * - *
Apache Commons BeanUtils commons-beanutils-1.8.3 commons-beanutils-1.9.2 * - *
Dozer dozer-5.4.0 dozer-5.5.1 * - *
Apache Commons Lang commons-lang3-3.1 commons-lang3-3.3.2 * - *
Joda Time joda-time-2.2 joda-time-2.5 * - *
Jadira Usertype usertype.core-3.0.0.GA usertype.core-3.2.0.GA   - *
  usertype.spi-3.0.0.GA usertype.spi-3.2.0.GA   - *
Apache Commons DBCP commons-dbcp-1.2.2 .patch_DBCP264_DBCP372 commons-dbcp2-2.0.1 * - *
Apache Commons Pool commons-pool-1.6 commons-pool2-2.2 * - *
Commons Digester commons-digester-2.0 commons-digester-2.1 * - *
Tiles tiles-api-2.2.2 tiles-api-3.0.5 * - *
  tiles-core-2.2.2 tiles-core-3.0.5 * - *
  tiles-jsp-2.2.2 tiles-jsp-3.0.5 * - *
  tiles-servlet-2.2.2 tiles-servlet-3.0.5 * - *
  tiles-template-2.2.2 tiles-template-3.0.5 * - *
Guava guava-13.0.1 guava-17.0 * - *

[Step 6]

Eclipse WTPプロジェクトの設定から参照されるライブラリ(以下のjarファイル)を削除します。

  • $YOUR_ECLIPSE_WTP_PROJECT/.classpath
  • $YOUR_ECLIPSE_WTP_PROJECT/build.xml
.. tabularcolumns:: |p{0.30\linewidth}|p{0.55\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|
Library Name Prefix jar file Non MB3 JPA
Java Persistence API 2.0 hibernate-jpa-2.0-api-1.0.1.Final   - *
Java Transaction API 1.1 jboss-transaction-api_1.1_spec-1.0.1.Final   - *
Jackson jackson-core-asl-1.9.7 * - *
  jackson-mapper-asl-1.9.7 * - *

[全てのblank projectが対象]

.classpath

<!-- ### Need to delete following classpath entries ### -->

<!-- omitted -->

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jackson-core-asl-1.9.7.jar"
    sourcepath="libsrc/jackson-core-asl-1.9.7-sources.jar" />

<!-- omitted -->

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jackson-mapper-asl-1.9.7.jar"
    sourcepath="libsrc/jackson-mapper-asl-1.9.7-sources.jar" />

<!-- omitted -->

build.xml

<!-- ### Need to delete following classpath entries ### -->

<path id="build.classpath">
    <!-- ... -->
    <pathelement location="${lib.dir}/jackson-core-asl-1.9.7.jar"/>
    <pathelement location="${lib.dir}/jackson-mapper-asl-1.9.7.jar"/>
    <!-- ... -->
</path>

[JPA blank projectのみ対象]

.classpath

<!-- ### Need to delete following classpath entries ### -->

<!-- omitted -->

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"
    sourcepath="libsrc/hibernate-jpa-2.0-api-1.0.1.Final-sources.jar" />

<!-- omitted -->

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jboss-transaction-api_1.1_spec-1.0.1.Final.jar"
    sourcepath="libsrc/jboss-transaction-api_1.1_spec-1.0.1.Final-sources.jar" />

<!-- omitted -->

build.xml

<!-- ### Need to delete following classpath entries ### -->

<path id="build.classpath">
    <!-- ... -->
    <pathelement location="${lib.dir}/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
    <!-- ... -->
    <pathelement location="${lib.dir}/jboss-transaction-api_1.1_spec-1.0.1.Final.jar"/>
    <!-- ... -->
</path>

[Step 7]

Eclipse WTPプロジェクトの設定に参照されるライブラリ(jarファイル以下)を追加します。

  • $YOUR_ECLIPSE_WTP_PROJECT/.classpath
  • $YOUR_ECLIPSE_WTP_PROJECT/build.xml
.. tabularcolumns:: |p{0.30\linewidth}|p{0.55\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|p{0.05\linewidth}|
Library Name Prefix jar file Non MB3 JPA
TERASOLUNA Server Framework for Java (5.x) Common Library terasoluna-gfw-jodatime-5.0.0.RELEASE * - *
Java Persistence API 2.1 hibernate-jpa-2.1-api-1.0.0.Final   - *
Java Persistence API 2.1 hibernate-jpa-2.1-api-1.0.0.Final   - *
Java Annotation Indexer jandex-1.1.0.Final   - *
JBoss Logging I18n Annotations jboss-logging-annotations-1.2.0.Final   - *
Java Transaction API 1.2 jboss-transaction-api_1.2_spec-1.0.0.Final   - *
Jackson jackson-annotations-2.4.4 * - *
  jackson-core-2.4.4 * - *
  jackson-databind-2.4.4 * - *
  jackson-datatype-joda-2.4.4 * - *
Dozer dozer-spring-5.5.1 * - *
Tiles Autotag Core tiles-autotag-core-runtime-1.1.0 * - *
Tiles Request tiles-request-servlet-1.0.6 * - *
  tiles-request-api-1.0.6 * - *
  tiles-request-jsp-1.0.6 * - *

[全てのblank projectが対象]

.classpath

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/terasoluna-gfw-jodatime-5.0.0.RELEASE.jar"
    sourcepath="libsrc/terasoluna-gfw-jodatime-5.0.0.RELEASE-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jackson-annotations-2.4.4.jar"
    sourcepath="libsrc/jackson-annotations-2.4.4-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jackson-core-2.4.4.jar"
    sourcepath="libsrc/jackson-core-2.4.4-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jackson-databind-2.4.4.jar"
    sourcepath="libsrc/jackson-databind-2.4.4-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jackson-datatype-joda-2.4.4.jar"
    sourcepath="libsrc/jackson-datatype-joda-2.4.4-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/dozer-spring-5.5.1.jar"
    sourcepath="libsrc/dozer-spring-5.5.1-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/tiles-autotag-core-runtime-1.1.0.jar"
    sourcepath="libsrc/tiles-autotag-core-runtime-1.1.0-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/tiles-request-servlet-1.0.6.jar"
    sourcepath="libsrc/tiles-request-servlet-1.0.6-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/tiles-request-api-1.0.6.jar"
    sourcepath="libsrc/tiles-request-api-1.0.6-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/tiles-request-jsp-1.0.6.jar"
    sourcepath="libsrc/tiles-request-jsp-1.0.6-sources.jar" />

build.xml

<!-- ### Need to delete following classpath entries ### -->

<path id="build.classpath">
    <!-- ... -->
    <pathelement location="${lib.dir}/terasoluna-gfw-jodatime-5.0.0.RELEASE.jar"/>
    <pathelement location="${lib.dir}/jackson-annotations-2.4.4.jar"/>
    <pathelement location="${lib.dir}/jackson-core-2.4.4.jar"/>
    <pathelement location="${lib.dir}/jackson-databind-2.4.4.jar"/>
    <pathelement location="${lib.dir}/jackson-datatype-joda-2.4.4.jar"/>
    <pathelement location="${lib.dir}/dozer-spring-5.5.1.jar"/>
    <pathelement location="${lib.dir}/tiles-autotag-core-runtime-1.1.0.jar"/>
    <pathelement location="${lib.dir}/tiles-request-servlet-1.0.6.jar"/>
    <pathelement location="${lib.dir}/tiles-request-api-1.0.6.jar"/>
    <pathelement location="${lib.dir}/tiles-request-jsp-1.0.6.jar"/>
    <!-- ... -->
</path>

[JPA blank projectのみ対象]

.classpath

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar"
    sourcepath="libsrc/hibernate-jpa-2.1-api-1.0.0.Final-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jandex-1.1.0.Final.jar"
    sourcepath="libsrc/jandex-1.1.0.Final-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jboss-logging-annotations-1.2.0.Final.jar"
    sourcepath="libsrc/jboss-logging-annotations-1.2.0.Final-sources.jar" />

<classpathentry kind="lib"
    path="src/main/webapp/WEB-INF/lib/jboss-transaction-api_1.2_spec-1.0.0.Final.jar"
    sourcepath="libsrc/jboss-transaction-api_1.2_spec-1.0.0.Final-sources.jar" />

build.xml

<!-- ### Need to delete following classpath entries ### -->

<path id="build.classpath">
    <!-- ... -->
    <pathelement location="${lib.dir}/hibernate-jpa-2.1-api-1.0.0.Final.jar"/>
    <pathelement location="${lib.dir}/jandex-1.1.0.Final.jar"/>
    <pathelement location="${lib.dir}/jboss-logging-annotations-1.2.0.Final.jar"/>
    <pathelement location="${lib.dir}/jboss-transaction-api_1.2_spec-1.0.0.Final.jar"/>
    <!-- ... -->
</path>
⚠️ **GitHub.com Fallback** ⚠️