我已经在 Liferay 论坛上问过,但没有得到答案,我试图配置一个干净的 Liferay 7.4 门户以作为 Windows Server 2022 上的服务启动,我遵循了与配置 Liferay 6.2.5 和通用 Tomcat 服务器作为服务相同的步骤,虽然后者启动没有问题,但 Liferay 7.4 不会启动并显示以下错误:
2023-01-18 13:46:05 Apache Commons Daemon procrun stderr initialized.
18-Jan-2023 13:46:06.582 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1057] milliseconds
JVM arguments: -Dcatalina.home=C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68 -Dcatalina.base=C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68 -Dignore.endorsed.dirs=C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68\endorsed -Djava.io.tmpdir=C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68\conf\logging.properties exit abort -Xms128m -Xmx256m
18-Jan-2023 13:46:10.657 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.sun.proxy.$Proxy6]
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy6.contextInitialized(Unknown Source)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4767)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5231)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:690)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1889)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:583)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: java.lang.reflect.InvocationTargetException
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 com.liferay.shielded.container.internal.proxy.ContextClassLoaderInvocationHandler.invoke(ContextClassLoaderInvocationHandler.java:43)
at com.liferay.shielded.container.internal.proxy.EventListenerInvocationHandler.invoke(EventListenerInvocationHandler.java:64)
... 42 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error initializing storage.
at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:248)
... 48 more
Caused by: java.lang.RuntimeException: Error initializing storage.
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:71)
at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
at org.eclipse.osgi.launch.EquinoxFactory.newFramework(EquinoxFactory.java:24)
at com.liferay.portal.bootstrap.ModuleFrameworkImpl.initFramework(ModuleFrameworkImpl.java:204)
at com.liferay.portal.module.framework.ModuleFrameworkUtil.initFramework(ModuleFrameworkUtil.java:37)
at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:236)
... 48 more
Caused by: java.io.FileNotFoundException: C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\osgi\state\org.eclipse.osgi\.manager\.fileTableLock (Access is denied)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at org.eclipse.osgi.internal.location.Locker_JavaNio.lock(Locker_JavaNio.java:36)
at org.eclipse.osgi.storagemanager.StorageManager.lock(StorageManager.java:388)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:701)
at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:2011)
at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:2028)
at org.eclipse.osgi.storage.Storage.<init>(Storage.java:216)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:151)
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:69)
... 53 more
18-Jan-2023 13:46:10.657 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
18-Jan-2023 13:46:10.657 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
null
null
BeanLocator is null
18-Jan-2023 13:46:10.704 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStop Exception sending context destroyed event to listener instance of class [com.sun.proxy.$Proxy6]
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy6.contextDestroyed(Unknown Source)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4815)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5478)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:187)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:690)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1889)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:583)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: java.lang.reflect.InvocationTargetException
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 com.liferay.shielded.container.internal.proxy.ContextClassLoaderInvocationHandler.invoke(ContextClassLoaderInvocationHandler.java:43)
at com.liferay.shielded.container.internal.proxy.EventListenerInvocationHandler.invoke(EventListenerInvocationHandler.java:64)
... 43 more
Caused by: com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator is not set
at com.liferay.portal.kernel.bean.PortalBeanLocatorUtil.locate(PortalBeanLocatorUtil.java:68)
at com.liferay.portal.spring.context.PortalContextLoaderListener.closeDataSource(PortalContextLoaderListener.java:380)
at com.liferay.portal.spring.context.PortalContextLoaderListener.contextDestroyed(PortalContextLoaderListener.java:151)
... 49 more
18-Jan-2023 13:46:10.751 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [4150] milliseconds
我使用此命令来安装该服务:
C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68\bin>service.bat install liferay74_59_clean
Installing the service 'liferay74_59_clean' ...
Using CATALINA_HOME: "C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68"
Using CATALINA_BASE: "C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\tomcat-9.0.68"
Using JAVA_HOME: "C:\Program Files\Java\jdk1.8.0_211"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_211\jre"
Using JVM: "C:\Program Files\Java\jdk1.8.0_211\jre\bin\server\jvm.dll"
The service 'liferay74_59_clean' has been installed.
如果我尝试使用 tomcat/bin 文件夹中的 startub.bat 启动门户,一切正常,所以它与作为 Windows 服务启动有关。
谁知道出了什么问题?
谢谢。
答案1
为了正常运行,Liferay 需要文件系统上的一些写入权限。如果您将其(或 tomcat)作为 Windows 服务运行,则通常会在与交互运行不同的用户帐户下运行。无论是哪个帐户,那帐户需要对几个目录的写权限。我不会声称自己详尽无遗,但其中一些在您的 下,${liferay.home}
似乎是C:\Portals\liferay-ce-portal-7.4.3.59-ga59_clean\
:
- /部署
- /OSGI
- /数据
- /tomcat/temp
- /tomcat/工作
- /tomcat/日志
- /日志
这些可以配置到其他地方,但你正在寻找这些目录通常是可写的。如果我漏掉了一个,请不要责怪我……