REGRESSION - java.lang.NoClassDefFoundError - Solr 8

Description

I am able to work with the Solr 8 Java libraries in Lucee 5.2
This has stopped working in Lucee 5.3

The solr libraries can be obtained here:
https://lucene.apache.org/solr/downloads.html
The library files you need are in:
/solr-8.1.1.zip/solr-8.1.1/dist

Here is the code for the the test files:

test.cfm

Application.cfc

Results of running test.cfm in 5.2.1.9

CloudSolrClient
class org.apache.solr.client.solrj.impl.CloudSolrClient
fields
name pattern value
STATE_VERSION public static final java.lang.String org.apache.solr.client.solrj.impl.CloudSolrClient.STATE_VERSION stateVer
methods
return interface exceptions
void setDefaultCollection(java.lang.String)
org.apache.solr.common.cloud.ZkStateReader getZkStateReader()
int getMinAchievedReplicationFactor(java.lang.String, org.apache.solr.common.util.NamedList)
java.util.Map getShardReplicationFactor(java.lang.String, org.apache.solr.common.util.NamedList)
org.apache.solr.client.solrj.impl.ClusterStateProvider getClusterStateProvider()
void setParser(org.apache.solr.client.solrj.ResponseParser)
org.apache.solr.client.solrj.request.RequestWriter getRequestWriter()
void setRetryExpiryTime(int)
void setCollectionCacheTTl(int)
java.lang.String getZkHost()
void setIdField(java.lang.String)
java.lang.String getIdField()
java.lang.String getDefaultCollection()
void setZkConnectTimeout(int)
void setZkClientTimeout(int)
boolean isParallelUpdates()
void setParallelUpdates(boolean)
void waitForState(java.lang.String, long, java.util.concurrent.TimeUnit, org.apache.solr.common.cloud.CollectionStatePredicate) java.lang.InterruptedException java.util.concurrent.TimeoutException
void registerCollectionStateWatcher(java.lang.String, org.apache.solr.common.cloud.CollectionStateWatcher)
void setRequestWriter(org.apache.solr.client.solrj.request.RequestWriter)
org.apache.solr.client.solrj.impl.CloudSolrClient$RouteResponse condenseResponse(org.apache.solr.common.util.NamedList, int)
org.apache.solr.client.solrj.impl.LBHttpSolrClient getLbClient()
boolean isUpdatesToLeaders()
boolean isDirectUpdatesToLeadersOnly()
void setParallelCacheRefreshes(int)
org.apache.http.client.HttpClient getHttpClient()
org.apache.solr.common.util.NamedList request(org.apache.solr.client.solrj.SolrRequest, java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.ResponseParser getParser()
void setSoTimeout(int)
void setConnectionTimeout(int)
void connect(long, java.util.concurrent.TimeUnit) java.util.concurrent.TimeoutException java.lang.InterruptedException
void connect()
void close() java.io.IOException
org.apache.solr.client.solrj.response.SolrPingResponse ping() org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.beans.DocumentObjectBinder getBinder()
org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(java.lang.String, java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(java.lang.String, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(java.lang.String, java.lang.String, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteByQuery(java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse addBean(java.lang.Object) java.io.IOException org.apache.solr.client.solrj.SolrServerException
org.apache.solr.client.solrj.response.UpdateResponse addBean(java.lang.String, java.lang.Object) java.io.IOException org.apache.solr.client.solrj.SolrServerException
org.apache.solr.client.solrj.response.UpdateResponse addBean(java.lang.Object, int) java.io.IOException org.apache.solr.client.solrj.SolrServerException
org.apache.solr.client.solrj.response.UpdateResponse addBean(java.lang.String, java.lang.Object, int) java.io.IOException org.apache.solr.client.solrj.SolrServerException
org.apache.solr.client.solrj.response.UpdateResponse addBeans(java.util.Iterator) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse addBeans(java.lang.String, java.util.Collection) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse addBeans(java.util.Collection) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse addBeans(java.lang.String, java.util.Iterator) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse addBeans(java.util.Collection, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse addBeans(java.lang.String, java.util.Collection, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.lang.String, java.util.List) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.util.List) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.lang.String, java.util.List, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.util.List, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.lang.String, java.lang.String, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.lang.String, java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse deleteById(java.lang.String, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.QueryResponse queryAndStreamResponse(org.apache.solr.common.params.SolrParams, org.apache.solr.client.solrj.StreamingResponseCallback) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.QueryResponse queryAndStreamResponse(java.lang.String, org.apache.solr.common.params.SolrParams, org.apache.solr.client.solrj.StreamingResponseCallback) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocumentList getById(java.lang.String, java.util.Collection, org.apache.solr.common.params.SolrParams) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocumentList getById(java.lang.String, java.util.Collection) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocumentList getById(java.util.Collection, org.apache.solr.common.params.SolrParams) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocument getById(java.lang.String, org.apache.solr.common.params.SolrParams) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocument getById(java.lang.String, java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocument getById(java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocument getById(java.lang.String, java.lang.String, org.apache.solr.common.params.SolrParams) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.SolrDocumentList getById(java.util.Collection) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse rollback() org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse rollback(java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.common.util.NamedList request(org.apache.solr.client.solrj.SolrRequest) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse commit() org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse commit(java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse commit(java.lang.String, boolean, boolean) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse commit(boolean, boolean) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse commit(java.lang.String, boolean, boolean, boolean) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse commit(boolean, boolean, boolean) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(org.apache.solr.common.SolrInputDocument, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.lang.String, org.apache.solr.common.SolrInputDocument, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(org.apache.solr.common.SolrInputDocument) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.lang.String, java.util.Iterator) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.util.Iterator) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.lang.String, java.util.Collection) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.util.Collection) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.lang.String, java.util.Collection, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.util.Collection, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse add(java.lang.String, org.apache.solr.common.SolrInputDocument) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse optimize(boolean, boolean, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse optimize(java.lang.String, boolean, boolean) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse optimize(boolean, boolean) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse optimize(java.lang.String, boolean, boolean, int) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse optimize(java.lang.String) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.UpdateResponse optimize() org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.QueryResponse query(java.lang.String, org.apache.solr.common.params.SolrParams) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.QueryResponse query(org.apache.solr.common.params.SolrParams) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.QueryResponse query(org.apache.solr.common.params.SolrParams, org.apache.solr.client.solrj.SolrRequest$METHOD) org.apache.solr.client.solrj.SolrServerException java.io.IOException
org.apache.solr.client.solrj.response.QueryResponse query(java.lang.String, org.apache.solr.common.params.SolrParams, org.apache.solr.client.solrj.SolrRequest$METHOD) org.apache.solr.client.solrj.SolrServerException java.io.IOException

Methods inherited from java.lang.Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Results of running test.cfm in 5.3.2.77
Lucee 5.3.2.77 Error (java.lang.NoClassDefFoundError)
Message org/apache/zookeeper/KeeperException
Stacktrace The Error Occurred in
/var/www/solr_test/test.cfm: line 5

3: Builder.init();
4: Builder.withZkHost( "collection" );
5: writeDump(Builder.build());
6: </cfscript>

Java Stacktrace lucee.runtime.exp.NativeException: org/apache/zookeeper/KeeperException
at org.apache.solr.client.solrj.impl.CloudSolrClient$Builder.build(CloudSolrClient.java:1587)
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 lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:56)
at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:877)
at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:867)
at lucee.runtime.java.JavaObject.call(JavaObject.java:239)
at lucee.runtime.java.JavaObject.call(JavaObject.java:269)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
at massey._test.solr_test.test_cfm$cf.call(/massey/_test/solr_test/test.cfm:5)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:942)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:834)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:216)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:42)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2409)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2399)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2374)
at lucee.runtime.engine.Request.exe(Request.java:43)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1037)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:983)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:480)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/apache/zookeeper/KeeperException
... 48 more
Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.KeeperException
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 48 more

Timestamp 6/17/19 11:38:50 AM NZST

Environment

Linux, Java 1.8, Tomcat 8

Activity

Show:
Michael Offner
November 27, 2019, 9:06 AM

do you have a test case for your issue?

 

Michael Offner
November 27, 2019, 9:39 AM

found the issue with solr 8.1.1, the zookeeper.jar is an OSGi bundle (not in 8.3.0). Lucee loads the jars provided whenever possible as OSGi bundle, what is fine when all jars are OSGi bundles, but fails when only half of it are. in this case the solr core jar is not and OSGi bundle and is loaded the old way. But then it cannot see OSGi bundles.

How to solve this, any jar loaded by javasettings should be AVAILABLE the classic way , OSGi should be optional.

Michael Offner
November 27, 2019, 9:42 AM

Michael Offner
November 27, 2019, 9:47 AM

Matthew Clemente
November 27, 2019, 11:53 AM

I'll try to track down the code that was causing the issue and put together a test.

Fixed

Assignee

Michael Offner

Reporter

Pat Moody

Priority

New

Labels

Fix versions

Sprint

None

Affects versions

Configure