[Shib-Users] Shib 2 failing to start when set for UK Federation

2 views
Skip to first unread message

john e. baker

unread,
Jun 14, 2010, 2:39:50 PM6/14/10
to shibbole...@internet2.edu

 

Hi Everyone

 

I am changing a Testshib working IDP to work with the UK Federation.  The IDP was working ok before starting the changeover and continues to work if I revert back to the Testshib  config files. 

 

Following the UK Federation guides I have changed the appropriate Shib config files.  Shib 2 refuses to start (error log below).

 

Can anyone point me in the right direction – the error log would indicate a problem with the relyingparty configuration – as far as I can see this is correct as per the UK Federation guides.

 

Thanks in advance

 

John Baker

 

14-Jun-2010 17:07:58 org.apache.catalina.core.ApplicationContext log

INFO: Initializing log4j from [classpath:log4j.properties]

14-Jun-2010 17:07:58 org.apache.catalina.core.ApplicationContext log

INFO: Initializing Spring root WebApplicationContext

14-Jun-2010 17:08:01 org.apache.catalina.core.ApplicationContext log

INFO: Initializing Spring FrameworkServlet 'cas'

14-Jun-2010 17:08:03 org.apache.catalina.core.ApplicationContext log

INFO: Initializing Spring root WebApplicationContext

14-Jun-2010 17:08:33 org.apache.catalina.core.StandardContext listenerStart

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shibboleth.RelyingPartyConfigurationManager': Invocation of init method failed; nested exception is java.lang.ClassCastException: java.lang.OutOfMemoryError cannot be cast to java.lang.Exception

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

                at java.security.AccessController.doPrivileged(Native Method)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

                at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)

                at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)

                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)

                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)

                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)

                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850)

                at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724)

                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)

                at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)

                at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)

                at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

                at org.apache.catalina.core.StandardService.start(StandardService.java:516)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:583)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Caused by: java.lang.ClassCastException: java.lang.OutOfMemoryError cannot be cast to java.lang.Exception

                at edu.internet2.middleware.shibboleth.common.config.BaseService.loadContext(BaseService.java:192)

                at edu.internet2.middleware.shibboleth.common.config.BaseReloadableService.initialize(BaseReloadableService.java:147)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)

                ... 39 more

14-Jun-2010 17:08:33 org.apache.catalina.core.ApplicationContext log

INFO: Closing Spring root WebApplicationContext

 

 

Nate Klingenstein

unread,
Jun 14, 2010, 2:48:34 PM6/14/10
to shibbole...@internet2.edu
John,

It looks like the IdP is running out of memory when you start it up. Do you think you could try setting JAVAOPTS as suggested in the container configuration documentation and giving it another try?

https://spaces.internet2.edu/display/SHIB2/IdPApacheTomcatPrepare

Take care,
Nate.

john e. baker

unread,
Jun 15, 2010, 8:54:17 AM6/15/10
to shibbole...@internet2.edu
Thanks for that Nate

Unfortunately this did not fix the problem. Is there any way of increasing the debugging and which items would I monitor so that I can drill down deeper into the problem.

Thanks



John Baker

Peter Schober

unread,
Jun 15, 2010, 9:00:32 AM6/15/10
to shibbole...@internet2.edu
* john e. baker <john.e...@franklin.ac.uk> [2010-06-15 14:56]:

> Unfortunately this did not fix the problem. Is there any way of
> increasing the debugging and which items would I monitor so that I
> can drill down deeper into the problem.

Try
http://wiki.apache.org/tomcat/OutOfMemory
http://wiki.apache.org/tomcat/FAQ/Memory
cheers,
-peter

Rod Widdowson

unread,
Jun 15, 2010, 9:04:28 AM6/15/10
to shibbole...@internet2.edu
John,

Are you running on Windows? Tomcat is configured indirectly on Windows and I have just noticed that that page doesn't mention it.

http://www.ukfederation.org.uk/content/Documents/IdPMemoryProblem

has details on how to make the change for windows. And I'll make a point of updating that page Nate referenced.

If you are not running windows and you are still getting the error then I'd hazard that your fix "hasn't taken" (for one of many reasons...)

There are hundreds of IdPs in the UK Fed, and although many of them have this problem during installation, todate they have all been fixed by doing what Nate recommended... Mind you there is always a first time and you could be the lucky one ....

