JcrUtils.getRepository throws ExceptionInIntializerError | Community
Skip to main content
margaretywong5
Level 2
February 22, 2019
Solved

JcrUtils.getRepository throws ExceptionInIntializerError

  • February 22, 2019
  • 7 replies
  • 2142 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

See this video I just created:

7 replies

smacdonald2008
Level 10
February 22, 2019

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

margaretywong5
Level 2
February 22, 2019

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.

smacdonald2008
Level 10
February 22, 2019

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.

smacdonald2008
Level 10
February 22, 2019

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

margaretywong5
Level 2
February 22, 2019

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

smacdonald2008
smacdonald2008Accepted solution
Level 10
February 22, 2019

See this video I just created:

margaretywong5
Level 2
February 22, 2019

Thank you, this worked for me.