【问题标题】:How to integrate OpenIMAJ with Restful web service?如何将 OpenIMAJ 与 Restful Web 服务集成?
【发布时间】:2014-12-05 03:55:11
【问题描述】:

我正在使用 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)

【问题讨论】:

    标签: eclipse rest web integration openimaj


    【解决方案1】:

    从错误中可以看出,您的 Web 应用程序的类路径中没有包含 OpenIMAJ jar 文件。如果没有更多关于您如何配置 eclipse 的详细信息,很难准确地说出您应该做什么,但是,我强烈建议您让 Maven 为您处理所有依赖项,因为手动尝试包含 OpenIMAJ 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 中,您应该一切顺利。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-28
      • 2014-11-04
      • 2018-11-18
      • 2015-10-21
      • 2012-12-07
      • 2021-02-05
      • 1970-01-01
      相关资源
      最近更新 更多