When i do this helpx adobe example i can see that in the pom.xml file if i keep <version>2.12.0</version> It throws the below INFO error for the JCR and the expected result is not there (i.e. adobe/cq node is not created). But when i change the code little by adding WORKSPACE and passing it to the SimpleCredentials (as shown below) it works. My doubt is how do the lower version is able to recognize the crx.default workspace with out passing it in code.?
Code for <version>2.12.0</version>:
String WORKSPACE = "crx.default"; javax.jcr.Session session = repository.login( new SimpleCredentials("admin", "admin".toCharArray()),WORKSPACE);
Code for <version>2.4.0</version>:
javax.jcr.Session session = repository.login( new SimpleCredentials("admin", "admin".toCharArray()));POM dependency tag:
<dependency> <groupId>org.apache.jackrabbit</groupId> <artifactId>jackrabbit-jcr2dav</artifactId> <version>2.12.0</version> </dependency>
Console output with 2.12.0 with out any code change which doesn't workout the helpx example
F:\mvnjavaexample>mvn exec:java -Dexec.mainClass="com.vardhan.mavenexp.GetRepository" [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building mvnjavaexample 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ mvnjavaexample --- javax.jcr.lock.LockException: Precondition Failed at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:109) at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51) at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:45) at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:809) at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:753) at org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:307) at org.apache.jackrabbit.jcr2spi.RepositoryImpl.login(RepositoryImpl.java:151) at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:144) at com.vardhan.mavenexp.GetRepository.main(GetRepository.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:294) at java.lang.Thread.run(Thread.java:744) Caused by: org.apache.jackrabbit.webdav.DavException: Precondition Failed at org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseException(DavMethodBase.java:162) at org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseBodyAsMultiStatus(DavMethodBase.java:91) at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.obtain(RepositoryServiceImpl.java:781) ... 11 more [WARNING] thread Thread[MultiThreadedHttpConnectionManager cleanup,5,com.vardhan.mavenexp.GetRepository] was interrupted but is still alive after waiting at least 15000msecs [WARNING] thread Thread[MultiThreadedHttpConnectionManager cleanup,5,com.vardhan.mavenexp.GetRepository] will linger despite being asked to die via interruption [WARNING] NOTE: 1 thread(s) did not finish despite being asked to via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied. [WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=com.vardhan.mavenexp.GetRepository,maxpri=10] java.lang.IllegalThreadStateException at java.lang.ThreadGroup.destroy(ThreadGroup.java:775) at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:328) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17.791s [INFO] Finished at: Tue Jan 17 23:14:40 CST 2017 [INFO] Final Memory: 13M/168M [INFO] ------------------------------------------------------------------------
~VAr
Views
Replies
Total Likes
What version of AEM are you using? Each version of AEM has a compatible JCR JAR file.
Views
Replies
Total Likes
smacdonald2008 wrote...
What version of AEM are you using? Each version of AEM has a compatible JCR JAR file.
Scott its AEM 6.1
Views
Replies
Total Likes
Views
Likes
Replies