我正在使用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)发布于 2014-10-13 16:24:08
从错误中可以清楚地看出,您的web应用程序的类路径中没有包含OpenIMAJ jar文件。如果没有更多关于如何配置OpenIMAJ的详细信息,就很难确切地说出您应该做什么,但是,我强烈建议您让Maven为您处理所有依赖项,因为手动尝试包含eclipse jar非常单调乏味(请参阅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中&您应该可以开始工作了。
https://stackoverflow.com/questions/26291628
复制相似问题