Expand my Community achievements bar.

SOLVED

JcrUtils.getRepository throws ExceptionInIntializerError

Avatar

Level 2

When I attempt to execute the code snippet in the "How to programmatically access the AEM JCR" article, I get the following exception:

Exception in thread "main" java.lang.ExceptionInInitializerError

  at GetRepository.main(GetRepository.java:15)

Caused by: java.lang.IllegalArgumentException: unknown type: 10

  at javax.jcr.PropertyType.nameFromValue(PropertyType.java:92)

  at org.apache.jackrabbit.commons.JcrUtils.<clinit>(JcrUtils.java:1277)

Any ideas on how to fix this?

1 Accepted Solution

Avatar

Correct answer by
Level 10

See this video I just created:

View solution in original post

7 Replies

Avatar

Level 10

How are you accessing it - from a Java APP - did you include the correct Jackrabbit JAR into your applications' classpath?

Avatar

Level 2

Yes, from a Java App and I do compile using "jackrabbit-jcr-commons-2.19.1.jar" in my classpath. The app compiles fine, it just gives this exception at runtime.

Avatar

Level 10

What AEM version are you using?

Looks like you are using wrong JAR for your AEM version. You can obtain the jackrabbit-standalone JAR file from http://jackrabbit.apache.org/jcr/jcr-api.html.

Avatar

Level 10

I am testing which JAR against AEM 6.4 - i will post back.

Avatar

Level 2

Now using "jackrabbit-standalone-2.12.10.jar" but still same error.

Avatar

Correct answer by
Level 10

See this video I just created: