Closed venkiiitk closed 6 years ago
Hi i resolved above issue by publishing local version now i am getting below error when try to execute the test case : java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository
at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:69)
at org.apache.sling.testing.mock.sling.context.SlingContextImpl.newResourceResolverFactory(SlingContextImpl.java:107)
at org.apache.sling.testing.mock.sling.context.SlingContextImpl.setUp(SlingContextImpl.java:98)
at com.citytechinc.aem.prosper.context.ProsperSlingContext.setup(ProsperSlingContext.groovy:35)
at com.citytechinc.aem.prosper.specs.ProsperSpec.setupSpec(ProsperSpec.groovy:54)
Caused by: java.lang.RuntimeException: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository
at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.invokeMethod(OsgiServiceUtil.java:262)
at org.apache.sling.testing.mock.osgi.OsgiServiceUtil.activateDeactivate(OsgiServiceUtil.java:86)
at org.apache.sling.testing.mock.osgi.MockOsgi.activate(MockOsgi.java:190)
at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:165)
at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.registerServiceIfNotPresent(ResourceResolverFactoryInitializer.java:151)
at org.apache.sling.testing.mock.sling.ResourceResolverFactoryInitializer.setUp(ResourceResolverFactoryInitializer.java:64)
at org.apache.sling.testing.mock.sling.MockSling.newResourceResolverFactory(MockSling.java:88)
at org.apache.sling.testing.mock.sling.context.ContextResourceResolverFactory.get(ContextResourceResolverFactory.java:45)
... 4 more
Caused by: java.lang.NoSuchMethodError: org.apache.jackrabbit.oak.plugins.commit.JcrConflictHandler.createJcrConflictHandler()Lorg/apache/jackrabbit/oak/spi/commit/CompositeConflictHandler;
at org.apache.jackrabbit.oak.jcr.Jcr.
Test ignored. java.lang.NullPointerException at org.apache.sling.testing.mock.sling.context.SlingContextImpl.resourceResolver(SlingContextImpl.java:189) at com.citytechinc.aem.prosper.context.ProsperSlingContext.getResourceResolver(ProsperSlingContext.groovy:55) at com.citytechinc.aem.prosper.specs.ProsperSpec.getResourceResolver(ProsperSpec.groovy:119) at com.citytechinc.aem.prosper.specs.ProsperSpec.getSession(ProsperSpec.groovy:98) at com.citytechinc.aem.prosper.specs.ProsperSpec.removeAllNodes(ProsperSpec.groovy:84) at com.citytechinc.aem.prosper.specs.ProsperSpec.cleanupSpec(ProsperSpec.groovy:67)
Could you please help me what is going wrong with this.
This is caused by a mismatch in the Jackrabbit dependency versions in your classpath. Prosper 7.0.0 uses the Jackrabbit version provided by the org.apache.sling:org.apache.sling.testing.sling-mock-oak:1.0.0
dependency; your project is probably using a different version than this dependency. If you run mvn:dependency:tree
or view the dependency tree in your IDE, you should be able to see which versions are being applied and which are being overridden. You can also try adding an exclusion to the sling-mock-oak
dependency to force it to use a Jackrabbit version from your project. There are a few different ways to resolve this but it's entirely dependent on the specifics of your build.
[ERROR] Failed to execute goal on project prosper: Could not resolve dependencies for project com.citytechinc.aem.prosper:prosper:jar:6.1.0: Failed to collect dependencies at com.day.cq:cq-commons:jar:5.8.32: Failed to read artifact descriptor for com.day.cq:cq-commons:jar:5.8.32: Could not transfer artifact com.day.cq:parent:pom:42 from/to adobe (http://repo.adobe.com/nexus/content/groups/public/): hostname in certificate didn't match: != OR -> [Help 1]
[ERROR]
tried to find parent 42 but not fine in any repo. any help pleae