You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Menard <ma...@mjm.net> on 2006/10/29 16:45:18 UTC

[s2] Interceptor init() being called multiple times per hit

I was working on a custom interceptor that would use the init() method to
configure itself. After some analysis I realized that the init() method was
being called multiple times per action invocation. So, I made a very simple
interceptor to test to make sure I wasn¹t crazy about this.

package net.vitarara.quadran.core.web.menu;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

public class TestInterceptor implements Interceptor {

    public static int initCount = 0;

    public void destroy () { }

    public void init () {
        System.err.println ("BEGIN: TestInterceptor.init()");
        TestInterceptor.initCount = TestInterceptor.initCount + 1;
        System.err.println ("TestInterceptor.initCount = " +
TestInterceptor.initCount);
        System.err.println ("TestInterceptor = " + this.toString () );
        System.err.println ("END: TestInterceptor.init()");
    }

    public String intercept (ActionInvocation invocation) throws Exception {
        System.err.println ("BEGIN: TestInterceptor.intercept()");
        String result = invocation.invoke ();
        System.err.println ("END: TestInterceptor.intercept()");
        return result;
    }

}

Here is the struts.xml portion defining the interceptor and the stack:

       <interceptors>
            <interceptor name="qmenu" class="qMenuInterceptor" />
            <interceptor name="testInterceptor"
class="net.vitarara.quadran.core.web.menu.TestInterceptor" />
            <interceptor-stack name="defaultStack">
                <interceptor-ref name="servlet-config" />
                <interceptor-ref name="params" />
                <interceptor-ref name="prepare" />
                <interceptor-ref name="chain" />
                <interceptor-ref name="model-driven" />
                <!-- <interceptor-ref name="component" /> -->
                <interceptor-ref name="fileUpload" />
                <interceptor-ref name="static-params" />
                <interceptor-ref name="params" />
                <interceptor-ref name="conversionError" />
                <interceptor-ref name="validation" />
                <interceptor-ref name="workflow" />
                <!-- <interceptor-ref name="qmenu" /> -->
                <interceptor-ref name="testInterceptor" />
            </interceptor-stack>
        </interceptors>

Here's the log output:

11:35:40,557 INFO  [STDOUT] 11:35:40,557 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
11:35:40,664 INFO  [STDOUT] 11:35:40,664 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
11:35:40,670 INFO  [STDOUT] 11:35:40,670 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
11:35:40,721 ERROR [STDERR] BEGIN: TestInterceptor.init()
11:35:40,721 ERROR [STDERR] TestInterceptor.initCount = 9
11:35:40,721 ERROR [STDERR] TestInterceptor =
net.vitarara.quadran.core.web.menu.TestInterceptor@b17a4c
11:35:40,721 ERROR [STDERR] END: TestInterceptor.init()
11:35:40,797 INFO  [STDOUT] 11:35:40,797 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
11:35:40,940 INFO  [STDOUT] 11:35:40,940 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
11:35:40,946 INFO  [STDOUT] 11:35:40,946 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
11:35:40,985 ERROR [STDERR] BEGIN: TestInterceptor.init()
11:35:40,985 ERROR [STDERR] TestInterceptor.initCount = 10
11:35:40,986 ERROR [STDERR] TestInterceptor =
net.vitarara.quadran.core.web.menu.TestInterceptor@fa25b1
11:35:40,986 ERROR [STDERR] END: TestInterceptor.init()
11:35:41,060 ERROR [STDERR] BEGIN: TestInterceptor.intercept()
11:35:41,060 ERROR [STDERR]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!
11:35:41,071 INFO  [STDOUT] 11:35:41,071 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
11:35:41,191 INFO  [STDOUT] 11:35:41,190 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
11:35:41,196 INFO  [STDOUT] 11:35:41,196 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
11:35:41,244 ERROR [STDERR] BEGIN: TestInterceptor.init()
11:35:41,244 ERROR [STDERR] TestInterceptor.initCount = 11
11:35:41,244 ERROR [STDERR] TestInterceptor =
net.vitarara.quadran.core.web.menu.TestInterceptor@4519b9
11:35:41,244 ERROR [STDERR] END: TestInterceptor.init()
11:35:41,470 INFO  [STDOUT] 11:35:41,470 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
11:35:41,630 INFO  [STDOUT] 11:35:41,630 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
11:35:41,644 INFO  [STDOUT] 11:35:41,644 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
11:35:41,720 ERROR [STDERR] BEGIN: TestInterceptor.init()
11:35:41,720 ERROR [STDERR] TestInterceptor.initCount = 12
11:35:41,721 ERROR [STDERR] TestInterceptor =
net.vitarara.quadran.core.web.menu.TestInterceptor@803f5b
11:35:41,721 ERROR [STDERR] END: TestInterceptor.init()
11:35:41,737 ERROR [STDERR] END: TestInterceptor.intercept()


