adobe / adobe/aem-project-archetype
xerces dependency seems to be old and causes errors
- Dominant language
- JavaScript
- Stars
- 596
- Forks
- 431
- Avg merge
- 10d 6h
- Merged PRs (30d)
- 1
Description
### Expected Behaviour
When using AEM mocks, I should be able to load json into the AemContext without error.
### Actual Behaviour
When using AEM mocks, loading json files for testing content is failing with the error:
```
[INFO] Running com.adobe.training.core.models.StockplexSlingMockTest
[ERROR] Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.119 s <<< FAILURE! - in com.adobe.training.core.models.StockplexSlingMockTest
[ERROR] testLoadedContent Time elapsed: 0.013 s <<< ERROR!
java.lang.IllegalStateException: Unable to enable secure processing.
at com.adobe.training.core.models.StockplexSlingMockTest.setup(StockplexSlingMockTest.java:56)
Caused by: org.xml.sax.SAXNotRecognizedException: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
at com.adobe.training.core.models.StockplexSlingMockTest.setup(StockplexSlingMockTest.java:56)
...
[ERROR] Errors:
[ERROR] StockplexSlingMockTest.setup:56 » IllegalState Unable to enable secure process...
```
The line the error refers to is:
``` java
context.load().json("/imported-stock-data.json","/my/folder");
```
### Reproduce Scenario (including but not limited to)
1. Create a project using the latest (36) archetype (AEM 6.5 or AEM SDK)
2. Create a json file at src/test/resources/my-test.json:
``` json
{ "myKey": "myVal" }
```
3. Update the HelloWorldModeTest.java setup() method at the bottom:
``` java
context.load().json("/my-test.json","/my/folder");
```
4. Run:
``` bash
cd core
mvn clean test
```
### Dependency that causes this
From what I can tell, there is a dependency that is adding this dependency to my project:
``` bash
xerces
xercesImpl
2.6.2
test
```
If you manually add this dependency to your core/pom.xml and update it to the latest version, it successfully loads json content for my tests:
``` bash
xerces
xercesImpl
2.12.2
test
```
I honestly have no idea if this is apart of the AEM archetype or an associated project, but this is an error when attempting to use AEM mocks from a project generated from Archetype 36.
Contributor guide
Research direction
Start by running `cd core && mvn clean test` with the JSON fixture and inspect the dependency source for `xercesImpl` 2.6.2 in `core/pom.xml`. Review `HelloWorldModeTest.java` or the reported `StockplexSlingMockTest.setup` failure, then verify that `context.load().json` succeeds without the secure-processing error and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100