-1

I want to include and start the solr server when I start my java project and then, when you click a button, I will run a python program which uses the solr server.

I have done it and it works when I launch it in Eclipse, but when I packeted all in the runnable jar file it doesn't work. What I expect first is to start the solr server included and packeted into the runnable jar. When the server is running I will try the python call.

Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42
  • 1
    Look at this : [EmbeddedSolr](https://wiki.apache.org/solr/EmbeddedSolr) – Shim-Sao Jun 04 '19 at 07:24
  • 1
    Be aware that EmbeddedSolr will not allow you to make the request from an external python process, since it's usage is expected to be from within the same Java process. – MatsLindh Jun 04 '19 at 07:24
  • But I have to execute from java an external Python script, so i can't use EmbeddedSolr. any other solution? – Garikoitz Garcia Jun 10 '19 at 12:02

1 Answers1

0

I think you are trying to package solr libraries into your own jar. With just Java it is not possible, it only works with war and ear files. But there are two other possibilities: when using spring boot, you can package fat jar with orher jars inside using spring boot maven plugin, or you can use maven shade plugin to repackage compiled classes into your jar from other jars.

Or you can do it the old school way - put jars you are dependent on into a directory and specify those jars in java classpath startup param/specify classpath in jar manifest.

maslan
  • 2,078
  • 16
  • 34