The ! marks are in the actions execute() method.

Looking at this log output I have a few questions:

1. It looks to me that the TestInterceptor is being instantiated multiple
times. Why?

2. Why is are the various struts xml files being parsed multiple times for a
single action invocation?

Thanks,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Interceptor init() being called multiple times per hit

Posted by Mark Menard <ma...@mjm.net>.
On 10/29/06 1:59 PM, "Don Brown" <do...@gmail.com> wrote:

> Well, first, what version of Struts 2 are you using?  My guess is you are
> using Struts 2.0.0, which contained a bug where the configuration would be
> reloaded multiple times in a request.

I'm using struts2-all-2.0.1.jar, which I downloaded about a week ago. I'm
trying to track just behind the bleeding edge on s2.

> As for your question why various struts files are loaded, that is how the new
> plugin system works.  First, struts-default.xml, in the Struts jar, is loaded.
> Then, all struts-plugin.xml files are loaded from the plugin jars. Finally,
> struts.xml is loaded for your application.

I understood the struts-default.xml, struts-plugin.xml, struts.xml process,
but didn't think they needed to be read over and over again. Do you think
the multiple initing of the Interceptor is due to the reload of the xml
files?

Thank, especially for replying on a Sunday,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Interceptor init() being called multiple times per hit

Posted by Don Brown <do...@gmail.com>.
Well, first, what version of Struts 2 are you using?  My guess is you
are using Struts 2.0.0, which contained a bug where the configuration
would be reloaded multiple times in a request.  As for your question
why various struts files are loaded, that is how the new plugin system
works.  First, struts-default.xml, in the Struts jar, is loaded.
Then, all struts-plugin.xml files are loaded from the plugin jars.
Finally, struts.xml is loaded for your application.

Don

