solr: function usage problem - solr

to solve a problem described at [question]: Solr: where to store additional information?
i wrote a function termcnt(fieldname) which just count specific terms in document regarding specified fieldname.
Using solr admin page (http://localhost:8080/admin/form.jsp) in "Solr/Lucene Statement" I queried:
fq={!frange l=3 u=1000}termcnt(wc_text)
and got an error:
type Status report
message org.apache.lucene.queryParser.ParseException: Cannot parse 'fq={!frange l=3 u=1000}termcnt(wc_text)': Encountered " <RANGEEX_GOOP> "u=1000 "" at line 1, column 16. Was expecting: "}" ...
description The request sent by the client was syntactically incorrect (org.apache.lucene.queryParser.ParseException: Cannot parse 'fq={!frange l=3 u=1000}termcnt(wc_text)': Encountered " <RANGEEX_GOOP> "u=1000 "" at line 1, column 16. Was expecting: "}" ... ).
where is my mistake?
thank you
P.S. when I'm queering:
_val_:"termcnt(wc_text)"
my function is working properly...
P.P.S even with sum func i have the same results :(
fq={!frange l=3 u=1000}sum(2,3)
solr 3.2.0
lucene 3.2.0
(from maven repository)
stack trace (as requested):
1 jul 2011 9:33:39 org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: org.apache.lucene.queryParser.ParseException: Cannot parse 'fq={!frange l=3 u=100000}termcnt(wc_text)': Encountered " <RANGEEX_GOOP> "u=100000 "" at line 1, column 16.
Was expecting:
"}" ...
at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:108)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1360)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:286)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:272)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1730)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse 'fq={!frange l=3 u=100000}termcnt(wc_text)': Encountered " <RANGEEX_GOOP> "u=100000 "" at line 1, column 16.
Was expecting:
"}" ...
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:211)
at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:80)
at org.apache.solr.search.QParser.getQuery(QParser.java:142)
at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:84)
... 21 more
Caused by: org.apache.lucene.queryParser.ParseException: Encountered " <RANGEEX_GOOP> "u=100000 "" at line 1, column 16.
Was expecting:
"}" ...
at org.apache.lucene.queryParser.QueryParser.generateParseException(QueryParser.java:1818)
at org.apache.lucene.queryParser.QueryParser.jj_consume_token(QueryParser.java:1700)
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1510)
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1266)
at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
... 24 more
1 jul 2011 9:33:39 org.apache.solr.core.SolrCore execute
INFO: [] webapp= path=/select params={explainOther=&fl=&indent=on&start=0&q=fq%3D{!frange+l%3D3+u%3D100000}termcnt(wc_text)&hl.fl=&qt=&wt=&fq=&rows=10&version=2.2} status=400 QTime=21

I believe the interface has changed somewhat since this was written--but your query
fq={!frange l=3 u=1000}sum(2,3)
seems to be written correctly. You might try to url encode it, like
fq=%7B!frange+l%3D3+u%3D1000%7Dsum(2%2C3)
But I have a feeling this issue is solved just from newer versions of Solr and the admin panel.

Related

Can't set azure blobname in application.properties with camel placeholder

