could not find system property or JNDI

Thanks everyone!! Finally got a solution for this problem on Jetty Server.

Instead of setting Java system variables like
JAVA_OPTS=-Dsolr.solr.home="C:\SOLR\apache-solr-1.3.0\apache-solr-1.3.0\example\solr",
we can provide the vm arguments directly while starting the jetty server.

I am running jetty as follows -
java -Dsolr.solr.home=<PATH_TO_SOLR_HOME> -jar start.jar

After this I am not getting any error. :-D

Thanks,
Manu


Nicholas Piasecki-2 wrote:
>
> For what it's worth, I bumped into
> http://jira.codehaus.org/browse/JETTY-854 on a recent Jetty installation
> when trying to set up Solr for a test run, so setting via JNDI may end
> up causing even more heartburn. I ended up just using Tomcat.
>
> V/R,
> Nicholas Piasecki
>
> Software Developer
> Skiviez, Inc.
> nick@xxxxxxxxxxx
> 804-550-9406
>
> -----Original Message-----
> From: Chris Hostetter [mailto:hossman_lucene@xxxxxxxxx]
> Sent: Tuesday, February 03, 2009 8:31 PM
> To: solr-user@xxxxxxxxxxxxxxxxx
> Subject: Re: Problem with setting solr.solr.home property
>
> : Till now I was working with the jetty server bundled with the SOLR
> : distribution. But I want to deploy solr.war to another jetty server.
> Here I
> : am facing some problem with solr/home. Whenever I start the jetty
> server, I
> : get the following error -
> ...
> : INFO: solr home defaulted to 'solr/' (could not find system property
> or
> : JNDI)
> ...
> : SEVERE: Could not start SOLR. Check solr/home property
> : java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in
> : classpath or 'solr/conf/', cwd=C:\jetty-6.1.3\je
> ...
>
> : I have tried following options -
> :
> : 1. Added system property on windows as 'solr.solr.home'. I am able to
> get
> : its value when I check through command prompt.
> : http://www.nabble.com/file/p21808987/cmd.gif
>
> i don't know much about windows, but i don't think that's the same
> thing
> as a java system property (that looks like an enviornment variable to
> me)
>
> : 2. I also tried adding vm argument through command prompt as follows -
>
> : set
> :
> JAVA_OPTS=-Dsolr.solr.home="C:\SOLR\apache-solr-1.3.0\apache-solr-1.3.0\
> example\solr"
> :
> : But in all the case, I am getting the above exception.
>
> what about the INFO line i quoted above (solr home defaulted to
> 'solr/'...) are you seeing that line even when you modify the JAVA_OPTS
> this way? (i'm wondering if perhaps you are setting the system property
>
> but maybe the quotes or formating or soemthing is confusing it when
> trying
> to find that directory) ... it would be helpful to see the *exact* logs
> and error messages you get when trying the JAVA_OPTS method ... i'm
> suspicious that maybe it's a slightly different error.
>
> : 3. I tried to retrieve the System property through java code (It is
> the
> : similar code that is triggered by Solr, SolrResourceLoader.java
> : locateInstanceDir() method). I get the value of system property in the
> code.
>
> your code looks right, but i don't understand exactly what you're saying
>
> -- do you in fact see the path in your logging output? if so then i'm
> more confident it's a problem with formating the path correctly so java
> understands it.
>
> FYI: in my opinion the best way to set solr home is using JNDI, but you
> didn't mention trying that...
> http://wiki.apache.org/solr/SolrJetty
>
>
> -Hoss
>
>
>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值