FarcrySolrPro & Lucee 5.3

Hi,
Is anyone using this plugin (v1.5) with Lucee 5.3? (Linux, Java 1.8.0_92-b14,Lucee 5.3.2.77)
The error thrown is not overly informative. I’ve tried it with the lucee lecene plugin installed and not, in case it made a difference.

The error is thrown on this line of cfsolrlib.cfc,

THIS.solrUpdateServer = THIS.javaLoaderInstance.create("org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer").init(THIS.solrURL,THIS.queueSize,THIS.threadCount);

We’re not using Lucee 5.3 in production yet so I haven’t run into this issue. It sounds like they might have upgraded a JAR file relating to Apache commons that the plugin needs but can’t find, or perhaps the JARs are totally missing for some other reason?

Also as an FYI, JavaLoader relies on CORBA which is deprecated in Java 9 and beyond. I’m not sure if farcrysolrpro will handle that or whether the plugin would need changes to load the JARs / create the Java objects differently.

In the p740 branch (upcoming FarCry Core 7.4) I’ve removed JavaLoader and made some changes to support a /jars folder inside each plugin/project so that FarCry Core will automatically configure the application to make those JARs available using createObject("java"...). This is still “beta” but it seems to work great in local testing.

1 Like

Hi Justin,
Thanks for that. I just decided to test out 5.3 again today because a few bug had been ironed out at the lucee end (one is the tag mapping issue I’ve been getting with 5.2).

Also, I’ve found that the image form tool has a few issues with 5.3 as well.

So for now I’ll stick with 5.2 :slight_smile:

Cheers Phil

1 Like

No worries :slight_smile:

Ahhh I haven’t seen the image formtool issues yet either, I’ll have to test…

I haven’t tried it on Lucee 5.3 yet. If you find a solution please let us know so we can update the plugin accordingly (or at least not the incompatibility).

Looks like I’ve got it running on lucee 5.3 :smiley:
I’ve removed the javaloader completely and now only use createObject. (I’ve let go of coldfusion server for now).
So in the solrlib.cfc I now have this:
at the top of the component:
THIS.aSolrjJars = [];
and in the init():
<cfset THIS.aSolrjJars = ['#expandPath("/farcry/plugins/farcrysolrpro/packages/custom/cfsolrlib/solrj-lib/apache-solr-solrj-3.5.0.jar")#','/opt/lucee/tomcat/lucee-server/bundles/org.lucee.commons.httpclient-3.1.0.jar'] />

and wherever a createObject is calling for the solrj I include the array of jar’s (THIS.aSolrjJars) eg:

THIS.solrUpdateServer = createObject("java", "org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer", THIS.aSolrjJars).init(THIS.solrURL,THIS.queueSize,THIS.threadCount);

Do you index files (pdfs, word docs) with that setup at all? I think the main issue would be Tika and how you need to switch out the class loader using that feature of Javaloader when indexing Office xml (*.docx, etc) files. Perhaps it isn’t necessary any more.

I don’t think that switch out is needed anymore.
I load tika 1.23 as a OSGi bundle. Change the MANIFEST.MF as per the image below and upload it to the bundles directory.
/opt/lucee/tomcat/lucee-server/bundles

So the parseFile() function doesn’t check for file type anymore. Just has this in the try block:
returnValue = createObject("java", "org.apache.tika.Tika", 'apache-tika-app-bundle').init().parseToString(CreateObject( "java","java.io.FileInputStream" ).init( JavaCast( "string", arguments.filePath ) ));

Interesting. If you’d like to fork the git repo and commit your changes I’d love to take a look

Have a look here

Thanks! Very helpful. I’m testing some changes using FarCry 7.4’s new /jars folder. I’m pretty easily able to test on ACF, once I have a build ready for testing would you be willing to test it on Lucee 5.3? I’m assuming you’re also using FarCry 7.4. These changes I’m implementing wont work on any version of FarCry prior to that since they wont support the new /jars folder.

If you feel like testing against Lucee 5.3 & FC 7.4 you can find my changes in this branch here https://github.com/seancoyne/farcrysolrpro/tree/remove-javaloader

Let me know if you have any issues. It seems to work great for me on ACF 2018. I need to test against CF10 since we still technically support that, but I don’t have an environment to test that currently. I’ll work on setting one up.

Thanks again for your help.

I currently use a customised version of 7.2 with no javaloader because at the time 7.4 had problems with mysql.
I can see an issue with lucee with the way you load tika as there is already an older version of tika included in lucee, hence the reason I needed to go the OSGi bundle way.

I’m away for the next week but when I’m back I’ll do some testing with FC 7.4 & Lucee 5.3 and report back.

Thanks. Perhaps there is a way to omit tika from being loaded on Lucee. I’ll spin up a vm and see if I can find a solution. Thanks for your help.