Expand my Community achievements bar.

SOLVED

Unit tests fail when loading JSON

Avatar

Level 2

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. 

1 Accepted Solution

Avatar

Correct answer by
Level 2

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

View solution in original post

2 Replies

Avatar

Correct answer by
Level 2

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

Avatar

Community Advisor

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