【发布时间】:2012-08-28 20:05:29
【问题描述】:
我正在使用Modeshape rest server。 Modeshape 的版本是 2.8.2。
当我向http://localhost:8080/modeshape-server/repo/workspace1/items/file 之类的某个节点发送 GET 请求时,它会返回有关该节点的信息。
但是当我在同一个地址上发送 DELETE 请求(例如使用 Fiddler)时,它返回 405 Method Not Allowed。
根据documentation 这样的地址应该支持删除请求。
更详细。 我发送
删除 http://localhost:8080/modeshape-server/repo/workspace1/items/uploads/file HTTP/1.1 用户代理:提琴手 主机:本地主机:8080
我明白了
HTTP/1.1 405 方法不允许 服务器:Apache-Coyote/1.1 允许:POST、OPTIONS 内容类型:text/html;charset=utf-8 内容长度:984 日期:格林威治标准时间 2012 年 9 月 4 日星期二 14:16:38JBoss Web/7.0.13.Final - 错误报告 HTTP 状态405 -
type 状态报告
消息
说明 所请求的资源()不允许指定的HTTP方法。
JBoss Web/7.0.13.Final
我用来构建 rest-server.war 的 pom.xml
4.0.0 2.8.2.Final 属性>modeshape org.modeshape 2.8.2.Final 父>modeshape.demo 0.1版本>modeshape-server 战争包装>Modeshape 休息服务器 提供对 JCR 项的 RESTful 访问的 ModeShape servlet javax.servlet servlet-api 2.5版本> 依赖>org.modeshape modeshape-web-jcr ${modeshape.version} 依赖>org.modeshape modeshape-jcr-api ${modeshape.version} 依赖>org.modeshape modeshape-jcr ${modeshape.version} 依赖>org.modeshape modeshape-search-lucene ${modeshape.version} 依赖>org.modeshape modeshape-cnd ${modeshape.version} 依赖>org.modeshape modeshape-repository ${modeshape.version} 依赖>org.modeshape modeshape-graph ${modeshape.version} 依赖>org.modeshape modeshape-common ${modeshape.version} 依赖>org.modeshape modeshape-web-jcr-rest ${modeshape.version} 依赖>org.modeshape modeshape-connector-jdbc-metadata ${modeshape.version} 依赖>mysql mysql-connector-java 5.1.6版本>编译 依赖>org.modeshape modeshape-connector-filesystem ${modeshape.version} 依赖>org.slf4j slf4j-log4j12 依赖>org.jboss.resteasy resteasy-jaxrs 1.2.1.GA版本> 依赖>junit junit 4.10版本>测试 依赖> 依赖>老板 http://repository.jboss.org/nexus/content/groups/public 存储库>休息服务器
我做错了吗?
我也在使用 JBoss-as-7.1.1。但作为回应写在 7.0.13。
而且我使用 Modeshape 休息不是作为服务。我将它用作通常部署的应用程序。 (不好意思,我对应用的类型不是很熟悉,听说JBoss-as里面有一些服务,反正我没用)
【问题讨论】:
-
ModeShape 的 REST 服务不会显式产生 405 错误,它确实支持
DELETE方法。能否添加完整的 HTTP 请求和响应消息? -
@RandallHauch 我已经编辑了我的问题。感谢您的关注。
标签: java rest http-delete modeshape