I m trying to set a filename in my application.properties file.
It work well when I use the file component as exaplained here : Smallrye doc
Notice that im in a quarkus context so I hava to double the $ as explained in the doc.
However I don't need to write in a file but in an azure blob. And things become more complicated with it.
Here is my configuration :
mp.messaging.outgoing.water.endpoint-uri=azure-blob://xxxxxx/xxxxx/xxxx/xxxxx-${date:now:ddMMyyyy-hh:mm:ss}.json?credentials=#credentials&operation=updateBlockBlob
If I double the $ I got the following stacktrace :
2020-06-26 19:21:02,204 WARN [org.apa.cam.com.rea.str.ReactiveStreamsConsumer] (Camel (camel-1) thread #0 - reactive-streams://87687045129B977-0000000000000000) Error processing exchange. Exchange[8768704512
9B977-0000000000000001]. Caused by: [java.lang.IllegalArgumentException - Illegal character in path at index 86: https://zstalrsdsmdatarec01.blob.core.windows.net/materiel/MTD-niveaudeau/niveaudeau-${date:now
:ddMMyyyy-hh:mm:ss}.json]: java.lang.IllegalArgumentException: Illegal character in path at index 86: https://zstalrsdsmdatarec01.blob.core.windows.net/materiel/MTD-niveaudeau/niveaudeau-${date:now:ddMMyyyy-h
h:mm:ss}.json
at java.net.URI.create(URI.java:852)
at org.apache.camel.component.azure.blob.BlobServiceUtil.prepareStorageBlobUri(BlobServiceUtil.java:214)
at org.apache.camel.component.azure.blob.BlobServiceUtil.prepareStorageBlobUri(BlobServiceUtil.java:196)
at org.apache.camel.component.azure.blob.BlobServiceUtil.createBlockBlobClient(BlobServiceUtil.java:135)
at org.apache.camel.component.azure.blob.BlobServiceProducer.updateBlockBlob(BlobServiceProducer.java:140)
at org.apache.camel.component.azure.blob.BlobServiceProducer.process(BlobServiceProducer.java:80)
at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:67)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:174)
at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:396)
at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:153)
at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:286)
at org.apache.camel.component.reactive.streams.ReactiveStreamsConsumer.lambda$doSend$3(ReactiveStreamsConsumer.java:100)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.URISyntaxException: Illegal character in path at index 86: https://zstalrsdsmdatarec01.blob.core.windows.net/materiel/MTD-niveaudeau/niveaudeau-${date:now:ddMMyyyy-hh:mm:ss}.json
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parseHierarchical(URI.java:3105)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URI.create(URI.java:850)
... 16 more
So I tried not to double the $. I don't have any error but in that case the filename looks like this in azure :
MTD-niveaudeau/niveaudeau-now:ddMMyyyy-hh:mm:ss.json
I also tried to use the $simple{ } placeholder with no success.
I really want to use the #Outgoing annotation instead of writing like this :
#Incoming( "xxxxxxxx" )
public void consume( final String message){
log.info( "Incoming message : {}", message );
final String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern("ddMMyyyy-HH:mm:ss"));
Multi
.createFrom()
.completionStage( camel
.createProducerTemplate()
.asyncSendBody(
"azure-blob://xxxxxxx/xxxxx/xxxxxx/xxxxx-"+now+".json?credentials=#credentials&operation=updateBlockBlob"
, message.toString() )
)
.subscribe()
.with( e ->
log.info( "Message successfullt sent to azure" )
)
;
}
How to do it ?
Thank you!

ArrayIndexOutOfBoundsException though array has value

I tried to do validation by comparing two array values using IF condition as follows:
if (!bomDataArray[1].trim().equals(agileDataArray[0].trim())) {
updateItemComments(bomDataArray[17], Constant.DESCRIPTOIN_MISMATCH);
}
I am able to print the value using sysout in server.
Code:
System.out.println("bomDataArray[1].trim().equals(agileDataArray[0].trim() ---> "+bomDataArray[1].trim() + "---" +(agileDataArray[0].trim()));
Ouput in Server:
[2018-02-26T17:22:51.158+0800] [Payara 4.1] [INFO] [] [] [tid: _ThreadID=28 _ThreadName=http-thread-pool::http-listener-1(5)] [timeMillis: 1519636971158] [levelValue: 800] [[
bomDataArray[1].trim().equals(agileDataArray[0].trim() ---> CAPACITOR, CERAMIC MULTILAYER, SURFACE MOUNT (CHIPS)---CAPACITOR, CERAMIC MULTILAYER, SURFACE MOUNT (CHIPS)]]
After running this, the system throws ArrayIndexOutOfBoundsException.
Stack trace:
java.lang.ArrayIndexOutOfBoundsException: 1
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.checkForAgileDiscrepancy(ZhuhaiBomComparisonParserPlugin.java:226)
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.updateBomData(ZhuhaiBomComparisonParserPlugin.java:206)
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.generatePdpItem(ZhuhaiBomComparisonParserPlugin.java:42)
at com.flextronics.pdp.parser.zhuhai.ZhuhaiBomComparisonParserPlugin.process(ZhuhaiBomComparisonParserPlugin.java:34)
at com.flextronics.pdp.core.engine.executor.java.JavaParserExecutor.transform(JavaParserExecutor.java:43)
at com.flextronics.pdp.core.engine.executor.PdpParserExecutor.execute(PdpParserExecutor.java:79)
at com.flextronics.pdp.core.engine.PdpEngine.parse(PdpEngine.java:60)
at com.flextronics.pdp.web.ux.viewmodels.documentcontrol.BomParsingViewModel.processBoms(BomParsingViewModel.java:717)
at sun.reflect.GeneratedMethodAccessor3720.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.zkoss.bind.impl.ParamCall.call(ParamCall.java:121)
at org.zkoss.bind.impl.BinderImpl.doGlobalCommandExecute(BinderImpl.java:1655)
at org.zkoss.bind.impl.BinderImpl.doGlobalCommand(BinderImpl.java:1625)
at org.zkoss.bind.impl.BinderImpl.access$300(BinderImpl.java:112)
at org.zkoss.bind.impl.BinderImpl$QueueListener.onEvent(BinderImpl.java:300)
at org.zkoss.zk.ui.event.impl.DesktopEventQueue$QueueListener.onEvent(DesktopEventQueue.java:162)
at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2752)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2723)
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2664)
Please help me to understand which went wrong in this?
If the code you posted is in ZhuhaiBomComparisonParserPlugin.java on line 226 as the stack trace says then the problem is that you're trying to access the second element of the array bomDataArray (with index 1) but the array has only 1 element or is empty. You need to find out why the array has less then 2 elements.
Btw, this is clearly error in your application code and has nothing to do with Payara Server your application is deployed to. You need to fix your code.