On 10/29/06, Mark Menard <ma...@mjm.net> wrote:
> I was working on a custom interceptor that would use the init() method to
> configure itself. After some analysis I realized that the init() method was
> being called multiple times per action invocation. So, I made a very simple
> interceptor to test to make sure I wasn¹t crazy about this.
>
> package net.vitarara.quadran.core.web.menu;
>
> import com.opensymphony.xwork2.ActionInvocation;
> import com.opensymphony.xwork2.interceptor.Interceptor;
>
> public class TestInterceptor implements Interceptor {
>
>     public static int initCount = 0;
>
>     public void destroy () { }
>
>     public void init () {
>         System.err.println ("BEGIN: TestInterceptor.init()");
>         TestInterceptor.initCount = TestInterceptor.initCount + 1;
>         System.err.println ("TestInterceptor.initCount = " +
> TestInterceptor.initCount);
>         System.err.println ("TestInterceptor = " + this.toString () );
>         System.err.println ("END: TestInterceptor.init()");
>     }
>
>     public String intercept (ActionInvocation invocation) throws Exception {
>         System.err.println ("BEGIN: TestInterceptor.intercept()");
>         String result = invocation.invoke ();
>         System.err.println ("END: TestInterceptor.intercept()");
>         return result;
>     }
>
> }
>
> Here is the struts.xml portion defining the interceptor and the stack:
>
>        <interceptors>
>             <interceptor name="qmenu" class="qMenuInterceptor" />
>             <interceptor name="testInterceptor"
> class="net.vitarara.quadran.core.web.menu.TestInterceptor" />
>             <interceptor-stack name="defaultStack">
>                 <interceptor-ref name="servlet-config" />
>                 <interceptor-ref name="params" />
>                 <interceptor-ref name="prepare" />
>                 <interceptor-ref name="chain" />
>                 <interceptor-ref name="model-driven" />
>                 <!-- <interceptor-ref name="component" /> -->
>                 <interceptor-ref name="fileUpload" />
>                 <interceptor-ref name="static-params" />
>                 <interceptor-ref name="params" />
>                 <interceptor-ref name="conversionError" />
>                 <interceptor-ref name="validation" />
>                 <interceptor-ref name="workflow" />
>                 <!-- <interceptor-ref name="qmenu" /> -->
>                 <interceptor-ref name="testInterceptor" />
>             </interceptor-stack>
>         </interceptors>
>
> Here's the log output:
>
> 11:35:40,557 INFO  [STDOUT] 11:35:40,557 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:40,664 INFO  [STDOUT] 11:35:40,664 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:40,670 INFO  [STDOUT] 11:35:40,670 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:40,721 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:40,721 ERROR [STDERR] TestInterceptor.initCount = 9
> 11:35:40,721 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@b17a4c
> 11:35:40,721 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:40,797 INFO  [STDOUT] 11:35:40,797 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:40,940 INFO  [STDOUT] 11:35:40,940 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:40,946 INFO  [STDOUT] 11:35:40,946 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:40,985 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:40,985 ERROR [STDERR] TestInterceptor.initCount = 10
> 11:35:40,986 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@fa25b1
> 11:35:40,986 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:41,060 ERROR [STDERR] BEGIN: TestInterceptor.intercept()
> 11:35:41,060 ERROR [STDERR]
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!
> 11:35:41,071 INFO  [STDOUT] 11:35:41,071 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:41,191 INFO  [STDOUT] 11:35:41,190 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:41,196 INFO  [STDOUT] 11:35:41,196 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:41,244 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:41,244 ERROR [STDERR] TestInterceptor.initCount = 11
> 11:35:41,244 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@4519b9
> 11:35:41,244 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:41,470 INFO  [STDOUT] 11:35:41,470 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:41,630 INFO  [STDOUT] 11:35:41,630 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:41,644 INFO  [STDOUT] 11:35:41,644 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:41,720 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:41,720 ERROR [STDERR] TestInterceptor.initCount = 12
> 11:35:41,721 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@803f5b
> 11:35:41,721 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:41,737 ERROR [STDERR] END: TestInterceptor.intercept()
>
>
> The ! marks are in the actions execute() method.
>
> Looking at this log output I have a few questions:
>
> 1. It looks to me that the TestInterceptor is being instantiated multiple
> times. Why?
>
> 2. Why is are the various struts xml files being parsed multiple times for a
> single action invocation?
>
> Thanks,
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Interceptor init() being called multiple times per hit

Posted by Mark Menard <ma...@mjm.net>.
On 10/29/06 4:21 PM, "Don Brown" <do...@gmail.com> wrote:

