简体   繁体   English

org.apache.axis2.AxisFault:org.apache.axis2.databinding.ADBException:Unexpected subelement underTimelyRenewal

[英]org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement underTimelyRenewal

I am getting the below exception before hitting a axis 2 webservice.在点击轴 2 网络服务之前,我收到以下异常。

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement underTimelyRenewal org.apache.axis2.AxisFault:org.apache.axis2.databinding.ADBException:Unexpected subelement underTimelyRenewal

I can't reproduce the same issue locally on tomcat or in DEV environment which runs in Weblogic.我无法在 tomcat 本地或在 Weblogic 中运行的 DEV 环境中重现相同的问题。 It justs happens only in 1 environment which runs on Weblogic 11g.它只发生在 1 个在 Weblogic 11g 上运行的环境中。 This makes to think that I am missing some config in that environment, I am not sure what it is.这让人觉得我在那个环境中缺少一些配置,我不确定它是什么。 Any help on this is highly appreciated.对此的任何帮助表示高度赞赏。

Here is code that calls web service.这是调用 Web 服务的代码。

public  com.ibs.accouting.employeeVerificationResponse getEmployeeVerificationRequest(

                        com.ibs.accounting.EmployeeVerificationRequest employeeVerificationRequest108)


                throws java.rmi.RemoteException

                {
          org.apache.axis2.context.MessageContext _messageContext = null;
          try{
           org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName());
          _operationClient.getOptions().setAction("http://ibs.com/accounting/WBLEmployeeVerificationRequest");
          _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);



              addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&");


          // create a message context
          _messageContext = new org.apache.axis2.context.MessageContext();



          // create SOAP envelope with that payload
          org.apache.axiom.soap.SOAPEnvelope env = null;


                                                env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
                                                employeeVerificationRequest108,
                                                optimizeContent(new javax.xml.namespace.QName("http://ibs.com/accounting",
                                                "getEmployeeVerificationRequest")));

    //adding SOAP soap_headers
     _serviceClient.addHeadersToEnvelope(env);
    // set the message context with that soap envelope
    _messageContext.setEnvelope(env);

    // add the message contxt to the operation client
    _operationClient.addMessageContext(_messageContext);

    //execute the operation client
    _operationClient.execute(true);


           org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(
                                       org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();


                            java.lang.Object object = fromOM(
                                         _returnEnv.getBody().getFirstElement() ,
                                         com.ibs.accounting.EmployeeVerificationResponse.class,
                                          getEnvelopeNamespaces(_returnEnv));


                                    return (com.ibs.accounting.EmployeeVerificationResponse)object;

     }catch(org.apache.axis2.AxisFault f){

        org.apache.axiom.om.OMElement faultElt = f.getDetail();
        if (faultElt!=null){
            if (faultExceptionNameMap.containsKey(faultElt.getQName())){
                //make the fault by reflection
                try{
                    java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());
                    java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);
                    java.lang.Exception ex=
                            (java.lang.Exception) exceptionClass.newInstance();
                    //message class
                    java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());
                    java.lang.Class messageClass = java.lang.Class.forName(messageClassName);
                    java.lang.Object messageObject = fromOM(faultElt,messageClass,null);
                    java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
                               new java.lang.Class[]{messageClass});
                    m.invoke(ex,new java.lang.Object[]{messageObject});


                    throw new java.rmi.RemoteException(ex.getMessage(), ex);
                }catch(java.lang.ClassCastException e){
                   // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                } catch (java.lang.ClassNotFoundException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }catch (java.lang.NoSuchMethodException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                } catch (java.lang.reflect.InvocationTargetException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }  catch (java.lang.IllegalAccessException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }   catch (java.lang.InstantiationException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }
            }else{
                throw f;
            }
        }else{
            throw f;
        }
        } finally {
            _messageContext.getTransportOut().getSender().cleanup(_messageContext);
        }
    }

This error can be kind of misleading.这个错误可能有点误导。 AFter I modified the WSDL and added a new mandatory element, I created my client.在我修改了 WSDL 并添加了一个新的必需元素之后,我创建了我的客户端。 Than this error appeared.比这个错误出现了。 The solution was, that I forgot to fill this element in one method of the my web service.解决方案是,我忘记在我的 Web 服务的一种方法中填充这个元素。 If this error appears, also check if your mandatory elements are filled within the server.如果出现此错误,还要检查服务器中是否填写了您的必填元素。 That it works under one environment and not in an other can also mean, that a mandatory item is filled on one server (development server) and not under the other (productive server).它在一种环境下工作而不在另一种环境中工作也可能意味着,在一台服务器(开发服务器)而不是在另一台(生产服务器)下填写必填项。

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

相关问题 org.apache.axis2.AxisFault连接被拒绝 - org.apache.axis2.AxisFault connection refused 引起:org.apache.axis2.AxisFault:无法参与模块:城墙 - Caused by: org.apache.axis2.AxisFault: Unable to engage module : rampart org.apache.axis2.AxisFault: sun.security.validator.ValidatorException: - org.apache.axis2.AxisFault: sun.security.validator.ValidatorException: 错误:org.apache.axis2.AxisFault:请求中未指定方法 - Error: org.apache.axis2.AxisFault: No method specified in request org.apache.axis2.AxisFault:尚未设置转出 - org.apache.axis2.AxisFault: Transport out has not been set org.apache.axis2.AxisFault:传输错误:501错误:未实现 - org.apache.axis2.AxisFault: Transport error: 501 Error: Not Implemented 导入 org.apache.axis2.AxisFault 无法解析。 什么依赖安装必要的 AxisFault? - The import org.apache.axis2.AxisFault cannot be resolved. What dependency installs necessary AxisFault? org.apache.axis2.AxisFault:不喜欢该软件包的映射qname:org.hibernate.collection - org.apache.axis2.AxisFault: Mapping qname not fond for the package: org.hibernate.collection org.apache.axis2.AxisFault:不喜欢该软件包的映射qname:org.joda.time.chrono - org.apache.axis2.AxisFault: Mapping qname not fond for the package: org.joda.time.chrono axis2.databinding.ADBException:意外的子元素 - axis2.databinding.ADBException: Unexpected subelement
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM