Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
web服务:java.io.IOException:服务器返回了URL的HTTP响应代码:500_Java_Web Services_Cxf - Fatal编程技术网

web服务:java.io.IOException:服务器返回了URL的HTTP响应代码:500

web服务:java.io.IOException:服务器返回了URL的HTTP响应代码:500,java,web-services,cxf,Java,Web Services,Cxf,我正在尝试使用cxf web服务。我有一个intelliJ中的java示例,当我运行它时,一切都正常。但当我尝试在JavaWeb项目(Struts2和spring框架)中调用web服务时,我遇到了这个异常。这两种代码中的每件事都是相同的。两者都运行在同一个客户机上 谁能告诉我出了什么问题 org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInte

我正在尝试使用cxf web服务。我有一个intelliJ中的java示例,当我运行它时,一切都正常。但当我尝试在JavaWeb项目(Struts2和spring框架)中调用web服务时,我遇到了这个异常。这两种代码中的每件事都是相同的。两者都运行在同一个客户机上

谁能告诉我出了什么问题

org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
.
.
.
`Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://servicebus......
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
`.
 .
 .
 .
 .
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://servicebus......
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2081)
... 111 more
我使用的代码如下:

        CustomsDebtService customsDebtService = new CustomsDebtService();
    CustomsDebt debtWebService = customsDebtService.getCustomsDebtPort();
    java.util.Map<String, Object> ctx = ((BindingProvider) debtWebServicePort).getRequestContext();
    ctx.put("ws-security.signature.properties", "keystore.properties");
    ctx.put("ws-security.encryption.properties", "truststore.properties");
    ctx.put("ws-security.encryption.username", "servicebus.ecogif.XX");
    ctx.put("ws-security.asymmetric.signature.algorithm", "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
    ctx.put("ws-security.callback-handler", "externalWebService.XXX.newDebts.CertificatePasswordCallbackHandler");
    PersonDebtInquiryResult personDebtInquiryResult;

        if (Empty.isNotEmpty(iricaDebtsInquiry.getNationalCode()))
        {

            personDebtInquiryResult=debtWebService.personDebtInquiryByNationalID("000000001");
        }
CustomsDebtService CustomsDebtService=new CustomsDebtService();
CustomsDebt debtWebService=customsDebtService.getCustomsDebtPort();
java.util.Map ctx=((BindingProvider)debtWebServicePort.getRequestContext();
ctx.put(“ws-security.signature.properties”、“keystore.properties”);
put(“ws-security.encryption.properties”、“truststore.properties”);
ctx.put(“ws-security.encryption.username”、“servicebus.ecogif.XX”);
put(“ws-security.asymetric.signature.algorithm”http://www.w3.org/2001/04/xmldsig-more#rsa-sha256”);
ctx.put(“ws-security.callbackhandler”、“externalWebService.XXX.newdebnts.CertificatePasswordCallbackHandler”);
PersonDebtInquiryResult PersonDebtInquiryResult;
if(Empty.isNotEmpty(iricaDebtsInquiry.getNationalCode()))
{
personDebtInquiryResult=debtWebService.PersonDebtInquiryByNational(“00000000 1”);
}
在最后一行发生异常。 所有地址都是正确的


还有一些用于配置的.jks文件,我将它们放在ctx中(代码中)。此文件的正确路径是什么,以便代码能够理解。问题是否可能是因为路径错误而发生的?

如果我们看不到两个项目中的编码代码是相同的,但一个是web项目,另一个不是,那么很难提供帮助。这是否会导致未完成配置(可能在tomcat中…)?或者可能是因为我的项目中缺少LIB(在运行时使用)?HTTP状态代码500:通常意味着Web服务器代码已崩溃服务器不喜欢输入参数您的意思是问题出在我发送的消息上?您的请求可能缺少一些参数