[OpenSAML] Error bootstrapping 2.0.0

344 views
Skip to first unread message

Bob Jacoby

unread,
Aug 11, 2008, 9:20:15 AM8/11/08
to mace-open...@internet2.edu
I'm using opensaml 2.0.0 (as the readme in the 2.1 line specifically
stated not to use it in production). When I configure the library using
the bootstrap class as shown in
https://spaces.internet2.edu/display/OpenSAML/OSTwoUsrManJavaLibIntro I
get an error (a snippet below, full at end of email):

ERROR XMLConfigurator - Can not create instance of
org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller

...

Caused by: java.lang.NoSuchMethodError:
org.opensaml.xml.encryption.impl.EncryptionMethodMarshaller: method
<init>(Ljava/lang/String;Ljava/lang/String;)V not found
at
org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller.<init>(Encry
ptionMethodMarshaller.java:28)

I'm not doing anything special; the extent of my entire test case to
reproduce this contains the following:

try {
org.opensaml.DefaultBootstrap.bootstrap();
}
catch (ConfigurationException ex) {
throw new RuntimeException(ex);
}

I've read and reread the documentation to see if I'm missing a
configuration, but as far as I can tell I've put the necessary libraries
in the classpath, endorsed the xerces/xalan jars, etc (against the sun
jre).

Any help would be appreciated.

Thanks,
Bob

Full error stack:

ERROR XMLConfigurator - Can not create instance of
org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.opensaml.xml.XMLConfigurator.createClassInstance(XMLConfigurator.jav
a:331)
at
org.opensaml.xml.XMLConfigurator.initializeObjectProviders(XMLConfigurat
or.java:222)
at
org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:164)
at
org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:148)
at
org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:125)
at
org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java
:135)
at
org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:75)
at testSaml.testCase(testSaml.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:
98)
at
org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(Met
hodRoadie.java:87)
at
org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at
org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4Clas
sRunner.java:88)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunne
r.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.jav
a:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:2
7)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:
42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes
tReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
va:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)
Caused by: java.lang.NoSuchMethodError:
org.opensaml.xml.encryption.impl.EncryptionMethodMarshaller: method
<init>(Ljava/lang/String;Ljava/lang/String;)V not found
at
org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller.<init>(Encry
ptionMethodMarshaller.java:28)
... 34 more
ERROR XMLConfigurator - Error initializing object provier
[ObjectProvider: null]
org.opensaml.xml.ConfigurationException: Can not create instance of
org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller
at
org.opensaml.xml.XMLConfigurator.createClassInstance(XMLConfigurator.jav
a:334)
at
org.opensaml.xml.XMLConfigurator.initializeObjectProviders(XMLConfigurat
or.java:222)
at
org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:164)
at
org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:148)
at
org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:125)
at
org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java
:135)
at
org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:75)
at testSaml.testCase(testSaml.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:
98)
at
org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(Met
hodRoadie.java:87)
at
org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at
org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4Clas
sRunner.java:88)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunne
r.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.jav
a:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:2
7)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:
42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes
tReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
va:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.opensaml.xml.XMLConfigurator.createClassInstance(XMLConfigurator.jav
a:331)
... 29 more
Caused by: java.lang.NoSuchMethodError:
org.opensaml.xml.encryption.impl.EncryptionMethodMarshaller: method
<init>(Ljava/lang/String;Ljava/lang/String;)V not found
at
org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller.<init>(Encry
ptionMethodMarshaller.java:28)
... 34 more

Brent Putman

unread,
Aug 12, 2008, 5:41:59 PM8/12/08
to mace-open...@internet2.edu

Bob Jacoby wrote:
> I'm using opensaml 2.0.0 (as the readme in the 2.1 line specifically
> stated not to use it in production).

I think this was brought up on the list before, but that was just a
mistake in the README.txt that made it's way into the release
distribution (wasn't updated from the alpha/beta/RC phases). OpenSAML
2.1.0 is a fully supported released version of the software.

> When I configure the library using
> the bootstrap class as shown in
> https://spaces.internet2.edu/display/OpenSAML/OSTwoUsrManJavaLibIntro I
> get an error (a snippet below, full at end of email):
>
> ERROR XMLConfigurator - Can not create instance of
> org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller
>
> ...
>
> Caused by: java.lang.NoSuchMethodError:
> org.opensaml.xml.encryption.impl.EncryptionMethodMarshaller: method
> <init>(Ljava/lang/String;Ljava/lang/String;)V not found
> at
> org.opensaml.saml2.metadata.impl.EncryptionMethodMarshaller.<init>(Encry
> ptionMethodMarshaller.java:28)
>
> I'm not doing anything special; the extent of my entire test case to
> reproduce this contains the following:
>
> try {
> org.opensaml.DefaultBootstrap.bootstrap();
> }
> catch (ConfigurationException ex) {
> throw new RuntimeException(ex);
> }
>
>


That's very strange. This might be caused if you are trying to used the
opensaml-2.0.0.jar with the newer versions of openws and xmltooling from
OpenSAML 2.1.0. I would suggest re-downloading the latest tarball or
zip and making sure you have a consistent set of all 3 libraries in the
OpenSAML stack. That would be:

opensaml-2.1.0.jar
openws-1.1.0.jar
xmltooling-1.0.1.jar

And make sure to remove any other versions of those 3 jars from your
classpath.

--Brent

Bob Jacoby

unread,
Aug 18, 2008, 5:31:54 PM8/18/08
to mace-open...@internet2.edu
Thanks, Brent. I switched to using 2.1 without any bootstrapping
problems. I think you were right regarding mismatched xml-tooling in the
2.0. I errantly had another version on the path. I didn't test that this
was the problem since I just upgraded to 2.1.

*sigh*

Bob

Reply all
Reply to author
Forward
0 new messages