Results 1 to 5 of 5

Thread: DeploymentException - can't figure out why

  1. #1
    Join Date
    May 2009
    Posts
    15

    Default DeploymentException - can't figure out why

    Hi guys,

    I'm running DM Server 1.0.2. Developed some Bundles and deployed them just fine. When I'm trying to deploy the Web Bundle (including BlazeDS) I always get a deploymentException if I include either of the following:
    Code:
    <listener>
    	<listener-class>org.springframework.web.context.ContextLoaderListener
    	</listener-class>
    </listener>
    or any kind of <filter> tag.

    I looked at so many different web.xml's I just can't seem to figure out what the problem is... Any help would be really appreciated. Thanks!

    My web.xml:

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
    	version="2.5">
    
    	<!-- Name of the application -->
    	<display-name>some app</display-name>
    
    
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/spring/*-context*.xml
        </param-value>
    	</context-param>
    
    <!-- Causes a DeploymentException --> 
    	<filter>
    		<filter-name>springSecurityFilterChain
    		</filter-name>
    		<filter-class>org.springframework.web.filter.DelegatingFilterProxy
    		</filter-class>
    	</filter>
    
    	<filter-mapping>
    		<filter-name>springSecurityFilterChain
    		</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    <!-- Causes a DeploymentException -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener
    		</listener-class>
    	</listener>
    	<listener>
    		<listener-class>org.springframework.web.util.Log4jConfigListener
    		</listener-class>
    	</listener>
    	<listener>
    		<listener-class>flex.messaging.HttpFlexSession
    		</listener-class>
    	</listener>
    	<!--
    		The front controller of this Spring Web application, responsible for
    		handling all application requests
    	-->
    	<servlet>
    		<servlet-name>DispatcherServlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet
    		</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>/WEB-INF/applicationContext.xml
    			</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    
    	<servlet-mapping>
    		<servlet-name>DispatcherServlet</servlet-name>
    		<url-pattern>/messagebroker/*</url-pattern>
    	</servlet-mapping>
    
    	<welcome-file-list>
    		<welcome-file>index.html</welcome-file>
    		<welcome-file>index.htm</welcome-file>
    	</welcome-file-list>
    
    </web-app>
    If i comment the elements causing the exception out it works just fine. But I want to use Spring Security...
    If you need any more info in order to help me out, please let me know.

    Cheers
    Last edited by muskatus; Jul 11th, 2009 at 05:50 AM.

  2. #2
    Join Date
    Jan 2006
    Location
    Zürich, Switzerland
    Posts
    423

    Default

    Hi,

    It sounds like you're mixing the Web Module and Shared Services WAR formats.

    For details, please consult the Programmer's Guide:



    In short: you should not configure a ContextLoaderListener for a Web Module, since the Root WebApplicationContext will be created for you from all *.xml files found in META-INF/spring/.

    Regarding your issue with filters, are you certain that you cannot configure any kind of filter? Or are you just having problems configuring the Spring Security Filter? To configure Spring Security in a Web Module, you'll want to use the Web-FilterMappings manifest header. For example:

    Code:
    Module-Type: Web
    Web-FilterMappings: springSecurityFilterChain;url-patterns:="/*"
    To see a working example of a Web Module with Spring Security, try out the Spring Travel Sample Application which you can download from the dm Server home page.

    Regards,

    Sam

  3. #3
    Join Date
    May 2009
    Posts
    15

    Default

    Thanks a lot, i'll give that a try and give feedback later today.

  4. #4
    Join Date
    May 2009
    Posts
    15

    Default

    OK I've looked at the example and tried what you said.

    Unfortunately the outcome is the same.
    Including:
    Code:
    Web-FilterMappings: springSecurityFilterChain;url-patterns:="/*"
    in the Manifest, causes the same Exception... If I leave it out it works like a charme.

    I really don't get it, my web.xml looks no different than the one in the Travel example.

  5. #5
    Join Date
    May 2009
    Location
    Hyderabad, India
    Posts
    106

    Default

    There will not be concept web-module(i,e Module-Type) in DM Server in next release, follow the documnetation of Spring 2.0 M2 or any night build documents for this.
    You can create Shared Services War Project to over come all these problems, there you can define all your filters in web.xml like normal web applications instead in Manifest.MF

    The following Post will help you
    http://forum.springsource.org/showthread.php?t=74385
    Last edited by mahesh_yamsani; Jul 13th, 2009 at 08:18 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •