Using Virgo Snaps and Spring Interceptors [message #774809] |
Wed, 04 January 2012 16:59 |
Gabriel Afonso Messages: 23 Registered: December 2011 |
Junior Member |
|
|
Hi,
I have two Web Bundles, the first is the Host and the other is a snap. In the Host I have a login page and a home page (it shows when I enter mi username and password). My problem is, I need to validate the user is authenticated to access to the other pages of the snap (second web bundle).
I have a Interceptor in the Host and works fine (localhost:8080/host/home) it validates the user is authenticated to show the home page, but when I go to the snap (localhost:8080/host/snap) the Interceptor doesn't work (it doesn't validate anything and show the snap page).
How can I validate the other snaps bundles with a Interceptor in the Host bundle? Is it possible?
this is the code of the interceptor in Host bundle
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<bean class="LoginValidatorInterceptor">
</bean>
</mvc:interceptor>
</mvc:interceptors>
class
public class LoginValidatorInterceptor extends HandlerInterceptorAdapter {
if (request.getSession().getAttribute("user") != null) {
return true;
}
response.sendRedirect("/host/");
return false;
}
}
[Updated on: Wed, 04 January 2012 17:04] Report message to a moderator
|
|
|
|
Re: Using Virgo Snaps and Spring Interceptors [message #774908 is a reply to message #774846] |
Wed, 04 January 2012 22:25 |
Gabriel Afonso Messages: 23 Registered: December 2011 |
Junior Member |
|
|
Thanks for your answer Dmitry.
In this moment I'm working with SpringSecurity, but I have a problem, I can't deploy the bundles of SpringSecurity in Virgo. I downloaded the Spring Security library and I put the bundles in /Virgo-folder/repository/usr/ folder, then I create a plan file for this bundles and finnally I add a line in the org.eclipse.virgo.kernel.userregion.properties file, but when I start Virgo, it throws this errors:
Unable to install application from URI 'file:/home/gabrielafonso/Virgo/virgo-tomcat-server-3.0.2.RELEASE/./repository/usr/org.springframework.security.plan'. Cannot satisfy constraints for bundle 'org.springframework.security.config' version '3.1.0.RELEASE'. Cannot resolve: org.springframework.security.config
Resolver report:
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.config_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.core; version="[3.0.6.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.acls_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.core.context; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.aspects_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.access.intercept.aspectj; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.cas_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.core.authority; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.core_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.context.support; version="[3.0.6.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.web_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.context.support; version="[3.0.6.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.taglibs_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.core.authority; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.openid_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.web.authentication.rememberme; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.ldap_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.ldap; version="[1.3.0,1.4.0)">
. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'org.springframework.security.config' at version '3.1.0.RELEASE': Cannot resolve: org.springframework.security.config
Resolver report:
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.config_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.core; version="[3.0.6.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.acls_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.core.context; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.aspects_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.access.intercept.aspectj; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.cas_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.core.authority; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.core_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.context.support; version="[3.0.6.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.web_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.context.support; version="[3.0.6.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.taglibs_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.core.authority; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.openid_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.security.web.authentication.rememberme; version="[3.1.0.RELEASE,3.2.0)">
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.security.ldap_3.1.0.RELEASE>
constraint: <Import-Package: org.springframework.ldap; version="[1.3.0,1.4.0)">
at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.QuasiResolveStage.process(QuasiResolveStage.java:45)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.internal.CompensatingPipeline.doProcessTree(CompensatingPipeline.java:72)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessTree(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(PipelinedApplicationDeployer.java:285)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:164)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.install(PipelinedApplicationDeployer.java:136)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:203)
at org.eclipse.virgo.kernel.userregion.internal.InitialArtifactDeployer$ArtifactDeployingRunnable.deployArtifacts(InitialArtifactDeployer.java:156)
at org.eclipse.virgo.kernel.userregion.internal.InitialArtifactDeployer$ArtifactDeployingRunnable.run(InitialArtifactDeployer.java:146)
at java.lang.Thread.run(Thread.java:662)
[2012-01-04 17:16:34.583] system-artifacts <UR0002E> User region failed while deploying initial artifacts. Shutting down.
[2012-01-04 17:16:34.585] System Bundle Shutdown <KE0010I> Shutdown initiated.
[2012-01-04 17:16:34.677] System Bundle Shutdown <TC0002I> Stopping Tomcat.
[2012-01-04 17:16:37.788] System Bundle Shutdown <TC0003I> Stopped Tomcat.
What am I doing wrong?
How can I load the Spring Security Library in Virgo?
|
|
|
Re: Using Virgo Snaps and Spring Interceptors [message #775110 is a reply to message #774908] |
Thu, 05 January 2012 10:43 |
|
Hi,
You are using Spring Security 3.1.0, this requires Spring framework 3.1.0. Virgo currently ships with an older version of the Spring framework as 3.1.0 has only recently released. You would have to upgrade Virgo to the newer version of the Spring framework, use an older version of Spring security or wait for the next release of Virgo which will have moved up to the new version of the Spring framework.
Chris.
------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02796 seconds