> Ok, I should have fixed the configuration files reloading too many
> times.  Unfortunately, if you use the action tag, they will still
> reload, as that tag doesn't fully use the ActionContext instance from
> the request (where the flag to not reload is stored

I'm not using an action tag. So, that shouldn't be the issue.
 
> If you can, check out trunk and ensure that the problem has been fixed for
> you.

OK, I checked out the 2.0.2 trunk, using:

svn checkout http://svn.apache.org/repos/asf/struts/struts2/trunk
struts2-parent

Then I built it using maven and I'm using the following two jars:

./api/target/struts2-api-2.0.2-SNAPSHOT.jar
./core/target/struts2-core-2.0.2-SNAPSHOT.jar

This is what I'm seeing in my log:

21:53:03,100 INFO  [STDOUT] 21:53:03,099 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
21:53:03,297 INFO  [STDOUT] 21:53:03,297 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
21:53:03,300 INFO  [STDOUT] 21:53:03,300 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
21:53:03,375 ERROR [STDERR] BEGIN: MenuInterceptor.init()
21:53:03,375 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@b65e9f
21:53:03,375 ERROR [STDERR] END: MenuInterceptor.init()
21:53:03,442 ERROR [STDERR] BEGIN: MenuInterceptor.intercept ()
21:53:03,470 INFO  [STDOUT] 21:53:03,470 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
21:53:03,664 INFO  [STDOUT] 21:53:03,664 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
21:53:03,667 INFO  [STDOUT] 21:53:03,667 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
21:53:03,759 ERROR [STDERR] BEGIN: MenuInterceptor.init()
21:53:03,759 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@b65e9f
21:53:03,760 ERROR [STDERR] END: MenuInterceptor.init()
21:53:04,085 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@b65e9f
21:53:04,085 ERROR [STDERR] END: MenuInterceptor.intercept ()


So, it looks to me like the interceptor is still being init'ed multiple
times.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Interceptor init() being called multiple times per hit

Posted by Don Brown <do...@gmail.com>.
Ok, I should have fixed the configuration files reloading too many
times.  Unfortunately, if you use the action tag, they will still
reload, as that tag doesn't fully use the ActionContext instance from
the request (where the flag to not reload is stored).

If you can, check out trunk and ensure that the problem has been fixed for you.

Don

On 10/29/06, Mark Menard <ma...@mjm.net> wrote:
> On 10/29/06 11:45 AM, "Mark Menard" <ma...@mjm.net> wrote:
> > Here's the log output:
> >
> > 11:35:40,557 INFO  [STDOUT] 11:35:40,557 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-default.xml]
> > 11:35:40,664 INFO  [STDOUT] 11:35:40,664 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-plugin.xml]
> > 11:35:40,670 INFO  [STDOUT] 11:35:40,670 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts.xml]
> > 11:35:40,721 ERROR [STDERR] BEGIN: TestInterceptor.init()
> > 11:35:40,721 ERROR [STDERR] TestInterceptor.initCount = 9
> > 11:35:40,721 ERROR [STDERR] TestInterceptor =
> > net.vitarara.quadran.core.web.menu.TestInterceptor@b17a4c
> > 11:35:40,721 ERROR [STDERR] END: TestInterceptor.init()
> > 11:35:40,797 INFO  [STDOUT] 11:35:40,797 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-default.xml]
> > 11:35:40,940 INFO  [STDOUT] 11:35:40,940 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-plugin.xml]
> > 11:35:40,946 INFO  [STDOUT] 11:35:40,946 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts.xml]
> > 11:35:40,985 ERROR [STDERR] BEGIN: TestInterceptor.init()
> > 11:35:40,985 ERROR [STDERR] TestInterceptor.initCount = 10
> > 11:35:40,986 ERROR [STDERR] TestInterceptor =
> > net.vitarara.quadran.core.web.menu.TestInterceptor@fa25b1
> > 11:35:40,986 ERROR [STDERR] END: TestInterceptor.init()
> > 11:35:41,060 ERROR [STDERR] BEGIN: TestInterceptor.intercept()
> > 11:35:41,060 ERROR [STDERR]
> > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > !!!!!!!!!!!!!!!!!!!!
> > 11:35:41,071 INFO  [STDOUT] 11:35:41,071 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-default.xml]
> > 11:35:41,191 INFO  [STDOUT] 11:35:41,190 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-plugin.xml]
> > 11:35:41,196 INFO  [STDOUT] 11:35:41,196 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts.xml]
> > 11:35:41,244 ERROR [STDERR] BEGIN: TestInterceptor.init()
> > 11:35:41,244 ERROR [STDERR] TestInterceptor.initCount = 11
> > 11:35:41,244 ERROR [STDERR] TestInterceptor =
> > net.vitarara.quadran.core.web.menu.TestInterceptor@4519b9
> > 11:35:41,244 ERROR [STDERR] END: TestInterceptor.init()
> > 11:35:41,470 INFO  [STDOUT] 11:35:41,470 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-default.xml]
> > 11:35:41,630 INFO  [STDOUT] 11:35:41,630 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts-plugin.xml]
> > 11:35:41,644 INFO  [STDOUT] 11:35:41,644 INFO  [XmlConfigurationProvider]
> > Parsing configuration file [struts.xml]
> > 11:35:41,720 ERROR [STDERR] BEGIN: TestInterceptor.init()
> > 11:35:41,720 ERROR [STDERR] TestInterceptor.initCount = 12
> > 11:35:41,721 ERROR [STDERR] TestInterceptor =
> > net.vitarara.quadran.core.web.menu.TestInterceptor@803f5b
> > 11:35:41,721 ERROR [STDERR] END: TestInterceptor.init()
> > 11:35:41,737 ERROR [STDERR] END: TestInterceptor.intercept()
>
> Here's another log spew from another interceptor. This one appears to be
> having init() called on it multiple times, but unlike the previous log it is
> the same instance of the Interceptor.
>
>
> 13:33:45,414 INFO  [STDOUT] 13:33:45,414 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 13:33:45,531 INFO  [STDOUT] 13:33:45,531 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 13:33:45,535 INFO  [STDOUT] 13:33:45,535 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 13:33:45,573 ERROR [STDERR] BEGIN: MenuInterceptor.init()
> 13:33:45,573 ERROR [STDERR] MenuInterceptor =
> net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
> 13:33:45,574 ERROR [STDERR] END: MenuInterceptor.init()
> 13:33:45,598 INFO  [STDOUT] 13:33:45,598 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 13:33:45,695 INFO  [STDOUT] 13:33:45,695 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 13:33:45,700 INFO  [STDOUT] 13:33:45,700 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 13:33:45,738 ERROR [STDERR] BEGIN: MenuInterceptor.init()
> 13:33:45,739 ERROR [STDERR] MenuInterceptor =
> net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
> 13:33:45,739 ERROR [STDERR] END: MenuInterceptor.init()
> 13:33:45,764 ERROR [STDERR] BEGIN: MenuInterceptor.intercept ()
> 13:33:45,775 INFO  [STDOUT] 13:33:45,775 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 13:33:45,899 INFO  [STDOUT] 13:33:45,899 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 13:33:45,905 INFO  [STDOUT] 13:33:45,904 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 13:33:45,927 ERROR [STDERR] BEGIN: MenuInterceptor.init()
> 13:33:45,927 ERROR [STDERR] MenuInterceptor =
> net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
> 13:33:45,928 ERROR [STDERR] END: MenuInterceptor.init()
> 13:33:46,115 INFO  [STDOUT] 13:33:46,114 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 13:33:46,215 INFO  [STDOUT] 13:33:46,215 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 13:33:46,224 INFO  [STDOUT] 13:33:46,224 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 13:33:46,269 ERROR [STDERR] BEGIN: MenuInterceptor.init()
> 13:33:46,270 ERROR [STDERR] MenuInterceptor =
> net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
> 13:33:46,270 ERROR [STDERR] END: MenuInterceptor.init()
> 13:33:46,285 ERROR [STDERR] MenuInterceptor =
> net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
> 13:33:46,285 ERROR [STDERR] END: MenuInterceptor.intercept ()
>
>
>
> Thanks,
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Interceptor init() being called multiple times per hit

