In OSB(Oracle Service Bus), I used the default report action, but disabled the default reporting provider in the console settings, so no one is reading the message from the default reporting message queue.
Now I am trying to use a JMS adapter in OEP(Oracle Event Processing) to get the reporting message from the default reporting queue.
I got the message and it is an Object Message(com.bea.wli.reporting.jmsprovider.runtime.ReportMessage), while testing I can only display the messageId by calling objectMessage.getJMSMessageID(), but when I can call objectMessage.getObject() I get this exception in the OEP server console. The code throws the exception is not visible to me. Here is the exception I am getting:
java.lang.RuntimeException: java.lang.ClassCastException: cannot assign instance of org.apache.xmlbeans.impl.values.XmlAnyTypeImpl
to field com.bea.wli.reporting.jmsprovider.runtime.ReportMessage.metadata
of type org.apache.xmlbeans.XmlObject in instance of com.bea.wli.reporting.jmsprovider.runtime.ReportMessage
But the Javadoc shows this XmlAnyTypeImpl implements XmlOjbect
package org.apache.xmlbeans.impl.values;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.SchemaType;
public class XmlAnyTypeImpl extends XmlComplexContentImpl implements XmlObject
My understanding about this exception is :
- I have a Interface A, and a class B implements A
- now I have a "b" which is a instance of B
- this exception is saying that I can not assign "b" to a variable which type is A.
Is this correct?
If my understanding is correct, how could this happen... Some people on the internet saying it could be these are not loaded in the same class loader, I am not quite sure is there a way that I can control that?
I have already tried to put this getObject call in a separate OSGi bundle to see if that would force it to use one classloader, but I am still getting the same exception.