`我是 Magnolia 的新手,目前正在从事一个不提供知识转移的项目,因此我正在尝试自己解决所有问题。我最近用新的 WAR 文件 (rpa-magnolia.war) 替换了 usr/share/magnolia/webapps 目录中的 ROOT.war 文件。
我尝试使用以下命令来部署它: sudo 服务木兰停止 sudo mv rpa-magnolia.war /usr/share/magnolia/webapps/ROOT.war sudo 服务 Magnolia 启动 sudo tail -f /usr/share/magnolia/logs/catalina.out
但是,我在日志中遇到了以下错误:
2024-11-05 07:01:39,250 INFO info.magnolia.cms.beans.config.ConfigLoader : Initializing content repositories
2024-11-05 07:01:39,254 INFO info.magnolia.repository.DefaultRepositoryManager : Loading JCR
2024-11-05 07:01:39,266 INFO info.magnolia.repository.DefaultRepositoryManager : Loading JCR magnolia
2024-11-05 07:01:39,285 INFO info.magnolia.jackrabbit.ProviderImpl : Loading repository at /usr/local/lib/rpa/repositories/magnolia (config file: /usr/share/magnolia/webapps/ROOT/WEB-INF/config/repo-conf/jackrabbit-mysql.xml) - cluster id: "<unset>"
2024-11-05 07:01:39,618 ERROR org.apache.jackrabbit.core.RepositoryImpl : failed to start Repository: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1353)
at org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:486)
at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311)
at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589)
at org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
at org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
at org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
at org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:52)
at org.apache.jackrabbit.core.jndi.RegistryHelper.registerRepository(RegistryHelper.java:74)
at info.magnolia.jackrabbit.ProviderImpl.init(ProviderImpl.java:214)
at info.magnolia.repository.DefaultRepositoryManager.loadRepository(DefaultRepositoryManager.java:187)
at info.magnolia.repository.DefaultRepositoryManager.loadRepositories(DefaultRepositoryManager.java:173)
at info.magnolia.repository.DefaultRepositoryManager.init(DefaultRepositoryManager.java:87)
at info.magnolia.cms.beans.config.ContentRepository.init(ContentRepository.java:143)
at info.magnolia.cms.beans.config.ConfigLoader.load(ConfigLoader.java:141)
at info.magnolia.init.MagnoliaServletContextListener$1.doExec(MagnoliaServletContextListener.java:253)
at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:443)
at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:440)
at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:403)
at info.magnolia.init.MagnoliaServletContextListener.startServer(MagnoliaServletContextListener.java:250)
at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:176)
at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:126)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
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.deployWAR(HostConfig.java:1024)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
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.deployWARs(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
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:263)
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:927)
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:480)
Caused by: javax.jcr.RepositoryException: JNDI name not found: java:comp/env/jdbc/MagnoliaDS
at org.apache.jackrabbit.core.util.db.ConnectionFactory.getJndiDataSource(ConnectionFactory.java:299)
at org.apache.jackrabbit.core.util.db.ConnectionFactory.createDataSource(ConnectionFactory.java:237)
at org.apache.jackrabbit.core.util.db.ConnectionFactory.getDataSource(ConnectionFactory.java:169)
at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getDataSource(BundleDbPersistenceManager.java:564)
at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:532)
at org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager.init(MySqlPersistenceManager.java:51)
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1349)
... 62 more
Caused by: javax.naming.NameNotFoundException: Name [jdbc/MagnoliaDS] is not bound in this Context. Unable to find [jdbc].
at org.apache.naming.NamingContext.lookup(NamingContext.java:840)
at org.apache.naming.NamingContext.lookup(NamingContext.java:158)
at org.apache.naming.NamingContext.lookup(NamingContext.java:850)
at org.apache.naming.NamingContext.lookup(NamingContext.java:158)
at org.apache.naming.NamingContext.lookup(NamingContext.java:850)
at org.apache.naming.NamingContext.lookup(NamingContext.java:172)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:161)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.apache.jackrabbit.core.util.db.ConnectionFactory.getJndiDataSource(ConnectionFactory.java:284)
... 68 more
这似乎表明 MySQL 持久性管理器存在问题。
任何人都可以帮助我理解为什么会发生此错误以及如何解决它?任何关于 Magnolia 如何在存储库和持久性设置方面工作的指导也将不胜感激!`
并不是具体针对 Magnolia。您的数据源配置期望在 JNDI 路径
java:comp/env/jdbc/MagnoliaDS
找到数据库连接,但它不在那里。最有可能是因为 JVM 应该可用的某些环境变量未设置或值错误。