Posted by Mark Menard <ma...@mjm.net>.
On 10/29/06 11:45 AM, "Mark Menard" <ma...@mjm.net> wrote:
> Here's the log output:
> 
> 11:35:40,557 INFO  [STDOUT] 11:35:40,557 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:40,664 INFO  [STDOUT] 11:35:40,664 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:40,670 INFO  [STDOUT] 11:35:40,670 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:40,721 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:40,721 ERROR [STDERR] TestInterceptor.initCount = 9
> 11:35:40,721 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@b17a4c
> 11:35:40,721 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:40,797 INFO  [STDOUT] 11:35:40,797 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:40,940 INFO  [STDOUT] 11:35:40,940 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:40,946 INFO  [STDOUT] 11:35:40,946 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:40,985 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:40,985 ERROR [STDERR] TestInterceptor.initCount = 10
> 11:35:40,986 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@fa25b1
> 11:35:40,986 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:41,060 ERROR [STDERR] BEGIN: TestInterceptor.intercept()
> 11:35:41,060 ERROR [STDERR]
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!!!!!!!!!!!!!!!!!!
> 11:35:41,071 INFO  [STDOUT] 11:35:41,071 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:41,191 INFO  [STDOUT] 11:35:41,190 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:41,196 INFO  [STDOUT] 11:35:41,196 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:41,244 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:41,244 ERROR [STDERR] TestInterceptor.initCount = 11
> 11:35:41,244 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@4519b9
> 11:35:41,244 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:41,470 INFO  [STDOUT] 11:35:41,470 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-default.xml]
> 11:35:41,630 INFO  [STDOUT] 11:35:41,630 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts-plugin.xml]
> 11:35:41,644 INFO  [STDOUT] 11:35:41,644 INFO  [XmlConfigurationProvider]
> Parsing configuration file [struts.xml]
> 11:35:41,720 ERROR [STDERR] BEGIN: TestInterceptor.init()
> 11:35:41,720 ERROR [STDERR] TestInterceptor.initCount = 12
> 11:35:41,721 ERROR [STDERR] TestInterceptor =
> net.vitarara.quadran.core.web.menu.TestInterceptor@803f5b
> 11:35:41,721 ERROR [STDERR] END: TestInterceptor.init()
> 11:35:41,737 ERROR [STDERR] END: TestInterceptor.intercept()

