[OPENENGSB-2128] Exception cannot be deserialized when transported via JSON Created: 01/Oct/11  Updated: 28/May/14  Resolved: 29/May/13

Status: Closed
Project: OpenEngSB
Component/s: framework
Affects Version/s: framework-2.0.1, framework-2.2.0
Fix Version/s: openengsb-3.0.0.M1

Type: Bug Priority: Critical
Reporter: Christoph Gritschenberger Assignee: Stefan Scheiber
Resolution: Fixed Votes: 0
Labels: gsoc2012


 Description   

When a method throws an exception and that exception-result is transported back via jms-json, The remote client cannot deserialize the Exception, because the JSON-lib cannot handle it.

We need some way to properly transmit Exceptions.

In addition an itest is required to verify this behavior



 Comments   
Comment by Andreas Pieber [ 02/Oct/11 ]

what does it mean? We've to find out which type of exception is transported? Do we have to extend the parser? Or what exactly is the problem?

Comment by Christoph Gritschenberger [ 28/Nov/11 ]

I increased the priority of this issue.
It's the reason for strange exceptions like these:

2011-11-28 12:17:19,374 | ERROR | Q Session Task-3 | JMSIncomingPort                  | ngsb.ports.jms.JMSIncomingPort$1   87 | 196 - org.openengsb.ports.jms - 2.2.0 | an error occured when processing the filterchain       
org.openengsb.core.api.remote.FilterException: java.io.FileNotFoundException: reader cannot be resolved to URL                                                                                                                 
        at org.openengsb.core.security.filter.JsonSecureRequestStringMarshallerFilter.doFilter(JsonSecureRequestStringMarshallerFilter.java:81)[172:org.openengsb.framework.security:2.2.0]                                    
        at org.openengsb.core.security.filter.JsonSecureRequestStringMarshallerFilter.doFilter(JsonSecureRequestStringMarshallerFilter.java:49)[172:org.openengsb.framework.security:2.2.0]                                    
        at org.openengsb.core.common.remote.AbstractFilterAction.filter(AbstractFilterAction.java:45)[169:org.openengsb.framework.common:2.2.0]                                                                                
        at org.openengsb.core.common.remote.FilterChain.filter(FilterChain.java:38)[169:org.openengsb.framework.common:2.2.0]                                                                                                  
        at org.openengsb.ports.jms.JMSIncomingPort$1.onMessage(JMSIncomingPort.java:74)[196:org.openengsb.ports.jms:2.2.0]                                                                                                     
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)[142:org.springframework.jms:3.0.6.RELEASE]                                            
        at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)[142:org.springframework.jms:3.0.6.RELEASE]                                              
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[142:org.springframework.jms:3.0.6.RELEASE]                                           
        at org.springframework.jms.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:439)[142:org.springframework.jms:3.0.6.RELEASE]                                             
        at org.springframework.jms.listener.SimpleMessageListenerContainer.processMessage(SimpleMessageListenerContainer.java:311)[142:org.springframework.jms:3.0.6.RELEASE]                                                  
        at org.springframework.jms.listener.SimpleMessageListenerContainer$2.onMessage(SimpleMessageListenerContainer.java:287)[142:org.springframework.jms:3.0.6.RELEASE]                                                     
        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1230)[187:org.apache.activemq.activemq-core:5.5.0]                                                                                
        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:134)[187:org.apache.activemq.activemq-core:5.5.0]                                                                                 
        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:205)[187:org.apache.activemq.activemq-core:5.5.0]                                                                                  
        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:127)[187:org.apache.activemq.activemq-core:5.5.0]                                                                                         
        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)[187:org.apache.activemq.activemq-core:5.5.0]                                                                                            
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.6.0_23]                                                                                                                          
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.6.0_23]                                                                                                                          
        at java.lang.Thread.run(Thread.java:679)[:1.6.0_23]                                                                                                                                                                    
Caused by: java.io.FileNotFoundException: reader cannot be resolved to URL                                                                                                                                                     
        at org.drools.io.impl.ReaderResource.getURL(ReaderResource.java:52)                                                                                                                                                    
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_23]                                                                                                                                              
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.6.0_23]                                                                                                                            
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_23]                                                                                                                    
        at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_23]                                                                                                                                                         
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.get(BeanPropertyWriter.java:467)[139:jackson-mapper-asl:1.8.5]                                                                                                      
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:402)[139:jackson-mapper-asl:1.8.5]                                                                                         
        at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:175)[139:jackson-mapper-asl:1.8.5]                                                                                                  
        at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:142)[139:jackson-mapper-asl:1.8.5]                                                                                                        
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:430)[139:jackson-mapper-asl:1.8.5]                                                                                         
        at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:175)[139:jackson-mapper-asl:1.8.5]                                                                                                  
        at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:142)[139:jackson-mapper-asl:1.8.5]                                                                                                        
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:430)[139:jackson-mapper-asl:1.8.5]                                                                                         
        at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:175)[139:jackson-mapper-asl:1.8.5]                                                                                                  
        at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:142)[139:jackson-mapper-asl:1.8.5]                                                                                                        
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:430)[139:jackson-mapper-asl:1.8.5]                                                                                         
        at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:175)[139:jackson-mapper-asl:1.8.5]                                                                                                  
        at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:142)[139:jackson-mapper-asl:1.8.5]                                                                                                        
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:430)[139:jackson-mapper-asl:1.8.5]                                                                                         
        at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:175)[139:jackson-mapper-asl:1.8.5]                                                                                                  
        at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:142)[139:jackson-mapper-asl:1.8.5]                                                                                                        
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:430)[139:jackson-mapper-asl:1.8.5]                                                                                         
        at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:175)[139:jackson-mapper-asl:1.8.5]                                                                                                  
        at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:142)[139:jackson-mapper-asl:1.8.5]                                                                                                        
        at org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:430)[139:jackson-mapper-asl:1.8.5]                                                                                         
        at org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:175)[139:jackson-mapper-asl:1.8.5]                                                                                                  
        at org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:142)[139:jackson-mapper-asl:1.8.5]                                                                                                        
        at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:600)[139:jackson-mapper-asl:1.8.5]                                                                                    
        at org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:280)[139:jackson-mapper-asl:1.8.5]                                                                                     
        at org.codehaus.jackson.map.ObjectMapper._configAndWriteValue(ObjectMapper.java:2260)[139:jackson-mapper-asl:1.8.5]                                                                                                    
        at org.codehaus.jackson.map.ObjectMapper.writeValueAsString(ObjectMapper.java:1829)[139:jackson-mapper-asl:1.8.5]                                                                                                      
        at org.openengsb.core.security.filter.JsonSecureRequestStringMarshallerFilter.doFilter(JsonSecureRequestStringMarshallerFilter.java:79)[172:org.openengsb.framework.security:2.2.0]                                    
        ... 18 more 

This happens when an exception (any exception) in a rule-consequece occurs and a ConsequenceException is thrown by the workflow engine.
It cannot be serialized.

Comment by Christoph Gritschenberger [ 28/Nov/11 ]

More on the deserialize-issue:
JSON cannot serialize and deserialize Exceptions.
We need to find some way to wrap this.

Comment by Christoph Gritschenberger [ 29/Nov/11 ]

Workaround for the consequence-exception has been implemented

Comment by Stefan Scheiber [ 29/May/13 ]

Issue dates back to 2011.
Workaround available (see comment from 29.11.2011)
If problem persists, please open new issue.

Generated at Tue Sep 19 15:30:50 CEST 2017 using JIRA 6.3.13#6344-sha1:62d2b41c1ddfd5b5a56568898407231b0d9c17cb.