Presumably you have checked
"whether you have multiple ContextLoader* definitions in your web.xml!"
??
Presumably you have checked
"whether you have multiple ContextLoader* definitions in your web.xml!"
??
Hi Luke,
In liferay-portal-4.2.1.ear, there are four war files. One of the war files tunnel-web.war containts SpringServletContextListener (which is instantiating org.springframework.web.context.ContextLoaderListe ner)
I added ContextLoaderListener Listener (org.springframework.web.context.ContextLoaderList ener) required for Acegi into web.xml of portal-web.war. No other ContextLoader is present inside web.xml of portal-web.war. But when I am trying to deploy the liferay-portal-4.2.1.ear I am getting the following error.
<Oct 31, 2007 4:48:36 PM IST> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListe ner failed: java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml!.
java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml!
at org.springframework.web.context.ContextLoader.init WebApplicationConte
xt(ContextLoader.java:167)
at org.springframework.web.context.ContextLoaderListe ner.contextInitiali
zed(ContextLoaderListener.java:49)
at weblogic.servlet.internal.EventsManager$FireContex tListenerAction.run
(EventsManager.java:376)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:
121)
Truncated. see log file for complete stacktrace
>
<Oct 31, 2007 4:48:36 PM IST> <Error> <HTTP> <BEA-101165> <Could not load user d
efined filter in web.xml: org.acegisecurity.util.FilterToBeanProxy.
java.lang.IllegalStateException: BeanFactory not initialized or already closed -
call 'refresh' before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefres hableApplicationCon
text.getBeanFactory(AbstractRefreshableApplication Context.java:118)
at org.springframework.context.support.AbstractApplic ationContext.contai
nsBean(AbstractApplicationContext.java:648)
at org.acegisecurity.util.FilterToBeanProxy.doInit(Fi lterToBeanProxy.jav
a:123) ......
Now in which web.xml file should I do the modification as per the document (AcegiSecurityPortletIntegration-0.1), So that I can solve the above error?
Hi Kenan,
Thanks a lot for the document (AcegiSecurityPortletIntegration-0.1) given by you.
I tried to integrate Acegi into Liferay Portlet by following the document (AcegiSecurityPortletIntegration-0.1). When I am deploying the ear file the following error is displaying. Please give me solution for this.
User defined listener org.springframework.web.context.ContextLoaderListe ner failed: org.springframework.beans.factory.CannotLoadBeanCl assException: Error loading class [org.acegisecurity.portlet.liferay.auth.LiferayUser PopulatingAuthenticationProcessingFilter] for bean with name 'authenticationProcessingFilter' defined in ServletContext resource [/WEB-INF/applicationContext-acegi-security.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/acegisecurity/ui/webapp/AuthenticationProcessingFilter.
org.springframework.beans.factory.CannotLoadBeanCl assException: Error loading class [org.acegisecurity.portlet.liferay.auth.LiferayUser PopulatingAuthenticationProcessingFilter] for bean with name 'authenticationProcessingFilter' defined in
ServletContext resource [/WEB-INF/applicationContext-acegi-security.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/acegisecurity/ui/webapp/AuthenticationProcessingFilter
at org.springframework.beans.factory.support.Abstract BeanFactory.resolve
BeanClass(AbstractBeanFactory.java:1014)
at org.springframework.beans.factory.support.Abstract BeanFactory.isBeanC
lassMatch(AbstractBeanFactory.java:1036)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.
getBeanNamesForType(DefaultListableBeanFactory.jav a:165)
at org.springframework.context.support.AbstractApplic ationContext.getBea
nNamesForType(AbstractApplicationContext.java:689)
at org.springframework.context.support.AbstractApplic ationContext.invoke
BeanFactoryPostProcessors(AbstractApplicationConte xt.java:395)
Truncated. see log file for complete stacktrace
java.lang.NoClassDefFoundError: org/acegisecurity/ui/webapp/AuthenticationProces
singFilter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
Truncated. see log file for complete stacktrace
Thanks in Advance.
Manohar.
Hi All,
Can any body please help me how to authorize the Portlets with in Liferay portal for an individual users? I want to restrict a user from few portlets based on his authorized role. How can I achieve this.
Thanks,
Manohar.
Hi All,
I am trying to deploy acegi-portlet-samples-liferay. For that i I am not able to find the following configuration files in the application.
classpath:/context/spring-beans.base.core.xml
classpath:/context/spring-beans.base.db.xml
classpath:/context/spring-beans.base.aop.xml
can any body help me, where can i get these files?
Thanks,
Manohar.
Unfortunately, i have stopped working on this topic, and the only portals I made acegi work are liferay and jboss. However, the basic idea should apply to other portals. You need to have a customization on how your portal invokes portlets. You just need to put current Authentication object into request and extract it on the portlet side and put again into SecurityContextHolder.
Created an issue on gridsphere's jira for it: http://bugs.gridsphere.org/browse/GPF-518