Spring security implementation

53 views
Skip to first unread message

New to hippo

unread,
Dec 3, 2015, 4:05:39 AM12/3/15
to Hippo Community
Hello All,

I am implementing spring security for SAML. I am using hippo version 7 (2.22.10, build: 35864).
I did all the required changes as for Spring security while building application i am getting NoClassDefFoundError. can someone please suggest how to fix this.
below is the exception stack trace.

 ERROR [org.hippoecm.hst.site.container.HstSiteConfigServlet.initializeComponentManager():368] HstSiteConfigServlet: ComponentManager initialization failed.
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.onehippo.forge.security.support.springsecurity.container.SpringSecurityValve] for bean with name 'springSecurityValve' defined in file [/var/lib/tomcat7/webapps/ROOT/WEB-INF/classes/META-INF/hst-assembly/overrides/spring-security.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/hippoecm/hst/container/valves/AbstractOrderableValve
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1238)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1304)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:870)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
        at org.hippoecm.hst.site.container.SpringComponentManager.initialize(SpringComponentManager.java:91)
        at org.hippoecm.hst.site.container.HstSiteConfigServlet.initializeComponentManager(HstSiteConfigServlet.java:349)
        at org.hippoecm.hst.site.container.HstSiteConfigServlet.init(HstSiteConfigServlet.java:274)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1279)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1192)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/hippoecm/hst/container/valves/AbstractOrderableValve
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2944)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1208)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
        at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1256)
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1227)
        ... 25 more
Caused by: java.lang.ClassNotFoundException: org.hippoecm.hst.container.valves.AbstractOrderableValve
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
        ... 36 more
Dec 03, 2015 8:36:21 AM org.apache.catalina.startup.HostConfig deployWAR


Regards,
JB

Woonsan Ko

unread,
Dec 3, 2015, 9:21:14 AM12/3/15
to hippo-c...@googlegroups.com
Hi JB,

Are you using a proper version compatible with your hippo cms release version (the parent pom in your root pom)?
You may check the compatibility here:

Regards,

Woonsan


--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
w....@onehippo.com     www.onehippo.com
Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

Testing Software

unread,
Dec 4, 2015, 8:22:37 AM12/4/15
to hippo-c...@googlegroups.com
Hello Woonsan,

Thanks for providing compatibility link.

Can you please provide link that describes how to implement spring security for cms version 7.7
I am fallowing 

Even though fallowing comparability i am getting issue like
update spring-security.xsd to version 3.0, after updating i am getting
 Attribute 'pattern' is not allowed to appear in element 'security:http'

can you please suggest which version exactly i need to use.

Thanks 
JB



You received this message because you are subscribed to a topic in the Google Groups "Hippo Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hippo-community/9tEA-YrtU8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hippo-communi...@googlegroups.com.

Woonsan Ko

unread,
Dec 4, 2015, 5:50:45 PM12/4/15
to hippo-c...@googlegroups.com
I think you can use hst-springsec 0.02.05 for your 7.7 based hippo project.
The blog article seems to be based on 7.9, with which you should use 0.03.01.

Regards,

Woonsan

Junaidh Sheriff

unread,
Dec 7, 2015, 3:30:39 AM12/7/15
to hippo-c...@googlegroups.com
On Fri, Dec 4, 2015 at 2:22 PM, Testing Software <bjcode...@gmail.com> wrote:
Hello Woonsan,

Thanks for providing compatibility link.

Can you please provide link that describes how to implement spring security for cms version 7.7
Please note that Hippo 7.7.x will reach EOL by end of this month.

Brian Snijders

unread,
Dec 7, 2015, 3:48:25 AM12/7/15
to hippo-c...@googlegroups.com
Hi JB,

Keep in mind that boosting the XSD-versions normally also needs you to increment SpringSec versions. Finding a compatible {SpringCore, SpringSec, HSTSpringSec} can be quite time consuming. The best approach is to:
1) have your vanilla (non SpringSec) Hippo project
2) first plugin the HST SpringSec plugin, keeping the Spring Core version the same as Hippo is using and adding HST SpringSec compatible versions for Spring Security
3) test your setup, using SpringSec authentication against the Hippo Repository (as described in my lab and/or plugin documentation)

When (3) works, add a separate context for your SAML2-authentication, and:
4) Add SpringSec SAML dependency
5) Setup an initial SAML2-authentication context
6) Run a test build/startup, checking your logs for Spring wiring errors and/or CNF-exceptions

When (6) works, customize your SAML2-authentication context to link with your SAML2 SSO gateway. If it doesn't work, you probably need to increment your Spring Core or Spring Security versions.

Kind regards,
Brian
Met vriendelijke groet,

Brian Snijders

Software Engineer
http://about.me/briansnijders

Finalist -  open IT oplossingen

Rotterdam - Eindhoven - Maarssen
http://www.finalist.nl


Telefoon 088 217 08 43
Mobiel    06 455 40 083

Testing Software

unread,
Dec 8, 2015, 2:29:16 AM12/8/15
to hippo-c...@googlegroups.com
Hello Junaidh,

Is the hippo version 7.7.x is going to be EOL or community support for version 7.7.x is going to be EOL?

Regards,
JB
Message has been deleted

Junaidh Sheriff

unread,
Dec 8, 2015, 3:38:51 AM12/8/15
to hippo-c...@googlegroups.com
7.7 is EOL by end of December 2015.

Testing Software

unread,
Dec 8, 2015, 5:14:22 AM12/8/15
to hippo-c...@googlegroups.com, w....@onehippo.com
Hello Woonsan,

Thanks for the providing demo link.

I did configured same as provided in the demo link, Now I am not getting any exceptions but I am not able to login site. its coming(redirecting) back to login page after form submission. can you please suggest on how to overcome this.

Regards,
JB

New to hippo

unread,
Dec 9, 2015, 8:21:26 AM12/9/15
to Hippo Community, w....@onehippo.com
Hi Woonsan,

Can you please advise where I am failing.. I had integrated spring security but i am not able to login application. if credentials are wrong it shows message with wrong credentials but if the credentials are correct it shows again login screen. i dont see any exceptions in the log. Please suggest on this. 

Thanks and Regards,
JB
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.



--
w....@onehippo.com     www.onehippo.com
Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
You received this message because you are subscribed to a topic in the Google Groups "Hippo Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hippo-community/9tEA-YrtU8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hippo-community+unsubscribe@googlegroups.com.

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to a topic in the Google Groups "Hippo Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hippo-community/9tEA-YrtU8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hippo-community+unsubscribe@googlegroups.com.

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to a topic in the Google Groups "Hippo Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hippo-community/9tEA-YrtU8E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hippo-community+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages