我正在使用Modeshape rest server。 Modeshape的版本是2.8.2。当我将GET请求发送到某些节点(例如http://localhost:8080/modeshape-server/repo/workspace1/items/file)时,它将返回有关该节点的信息。但是,当我在同一地址上发送DELETE请求(例如,使用Fiddler)时,它返回405 Method Not Allowed。根据documentation这样的地址应该支持DELETE请求。更详细。我寄删除http:// localhost:8080 / modeshape-server / repo / workspace1 / items / uploads / file HTTP / 1.1用户代理:提琴手主机:localhost:8080我懂了不允许使用HTTP / 1.1 405方法伺服器:Apache-Coyote / 1.1允许:POST,OPTIONS内容类型:text / html; charset = utf-8内容长度:984日期:2012年9月4日,星期二14:16:38 GMT JBoss Web / 7.0.13.Final-错误报告 HTTP状态405- 类型状态报告 消息 描述 请求的资源()不允许使用指定的HTTP方法。 JBoss Web / 7.0.13.Final 我用来构建rest-server.war的pom.xml         xmlns:xsi =“ http://www.w3.org/2001/XMLSchema-instance”         xsi:schemaLocation =“ http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd”>     4.0.0              2.8.2。最终                 modeshape          org.modeshape          2.8.2。最终         modeshape.demo      0.1      modeshape-server     战争     Modeshape其余服务器     ModeShape servlet,提供对JCR项的RESTful访问                              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存储库             $ {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             测试                                     jboss              http://repository.jboss.org/nexus/content/groups/public                         休息服务器    难道我做错了什么?而且我还在使用JBoss-as 7.1.1。但作为回应,写成7.0.13。而且我正在使用Modeshape rest而不是服务。我将其用作正常部署的应用程序。 (很抱歉,但是我对应用程序的类型不太熟悉。我听说JBoss-as中有一些服务。无论如何我都没有使用它) (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 看起来2.8.x期望DELETE请求中包含“ Content-Type:application / json”标头。我怀疑由于请求没有这样的标头,因此Web应用程序没有该请求的处理程序。ModeShape确实提供了一个工具包,它将在JBoss AS 5和6中作为服务安装ModeShape 2.x,并且另一个工具包将在JBoss AS7中作为服务安装ModeShape 3.0(仍处于Beta版)。好处是您的1个以上的应用程序只需要查找Repository实例(通常通过JNDI,尽管在3.0中,您也可以使用JavaEE @Inject批注将存储库自动注入到EJB或应用程序中)。但是,在JBoss AS7中没有用于将ModeShape 2.8.2作为服务安装的工具包。关于java - 删除对Modeshape其余服务器的请求,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12258808/ (adsbygoogle = window.adsbygoogle || []).push({});
10-10 03:07