You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Musachy Barroso <mu...@gmail.com> on 2009/07/12 03:52:03 UTC

Class reloading

FYI I moved the "classloader" package from Convention into XWork, so
it can be used by other plugins. Extending a couple Spring classes,
and using the ReloadingClassLoader with Commons JCI FAM
(http://commons.apache.org/jci/commons-jci-fam/index.html) I get my
action classes reloaded after compilation, from jar files and normal
dirs. If anyone is interested I could add this to the Spring plugin,
if not I will drop it in the wiki somewhere.

musachy

-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> did you figure it out?

I did find that glassfish was applying my logging levels in a dumb 
order, resulting in me not seeing logs I thought I was seeing...
...and I did subsequently see an appropriate log message on touching a 
.class file...
...but I've not since had an occasion where a code update I needed to 
test included only action class changes, so this trick rather than a 
redeploy hasn't yet been a viable testing strategy for me, and I've not 
yet fully tested it.  I'll let you know once I see it work.

-Dale

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


RE: [OT] Was Re: Class reloading

Posted by Martin Gainty <mg...@hotmail.com>.
was 80 gallons..new one is 60gallons
the trick was cranking the valve off while hot water was blasting 
what little water hit the floor drained away..not a 'real flood' per se

thx,
Martin 
______________________________________________ 
Usual Caveats go here




> Date: Wed, 23 Sep 2009 14:53:54 -0700
> Subject: Re: [OT] Was Re: Class reloading
> From: thechrispratt@gmail.com
> To: dev@struts.apache.org
> 
> Holy Carp!  How big is your water heater? =9^D
>   (*Chris*)
> 
> On Wed, Sep 23, 2009 at 2:27 PM, Dale Newfield <da...@newfield.org> wrote:
> 
> > Martin Gainty wrote:
> >
> >> a small flood a few weeks back when my HW tank blew..not fun
> >>
> >
> > http://newfield.org/dale/flood/
> >
> > -Dale
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >

_________________________________________________________________
Bing brings you health info from trusted sources.
http://www.bing.com/search?q=pet+allergy&form=MHEINA&publ=WLHMTAG&crea=TXT_MHEINA_Health_Health_PetAllergy_1x1

Re: [OT] Was Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Chris Pratt wrote:
> Holy Carp!  How big is your water heater? =9^D

Funny you should mention that--yes, I've been finding dead fish all over 
the place.

-Dale

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


Re: [OT] Was Re: Class reloading

Posted by Chris Pratt <th...@gmail.com>.
Holy Carp!  How big is your water heater? =9^D
  (*Chris*)

On Wed, Sep 23, 2009 at 2:27 PM, Dale Newfield <da...@newfield.org> wrote:

> Martin Gainty wrote:
>
>> a small flood a few weeks back when my HW tank blew..not fun
>>
>
> http://newfield.org/dale/flood/
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

RE: [OT] Was Re: Class reloading

Posted by Martin Gainty <mg...@hotmail.com>.
whoa..thats a real FLOOD!..any luck with fema ?

Martin 
______________________________________________ 
Usual Caveats go here



> Date: Wed, 23 Sep 2009 17:27:24 -0400
> From: dale@newfield.org
> To: dev@struts.apache.org
> Subject: [OT] Was Re: Class reloading
> 
> Martin Gainty wrote:
> > a small flood a few weeks back when my HW tank blew..not fun
> 
> http://newfield.org/dale/flood/
> 
> -Dale
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 

_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/

[OT] Was Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Martin Gainty wrote:
> a small flood a few weeks back when my HW tank blew..not fun

http://newfield.org/dale/flood/

-Dale

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


RE: Class reloading

Posted by Martin Gainty <mg...@hotmail.com>.
a small flood a few weeks back when my HW tank blew..not fun

i'm curious if you (or anyone) got Xwork 2.1.6 to build?
you mentioned multi-threading issues..which multithreading issues were you speaking of?

may want to ping FEMA..they're usually pretty quick with assesments.. 
GL with the basement
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Tue, 22 Sep 2009 16:32:00 -0400
> From: dale@newfield.org
> To: dev@struts.apache.org
> Subject: Re: Class reloading
> 
> Wes Wannemacher wrote:
> > @Dale - which container / JDK are you running when you get the error?
> 
> I was using glassfish / 1.5 (on a mac PPC, so no 1.6 available), and 
> while I *think* I saw the error on a clean launch of glassfish, I *know* 
> I saw it on a redeploy.  I did have a completely screwed up struts 
> filter setup in my web.xml at the time, though...(and since I added a 
> setting in my struts.properties that masks the problem -- when next I 
> test I'll remove that setting).
> 
> > Can you try the newer jars from the nightly build?
> 
> I'm digging out from yesterday's flooding, so not yet.  I'll let y'all 
> know when I've tested it.
> 
> -Dale
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 

_________________________________________________________________
Hotmail: Free, trusted and rich email service.
http://clk.atdmt.com/GBL/go/171222984/direct/01/

Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Wes Wannemacher wrote:
> @Dale - which container / JDK are you running when you get the error?

I was using glassfish / 1.5 (on a mac PPC, so no 1.6 available), and 
while I *think* I saw the error on a clean launch of glassfish, I *know* 
I saw it on a redeploy.  I did have a completely screwed up struts 
filter setup in my web.xml at the time, though...(and since I added a 
setting in my struts.properties that masks the problem -- when next I 
test I'll remove that setting).

> Can you try the newer jars from the nightly build?

I'm digging out from yesterday's flooding, so not yet.  I'll let y'all 
know when I've tested it.

-Dale

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


Re: Class reloading

Posted by Wes Wannemacher <we...@wantii.com>.
On Tue, Sep 22, 2009 at 10:27 AM, Wes Wannemacher <we...@wantii.com> wrote:
> On Mon, Sep 21, 2009 at 11:23 PM, Musachy Barroso <mu...@gmail.com> wrote:
>> We had the same problem today running showcase in the zone, while it
>> worked locally for me and Wes. I changed the plugin to lookup those
>> constants instead of getting them injected, I have no idea what is
>> going on.
>>
>> musachy
>>
>
> Okay, I rebuilt and pushed the latest snapshot out to the zone... It
> didn't work right away, I had to bounce both tomcat and jetty before
> the showcase would work. We should probably take a closer look, the
> problem may be (re-)deployment, and not injection like originally
> thought. The errors in Tomcat were different than the errors in Jetty.
> After looking through logs, Jetty was complaining that
> XWorkParametersBinder could not be found while it was parsing
> struts-default.xml.
>

Quick Update -

Tomcat 6.0.18 with JDK 1.6.0_16-b01 on Linux amd64 (Ubuntu Jaunty
defaults) works w/o problem. Deploy and redeploy.

@Dale - which container / JDK are you running when you get the error?
Can you try the newer jars from the nightly build?

-Wes

-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: Class reloading

Posted by Wes Wannemacher <we...@wantii.com>.
On Mon, Sep 21, 2009 at 11:23 PM, Musachy Barroso <mu...@gmail.com> wrote:
> We had the same problem today running showcase in the zone, while it
> worked locally for me and Wes. I changed the plugin to lookup those
> constants instead of getting them injected, I have no idea what is
> going on.
>
> musachy
>

Okay, I rebuilt and pushed the latest snapshot out to the zone... It
didn't work right away, I had to bounce both tomcat and jetty before
the showcase would work. We should probably take a closer look, the
problem may be (re-)deployment, and not injection like originally
thought. The errors in Tomcat were different than the errors in Jetty.
After looking through logs, Jetty was complaining that
XWorkParametersBinder could not be found while it was parsing
struts-default.xml.

-Wes


-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
We had the same problem today running showcase in the zone, while it
worked locally for me and Wes. I changed the plugin to lookup those
constants instead of getting them injected, I have no idea what is
going on.

musachy

On Fri, Sep 11, 2009 at 8:17 AM, Musachy Barroso <mu...@gmail.com> wrote:
> one more thing, check that you don't have the spring plugin duplicated
> in the classpath.
>
> musachy
>
> On Thu, Sep 10, 2009 at 9:23 PM, Musachy Barroso <mu...@gmail.com> wrote:
>> I am out of ideas. If the change to the class file to use that
>> constant is there (and it is because it fails), then the constant
>> should be there as well.
>>
>> musachy
>>
>> On Thu, Sep 10, 2009 at 7:59 PM, Dale Newfield <da...@newfield.org> wrote:
>>> Musachy Barroso wrote:
>>>>
>>>> that should not matter, maybe it is not loading your .properties file.
>>>
>>> It is loading it, because once I added a value (false) in my .properties
>>> file it got past that error and began to load.
>>>
>>> I'm not claiming that class reloading isn't working.
>>> I'm not claiming that struts2 isn't working.
>>>
>>> I'm saying I don't use maven, but rather ant so updating dependencies can be
>>> tricky.  Between a failed ACEGI -> Spring Security upgrade, some changes
>>> attempting to make the login accept "username or email address", a bunch of
>>> other dependency updates, code updates, switching to 2.1.8-SNAPSHOT,
>>> changing from
>>> org.apache.struts2.dispatcher.FilterDispatcher/ActionContextCleanUp to
>>> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter/StrutsPrepareFilter,
>>> and who knows what other changes I've managed to completely break my
>>> application.  I'm attempting to back out various of those changes to get it
>>> working again (and was just trying to turn off the reloading bit so that I
>>> knew that had nothing to do with it), but I can't even display the login
>>> form right now.
>>>
>>>> Make sure you do an mvn clean install..just to satisfy the maven dark
>>>> gods
>>>
>>> I did have to skip the tests to get xwork to compile, too--now that I think
>>> about the error I bet it was a java5/java6 thing, too...
>>>
>>>> http://www.codeodor.com/images/works-on-my-machine-starburst.png :)
>>>
>>> Yeah.  I guess it would be nice if xwork/struts HEAD could get released (and
>>> hopefully go GA) so I would know my java5 compilation environment isn't
>>> screwing up anything important.
>>>
>>> -Dale
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
one more thing, check that you don't have the spring plugin duplicated
in the classpath.

musachy

On Thu, Sep 10, 2009 at 9:23 PM, Musachy Barroso <mu...@gmail.com> wrote:
> I am out of ideas. If the change to the class file to use that
> constant is there (and it is because it fails), then the constant
> should be there as well.
>
> musachy
>
> On Thu, Sep 10, 2009 at 7:59 PM, Dale Newfield <da...@newfield.org> wrote:
>> Musachy Barroso wrote:
>>>
>>> that should not matter, maybe it is not loading your .properties file.
>>
>> It is loading it, because once I added a value (false) in my .properties
>> file it got past that error and began to load.
>>
>> I'm not claiming that class reloading isn't working.
>> I'm not claiming that struts2 isn't working.
>>
>> I'm saying I don't use maven, but rather ant so updating dependencies can be
>> tricky.  Between a failed ACEGI -> Spring Security upgrade, some changes
>> attempting to make the login accept "username or email address", a bunch of
>> other dependency updates, code updates, switching to 2.1.8-SNAPSHOT,
>> changing from
>> org.apache.struts2.dispatcher.FilterDispatcher/ActionContextCleanUp to
>> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter/StrutsPrepareFilter,
>> and who knows what other changes I've managed to completely break my
>> application.  I'm attempting to back out various of those changes to get it
>> working again (and was just trying to turn off the reloading bit so that I
>> knew that had nothing to do with it), but I can't even display the login
>> form right now.
>>
>>> Make sure you do an mvn clean install..just to satisfy the maven dark
>>> gods
>>
>> I did have to skip the tests to get xwork to compile, too--now that I think
>> about the error I bet it was a java5/java6 thing, too...
>>
>>> http://www.codeodor.com/images/works-on-my-machine-starburst.png :)
>>
>> Yeah.  I guess it would be nice if xwork/struts HEAD could get released (and
>> hopefully go GA) so I would know my java5 compilation environment isn't
>> screwing up anything important.
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
I am out of ideas. If the change to the class file to use that
constant is there (and it is because it fails), then the constant
should be there as well.

musachy

On Thu, Sep 10, 2009 at 7:59 PM, Dale Newfield <da...@newfield.org> wrote:
> Musachy Barroso wrote:
>>
>> that should not matter, maybe it is not loading your .properties file.
>
> It is loading it, because once I added a value (false) in my .properties
> file it got past that error and began to load.
>
> I'm not claiming that class reloading isn't working.
> I'm not claiming that struts2 isn't working.
>
> I'm saying I don't use maven, but rather ant so updating dependencies can be
> tricky.  Between a failed ACEGI -> Spring Security upgrade, some changes
> attempting to make the login accept "username or email address", a bunch of
> other dependency updates, code updates, switching to 2.1.8-SNAPSHOT,
> changing from
> org.apache.struts2.dispatcher.FilterDispatcher/ActionContextCleanUp to
> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter/StrutsPrepareFilter,
> and who knows what other changes I've managed to completely break my
> application.  I'm attempting to back out various of those changes to get it
> working again (and was just trying to turn off the reloading bit so that I
> knew that had nothing to do with it), but I can't even display the login
> form right now.
>
>> Make sure you do an mvn clean install..just to satisfy the maven dark
>> gods
>
> I did have to skip the tests to get xwork to compile, too--now that I think
> about the error I bet it was a java5/java6 thing, too...
>
>> http://www.codeodor.com/images/works-on-my-machine-starburst.png :)
>
> Yeah.  I guess it would be nice if xwork/struts HEAD could get released (and
> hopefully go GA) so I would know my java5 compilation environment isn't
> screwing up anything important.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> that should not matter, maybe it is not loading your .properties file.

It is loading it, because once I added a value (false) in my .properties 
file it got past that error and began to load.

I'm not claiming that class reloading isn't working.
I'm not claiming that struts2 isn't working.

I'm saying I don't use maven, but rather ant so updating dependencies 
can be tricky.  Between a failed ACEGI -> Spring Security upgrade, some 
changes attempting to make the login accept "username or email address", 
a bunch of other dependency updates, code updates, switching to 
2.1.8-SNAPSHOT, changing from 
org.apache.struts2.dispatcher.FilterDispatcher/ActionContextCleanUp to 
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter/StrutsPrepareFilter, 
and who knows what other changes I've managed to completely break my 
application.  I'm attempting to back out various of those changes to get 
it working again (and was just trying to turn off the reloading bit so 
that I knew that had nothing to do with it), but I can't even display 
the login form right now.

> Make sure you do an mvn clean install..just to satisfy the maven dark
> gods

I did have to skip the tests to get xwork to compile, too--now that I 
think about the error I bet it was a java5/java6 thing, too...

> http://www.codeodor.com/images/works-on-my-machine-starburst.png :)

Yeah.  I guess it would be nice if xwork/struts HEAD could get released 
(and hopefully go GA) so I would know my java5 compilation environment 
isn't screwing up anything important.

-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
that should not matter, maybe it is not loading your .properties file.
Make sure you do an mvn clean install..just to satisfy the maven dark
gods, if it still fails, try to set it in to struts.xml. I have been
using it in last few days for a demo and it was working fine for me
(tm): http://www.codeodor.com/images/works-on-my-machine-starburst.png
:)

musachy

On Thu, Sep 10, 2009 at 5:41 PM, Dale Newfield <da...@newfield.org> wrote:
> Musachy Barroso wrote:
>>
>> that's weird, it is defined in struts-plugin.xml in the spring plugin.
>> Can you check if you have it there?
>
> It is there:
>
> <constant name="struts.class.reloading.reloadConfig" value="false" />
>
> Does it matter that I've been setting these values in a struts.properties
> file instead of through XML?
>
> I don't know what's going on.  I just know that I'm spinning my wheels like
> crazy trying to get stuff working again.  Serves me right for not doing more
> frequent svn commits, I guess :-(
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> that's weird, it is defined in struts-plugin.xml in the spring plugin.
> Can you check if you have it there?

It is there:

<constant name="struts.class.reloading.reloadConfig" value="false" />

Does it matter that I've been setting these values in a 
struts.properties file instead of through XML?

I don't know what's going on.  I just know that I'm spinning my wheels 
like crazy trying to get stuff working again.  Serves me right for not 
doing more frequent svn commits, I guess :-(

-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
that's weird, it is defined in struts-plugin.xml in the spring plugin.
Can you check if you have it there?

musachy

On Thu, Sep 10, 2009 at 4:30 PM, Dale Newfield <da...@newfield.org> wrote:
> Musachy Barroso <mu...@gmail.com> wrote:
>> did you figure it out?
>
> My current web app has been having severe issues, and has been broken
> for about a month (half the time I was out of town, so it's not as bad
> as it sounds :-).  In trying to back out a number of changes to track
> down the source of my problems, I think I found a bug in your
> documentation:
>
> http://cwiki.apache.org/confluence/display/WW/Spring+Plugin says that
> struts.class.reloading.reloadConfig defaults to false, but I found not
> specifying led to the context failing to start with the following
> message:
> com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException:
> No mapping found for dependency [type=java.lang.String,
> name='struts.class.reloading.reloadConfig'] in public
> org.apache.struts2.spring.StrutsSpringObjectFactory(java.lang.String,java.lang.String,java.lang.String,javax.servlet.ServletContext,java.lang.String,java.lang.String,java.lang.String,java.lang.String).
>
> So I'm thinking it doesn't actually have a default value.
> (yes, I'm using xwork and struts2 SNAPSHOT updated today, and since
> I'm on an apple still running 10.4, I don't have java6, so it took
> some pom hacking just to get it to compile).
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso <mu...@gmail.com> wrote:
> did you figure it out?

My current web app has been having severe issues, and has been broken
for about a month (half the time I was out of town, so it's not as bad
as it sounds :-).  In trying to back out a number of changes to track
down the source of my problems, I think I found a bug in your
documentation:

http://cwiki.apache.org/confluence/display/WW/Spring+Plugin says that
struts.class.reloading.reloadConfig defaults to false, but I found not
specifying led to the context failing to start with the following
message:
com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException:
No mapping found for dependency [type=java.lang.String,
name='struts.class.reloading.reloadConfig'] in public
org.apache.struts2.spring.StrutsSpringObjectFactory(java.lang.String,java.lang.String,java.lang.String,javax.servlet.ServletContext,java.lang.String,java.lang.String,java.lang.String,java.lang.String).

So I'm thinking it doesn't actually have a default value.
(yes, I'm using xwork and struts2 SNAPSHOT updated today, and since
I'm on an apple still running 10.4, I don't have java6, so it took
some pom hacking just to get it to compile).

-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
did you figure it out?

musachy

On Wed, Jul 29, 2009 at 1:24 PM, Musachy Barroso<mu...@gmail.com> wrote:
> "It works for me" (is that a trademark already?). My config is like:
>
> <constant name="struts.class.reloading.watchList"
> value="WEB-INF/classes/com/company" />
> <constant name="struts.class.reloading.acceptClasses"
> value="com\.company\.sandbox\.actions.*" />
> <constant name="struts.convention.classes.reload" value="true" />
>
> When I touch a file under that dir, I get:
>
>  DEBUG org.apache.struts2.spring.ClassReloadingXMLWebApplicationContext
>  - Change detected in file
> [/mumble/WEB-INF/classes/com/company/MyAction.class], reloading class
> loader
>
> Are you sure the timestamp is different on the 2 files?
>
> musachy
>
> On Wed, Jul 29, 2009 at 1:12 PM, Musachy Barroso<mu...@gmail.com> wrote:
>> Let me try with relative paths.
>>
>> musachy
>>
>> On Wed, Jul 29, 2009 at 1:02 PM, Dale Newfield<da...@newfield.org> wrote:
>>> Musachy Barroso wrote:
>>>>
>>>> touche :). The FAM starts a thread that watches the dir, so it will
>>>> callback ClassReloadingXMLWebApplicationContext.onFileChange as soon
>>>> as a file is changed(set a breakpoint there and see if it is stopping,
>>>> there is also a log statement there).
>>>
>>> I included a log message generated from there in my previous post.  It does
>>> get called as soon as the spring context is set up, but never again.
>>>
>>>> Are you using relative or absolute paths for
>>>> struts.class.reloading.watchList? I haven't tested relative paths yet.
>>>
>>> I'm using relative paths.  I've been trying to test changes to my app by
>>> just copying the new .class file over the old one, but it doesn't seem to
>>> get noticed.
>>>
>>> -Dale
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
"It works for me" (is that a trademark already?). My config is like:

<constant name="struts.class.reloading.watchList"
value="WEB-INF/classes/com/company" />
<constant name="struts.class.reloading.acceptClasses"
value="com\.company\.sandbox\.actions.*" />
<constant name="struts.convention.classes.reload" value="true" />

When I touch a file under that dir, I get:

 DEBUG org.apache.struts2.spring.ClassReloadingXMLWebApplicationContext
 - Change detected in file
[/mumble/WEB-INF/classes/com/company/MyAction.class], reloading class
loader

Are you sure the timestamp is different on the 2 files?

musachy

On Wed, Jul 29, 2009 at 1:12 PM, Musachy Barroso<mu...@gmail.com> wrote:
> Let me try with relative paths.
>
> musachy
>
> On Wed, Jul 29, 2009 at 1:02 PM, Dale Newfield<da...@newfield.org> wrote:
>> Musachy Barroso wrote:
>>>
>>> touche :). The FAM starts a thread that watches the dir, so it will
>>> callback ClassReloadingXMLWebApplicationContext.onFileChange as soon
>>> as a file is changed(set a breakpoint there and see if it is stopping,
>>> there is also a log statement there).
>>
>> I included a log message generated from there in my previous post.  It does
>> get called as soon as the spring context is set up, but never again.
>>
>>> Are you using relative or absolute paths for
>>> struts.class.reloading.watchList? I haven't tested relative paths yet.
>>
>> I'm using relative paths.  I've been trying to test changes to my app by
>> just copying the new .class file over the old one, but it doesn't seem to
>> get noticed.
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
Let me try with relative paths.

musachy

On Wed, Jul 29, 2009 at 1:02 PM, Dale Newfield<da...@newfield.org> wrote:
> Musachy Barroso wrote:
>>
>> touche :). The FAM starts a thread that watches the dir, so it will
>> callback ClassReloadingXMLWebApplicationContext.onFileChange as soon
>> as a file is changed(set a breakpoint there and see if it is stopping,
>> there is also a log statement there).
>
> I included a log message generated from there in my previous post.  It does
> get called as soon as the spring context is set up, but never again.
>
>> Are you using relative or absolute paths for
>> struts.class.reloading.watchList? I haven't tested relative paths yet.
>
> I'm using relative paths.  I've been trying to test changes to my app by
> just copying the new .class file over the old one, but it doesn't seem to
> get noticed.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> touche :). The FAM starts a thread that watches the dir, so it will
> callback ClassReloadingXMLWebApplicationContext.onFileChange as soon
> as a file is changed(set a breakpoint there and see if it is stopping,
> there is also a log statement there).

