Mantis - Resin
Viewing Issue Advanced Details
4523 minor always 04-27-11 16:18 05-02-11 12:13
rickHigh  
ferg  
normal  
closed  
fixed  
none    
none 4.0.18  
0004523: appear to have circular dependency. Consider using <absolute-ordering> in web.xml
I am using a web-fragment.xml file and am getting a circular dependency issue.

My fragment is defined here:

https://github.com/CDISource/cdisource/blob/master/spring/src/main/resources/META-INF/web-fragment.xml [^]

The listener for this fragment is defined here:

https://github.com/CDISource/cdisource/blob/master/spring/src/main/java/org/cdisource/springintegration/servletsupport/ApplicationContextFinderServletContextListener.java [^]

The error message I am getting is here.

 

    [java] [11-04-27 16:11:17.801] {http://*:8080-1} [^] WebApp[production/webapp/default/springapp] stopping
     [java] [11-04-27 16:11:18.586] {http://*:8080-1} [^] web-fragments at 'WebApp[production/webapp/default/springapp,INITIALIZING]' appear to have circular dependency. Consider using <absolute-ordering> in web.xml.
     [java] [11-04-27 16:11:18.587] {http://*:8080-1} [^] web-fragments at 'WebApp[production/webapp/default/springapp,INITIALIZING]' appear to have circular dependency. Consider using <absolute-ordering> in web.xml.


I believe it might because the @WebListener
public class ApplicationContextFinderServletContextListener

and the web-fragment clash

I think the behavior should be that the web fragment take precedence over the annotation.


Notes
(0005218)
rickHigh   
04-27-11 16:24   
Removing the @WebListener did not help.
(0005219)
rickHigh   
04-27-11 16:32   
When I changed this:

<?xml version="1.0" encoding="UTF-8"?>

<web-fragment version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" [^] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [^] xsi:schemaLocation="http://java.sun.com/xml/ns/javaee [^] http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"> [^]

    <name>Spring CDI Bridge</name>

    <ordering><after><others/></after></ordering>

    <listener>
        <display-name></display-name>

        <listener-class>org.cdisource.springintegration.servletsupport.ApplicationContextFinderServletContextListener</listener-class>

    </listener>

 
</web-fragment>

to this:

<?xml version="1.0" encoding="UTF-8"?>

<web-fragment version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" [^] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [^] xsi:schemaLocation="http://java.sun.com/xml/ns/javaee [^] http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"> [^]

    <name>Spring CDI Bridge</name>

    <listener>
        <display-name></display-name>

        <listener-class>org.cdisource.springintegration.servletsupport.ApplicationContextFinderServletContextListener</listener-class>

    </listener>

 
</web-fragment>

It "works".

However I want to make sure that this listener executes after others, namely the one spring appilcatiion context loader one. But when I use what appears to be valid syntax, resin gives me a circular error.
(0005224)
ferg   
05-02-11 12:13   
server/1r20