简体   繁体   English

java.lang.IllegalArgumentException

[英]java.lang.IllegalArgumentException

I'm less than a beginner in Java (I'm a .NET developer), but i have to fix a Java error when invoking a WebMethod through a proxy class. 我还不是Java的初学者(我是.NET开发人员),但是在通过代理类调用WebMethod时必须修复Java错误。 From .NET, I can call it with no problems, but in Java, this is what happens: 从.NET,我可以毫无问题地调用它,但是在Java中,会发生以下情况:

java.lang.IllegalArgumentException

at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at weblogic.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1411)
    at weblogic.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1613)
    at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1174)
    at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:399)
    at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1147)
    at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
    at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:147)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.verizon.vmw.csgw.ws.updateDOJob.v4_4.wsdl.UpdateDOJobServiceSoapBindingStub.updateDOJob(UpdateDOJobServiceSoapBindingStub.java:206)
    at com.verizon.vmw.csgw.ws.updateDOJob.v4_4.wsdl.UpdateDOJobServiceProxy.updateDOJob(UpdateDOJobServiceProxy.java:50)
    at rm.interfaces.wfadosnd.WfaDoSndWorker.updateDOJobComments(WfaDoSndWorker.java:1111)
    at rm.interfaces.wfadosnd.WfaDoSndWorker.checkEtaAsgn(WfaDoSndWorker.java:507)
    at rm.interfaces.wfadosnd.WfaDoSndWorker.resequenceDODispatches(WfaDoSndWorker.java:541)
    at rm.interfaces.wfadosnd.WfaDoSndWorker.processOutboundRows(WfaDoSndWorker.java:283)
    at rm.interfaces.wfadosnd.WfaDoSndWorker.run(WfaDoSndWorker.java:112)
    at rm.util.WorkerThread.run(ThreadPool.java:152)

Does anyone have any idea of what could be causing this exception? 是否有人对导致此异常的原因有任何想法?

使用Wireshark进行检查,然后将.NET请求与Java请求进行比较。

Looks like your web application was receiving a message, and one of its fields failed verification that it was the right type (or acceptable value). 看起来您的Web应用程序正在接收消息,并且其字段之一未能通过验证它是否是正确的类型(或可接受的值)。

Whether that was a data issue, or a coding issue depends heavily on the data, code, and intent which are all not provided. 究竟是数据问题还是编码问题在很大程度上取决于未提供的数据,代码和意图。

As you can see from the class names in the stack trace, the exception is thrown during deserialization of the webservice response. 从堆栈跟踪中的类名称可以看到,在反序列化Web服务响应期间会引发异常。

The exception itself is pretty generic and hence carries little useful information. 异常本身非常通用,因此几乎没有有用的信息。

Try looking at the response sent over the wire, or set an exception breakpoint in eclipse so you can inspect the stack frames the exception is thrown to get additional context. 尝试查看通过电线发送的响应,或者在eclipse中设置异常断点,以便您可以检查引发异常的堆栈帧以获取其他上下文。 (To ease interpretation of what went wrong, you'll probably want to procure the source code of your web service stack). (为了简化对错误原因的解释,您可能需要购买Web服务堆栈的源代码)。

look in the code for something is parsed for user input 在代码中查找已解析的内容以供用户输入

like this Integer i = Integer.parseInt("string"); 像这样的Integer i = Integer.parseInt("string");

and the "string" contains none valid number 并且“字符串”不包含有效数字

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM