Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-82559

Solr on JBoss/WildFly connecting to SolrCloud throws NoClassDefFoundError for log4j

    Details

      Description

      Steps to reproduce:

      1. Set up a JBoss EAP/WildFly with Liferay
      2. Set up a SolrCloud per this documentation: https://dev.liferay.com/discover/deployment/-/knowledge_base/7-0/using-solr
      3. Configure Liferay to connect to SolrCloud as per above documentation
        1.  Reproduced with both Solr 5.5.5 and Solr 7.2.1 and Liferay Solr 5 Search Engine 1.0.1 (for 7.0) and Liferay deployed to WildFily 11
        2. Attached configs for elasticsearch blacklist and solr configs
      4. Start Liferay

      Observed result: continued logging - solr5:

      2018-06-07 15:55:39.834 WARN  [liferay/search_writer/SYSTEM_ENGINE-4-SendThread(localhost:9983)][ClientCnxn:1162] Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
      java.lang.NoClassDefFoundError: org/apache/log4j/Logger
      	at org.apache.zookeeper.Login.<init>(Login.java:44)
      	at org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslClient(ZooKeeperSaslClient.java:226)
      	at org.apache.zookeeper.client.ZooKeeperSaslClient.<init>(ZooKeeperSaslClient.java:131)
      	at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1008)
      	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1060)
      Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger cannot be found by com.liferay.portal.search.solr_2.0.31
      	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:444)
      	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:357)
      	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:349)
      	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 5 more

      Observed result - solr7:

      2018-11-13 15:31:43.222 WARN  [liferay/search_writer/SYSTEM_ENGINE-4-SendThread(localhost:9983)][ClientCnxn:1162] Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
      java.lang.NoClassDefFoundError: org/apache/log4j/Logger
      	at org.apache.zookeeper.Login.<init>(Login.java:44)
      	at org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslClient(ZooKeeperSaslClient.java:226)
      	at org.apache.zookeeper.client.ZooKeeperSaslClient.<init>(ZooKeeperSaslClient.java:131)
      	at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1008)
      	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1060)
      Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger cannot be found by com.liferay.portal.search.solr7.impl_2.0.0
      	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
      	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
      	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
      	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 5 more
      

      Additional information

      1. Issue not reproducible on Tomcat

      QA Notes

      1. On master & 7.1.x, test with "/modules/apps/portal-search-solr7" module too connecting to Solr 7.2.x server.
      2. On 7.0.x, use "/modules/apps/portal-search-solr"

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 2 weeks, 3 days ago

                Packages

                Version Package
                7.0.X
                7.1.X
                Master