0
votes

I'm trying to start SOLR 4.3.1 on a Websphere Liberty Profile 8.5.5. I put the solr.war into the dropins folder and added the logging jars (log4j-1.2.16.jar, slf4j-api-1.6.6.jar, slf4j-log4j12-1.6.6.jar) as global librarys. During startup of solr the following exception is thrown:

java.lang.NullPointerException: 
at com.ibm.websphere.ras.TruncatableThrowable.getStackTrace(TruncatableThrowable.java:247)
at [internal classes]
at com.ibm.ws.logging.internal.impl.BaseTraceFormatter.formatMessage(BaseTraceFormatter.java:234)
at com.ibm.ws.logging.internal.impl.BaseTraceFormatter.formatMessage(BaseTraceFormatter.java:191)
at com.ibm.ws.logging.internal.impl.BaseTraceService.publishLogRecord(BaseTraceService.java:447)
at com.ibm.ws.logging.internal.impl.LoggerHandlerManager$BaseTrLoggerHandler.publish(LoggerHandlerManager.java:69)
at java.util.logging.Logger.log(Unknown Source)
at com.ibm.ws.logging.internal.WsLogger.log(WsLogger.java:158)
at com.ibm.ws.logging.internal.WsLogger.logp(WsLogger.java:354)
at com.ibm.ws.webcontainer.webapp.WebApp.logMessage(WebApp.java:2981)
at [internal classes]
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:165)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]

Is anyone using SOLR on Websphere Liberty successfully?

3

3 Answers

0
votes

It looks like something is trying to log a message which has a parameter of type Throwable, but that Throwable object has overridden getStackTrace() to return null. It would be useful to see the contents of messages.log - that should show an unprocessed log, including what class the Throwable parameter is.

As a workaround, disabling console logging should prevent the problem:

<logging consoleLogLevel="OFF"/>

Full logs will still be available in the messages.log file. Once you've prevented this stack trace from Liberty, you'll need to use the messages.log file to identify what exception is being thrown from within Solr and figure out how to fix that root cause.

0
votes

I am running solr successfully on Liberty (pre-8.5.5 version):

a) I extracted the war file in the apps directory, rather than putting it in dropins, e.g. serverDir/apps/solr.war

b) I defined the application in server.xml:

<application id="solr" location="solr.war" />

c) I enabled jsp and jndi features:

<featureManager>
    <feature>jsp-2.2</feature>
    <feature>jndi-1.0</feature>
</featureManager>

d) I did not do anything to add slf4j jars that I recall. I definitely did not create or define any global libraries. My WEB-INF/lib contains:

./WEB-INF/lib/slf4j-jdk14-1.6.1.jar
./WEB-INF/lib/jcl-over-slf4j-1.6.1.jar
./WEB-INF/lib/log4j-over-slf4j-1.6.1.jar
./WEB-INF/lib/slf4j-api-1.6.1.jar

I've messed with filters and things, and it's running without issue. As Holly said, there is an underlying cause here that you'll have to uncover, and her workaround will allow you to do that.

0
votes

I just got SOLR 4.9.0 running in Liberty. Some steps I had to do: 1. extract solr.war from \example\webapps to the Liberty server apps dir as solr.war 2. modified server.xml

<application id="solr" location="solr.war" />

<featureManager>
    <feature>jsp-2.2</feature>
    <feature>jndi-1.0</feature>
</featureManager>
  1. downloaded http://www.slf4j.org/dist/slf4j-1.6.6.zip per instructions to disable logging at https://wiki.apache.org/solr/SolrLogging copied following .jar to the web-inf dir

    ./WEB-INF/lib/slf4j-jdk14-1.6.1.jar ./WEB-INF/lib/jcl-over-slf4j-1.6.1.jar ./WEB-INF/lib/log4j-over-slf4j-1.6.1.jar ./WEB-INF/lib/slf4j-api-1.6.1.jar

  2. changed the default port from 9080 to 8983 to make it easier to use the load examples

I'm running Java 8 as well and using eclipse to control my Liberty profile