0

I am running Solr inside docker using following docker-compose.yml.

version: "3"
services:
  solr:
    image: solr:8.0.0
    ports:
      - "8983:8983"
    volumes:
      - ./myData:/var/solr
      - ./Config/jetty.xml:/opt/solr-8.0.0/server/etc/jetty.xml
    command:
      - solr-precreate
      - gettingstarted
    container_name: solr

I am trying to provide common MySQL configuration for all cores as mentioned in here.

Here is the configuration I have added in jetty.xml

<New id="jdbc" class="org.eclipse.jetty.plus.jndi.Resource">
    <Arg>jdbc/myconfig</Arg>
    <Arg>
        <New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
            <Set name="Url">jdbc:mysql://ip:port/myDB</Set>
            <Set name="User">user</Set>
            <Set name="Password">password</Set>
        </New>
    </Arg>
</New>

However, when I try to run Solr with this, I am getting the following error.

java.security.PrivilegedActionException: null
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1511) [jetty-xml-9.4.14.v20181114.jar:9.4.14.v20181114]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
    at org.eclipse.jetty.start.Main.invokeMain(Main.java:220) [start.jar:9.4.14.v20181114]
    at org.eclipse.jetty.start.Main.start(Main.java:490) [start.jar:9.4.14.v20181114]
    at org.eclipse.jetty.start.Main.main(Main.java:77) [start.jar:9.4.14.v20181114]
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.plus.jndi.Resource
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
    at org.eclipse.jetty.util.Loader.loadClass(Loader.java:65) ~[jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:834) ~[jetty-xml-9.4.14.v20181114.jar:9.4.14.v20181114]
    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:478) ~[jetty-xml-9.4.14.v20181114.jar:9.4.14.v20181114]
    at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:413) ~[jetty-xml-9.4.14.v20181114.jar:9.4.14.v20181114]
    at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:311) ~[jetty-xml-9.4.14.v20181114.jar:9.4.14.v20181114]
    at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1558) ~[jetty-xml-9.4.14.v20181114.jar:9.4.14.v20181114]
    at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1512) ~[jetty-xml-9.4.14.v20181114.jar:9.4.14.v20181114]
    ... 9 more

Is there anything that needs to be added?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
TheAkashKamble
  • 181
  • 2
  • 17
  • Does this answer your question? [How do I resolve ClassNotFoundException?](https://stackoverflow.com/questions/17408769/how-do-i-resolve-classnotfoundexception) – 9ilsdx 9rvj 0lo Aug 12 '21 at 13:50
  • Hi @9ilsdx9rvj0lo Thanks for the reference but I am not sure how to use these steps when I am working with solr inside docker ( Jetty is giving me this error ). Had it been standalone I would have gave it a try but that is not the case. – TheAkashKamble Aug 12 '21 at 15:23

0 Answers0