为什么无法使用 CentOS、plesk 9.2.1 和 tomcat 5.5 安装 solr 1.3.0?
好吧,我只是通过他的托管提供商为我的客户设置了一个专用服务器。 他们在那里安装了 plesk(版本 9.2.1),并且该专用服务器的一个警告是,如果我在控制面板之外(即使用 SSH)执行任何任务,他们不保证支持该软件组件。 这很好,因为我宁愿使用控制面板来完成此操作,因为我所要做的就是上传一个 war 文件来安装 servlet。
但这是问题所在,在安装最新版本的 solr (1.3.0) 后,我在 plesk 中收到一个警告图标,它给了我一个模糊的错误,例如“应用程序的实际状态与从数据库检索的状态不对应。 ”
这是日志条目:
Aug 17, 2009 11:16:15 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
Aug 17, 2009 11:16:15 PM org.apache.solr.core.SolrResourceLoader
locateInstanceDir
INFO: Using JNDI solr.home: /usr/share/solr
Aug 17, 2009 11:16:15 PM
org.apache.solr.core.CoreContainer$Initializer initialize
INFO: looking for solr.xml: /usr/share/solr/solr.xml
Aug 17, 2009 11:16:15 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/usr/share/solr/'
Aug 17, 2009 11:16:15 PM org.apache.solr.core.SolrResourceLoader
createClassLoader
INFO: Reusing parent classloader
Aug 17, 2009 11:16:15 PM org.apache.solr.servlet.SolrDispatchFilter init
SEVERE: Could not start SOLR. Check solr/home property
java.lang.ExceptionInInitializerError
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:69)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.lang.RuntimeException: XPathFactory#newInstance()
failed to create an XPathFactory for the default object model:
http://java.sun.com/jaxp/xpath/dom with the
XPathFactoryConfigurationException:
javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory
implementation found for the object model:
http://java.sun.com/jaxp/xpath/dom
at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)
at org.apache.solr.core.Config.<clinit>(Config.java:41)
... 20 more
Aug 17, 2009 11:16:15 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter SolrRequestFilter
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.solr.core.SolrConfig
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:76)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Aug 17, 2009 11:16:15 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Aug 17, 2009 11:16:15 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/solr] startup failed due to previous errors
solr/home 目录存在,那么为什么 solr 会抱怨这个?
Ok I just setup a dedicated server for my client through his hosting provider. They have plesk installed on there (version 9.2.1) and one of the caveats of this dedicated server is that if i do anything OUTSIDE of the control panel (i.e. use SSH) for any task they do not guarantee support for that software component. That's fine because I would rather use the control panel to do it anyway since all i have to do is upload a war file to install the servlet.
Here is the issue though, after installing the latest version of solr (1.3.0) I got a warning icon in plesk and it gave me a vague error like "Actual status of the application does not correspond to the status retrieved from the database."
Here is the log entry:
Aug 17, 2009 11:16:15 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
Aug 17, 2009 11:16:15 PM org.apache.solr.core.SolrResourceLoader
locateInstanceDir
INFO: Using JNDI solr.home: /usr/share/solr
Aug 17, 2009 11:16:15 PM
org.apache.solr.core.CoreContainer$Initializer initialize
INFO: looking for solr.xml: /usr/share/solr/solr.xml
Aug 17, 2009 11:16:15 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/usr/share/solr/'
Aug 17, 2009 11:16:15 PM org.apache.solr.core.SolrResourceLoader
createClassLoader
INFO: Reusing parent classloader
Aug 17, 2009 11:16:15 PM org.apache.solr.servlet.SolrDispatchFilter init
SEVERE: Could not start SOLR. Check solr/home property
java.lang.ExceptionInInitializerError
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:69)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.lang.RuntimeException: XPathFactory#newInstance()
failed to create an XPathFactory for the default object model:
http://java.sun.com/jaxp/xpath/dom with the
XPathFactoryConfigurationException:
javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory
implementation found for the object model:
http://java.sun.com/jaxp/xpath/dom
at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)
at org.apache.solr.core.Config.<clinit>(Config.java:41)
... 20 more
Aug 17, 2009 11:16:15 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter SolrRequestFilter
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.solr.core.SolrConfig
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:76)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Aug 17, 2009 11:16:15 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Aug 17, 2009 11:16:15 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/solr] startup failed due to previous errors
The solr/home directory exists, so why is solr complaining about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,问题就在这里! 事实证明,tomcat 的某些发行版没有对 xalan 的引用,这就是有关 XPathFactory 的异常的来源。 此错误可能会产生误导,因为它将错误记录为 solr/home 属性未设置的问题。 事实是它已经被设定了。 启动 solr 时出现的问题十分之九是由于未设置 solr/home 目录造成的。
这就是我自己修复它的方法:我进入
/usr/share/tomcat5/shared/lib
目录并创建了指向位于中的 xalan-j2.jar 文件的符号链接/usr/share/java
目录。 重新启动 Tomcat,Solr 就启动了!其他一些提示:
编辑要上传的
solr.war
文件中的 web.xml 文件,将其取消 jar 化,进行更改,然后重新 jar 化它。 将目录设置为/usr/share/solr
之类的目录。 这样,如果日志没有显示它使用该目录作为 solr/home ,那么就有问题了。 另外,请确保 solr/home 看起来像这样:user:group 权限为 tomcat:tomcat。 如果 solr 正常启动,将会创建数据目录。
希望这能为某人节省大量时间。
Ok here is the problem! It turns out that some distributions of tomcat do not have a reference to xalan, which is where the exception regarding XPathFactory is coming from. This error can be misleading because it logs the error as a problem with the solr/home property NOT BEING SET. The truth is that it WAS being set. 9 times out of 10 a problem starting solr is due to the solr/home directory not being set.
This is how I fixed it for myself: I went into the
/usr/share/tomcat5/shared/lib
directory and created a symlink to the xalan-j2.jar file which was located in/usr/share/java
directory. Restarted Tomcat and Solr booted right up!Some other tips:
Edit the web.xml file in the
solr.war
file you are uploading un jaring it, making your change and then rejaring it. Set the directory to something like/usr/share/solr
. That way, if the logs aren't showing that its using that directory as solr/home then there is something wrong. Also, make sure that solr/home looks something like this:with user:group permissions to be tomcat:tomcat. the data directory will be created if solr starts up properly.
Hopefully this will save someone a ton of time.
我很确定“solr/home 属性”并不意味着名为“solr/home”的目录,而是一个环境变量或包含该目录路径的系统属性。
快速谷歌搜索出现了此页面,其中该属性被设置为java系统属性: “-Dsolr.solr.home=/my/custom/solr/home/dir/”。
I'm quite sure 'solr/home property' doesn't mean a directory named 'solr/home', but rather an environment variable or a system property which contains the path of the directory.
A quick google search turned up this page, where the property is set as a java system property: "-Dsolr.solr.home=/my/custom/solr/home/dir/".