Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Deploy WAR to VTS(Having trouble deploying a standard WAR on Virgo Tomcat Server)
Deploy WAR to VTS [message #892707] Fri, 29 June 2012 09:42 Go to next message
m t is currently offline m tFriend
Messages: 1
Registered: June 2012
Junior Member
Hi,

for the past couple of days I have been running into issues deploying a standard WAR onto VTS. At the moment the WAR is fully functional on Apache Tomcat.

I am using Virgo 3.0.3.

The following is the error message found in the logs.

[2012-06-29 10:34:28.328] ERROR start-signalling-1           o.a.catalina.core.ContainerBase.[Catalina].[localhost].[/virgo]   Exception starting filter securityFilter org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1079)
	at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:217)
	at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:145)
	at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:179)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:122)
	at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
	at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:247)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:294)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:291)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:229)
	at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:143)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)



The following is the content of my web.xml file located within the WEB-INF directory of my WAR.

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="://java.sun.com/xml/ns/javaee"
	xmlns:xsi="://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="://java.sun.com/xml/ns/javaee ://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

	<!-- Java-based Spring container definition -->

	<context-param>
		<param-name>contextClass</param-name>
		<param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
	</context-param>

	<!-- Location of Java @Configuration classes that configure the components 
		that makeup this application -->

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
					org.TSSG.social.statusnet.config
					/WEB-INF/security.xml
		</param-value>
	</context-param>

	<!-- Creates the Spring Container shared by all Servlets and Filters -->

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<!-- Processes application requests -->
	<servlet>
		<servlet-name>appServlet</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value></param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>appServlet</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>

	<!-- Secures the application -->

	<filter>
		<filter-name>securityFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

		<init-param>
			<param-name>targetBeanName</param-name>
			<param-value>springSecurityFilterChain</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>securityFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>


	<!-- Enables support for DELETE and PUT request methods with web browser 
		clients -->

	<filter>
		<filter-name>hiddenHttpMethodFilter</filter-name>
		<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>hiddenHttpMethodFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
</web-app>


The following is the contents of the security.xml file

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="://www.springframework.org/schema/security"
	xmlns:xsi="://www.w3.org/2001/XMLSchema-instance"
	xmlns:beans="://www.springframework.org/schema/beans"
	xsi:schemaLocation="://www.springframework.org/schema/security ://www.springframework.org/schema/security/spring-security-3.1.xsd
		://www.springframework.org/schema/beans ://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

	<http use-expressions="true">
		<!-- Authentication policy -->
		<form-login login-page="/signin" login-processing-url="/signin/authenticate" />
		<logout logout-url="/signout" delete-cookies="JSESSIONID" />
		<intercept-url pattern="/favicon.ico" access="permitAll" />
		<intercept-url pattern="/resources/**" access="permitAll" />
		<intercept-url pattern="/signin/**" access="permitAll" />
		<intercept-url pattern="/signup/**" access="permitAll" />
		<intercept-url pattern="/**" access="isAuthenticated()"  />
	</http>

	<authentication-manager alias="authenticationManager">
		<authentication-provider>
			<password-encoder ref="passwordEncoder" />
			<jdbc-user-service data-source-ref="dataSource" 
							   users-by-username-query="select username, password, true from Account where username = ?"
							   authorities-by-username-query="select username, 'ROLE_USER' from Account where username = ?"/>
        </authentication-provider>
	</authentication-manager>

</beans:beans>



Finally, the Manifest contents are listed below.

Manifest-Version: 1.0
Class-Path: 
Import-package: org.springframework.web.context, org.springframework.web.context.support, org.springframework.web.filter, org.springframework.web.servlet, javax.servlet.http, javax.servlet, org.eclipse.virgo.web.dm, org.apache.tomcat


Any help would be greatly appreciated!
Thank you.

*Edited - removed http from links as unable to post topic.

[Updated on: Fri, 29 June 2012 09:43]

Report message to a moderator

Re: Deploy WAR to VTS [message #892719 is a reply to message #892707] Fri, 29 June 2012 10:45 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
WAR files with certain OSGi manifest headers, including Import-Package, are deemed by the OSGi Web Applications specification to be Web Application Bundles, so this FAQ may help you.
Re: Deploy WAR to VTS [message #975080 is a reply to message #892707] Wed, 07 November 2012 15:29 Go to previous message
Diego Marafetti is currently offline Diego MarafettiFriend
Messages: 1
Registered: November 2012
Junior Member
Hi, try using @importResource instead. I couldn't find another way to load both via annotations and xml. So, if you have your spring security context configuration in application-context.xml for example try this code.


@Configuration
@ImportResource(value={"classpath:/com/yourpackage/spring/application-context.xml"})
public class WebConfiguration {


Hope that help!
Previous Topic:how to prevent double loading of blueprint extender (one loaded in kernel and one in user)
Next Topic:Books you should read about OSGi
Goto Forum:
  


Current Time: Thu Apr 25 13:21:22 GMT 2024

Powered by FUDForum. Page generated in 0.02816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top