Junit 5 Issue while reading XML | Community
Skip to main content
New Participant
April 12, 2023
Solved

Junit 5 Issue while reading XML

  • April 12, 2023
  • 1 reply
  • 507 views

Hi ,

 

I am trying to write a junit for a path based servlet using junit5. The servlet basically reads an input stream (XML format) and then processes that further.

I am trying to load XML from class path src/test/resources :

 

private final AemContext context = new AemContext();

 

@BeforeEach

public void setUp() throws Exception {

context.load().fileVaultXml("relative path to XML", "/content/dam/UticaQuoteProposal/samplexml");

}

 

Exception :

 

java.lang.IllegalStateException: Unable to enable secure processing.

 

Cause : 

org.xml.sax.SAXNotRecognizedException: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.

 

In the parent POM I am using dependency:

 

<dependency>

<groupId>io.wcm</groupId>

<artifactId>io.wcm.testing.aem-mock.junit5</artifactId>

<version>4.1.0</version>

<scope>test</scope>

</dependency>

 

In the core bundle pom added :

 

<dependency>

<groupId>xerces</groupId>

<artifactId>xercesImpl</artifactId>

<version>2.12.2</version>

<scope>test</scope>

</dependency>

 

Kindly, let me know what might be the root cause for this issue.

 

Thanks

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 Vijay_Katoch

Seems like the issue is with dependency version compatibility with the JDK version.

 

https://github.com/adobe/aem-project-archetype/issues/920

 

1 reply

Vijay_Katoch
Vijay_KatochAccepted solution
New Participant
April 12, 2023

Seems like the issue is with dependency version compatibility with the JDK version.

 

https://github.com/adobe/aem-project-archetype/issues/920