如何将OpenIMAJ与Restful Web服务集成?

时间:2014-10-10 03:48:58

标签: eclipse rest web integration openimaj

我正在使用eclipse与OpenIMAJ合作,我想将OpenIMAJ与RESTful Web服务集成。

当我尝试在RESTful Web服务上运行OpenIMAJ项目时

SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoClassDefFoundError: org/openimaj/image/Image
    at edu.carleton.comp4905.main.Index.hello(Index.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)

1 个答案:

答案 0 :(得分:0)

从错误中可以清楚地看出,您的Web应用程序的类路径中没有包含OpenIMAJ jar文件。如果没有关于如何配置eclipse的更多细节,很难准确说出你应该做什么,但是,我强烈建议你让Maven为你处理所有的依赖关系,因为手动尝试包含OpenIMAJ罐子是令人难以置信的乏味(请参阅here进行讨论)。

您应该可以按照以下说明升级现有的eclipse项目以使用maven:http://aykutakin.wordpress.com/2013/12/04/create-eclipse-dynamic-web-project-with-maven-2/

然后,您可以编辑pom文件并添加所需的Web服务依赖项(我猜错了您使用Jersey JAX-RS实现的错误?如果是,请在此处说明:https://jersey.java.net/documentation/latest/modules-and-dependencies.html)。然后将所需的OpenIMAJ依赖项添加到pom&你应该好好去。

相关问题