Home > Java > Grails Openid plugin and Xerces

Grails Openid plugin and Xerces

by paul on March 18, 2009

I just created a grails 1.1 application, and installed the openid plugin. When starting the application, I got the following exception:

2009-03-17 22:25:41,090 [main] ERROR context.ContextLoader – Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘consumerManager’: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.openid4java.consumer.ConsumerManager]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser
at java.security.AccessController.doPrivileged(Native Method)

Caused by: java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser
at org.openid4java.discovery.Discovery.(Discovery.java:47)
at org.openid4java.consumer.ConsumerManager.(ConsumerManager.java:51)
… 21 more

I worked around this by dropping xercesImpl-2.6.2.jar in the lib directory of my grails app. This seems to work – I’ve successfully logged in via my yahoo openid account.

I haven’t looked any further into this – time is short already, but I hope this helps you if you stumble across this problem.

{ 3 comments… read them below or add one }

Shane January 8, 2010 at 4:06 am

This helped me big time. Thanks!

Sastry January 12, 2010 at 4:14 am

helped, thanks.

Deepak Mittal March 30, 2010 at 8:15 pm

Thanks, it was helpful.

Leave a Comment

Previous post:

Next post: