EJBを含んだ warをdeployするときに、以下のようなエラーが発生することがある
Glassfish Exception during deployment project with Stateful EJBという記事にあるとおり、ホスト名が解決できないことが原因っぽい?
【環境】
- CentOS7
- JDK1.8.0_60
- glassfish 4.1
【詳細】
エラーログを見るとこんな感じ。
Exception while loading the app : EJB Container initialization error
java.lang.ArrayIndexOutOfBoundsException: 4
at com.sun.enterprise.util.Utility.longToBytes(Utility.java:234)
サーバ再起動するとこんなエラーが出る
[XXXX@XXXX glassfish4]# sudo bin/asadmin start-domain
Bad Network Configuration. DNS can not resolve the hostname:
java.net.UnknownHostException: XXXX.XXXX: XXXX.XXXXX: unknown error
Waiting for domain1 to start ........................................................................
Successfully started the domain : domain1
解消方法としては、hostnameで出てくる名称を、DNSから引けるようにするか
/etc/hostsに追記するです。
XXX.XXX.XXX.XXX XXXXhost