Legacy Knowledge Base
公開されました Jun. 30, 2025

開発者ライセンスが登録できない NullPointerException と UnknownHostException が発生する。

Written By

Shine Yang

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • 開発者ライセンスのデプロイ時に、 NullPointerException および UnknownHostExceptionでDXPインスタンスが起動できない。
2023-05-15 05:35:37.524 ERROR [fileinstall-/home/username/liferay-dxp-digital-enterprise-7.0.10-de-98/osgi/modules][LicenseManager:?] DXP Development license validation failed
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:461)
at com.liferay.portal.license.LicenseManager.f(Unknown Source)
at com.liferay.portal.license.LicenseManager.getServerId(Unknown Source)
at com.liferay.portal.license.LicenseManager.c(Unknown Source)
at com.liferay.portal.license.LicenseManager.checkBinaryLicense(Unknown Source)
at com.liferay.portal.license.LicenseManager.registerLicense(Unknown Source)
at com.liferay.portal.license.util.LocalLicenseManagerImpl.registerLicense(LocalLicenseManagerImpl.java:82)
at com.liferay.portal.kernel.license.util.LicenseManagerUtil.registerLicense(LicenseManagerUtil.java:79)
at com.liferay.portal.license.deployer.internal.installer.LicenseInstaller.install(LicenseInstaller.java:71)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:937)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:871)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:485)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)
2023-05-15 06:25:06.734 INFO [fileinstall-/home/username/liferay-dxp-digital-enterprise-7.0.10-de-98/osgi/modules][LicenseManager:?] License registered for DXP Development)
2023-05-15 06:24:52.079 ERROR [Start Level: Equinox Container: a0205a0f-e9f2-001d-1733-dbe89e521793][Cache:224] Unable to set localhost. This prevents creation of a GUID. Cause was: hostname: hostname: Name or service not known
java.net.UnknownHostException: hostname: hostname: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1512)
at net.sf.ehcache.Cache.<clinit>(Cache.java:222)
at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:305)
at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:223)
at net.sf.ehcache.CacheManager.configure(CacheManager.java:788)
at net.sf.ehcache.CacheManager.doInit(CacheManager.java:474)
at net.sf.ehcache.CacheManager.init(CacheManager.java:398)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:269)
at com.liferay.portal.cache.ehcache.internal.EhcachePortalCacheManager.initPortalCacheManager(EhcachePortalCacheManager.java:253)
at com.liferay.portal.cache.BasePortalCacheManager.initialize(BasePortalCacheManager.java:236)
at com.liferay.portal.cache.ehcache.internal.MultiVMEhcachePortalCacheManager.activate(MultiVMEhcachePortalCacheManager.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
...
Caused by: java.net.UnknownHostException: hostname: Name or service not known
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1330)
at java.net.InetAddress.getLocalHost(InetAddress.java:1507)
... 238 more

Environment

  • Liferay DXP 7.0

解決策

  • OSレベルでのネットワーク設定によるエラーです。 具体的には、ホスト名が既知のIPアドレスに解決しないことです。 OSが対応するIPアドレスを取得できない。 これにより、 UnknownHostException が、 localhostを取得する際にスローされるようになります。 ロジックは数カ所で発生し、そのうちのひとつがライセンス認証コードです。
  • これを解決するには、 /etc/hosts ファイルを確認し、次の行が存在することを確認してください:
    127.0.1.1 hostname
    注: ホスト名 をお使いのOSの実際の ホスト名 に置き換えてください( ホスト名 コマンドの出力です)。

Did this article resolve your issue ?

Legacy Knowledge Base