ある日、iDempiereを起動しようとしたら突然起動しなかった。
1.現象
idempiere-server.shまたはidempiere-server.batを実行して、
iDempiereを起動をしようとすると以下のエラーが発生し、起動しない。
JAVA_HOME is not set.
You may not be able to start the server
Set JAVA_HOME to the directory of your local JDK.
===================================
Starting iDempiere Server
===================================
Setting myEnvironment ....
java.lang.RuntimeException: Error initializing storage.
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:77)
at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:295)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:392)
at org.eclipse.osgi.container.ModuleDatabase$Persistence.readWire(ModuleDatabase.java:1168)
at org.eclipse.osgi.container.ModuleDatabase$Persistence.load(ModuleDatabase.java:1028)
at org.eclipse.osgi.container.ModuleDatabase.load(ModuleDatabase.java:879)
at org.eclipse.osgi.storage.Storage.<init>(Storage.java:145)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:85)
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:75)
... 11 more
An error has occurred. See the log file
null.
*JAVA_HOMEは関係ない。
JAVA_HOMEに関するmessageは警告なので、これまで起動できていれば関係ない。
idempiere-server.sh
# !/bin/sh
#
if [ $JAVA_HOME ]; then
JAVA=$JAVA_HOME/bin/java
else
JAVA=java
echo JAVA_HOME is not set.
echo You may not be able to start the server
echo Set JAVA_HOME to the directory of your local JDK.
fi
if [ "$1" = "debug" ]; then
DEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4554,server=y,suspend=n"
fi
echo ===================================
echo Starting iDempiere Server
echo ===================================
以下省力
2.原因
.fileTableLockと.fileTable*ファイルが原因
起動時にosgi.storagemanager.StorageManagerクラスで、.fileTableLockファイルと.fileTable*ファイルを削除できなかったのが原因
まずユーザーAを使用してconsole-setup.shを実行した後、ユーザーBを使用してサーバーを起動すると発生する(らしい)
*クラウド環境で、起動時にsudoで実行したため、上記に意識せず上記の地雷を踏んだか…
3.対応方法
.fileTableLockと.fileTableファイルを削除する
.fileTableLockと.fileTableファイルは、以下にある
- /opt/idempiere-server/configuration/org.eclipse.osgi/.manager
- /opt/idempiere-server/configuration/org.eclipse.equinox.app/.manager
- /opt/idempiere-server/configuration/org.eclipse.core.runtime/.manager
- /opt/idempiere-server/setup/configuration/org.eclipse.osgi/.manager
- /opt/idempiere-server/setup/configuration/org.eclipse.core.runtime/.manager
- /opt/idempiere-server/setup/configuration/org.eclipse.equinox.app/.manager
削除するためのLinuxコマンドは次のとおり
sudo -u idempiere / opt / idempiere-server / -name '.fileTableLock *' -delete
sudo -u idempiere find / opt / idempiere-server / -name '.fileTable。*' -delete
参考サイト
IDempiere 4.1 java.lang.RuntimeException: Error initializing storage.