I included a log message generated from there in my previous post.  It 
does get called as soon as the spring context is set up, but never again.

> Are you using relative or absolute paths for
> struts.class.reloading.watchList? I haven't tested relative paths yet.

I'm using relative paths.  I've been trying to test changes to my app by 
just copying the new .class file over the old one, but it doesn't seem 
to get noticed.

-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
touche :). The FAM starts a thread that watches the dir, so it will
callback ClassReloadingXMLWebApplicationContext.onFileChange as soon
as a file is changed(set a breakpoint there and see if it is stopping,
there is also a log statement there).

 Are you using relative or absolute paths for
struts.class.reloading.watchList? I haven't tested relative paths yet.

musachy

On Wed, Jul 29, 2009 at 12:46 PM, Dale Newfield<da...@newfield.org> wrote:
> Musachy Barroso wrote:
>>
>> I am, I am using it with convention and spring.
>
> Of course I meant anyone other than you -- I assumed you had it working, or
> you wouldn't have checked it in :-)
>
>> if you touch the files, do you see any message about detecting a change?
>
> No.  Should that detection/reload happen even if there are currently no
> active requests, or will it only notice when the next request comes in?
>  (No, in my case it doesn't notice then, either.)
>
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> I am, I am using it with convention and spring.

Of course I meant anyone other than you -- I assumed you had it working, 
or you wouldn't have checked it in :-)

> if you touch the files, do you see any message about detecting a change?

No.  Should that detection/reload happen even if there are currently no 
active requests, or will it only notice when the next request comes in? 
  (No, in my case it doesn't notice then, either.)


-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
I am, I am using it with convention and spring.

if you touch the files, do you see any message about detecting a change?

musachy

On Wed, Jul 29, 2009 at 11:51 AM, Dale Newfield<da...@newfield.org> wrote:
> Musachy Barroso wrote:
>>
>> I added "struts.class.reloading.acceptClasses", so now I can make the
>> reloading class loader handle only action classes, so I don't get
>> ClassCastException(s)
>>
>> I also added support for the relative paths, @Dale, take it for a spin
>> and let me know how it works.
>
> I don't think I've yet managed to see this work :-(
>
> Initializing Struts-Spring integration...
>
>> Watching
>>
>> [/<CORRECT_PATH_TO_DEPLOYED_APP>/WEB-INF/classes/com/<MUMBLE>/webapp/action]
>> for changes
>>
>> Class reloading is enabled. Make sure this is not used on a
>> production environment!
>>
>> Change detected in file
>>
>> [/<CORRECT_PATH_TO_DEPLOYED_APP>/WEB-INF/classes/com/<MUMBLE>/webapp/action],
>> reloading class loader
>
> It detects a change right out of the gate, but never appears to do so
> again...
>
> ...have others successfully tested this new functionality?
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> I added "struts.class.reloading.acceptClasses", so now I can make the
> reloading class loader handle only action classes, so I don't get
> ClassCastException(s)
> 
> I also added support for the relative paths, @Dale, take it for a spin
> and let me know how it works.

I don't think I've yet managed to see this work :-(

Initializing Struts-Spring integration...

> Watching
> [/<CORRECT_PATH_TO_DEPLOYED_APP>/WEB-INF/classes/com/<MUMBLE>/webapp/action]
> for changes
> 
> Class reloading is enabled. Make sure this is not used on a
> production environment!
> 
> Change detected in file
> [/<CORRECT_PATH_TO_DEPLOYED_APP>/WEB-INF/classes/com/<MUMBLE>/webapp/action],
> reloading class loader

It detects a change right out of the gate, but never appears to do so 
again...

...have others successfully tested this new functionality?

-Dale

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
>Dale, take it for a spin and let me know how it works.

Sorry I've been banging my head against JNI stuff and not working on the 
web side of my current application lately, so I've not yet gotten a 
chance to test any of this...

-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
this now works with the convention plugin(it didn't before)

musachy

On Mon, Jul 13, 2009 at 10:47 AM, Musachy Barroso<mu...@gmail.com> wrote:
> I added "struts.class.reloading.acceptClasses", so now I can make the
> reloading class loader handle only action classes, so I don't get
> ClassCastException(s)
>
> I also added support for the relative paths, @Dale, take it for a spin
> and let me know how it works.
>
> musachy
>
> On Mon, Jul 13, 2009 at 9:29 AM, Musachy Barroso<mu...@gmail.com> wrote:
>> I am thinking about adding another constant which holds a list of
>> regex, which if set, will limit what classes can be loaded by the
>> reloading classloader. The reason for this, is that I would like to
>> limit the reloaded classes to just my actions. If the reloading class
>> loader loads something that is not an action, there is a good chance
>> that instance of that class will be casted to the same class loaded by
>> the original class loader, which fails with a class cast exception.
>>
>> musachy
>>
>> On Mon, Jul 13, 2009 at 7:10 AM, Dale Newfield<da...@newfield.org> wrote:
>>> Musachy Barroso wrote:
>>>>
>>>> I could test the path as an absolute path, if it exist, use it,
>>>> otherwise try it as a relative path to context root, sounds good?
>>>
>>> Almost.  The File interface can tell you whether or not a given instance
>>> (path) isAbsolute().  Clearly if the (absolute or relative) file does not
>>> exist it should not be loaded, but existence shouldn't help you decide which
>>> way to interpret the path.
>>>
>>> This does bring up the question:  If the given (.class or .jar) file does
>>> not exist at deployment time, will creation of it/changes to it later
>>> trigger reloading?  Either way, just to avoid confusion that bit of info
>>> should be added to the documentation.  (Hrm--looking at
>>> FilesystemAlterationListener and ClassReloadingXMLWebApplicationContext
>>> suggests that if the file exists at deployment time we should notice in
>>> onFileChange as you currently do, but if it did not exist (and we want to
>>> support later adding of classes/jars) we could be paying attention to
>>> onFileCreate/onDirectoryCreate events, too.)
>>>
>>> Oh, and once again:  Musachy++
>>>
>>> Lately it seems like Struts is improving more due to the heroic effort of a
>>> few individuals than as a result of a community effort.  (I have a feeling
>>> that this has fairly consistently been the case throughout the lifetime of
>>> struts v1 and v2.)  I'm happy that struts is improving, so I'm not trying to
>>> discourage heroic effort, but I'm wondering if anyone has any suggestions
>>> for how to get more involvement?
>>>
>>> -Dale
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
I added "struts.class.reloading.acceptClasses", so now I can make the
reloading class loader handle only action classes, so I don't get
ClassCastException(s)

I also added support for the relative paths, @Dale, take it for a spin
and let me know how it works.

musachy

On Mon, Jul 13, 2009 at 9:29 AM, Musachy Barroso<mu...@gmail.com> wrote:
> I am thinking about adding another constant which holds a list of
> regex, which if set, will limit what classes can be loaded by the
> reloading classloader. The reason for this, is that I would like to
> limit the reloaded classes to just my actions. If the reloading class
> loader loads something that is not an action, there is a good chance
> that instance of that class will be casted to the same class loaded by
> the original class loader, which fails with a class cast exception.
>
> musachy
>
> On Mon, Jul 13, 2009 at 7:10 AM, Dale Newfield<da...@newfield.org> wrote:
>> Musachy Barroso wrote:
>>>
>>> I could test the path as an absolute path, if it exist, use it,
>>> otherwise try it as a relative path to context root, sounds good?
>>
>> Almost.  The File interface can tell you whether or not a given instance
>> (path) isAbsolute().  Clearly if the (absolute or relative) file does not
>> exist it should not be loaded, but existence shouldn't help you decide which
>> way to interpret the path.
>>
>> This does bring up the question:  If the given (.class or .jar) file does
>> not exist at deployment time, will creation of it/changes to it later
>> trigger reloading?  Either way, just to avoid confusion that bit of info
>> should be added to the documentation.  (Hrm--looking at
>> FilesystemAlterationListener and ClassReloadingXMLWebApplicationContext
>> suggests that if the file exists at deployment time we should notice in
>> onFileChange as you currently do, but if it did not exist (and we want to
>> support later adding of classes/jars) we could be paying attention to
>> onFileCreate/onDirectoryCreate events, too.)
>>
>> Oh, and once again:  Musachy++
>>
>> Lately it seems like Struts is improving more due to the heroic effort of a
>> few individuals than as a result of a community effort.  (I have a feeling
>> that this has fairly consistently been the case throughout the lifetime of
>> struts v1 and v2.)  I'm happy that struts is improving, so I'm not trying to
>> discourage heroic effort, but I'm wondering if anyone has any suggestions
>> for how to get more involvement?
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
I am thinking about adding another constant which holds a list of
regex, which if set, will limit what classes can be loaded by the
reloading classloader. The reason for this, is that I would like to
limit the reloaded classes to just my actions. If the reloading class
loader loads something that is not an action, there is a good chance
that instance of that class will be casted to the same class loaded by
the original class loader, which fails with a class cast exception.

musachy

On Mon, Jul 13, 2009 at 7:10 AM, Dale Newfield<da...@newfield.org> wrote:
> Musachy Barroso wrote:
>>
>> I could test the path as an absolute path, if it exist, use it,
>> otherwise try it as a relative path to context root, sounds good?
>
> Almost.  The File interface can tell you whether or not a given instance
> (path) isAbsolute().  Clearly if the (absolute or relative) file does not
> exist it should not be loaded, but existence shouldn't help you decide which
> way to interpret the path.
>
> This does bring up the question:  If the given (.class or .jar) file does
> not exist at deployment time, will creation of it/changes to it later
> trigger reloading?  Either way, just to avoid confusion that bit of info
> should be added to the documentation.  (Hrm--looking at
> FilesystemAlterationListener and ClassReloadingXMLWebApplicationContext
> suggests that if the file exists at deployment time we should notice in
> onFileChange as you currently do, but if it did not exist (and we want to
> support later adding of classes/jars) we could be paying attention to
> onFileCreate/onDirectoryCreate events, too.)
>
> Oh, and once again:  Musachy++
>
> Lately it seems like Struts is improving more due to the heroic effort of a
> few individuals than as a result of a community effort.  (I have a feeling
> that this has fairly consistently been the case throughout the lifetime of
> struts v1 and v2.)  I'm happy that struts is improving, so I'm not trying to
> discourage heroic effort, but I'm wondering if anyone has any suggestions
> for how to get more involvement?
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
On Mon, Jul 13, 2009 at 9:16 AM, Wes Wannemacher<we...@wantii.com> wrote:
> And
> no, Musachy doesn't sleep.

well in fact, I sleep walk almost every night, so yeah I don't sleep much :)

musachy
-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Wes Wannemacher <we...@wantii.com>.
On Mon, Jul 13, 2009 at 12:10 PM, Lukasz
Lenart<lu...@googlemail.com> wrote:
> 2009/7/13 Dale Newfield <da...@newfield.org>:
>> Lately it seems like Struts is improving more due to the heroic effort of a
>> few individuals than as a result of a community effort.  (I have a feeling
>> that this has fairly consistently been the case throughout the lifetime of
>> struts v1 and v2.)  I'm happy that struts is improving, so I'm not trying to
>> discourage heroic effort, but I'm wondering if anyone has any suggestions
>> for how to get more involvement?
>
> I'm trying to follow as I can, but looks like musachy never sleeps ;-)
> The hardest thing for me is to really understand dependencies and
> connections between classes - in Struts and / with Struts. Also
> dependency injection in Xwork is very misleading, I'm trying to walk
> around and figure out, but it's a pain in the neck ;-)
>
>

Don't worry Lukasz, it just takes time. It is very confusing, but you
get the hang of it after you've had to mess with it for a while. The
nice thing about it is that it is very simple compared to Spring. And
no, Musachy doesn't sleep.

-Wes

-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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


Re: Class reloading

Posted by Lukasz Lenart <lu...@googlemail.com>.
2009/7/13 Dale Newfield <da...@newfield.org>:
> Lately it seems like Struts is improving more due to the heroic effort of a
> few individuals than as a result of a community effort.  (I have a feeling
> that this has fairly consistently been the case throughout the lifetime of
> struts v1 and v2.)  I'm happy that struts is improving, so I'm not trying to
> discourage heroic effort, but I'm wondering if anyone has any suggestions
> for how to get more involvement?

I'm trying to follow as I can, but looks like musachy never sleeps ;-)
The hardest thing for me is to really understand dependencies and
connections between classes - in Struts and / with Struts. Also
dependency injection in Xwork is very misleading, I'm trying to walk
around and figure out, but it's a pain in the neck ;-)


Regards
-- 
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/

Timothy Leary  - "Women who seek to be equal with men lack ambition."
- http://www.brainyquote.com/quotes/authors/t/timothy_leary.html

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
On Mon, Jul 13, 2009 at 7:10 AM, Dale Newfield<da...@newfield.org> wrote:
> Almost.  The File interface can tell you whether or not a given instance
> (path) isAbsolute().  Clearly if the (absolute or relative) file does not
> exist it should not be loaded, but existence shouldn't help you decide which
> way to interpret the path.

yes, of course I knew that! (I had never seen that method before lol)

musachy
-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> I could test the path as an absolute path, if it exist, use it,
> otherwise try it as a relative path to context root, sounds good?

Almost.  The File interface can tell you whether or not a given instance 
(path) isAbsolute().  Clearly if the (absolute or relative) file does 
not exist it should not be loaded, but existence shouldn't help you 
decide which way to interpret the path.

This does bring up the question:  If the given (.class or .jar) file 
does not exist at deployment time, will creation of it/changes to it 
later trigger reloading?  Either way, just to avoid confusion that bit 
of info should be added to the documentation.  (Hrm--looking at 
FilesystemAlterationListener and ClassReloadingXMLWebApplicationContext 
suggests that if the file exists at deployment time we should notice in 
onFileChange as you currently do, but if it did not exist (and we want 
to support later adding of classes/jars) we could be paying attention to 
onFileCreate/onDirectoryCreate events, too.)

Oh, and once again:  Musachy++

Lately it seems like Struts is improving more due to the heroic effort 
of a few individuals than as a result of a community effort.  (I have a 
feeling that this has fairly consistently been the case throughout the 
lifetime of struts v1 and v2.)  I'm happy that struts is improving, so 
I'm not trying to discourage heroic effort, but I'm wondering if anyone 
has any suggestions for how to get more involvement?

-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
hum, that is a good point, I would still need to support absolute
paths, as I want to point it to my eclipse output dir, and just
recompile from eclipse and get my changes picked up. I could test the
path as an absolute path, if it exist, use it, otherwise try it as a
relative path to context root, sounds good?

musachy

On Sun, Jul 12, 2009 at 9:31 PM, Dale Newfield<da...@newfield.org> wrote:
> Does that have to be absolutely absolute?  Meaning this must know the
> deployment directory?  Any way to make relative paths be relative to the
> context root, so you can just add 'WEB-INF/classes' without knowing the
> deployment path?  (Sorry to nit pick, I'm excited about this, just trying to
> make it easy to use, too :-).



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> Ok I committed my changes to the spring plugin,

Now I'm looking forward even more to 2.1.8 :-)

>  * Set "struts.class.reloading.watchList" to a comma separated list of
> directories, or jar files (absolute paths)

Does that have to be absolutely absolute?  Meaning this must know the 
deployment directory?  Any way to make relative paths be relative to the 
context root, so you can just add 'WEB-INF/classes' without knowing the 
deployment path?  (Sorry to nit pick, I'm excited about this, just 
trying to make it easy to use, too :-).

-Dale

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
Ok I committed my changes to the spring plugin,

jira ticket: https://issues.apache.org/struts/browse/WW-3183
docs: http://cwiki.apache.org/confluence/display/WW/Spring+Plugin

here is what you need to do to enable this:

 * Set "struts.devMode" to "true"
 * Set "struts.class.reloading.watchList" to a comma separated list of
directories, or jar files (absolute paths)
 * Add this to web.xml:

        <context-param>
             <param-name>contextClass</param-name>
             <param-value>org.apache.struts2.spring.ClassReloadingXMLWebApplicationContext</param-value>
         </context-param>

 * Add Apache Commons JCI FAM to the classpath. If you are using
maven, add this to pom.xml:

       <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-jci-fam</artifactId>
            <version>1.0</version>
        </dependency>

I have to say that I love being able to just recompile my changes and
not having to reload the container (yes, yes I know about javarebel).

musachy


On Sun, Jul 12, 2009 at 12:10 AM, Musachy Barroso<mu...@gmail.com> wrote:
> actually this is easier said than done, I will need some creative way
> to let my spring class (which extends XmlWebApplicationContext) if we
> are in devMode or not. Any ideas?
>
> musachy
>
> On Sat, Jul 11, 2009 at 7:25 PM, Musachy Barroso<mu...@gmail.com> wrote:
>> On Sat, Jul 11, 2009 at 7:16 PM, Dale Newfield<da...@newfield.org> wrote:
>>> That seems great, but something that should only kick in if devMode is true.
>>>  Is that possible?
>>
>> yeah, I kinda forgot that part :)
>>
>> musachy
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
actually this is easier said than done, I will need some creative way
to let my spring class (which extends XmlWebApplicationContext) if we
are in devMode or not. Any ideas?

musachy

On Sat, Jul 11, 2009 at 7:25 PM, Musachy Barroso<mu...@gmail.com> wrote:
> On Sat, Jul 11, 2009 at 7:16 PM, Dale Newfield<da...@newfield.org> wrote:
>> That seems great, but something that should only kick in if devMode is true.
>>  Is that possible?
>
> yeah, I kinda forgot that part :)
>
> musachy
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Musachy Barroso <mu...@gmail.com>.
On Sat, Jul 11, 2009 at 7:16 PM, Dale Newfield<da...@newfield.org> wrote:
> That seems great, but something that should only kick in if devMode is true.
>  Is that possible?

yeah, I kinda forgot that part :)

musachy

-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Class reloading

Posted by Dale Newfield <da...@newfield.org>.
Musachy Barroso wrote:
> I get my action classes reloaded after compilation, from jar files
> and normal dirs.  If anyone is interested I could add this to the
> Spring plugin

That seems great, but something that should only kick in if devMode is 
true.  Is that possible?

-Dale

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