Zeppelin 0.7.2 org.apache.thrift.transport.TTransportException with Spark and HighCharts

If I add this artifact to Zeppelin com.knockdata:spark-highcharts:0.6.4 it gives the error org.apache.thrift.transport.TTransportException
Even a simple example like this causes the error:
val x = Array(1,2,3,4)
val rdd = sc.parallelize(x)
The problem is definitely related to %spark as %md and %sh work. I have Spark version spark-2.1.0-bin-hadoop2.6.
There are no messages in the Spark logs. In zeppelin-interpreter-spark-root-(hostname).log it says:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was
BEGIN_OBJECT at line 1 column 2
at com.google.gson.Gson.fromJson(Gson.java:802)
at com.google.gson.Gson.fromJson(Gson.java:757)
at com.google.gson.Gson.fromJson(Gson.java:706)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer.convert(RemoteInterprete
rServer.java:425)
org.apache.zeppelin.interpreter.InterpreterException: Exception in thread "main" java.lang.NoSuchMethodError: scala.Predef$.wrapRefArray([Ljava/lang/Object;)Lscala/collection/mutable/WrappedArray;
spark-highcharts:0.6.4 does not support zeppelin:0.7.2. There is a dependency from spark-highcharts which clearly state which zeppelin version to use and it is not binary compatible. That is why the error reported.
The version has been bumped to spark-highcharts:0.6.5 to support zeppelin:0.7.2(spark:2.1).

Error in solr for "date" data index

I'm getting following error in log file while indexing data to solr.This error appears when i'm indexing "Date" info to solr. I'm using Oracle 10G and solr version 3.5. I think date format may be wrong here. I checked enough couldn't find the solution. Following is my error:
date format "'date1'='2012-05-23T09:47:23'"
------
SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=12603] Error adding field 'date1'='2012-05-23T09:47:23'
at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:324)
at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:60)
at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:115)
at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:158)
at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:79)
at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:58)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1398)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Invalid Date String:'2012-05-23T09:47:23'
at org.apache.solr.schema.DateField.parseMath(DateField.java:165)
at org.apache.solr.schema.TrieField.createField(TrieField.java:421)
at org.apache.solr.schema.TrieDateField.createField(TrieDateField.java:120)
at org.apache.solr.schema.SchemaField.createField(SchemaField.java:104)
at org.apache.solr.update.DocumentBuilder.addField(DocumentBuilder.java:203)
at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:281)
Is there a mistake from my side.Plz help me...I`m new to solr.
You seem to be missing the trailing Z - i e UTC timezone which is mandatory. It should look something like this:
2012-05-23T09:47:23Z
http://lucene.apache.org/solr/api-4_0_0-BETA/org/apache/solr/schema/DateField.html
{
convertTimestamp {
field :To
inputFormats : ["yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "yyyy-MM-dd'T'HH:mm:ss", "yyyy-MM-dd"]
inputTimezone : UTC
outputFormat : "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
outputTimezone : Europe/London
}
}
If you're using this piece of morphlines code from the kite-examples-morphlines package, if you look on the out outputformat column they have made an error. it should be "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'". hope this helps anyone else using morphlines.

Installing liferay with Solr : admin console unreachable + exceptions on launching

I try to install solr 1.4.1 with Liferay 5.5-5.2.3 running with Tomcat; my system is RHEL5.
Below I explain the errors I meet; then I give the details of my solr install.
When I start Tomcat, I have the following exceptions :
INFO: Solr home set to '/opt/apache-solr-1.4.1/example/solr/'
Aug 4, 2010 10:44:26 AM org.apache.solr.common.SolrException log
SEVERE:
javax.xml.transform.TransformerException: Unknown error in XPath.
at org.apache.xpath.XPath.execute(XPath.java:363)
at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:213)
at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:275)
at org.apache.solr.core.CoreContainer.readProperties(CoreContainer.java:303)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:242)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
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.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.lang.NullPointerException
at org.apache.xpath.axes.ChildTestIterator.setRoot(ChildTestIterator.java:125)
at org.apache.xpath.axes.NodeSequence.setRoot(NodeSequence.java:213)
at org.apache.xpath.axes.LocPathIterator.execute(LocPathIterator.java:210)
at org.apache.xpath.XPath.execute(XPath.java:335)
... 33 more
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Unknown error in XPath.
at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:289)
at org.apache.solr.core.CoreContainer.readProperties(CoreContainer.java:303)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:242)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
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.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: javax.xml.transform.TransformerException: Unknown error in XPath.
at org.apache.xpath.XPath.execute(XPath.java:363)
at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:213)
at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:275)
... 31 more
Caused by: java.lang.NullPointerException
at org.apache.xpath.axes.ChildTestIterator.setRoot(ChildTestIterator.java:125)
at org.apache.xpath.axes.NodeSequence.setRoot(NodeSequence.java:213)
at org.apache.xpath.axes.LocPathIterator.execute(LocPathIterator.java:210)
at org.apache.xpath.XPath.execute(XPath.java:335)
... 33 more
Aug 4, 2010 10:44:26 AM org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=/opt/apache-solr-1.4.1
Once Tomcat has started, I try to access solr in a navigator : http://MyIpAddress/solr/ .
I have the "Welcome to Solr!" page, which is OK. But when I click on the "Solr Admin" link, I getthe error message "HTTP Status 404 - missing core name in path".
I add that I get the same behaviour if I launch solr separately with start.jar (I get the same exception, and then the same error when I try to access the console).
Now, here are the steps I followed in my install :
I downloaded solr 1.4.1,, and unzipped the file under /opt.
I copied the file /opt/apache-solr-1.4.1/dist/apache-solr-1.4.1.war under /opt/apache-solr-1.4.1/example/solr
I created a file called solr.xml, with the content below, and I put it in two folders : conf/Catalina/localhost from Tomcat, and in /opt/apache-solr-1.4.1/example/solr :
Context
docBase="/opt/apache-solr-1.4.1/example/solr/apache-solr-1.4.1.war"
debug="0" crossContext="true"
Environment name="solr/home"
type="java.lang.String"
value="/opt/apache-solr-1.4.1/example/solr" override="true"
In the file bin/setenv.sh from Tomcat, I added the line :
JAVA_OPTS=="$JAVA_OPTS -Dsolr.solr.home=SOLR_HOME/example/solr"
In the file /opt/apache-solr-1.4.1/example/solr/conf/solrconfig.xml, I explicitly set the index directory in the dataDir tag :
${solr.data.dir:/opt/apache-solr-1.4.1/example/solr/data}
Then I launched Tomcat.
Thank you for any advice on what is wrong with my configuration.
Sylvain
It looks like the solr.xml file does not contain the correct settings. You should use the the settings in the Catalina folder, but you should create another one in the solr home directory.
It looks like this (if you want to use cores):
<solr persistent="false" sharedLib="./lib">
<cores adminPath="/admin/cores">
<core name="standards" instanceDir="standards" />
</cores>
</solr>

Resources