« マイナタッチにおける保険証OCR不具合発生 | トップページ

2025年11月 9日 (日)

OpenDolphin: Java 25 / WildFly 38 への移行

これまで java 21、wildfly 34 で運用していたが、java 25、wildfly 38 への移行に挑戦した

wildfly 38 の準備

wildfly の github から branch 38.x を選択,"Download Zip" して解凍する。作業時点ではこれで 38.0.1.Final がダウンロードされた。

mac で wildfly 38 のビルド

brew をアップデートして mvn と ant を最新にしておく。

$ brew update ; brew upgrade

wildfly の build

[INFO] WildFly Preview: Distribution                                      [jar]
[INFO]
[INFO] ---------------------< org.wildfly:wildfly-parent >---------------------
[INFO] Building WildFly: Parent Aggregator 38.0.1.Final-SNAPSHOT        [1/210]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
Downloading from jboss-public-repository-group: https://repository.jboss.org/nexus/content/groups/public/org/apache/maven/plugins/maven-enforcer-plugin/3.6.1/maven-enforcer-plugin-3.6.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-enforcer-plugin/3.6.1/maven-enforcer-plugin-3.6.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-enforcer-plugin/3.6.1/maven-enforcer-plugin-3.6.1.pom (8.2 kB at 144 kB/s)
 :
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  26:05 min
[INFO] Finished at: 2025-10-30T08:00:12+09:00
[INFO] ------------------------------------------------------------------------

これで wildfly-38.0.1.Final-SNAPSHOT ができる。WildFly 34.0.1 と同じく,full distributable build が欲しい場合は,build/target ではなく,dist/target の方を使う必要がある。

wildfly 38.0.1 のセットアップ

  • ./standalone.sh -b 0.0.0.0 で立ち上げて,./add-user.sh で管理ユーザ登録
  • JDBC の登録(ドライバは postgresql-42.7.8.jar),data-source の作成,パスワード登録。
    $ ./jboss-cli.sh --connect
    [standalone@localhost:9990 /] module add --name=org.postgres --resources=~/Downloads/postgresql-42.7.8.jar --dependencies=javax.api,javax.transaction.api
    [standalone@localhost:9990 /] /subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
    [standalone@localhost:9990 /] data-source add --jndi-name=java:jboss/datasources/DolphinDS --name=DolphinDS --connection-url=jdbc:postgresql://localhost/dolphin --driver-name=postgres --user-name=dolphin
    [standalone@localhost:9990 /] /subsystem=datasources/data-source=DolphinDS:write-attribute(name=password, value=dolphin)
    [standalone@localhost:9990 /] quit
    

ライブラリのアップデート

WildFly 38 に合わせて、ライブラリをアップデートする。マイナーバージョンアップのみ。

  • Hibernate 6.6.31.Final
  • Hibernate Search 7.2.4.Final
  • Resteasy 6.2.14.Final
  • Jackson 2.18.4
  • Postgresql 42.7.8

移行に必要な書き換え

  • websocket のタイムアウト抑止
    standalone.xml
    <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" read-timeout="0" write-timeout="0"/>
    

    dolphin server に java 25 をインストール

    $ sudo apt install openjdk-25-jdk-headless
    $ sudo update-alternatives --config java
    alternative java (/usr/bin/java を提供) には 3 個の選択肢があります。
    
      選択肢    パス                                       優先度  状態
    ------------------------------------------------------------
    * 0            /usr/lib/jvm/java-25-openjdk-amd64/bin/java   2511      自動モード
      1            /usr/lib/jvm/java-17-openjdk-amd64/bin/java   1711      手動モード
      2            /usr/lib/jvm/java-21-openjdk-amd64/bin/java   2111      手動モード
      3            /usr/lib/jvm/java-25-openjdk-amd64/bin/java   2511      手動モード
    

    Opensearch インストール

    • ダウンロードサイトから tarball を取ってくる
      $ tar xvzf opensearch-3.3.2-linux-arm64.tar.gz
      $ ln -s opensearch-3.3.2 opensearch
      
    • 初期インストールのプラグインは全部消す
      $ cd opensearch
      $ rm -rf plugins/*
      
    • プラグインインストール
      $ ./bin/opensearch-plugin install analysis-kuromoji
      $ ./bin/opensearch-plugin install analysis-icu
      
    • config/opensearch.yml を設定して起動してみる
      $ vi ./config/opensearch.yml
      cluster.name: opensearch_dolphin
      path.data: /home/dolphin/opensearch/var/lib/opensearch
      path.log: /home/dolphin/opensearch/var/log/opensearch
      
    • opensearch-2.x のインデックスは使えないので、インデックス更新が必要
      2025-11-05 17:10:41,090 INFO  [org.hibernate.search.mapper.pojo.massindexing.impl.PojoMassIndexingLoggingMonitor] (Hibernate Search - Mass indexing - DocumentModel - Entity loading - 3) HSEARCH000031: Mass indexing progress: 100.00%. Mass indexing speed: 259.932800 documents/second since last message, 52.218971 documents/second since start.
      2025-11-05 17:10:43,153 INFO  [org.hibernate.search.mapper.pojo.massindexing.impl.PojoMassIndexingLoggingMonitor] (default task-3) HSEARCH000028: Mass indexing complete. Indexed 246619 entities.
      

    wildfly 起動

    17:29:22,773 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly 38.0.1.Final-SNAPSHOT (WildFly Core 30.0.0.Final) started in 4690ms - Started 628 of 817 services (336 services are lazy, passive or on-demand) - Server configuration file in use: standalone.xml - Minimum feature stability level: community
    

    WildFly アップデート記録
    • 2008年 JBossAS 4.0.5
    • 2009年 JBossAS 4.2.3
    • 2010年 JBossAS 5.1.0
    • 2013年 JBossAS 7.1.4
    • 2015年 WildFly 8.2.1
    • 2017年 WildFly 10.2.0
    • 2019年 WildFly 18.0.1
    • 2021年 WildFly 25.0.2
    • 2023年 WildFly 27.0.2
    • 2024年 WildFly 34.0.1
    • 2025年 WildFly 38.0.1
  • « マイナタッチにおける保険証OCR不具合発生 | トップページ

    OpenDolphin」カテゴリの記事