cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sanjay Gautam (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6197) Although the Parts classes are same PhaseInterceptorChain not able to recognize it that they are bother same object of same class type
Date Fri, 16 Jan 2015 04:07:34 GMT

     [ https://issues.apache.org/jira/browse/CXF-6197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sanjay Gautam updated CXF-6197:
-------------------------------
    Attachment: typeClass-debug-inspect.png

> Although the Parts classes are same PhaseInterceptorChain not able to recognize it that
they are bother same object of same class type
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-6197
>                 URL: https://issues.apache.org/jira/browse/CXF-6197
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding, Soap Binding
>    Affects Versions: 3.0.1, 2.7.14
>         Environment: JBPM 6.1.0.Final and CXF and wildfly 8.2.0 
>            Reporter: Sanjay Gautam
>         Attachments: typeClass-debug-inspect.png
>
>
> JBPM using the call like this below 
> I don't see any issue with the client code and the cxf not able to figure out that that
two instance are same. 
> Cxf using the comparison method exactly at this place fails 
> ClientImpl.java 
>    private void checkPart(MessagePartInfo part, Object object) {
>         if (part == null || part.getTypeClass() == null || object == null) {
>             return;
>         }
>         Class<?> typeClass = part.getTypeClass();
>         if (typeClass == null) {
>             return;
>         }
>         if (typeClass.isPrimitive()) {
>             if (typeClass == Long.TYPE) {
>                 typeClass = Long.class;
>             } else if (typeClass == Integer.TYPE) {
>                 typeClass = Integer.class;
>             } else if (typeClass == Short.TYPE) {
>                 typeClass = Short.class;
>             } else if (typeClass == Byte.TYPE) {
>                 typeClass = Byte.class;
>             } else if (typeClass == Character.TYPE) {
>                 typeClass = Character.class;
>             } else if (typeClass == Double.TYPE) {
>                 typeClass = Double.class;
>             } else if (typeClass == Float.TYPE) {
>                 typeClass = Float.class;
>             } else if (typeClass == Boolean.TYPE) {
>                 typeClass = Boolean.class;
>             }
>         } else if (typeClass.isArray() && object instanceof Collection) {
>             //JAXB allows a pseudo [] <--> List equivalence
>             return;
>         }
>         if (!typeClass.isInstance(object)) {
>             throw new IllegalArgumentException("Part " + part.getName() + " should be
of type " 
>                 + typeClass.getName() + ", not " 
>                 + object.getClass().getName());
>         }
>     }
>  
> #######   CODE SNIPPETS  ########
>  public void executeWorkItem(WorkItem workItem, final WorkItemManager manager) {
>     	Object[] parameters = null;
>         String interfaceRef = (String) workItem.getParameter("Interface");
>         String operationRef = (String) workItem.getParameter("Operation");
>         String endpointAddress = (String) workItem.getParameter("Endpoint");
>         if ( workItem.getParameter("Parameter") instanceof Object[]) {
>         	parameters =  (Object[]) workItem.getParameter("Parameter");
>         } else if (workItem.getParameter("Parameter") != null && workItem.getParameter("Parameter").getClass().isArray())
{
>         	int length = Array.getLength(workItem.getParameter("Parameter"));
>             parameters = new Object[length];
>             for(int i = 0; i < length; i++) {
>             	parameters[i] = Array.get(workItem.getParameter("Parameter"), i);
>             }            
>         } else {
>         	parameters = new Object[]{ workItem.getParameter("Parameter")};
>         }
>         
>         String modeParam = (String) workItem.getParameter("Mode");
>         WSMode mode = WSMode.valueOf(modeParam == null ? "SYNC" : modeParam.toUpperCase());
>             
>         try {
>              Client client = getWSClient(workItem, interfaceRef);
>              if (client == null) {
>                  throw new IllegalStateException("Unable to create client for web service
" + interfaceRef + " - " + operationRef);
>              }
>              //Override endpoint address if configured.
>              if (endpointAddress != null && !"".equals(endpointAddress)) {
>             	 client.getRequestContext().put(Message.ENDPOINT_ADDRESS, endpointAddress)
;
>              }
>              
>              switch (mode) {
>                 case SYNC:
>                     Object[] result = client.invoke(operationRef, parameters);
>                     
>                     Map<String, Object> output = new HashMap<String, Object>();
         
>    
>                     if (result == null || result.length == 0) {
>                       output.put("Result", null);
>                     } else {
>                         output.put("Result", result[0]);
>                     }
>                     logger.debug("Received sync response {} completeing work item {}",
result, workItem.getId());
>                     manager.completeWorkItem(workItem.getId(), output);
>                     break;
> -------------------------------
>  protected synchronized Client getWSClient(WorkItem workItem, String interfaceRef) {
>         if (clients.containsKey(interfaceRef)) {
>             return clients.get(interfaceRef);
>         }
>         
>         String importLocation = (String) workItem.getParameter("Url");
>         String importNamespace = (String) workItem.getParameter("Namespace");
>         if (importLocation != null && importLocation.trim().length() > 0 
>         		&& importNamespace != null && importNamespace.trim().length()
> 0) {
>         	Client client = dcf.createClient(importLocation, new QName(importNamespace,
interfaceRef), getInternalClassLoader(), null);
>             clients.put(interfaceRef, client);
>             return client;
>         }
>         
>         
>         long processInstanceId = ((WorkItemImpl) workItem).getProcessInstanceId();
>         WorkflowProcessImpl process = ((WorkflowProcessImpl) ksession.getProcessInstance(processInstanceId).getProcess());
>         List<Bpmn2Import> typedImports = (List<Bpmn2Import>)process.getMetaData("Bpmn2Imports");
>         
>         if (typedImports != null ){
>             Client client = null;
>             for (Bpmn2Import importObj : typedImports) {
>                 if (WSDL_IMPORT_TYPE.equalsIgnoreCase(importObj.getType())) {
>                     try {
>                         client = dcf.createClient(importObj.getLocation(), new QName(importObj.getNamespace(),
interfaceRef), getInternalClassLoader(), null);
>                         clients.put(interfaceRef, client);
>                         return client;
>                     } catch (Exception e) {
>                     	logger.error("Error when creating WS Client", e);
>                         continue;
>                     }
>                 }
>             }
>         }
>         return null;
>     }
> XXXXXXXXXXXXXX  ERROR  XXXXXXXXXXXXXXXXXXXXXXXXX
> 19:16:26,899 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-29) Interceptor
for {http://mdsoasis.caiso.com/}MdsOasisServiceService#{http://mdsoasis.caiso.com/}saveOrUpdateOasisNoti
> fication has thrown exception, unwinding now: java.lang.IllegalArgumentException: Part
{http://mdsoasis.caiso.com/}arg0 should be of type com.caiso.mdsoasis.OasisNotificationCtlDto,
not com.caiso.mdso
> asis.OasisNotificationCtlDto
>         at org.apache.cxf.jaxb.io.DataWriterImpl.checkPart(DataWriterImpl.java:277) [cxf-rt-databinding-jaxb-3.0.1.jar:3.0.1]
>         at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:209) [cxf-rt-databinding-jaxb-3.0.1.jar:3.0.1]
>         at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:121)
[cxf-core-3.0.1.jar:3.0.1]
>         at org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor.handleMessage(RPCOutInterceptor.java:112)
[cxf-rt-bindings-soap-3.0.1.jar:3.0.1]
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
[cxf-core-3.0.1.jar:3.0.1]
>         at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) [cxf-core-3.0.1.jar:3.0.1]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) [cxf-core-3.0.1.jar:3.0.1]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) [cxf-core-3.0.1.jar:3.0.1]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) [cxf-core-3.0.1.jar:3.0.1]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299) [cxf-core-3.0.1.jar:3.0.1]
>         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:285) [cxf-core-3.0.1.jar:3.0.1]
>         at org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler.executeWorkItem(WebServiceWorkItemHandler.java:113)
[jbpm-workitems-6.1.0.Final.jar:6.1.0.Final]
>         at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:54)
[drools-persistence-jpa-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:133)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:354)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:313)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:61)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:57)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:354)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:369)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:117)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:63)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:354)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:313)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:61)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:57)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:162)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:354)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:313)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:66)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]
>         at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:43)
[jbpm-flow-6.1.0.Final.jar:6.1.0.Final]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message