We have the problem I mentioned in the subject of the post in all our APIs we migrate to Runtime 4.6.
To reproduce, I created a test API from scratch in Anypoint Studio, with one endpoint. In the raise error component a custom error is thrown. Next, I added a on error continue to the flow:
In the logger in the error handler I try to log the errortype like this:
When I trigger the flow via HTTP, the console log shows an error:
Message : "Illegal access while trying to access field `asString` at class `org.mule.runtime.ast.privileged.error.DefaultErrorType`. Please verify that the correct getter method is being defined.
Caused by: java.lang.IllegalAccessException: Class org.mule.weave.v2.module.pojo.reader.PropertyDefinition can not access a member of class org.mule.runtime.ast.privileged.error.DefaultErrorType with modifiers "private final"
sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
java.lang.reflect.Field.get(Field.java:390)
org.mule.weave.v2.module.pojo.reader.PropertyDefinition.read(PropertyDefinition.scala:157)
org.mule.weave.v2.module.pojo.reader.JavaBeanObjectValue$JavaBeanObjectSeq.selectValue(JavaBeanObjectValue.scala:52)
With Runtime 4.4 this worked. Was the asString property removed from the errorType in Runtime 4.6 ?
Best regards,
Gerd
Raghav, due to Java Refelaction , Some property is now not accessible in Mule in some JDK version . It works in CloudHub because there might be diffrent Runtime and JDK/JRE version than local one.