问题
I have a Jersey
WebApp running on Tomcat
and want to integrate the MarvinFramework
for ImageProcessing. Basically I want to reduce noise, grayscale and scale an Image for further processing.
The Marvin Framework relies on custom Plugins for their specific prupose, and those Plugins I want to use. But since the Framwork has its own ClassLoader
, that loads the plugins JAR
dynamically at runtime from an absolute location inside the project, I am confused where to put the files or how to configure the WebApp, that the ClassLoader is able load the JARs. I recreated the directory-structure for standalone Apps inside my WEB-INF/lib
-dir with the Deployment Assembly
but I had no success.
I am getting a:
java.io.FileNotFoundException: .\marvin\plugins\image\org.marvinproject.image.color.grayScale.jar
when I try:
marvinImagePlugin = MarvinPluginLoader.loadImagePlugin("org.marvinproject.image.color.grayScale.jar");
the jar-file should be located by the deploment assebmly in:
WEB-INF/lib/marvin/plugins/image
回答1:
You can set the library path with MarvinDefinitions.setImagePluginPath(path);
to a path of your choice. In this case you have to manually put the files to the JVM and they are not deployed automatically.
来源:https://stackoverflow.com/questions/12602953/adding-marvinframework-to-a-webapp-on-tomcat7