@lfagua -
Possible cause 1 - The required 3rd party jars are not available in classpath
Use of Third-party Libraries in Customizations, Not Available OOTB
Before starting, ensure that all third-party libraries used:
- Are from an authentic/trusted source.
- Do not incur legal obligations.
- Are free from known security vulnerabilities.
- Are compatible with the supported JDK versions of IdentityIQ.
Never add the following libraries explicitly to the classpath of any application, as they can cause class loading or conflict errors (these libraries are infrastructure libraries provided OOTB and are shared across IdentityIQ):
- Openconnector framework classes or jar: Responsible for providing connector infrastructure like interfaces and functionality control.
- Any OOTB connector bundle jar.
- Aspect.jar*: Responsible for providing the aspect infrastructure.
- Commons-logging.jar, log4j-.jar, slf4j-api.jar*: Responsible for providing logging infrastructure.
- Bsf.jar* and bsh.jar*: Used to execute Rules.
To enable third-party libraries, complete the following:
- Create a subfolder in the WEB-INF/lib-connectors folder. For example, WEB-INF/lib-connectors/XYZcustom
- Save a copy of the required third-party libraries for the customization.
- In the Application Definition for your application that is using this customization, add a connector-classpath entry to the Attributes map. This entry can point to the jars individually or to the folder, as shown in the example below. This adds the specified jar file, or all jars in the folder, to the classpath for the connector.
<!-- IIQ filePathPrefix = Directory Path including /WEB-INF -->
<entry key="connector-classpath">
<value>
<List>
<String>\lib-connectors\JDBCCustom\commons-codec-1.9.jar</String> <!-- path of single jar -->
<String>\lib-connectors\ JDBCCustom\</String> <!-- path of folder, all jars under the folder will be added to classpath -->
</List>
</value>
</entry>
For more details, please check this link.
Possible Cause 2
This error indicates a problem with access permissions when trying to invoke the newDocumentBuilder()
method on the DocumentBuilderFactoryImpl
class from the com.sun.org.apache.xerces.internal.jaxp
package. It is likely caused by the module system introduced in Java 9.
To resolve this issue, you can try the following:
- Update Java Version: Ensure that you are using a Java version that is compatible with your code. Newer versions of Java might have resolved certain module-related issues.
- Use Official APIs: Avoid using internal classes such as
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
. Instead, use the official APIs provided by Java, such as javax.xml.parsers.DocumentBuilderFactory
.
import javax.xml.parsers.DocumentBuilderFactory;
And then, create a DocumentBuilderFactory instance:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
Add Appropriate Modules: If you are using a modular project, make sure that you have the necessary modules in your module-info.java file. For example:
module your.module.name {
requires java.xml;
}
- Make sure that your module has the required dependencies specified.
- Update Dependencies: If you are using external libraries, make sure they are compatible with the Java version you are using. Update your dependencies to the latest versions if needed.
- Review Security Policies: Check if there are any security policies or restrictions in place that might be affecting the accessibility of the classes.
- Check for Reflective Access Warnings: If you are using reflection in your code, you might encounter issues due to module restrictions. Ensure that your reflective access is legitimate and consider adding appropriate
--add-opens
or --add-exports
flags to your JVM arguments if necessary.For example:
--add-opens java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED
This link might be helpful.
Mark it as solution, if it helps.