guvnor 的 rest api中 post函数 建立一个package总是报405 get与delete都过了。

378938974 2012-12-24
今天公司在研究drools时,在调用guvnor的rest api时其post 方法总是报如下异常,但 get与delete方法都通过。所以排除是权限问题。有用过的大仙没?求教!url:http://guvnor.jdpay.360buy.net:7003/rest/packages/test

ResponseCode: 405
MediaType: text/html;charset=utf-8
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 405 for URL: http://guvnor.jdpay.360buy.net:7003/rest/packages/test
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
at java.net.URLConnection.getContent(URLConnection.java:688)
at com.jd.payment.risk.common.library.GuvnorLibrary.main(GuvnorLibrary.java:52)
Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: http://guvnor.jdpay.360buy.net:7003/rest/packages/test
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
at com.jd.payment.risk.common.library.GuvnorLibrary.main(GuvnorLibrary.java:48)
378938974 2012-12-24
The POST method creates a new package from an input stream of DRL, an Atom feed, JSON, or XML, and returns the newly created package in the requested format (Atom feed, JSON, or XML).  文档中只有这么一段描述,但列子给的都是GET方式,很纠结。按这段描述分析应该是我的post方式问题,但是在文档中却没有明确指出.
Global site tag (gtag.js) - Google Analytics