Here's another log spew from another interceptor. This one appears to be
having init() called on it multiple times, but unlike the previous log it is
the same instance of the Interceptor.


13:33:45,414 INFO  [STDOUT] 13:33:45,414 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
13:33:45,531 INFO  [STDOUT] 13:33:45,531 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
13:33:45,535 INFO  [STDOUT] 13:33:45,535 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
13:33:45,573 ERROR [STDERR] BEGIN: MenuInterceptor.init()
13:33:45,573 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
13:33:45,574 ERROR [STDERR] END: MenuInterceptor.init()
13:33:45,598 INFO  [STDOUT] 13:33:45,598 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
13:33:45,695 INFO  [STDOUT] 13:33:45,695 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
13:33:45,700 INFO  [STDOUT] 13:33:45,700 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
13:33:45,738 ERROR [STDERR] BEGIN: MenuInterceptor.init()
13:33:45,739 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
13:33:45,739 ERROR [STDERR] END: MenuInterceptor.init()
13:33:45,764 ERROR [STDERR] BEGIN: MenuInterceptor.intercept ()
13:33:45,775 INFO  [STDOUT] 13:33:45,775 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
13:33:45,899 INFO  [STDOUT] 13:33:45,899 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
13:33:45,905 INFO  [STDOUT] 13:33:45,904 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
13:33:45,927 ERROR [STDERR] BEGIN: MenuInterceptor.init()
13:33:45,927 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
13:33:45,928 ERROR [STDERR] END: MenuInterceptor.init()
13:33:46,115 INFO  [STDOUT] 13:33:46,114 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-default.xml]
13:33:46,215 INFO  [STDOUT] 13:33:46,215 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts-plugin.xml]
13:33:46,224 INFO  [STDOUT] 13:33:46,224 INFO  [XmlConfigurationProvider]
Parsing configuration file [struts.xml]
13:33:46,269 ERROR [STDERR] BEGIN: MenuInterceptor.init()
13:33:46,270 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
13:33:46,270 ERROR [STDERR] END: MenuInterceptor.init()
13:33:46,285 ERROR [STDERR] MenuInterceptor =
net.vitarara.quadran.core.web.menu.MenuInterceptor@f8a34f
13:33:46,285 ERROR [STDERR] END: MenuInterceptor.intercept ()



Thanks,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org