Tuesday, May 12, 2015

BEA-382515: Callout to Java resulted in null exception

Problem:

Getting the following error testing an OSB 11g service in the OSB Console:
BEA-382515: Callout to java method "public static java.lang.String com.amway.common.XMLJSONConverter.convertXML2JSON(java.lang.String) throws java.lang.Exception" resulted in exception: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at stages.transform.runtime.JavaCalloutRuntimeStep$1.run(JavaCalloutRuntimeStep.java:183)

Analysis:

The osb_server1.out file also reports this error:
<May 12, 2015 4:55:32 PM EDT> <Error> <OSB Transform> <BEA-382515> <Callout to java method "public static java.lang.String com.amway.common.XMLJSONConverter.convertXML2JSON(java.lang.String) throws java.lang.Exception" resulted in exception: null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at stages.transform.runtime.JavaCalloutRuntimeStep$1.run(JavaCalloutRuntimeStep.java:183)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.NoClassDefFoundError: nu/xom/Serializer
        at com.amway.common.XMLJSONConverter.convertXML2JSON(XMLJSONConverter.java:42)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        Truncated. see log file for complete stacktrace
>
As you can see, the class is not found for nu/xom/Serializer, which is a part of the xom.jar file.


Solution:

1. Copy xom-1.2.6.jar to the following folder:
$DOMAIN_HOME/soa_domain/lib/xom-1.2.6.jar
2. Bounce both osb_server1


Applicable Versions:
  • Oracle WebLogic Server 11g
  • Oracle Service Bus (OSB) 11g 

 

2 comments:

Sandeep Rudra said...

Hey Thanks Ahmed. You are still helping us by putting out these blogs :)

jefffry911 said...

Wow, very strange coincidence cause I also had such problem not so long time ago. I think that if I had it now I would definitely solve it with help of your advice, but when I had such problem I did not know about your service and used another that perfectly explained me what is an exception in java https://explainjava.com/java-exceptions/ and some others useful things that helped me to fix this issue.