Rod

Chad La Joie

unread,
Jun 15, 2010, 9:06:02 AM6/15/10
to shibbole...@internet2.edu
What Nate said is the cause of the problem. By default the JVM doesn't
allocate much memory and reading in the UK metadata takes a modest
amount (certainly more than what the JVM initially allocates). If the
JAVA_OPTS didn't work you'll need to refer to the Tomcat documentation
for how you set the properties mentioned in the Shib documentation. I
try to keep up to date with Tomcat but they change fairly significant
things in almost every point release so the docs may be out of date in
this area now.

--
Chad La Joie
http://itumi.biz
trusted identities, delivered

john e. baker

unread,
Jun 16, 2010, 6:02:08 AM6/16/10
to shibbole...@internet2.edu
Hi

Thanks for all the suggestions. Unfortunately none of them worked.

Does anyone have a working relying-party.xml file (sanitized of course) that I can compare with mine. As far as I can tell the problem is originating in this file when I enable the security trust engine as per the UK Federation instructions.

Thanks in advance



John Baker


Nick Howes

unread,
Jun 16, 2010, 11:54:38 AM6/16/10
to shibbole...@internet2.edu

We started having problems with memory while loading the UKF metadata until we added a MetadataFilter to filter it down to just service providers - as an IdP, you don't really need to store the details of other IdPs, and there are a lot of them in the UK fed so filtering them out saves a lot of memory. This might already be in your metadata but if not, it is a good thing to try.

https://spaces.internet2.edu/display/SHIB2/IdPMetadataProvider#IdPMetadataProvider-EntityRoleWhiteListFilter

Example of using a filter chain (doesn't use the above, but still a good example)
https://spaces.internet2.edu/display/SHIB2/IdPMetadataProviderExamples#IdPMetadataProviderExamples-LoadUKandSwissMetadata

I wonder if this filter should be in the example page above?

Rod Widdowson

unread,
Jun 17, 2010, 4:26:25 AM6/17/10
to shibbole...@internet2.edu
John,

- Well, we *know* that you are not giving your tomcat instance enough memory.
- We also know that the UK Fed metadata will fit into a Gig of memory with plenty of head room - I run a tomcat with two IdPs and two Discovery services (hence 4 copies of metadata) inside a gig and although it aint fast, it does work...
- We know that you have told Java to give tomcat that memory.

So we have to assume that either Tomcat is chewing more memory for other things or that the operating systems isn't giving java enough

1) Are you running any other applications inside Tomcat? If so, does suppressing them help?
2) Are there any OS derived limits at play here? What do the OS tools say about the tomcat process?

Rod

> -----Original Message-----
> From: john e. baker [mailto:john.e...@franklin.ac.uk]

> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
> ctory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
> >
> > at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
> ctory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
> >
> > at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa

> ctory$1.run(AbstractAutowireCapableBeanFactory.java:409)
> >
> > at java.security.AccessController.doPrivileged(Native Method)
> >
> > at

> ava:791)
> >
> > at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
> >
> > at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
> >
> > at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850)
> >
> > at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724)
> >
> > at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493)
> >
> > at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
> >
> > at

> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:3
> 14)
> >
> > at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS

> upport.java:119)
> >
> > at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
> >
> > at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
> >
> > at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> >
> > at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> >
> > at
> org.apache.catalina.core.StandardService.start(StandardService.java:516
> )
> >
> > at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> >
> > at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
> >
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >
> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >
> > at java.lang.reflect.Method.invoke(Unknown Source)
> >
> > at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> >
> > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> >
> > Caused by: java.lang.ClassCastException: java.lang.OutOfMemoryError
> cannot be cast to java.lang.Exception
> >
> > at

> edu.internet2.middleware.shibboleth.common.config.BaseService.loadConte
> xt(BaseService.java:192)
> >
> > at
> edu.internet2.middleware.shibboleth.common.config.BaseReloadableService

> .initialize(BaseReloadableService.java:147)
> >
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >
> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> >
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >
> > at java.lang.reflect.Method.invoke(Unknown Source)
> >
> > at

> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
> ctory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:14
> 14)
> >
> > at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa
> ctory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
> >
> > at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa

Reply all
Reply to author
Forward
0 new messages