Unit tests fail when loading JSON | Community
Skip to main content
New Participant
June 23, 2023
Solved

Unit tests fail when loading JSON

  • June 23, 2023
  • 2 replies
  • 1319 views

Problem I encountered with newest available AEM archetype (May 2023) and running unit tests is the method:

aemContext.load().json("file.json","/path/in/aem")

 It gives out the following exception:

java.lang.IllegalStateException: Unable to enable secure processing

This is a very common way to load content on to the test runtime. I'm curious why this doesn't just work on the official maven project. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by fperez-1

I was able to find a solution here: https://binarycipher.dev/java-lang-illegalstateexception-unable-to-enable-secure-processing/ 

 

And it just consists on adding the following dependency to the core maven project:

 

<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.12.2</version> <scope>test</scope> </dependency>

 I hope this gets added to the dependencies for the archetype for future releases

2 replies

EstebanBustamante
New Participant
June 23, 2023

It would be great if you can create an issue in the official GitHub repository so it can be addressed in future releases of the archetype. https://github.com/adobe/aem-project-archetype/issues 

Esteban Bustamante
fperez-1AuthorAccepted solution
New Participant
June 23, 2023

I was able to find a solution here: https://binarycipher.dev/java-lang-illegalstateexception-unable-to-enable-secure-processing/ 

 

And it just consists on adding the following dependency to the core maven project:

 

<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.12.2</version> <scope>test</scope> </dependency>

 I hope this gets added to the dependencies for the archetype for future releases