We created project using latest archetype (cloud runtime).
Junit test fails in the part when json is loading,
ctx.load().json("/com/myproject/core/models/impl/MycmpntImplTest.json", "/content");
Same test works when I move it and run from inside weekend project or when I use weekend test libs (pom defintions) in our project.
Exception follows :
java.lang.IllegalStateException: Unable to enable secure processing.
at org.apache.sling.contentparser.xml.jcr.internal.JCRXMLContentParser.<init>(JCRXMLContentParser.java:61)
at org.apache.sling.testing.mock.sling.loader.ContentLoader.<init>(ContentLoader.java:149)
at org.apache.sling.testing.mock.sling.context.SlingContextImpl.load(SlingContextImpl.java:376)
at org.apache.sling.testing.mock.sling.context.SlingContextImpl.load(SlingContextImpl.java:366)
at com.myproject.core.models.impl.MycmpntImplTest.setUp(MycmpntImplTest.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
.
.
.at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: org.xml.sax.SAXNotRecognizedException: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source)
at org.apache.sling.contentparser.xml.jcr.internal.JCRXMLContentParser.<init>(JCRXMLContentParser.java:57)
Solved! Go to Solution.
Adding following to Core resolved it (thanks to Adobe support)
<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.12.2</version> <scope>test</scope> </dependency>
What Java version are you using? mvn -version should display it.
hi Jorg,
I'm running it from eclipse, 1.8 Java version
Adding following to Core resolved it (thanks to Adobe support)
<dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.12.2</version> <scope>test</scope> </dependency>
It required a restart of IDE.
Thanks, it worked.
@nbg62 Do we have to add this dependency in the core pom.xml file or in the root pom.xml file? please help as i am getting this same issue
Views
Replies
Total Likes
In the core pom.xml
Views
Replies
Total Likes
In cloud instance, adding <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.12.2</version> <scope>test</scope> </dependency> does not work for me.
Changing version from 4.1.8 to 4.1.0 in root pom makes it work for me.
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.testing.aem-mock.junit5</artifactId>
<!-- <version>4.1.8</version>-->
<version>4.1.0</version>
<scope>test</scope>
</dependency>
Views
Replies
Total Likes