Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Use of OpenImaj in Webservice - Logger issue #124
I have built functionality using openImaj in IntelliJ. It works well using the various processes I need. I now need to expose it in a webservice. To do this I am trying to use the Play framework.
I have a basic sample webservice working based upon this tutorial. https://marianafranco.github.io/2014/07/28/rest-play/ and am using IntelliJ to work with it. It runs fine out of the box.
I have added the JAR from the OpenImaj application I built. Test-1.0-SNAPSHOT-jar-with-dependencies.jar . IntelliJ indexes the project and all the dependencies seem to resolve OK (though I did initially have issues with this). I also get no issues when I build the project.
However the when I actually look to run, I get an error complaining about lack of a method : ch.qos.logback.classic.LoggerContext.getFrameworkPackages()
My guess here and from the last days worth of trial, error, hair tearing etc that there is an issue with which version of ch.qos.logback Play uses. I think Play defaults to the version it is using in the project. These are : -
OpenImaj then has issues using the versions within Test-1.0-SNAPSHOT-jar-with-dependencies.jar ... or vice versa i.e. the versions are defaulted to those on the Jar files.
Any ideas on what I can do here?
FYI - I tried using Maven to pull down all the required libraries but encountered similar issues.
This should be possible (we've used Play and OpenIMAJ together successfully in the past). I think your problem is that you're adding the "fat" jar (the one named "...-jar-with-wependencies.jar" to your play app. You definitely don't want to do this as it will create problems with the dependencies play wants to use. The correct way to add your openimaj app jar to your play app would be by declaring it as a dependency in
Fundamentally, the steps are:
(Caveats: if you're using Windows, you might need to adjust the paths accordingly; I'm also not sure how this fits in with IntelliJ)
I am using a Mac to build this but it will be deployed on Linux.
Quick question relating to your points above : -
Do I need to downlaod all the sources and compile to a new JAR or will this fat JAR 'Test-1.0-SNAPSHOT-jar-with-dependencies.jar' work in Play if I follow step 2 above?
Apologies for the novice like questions. Learning a lot of this as I go.