<Loggers>
...
<AsyncLogger name="org.mule.extensions.java" level="DEBUG"/>
...
</Loggers>
Troubleshooting Java Module - Mule 4
To troubleshoot Java module, become familiar with the information about enabling verbose logging and interpreting commonly thrown messages.
Enable Verbose Logging
To get a better understanding of why an application’s interaction with the Java module is failing, temporarily enable verbose logging for the module.
Remember to always disable the enhanced verbosity after troubleshooting, because it affects your Mule application performance.
To enable verbose logging in the configuration file:
-
In Anypoint Studio, navigate to the Package Explorer view.
-
Open your application’s project name.
-
Open the
src/main/resources
path folder. -
Open the
log4j2.xml
file inside the folder. -
Add an
<AsyncLogger>
tag inside the<Loggers>
tag: -
Save your application changes.
-
In Anypoint Studio, click the project name in Package Explorer and then click Run > Run As > Mule Application. .
Understand Common Throws
Here is a list of common throw messages and how to interpret them:
-
JAVA:ARGUMENTS_MISMATCH
Any of the arguments is either of the wrong type or missing, or there were too many arguments provided.
-
JAVA:CLASS_NOT_FOUND
A definition could not be found for the class with the specified name.
-
JAVA:INVOCATION
An error occurred during the invocation of a method or constructor.
-
JAVA:NO_SUCH_METHOD
The specified method cannot be found.
-
JAVA:WRONG_INSTANCE_CLASS
The class of the given instance does not match with the expected class.
-
JAVA:NO_SUCH_CONSTRUCTOR
The class doesn’t have a matching constructor, or it is not visible.
-
JAVA:NOT_INSTANTIABLE_TYPE
The supplied class is either abstract or interface.