You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Steve Eynon <st...@alienfactory.co.uk> on 2011/09/14 14:50:54 UTC

[T5.3-beta-6] Not Ready For Production!

This is neat,

Application startup blows up with a Service Override recursion
exception when IOC fails to resolve 'SymbolConstants.PRODUCTION_MODE'
for the TapestryModule.productionModeOverrides() method!

public static void productionModeOverrides(
    MappedConfiguration<Class, Object> configuration,
    @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode)

I came across this little gotcha in T5.1 have been using the following
method ever since.

private static boolean inProductionMode() {
	// can't inject ProdMode Symbol for if it's not defined... service
recursion error!
	return !"false".equalsIgnoreCase(System.getProperty("tapestry.production-mode",
"true"));
}

That or you need to set a true / false value for the System Property
"tapestry.production-mode" in your web / app server.

Steve.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Steve Eynon <st...@alienfactory.co.uk>.
> the post title "beta not ready for production"

I know, that's why I wrote it - it's like double irony!

I understand why the exception was thrown - it just threw me off guard
as it only happened when I set Prod Mode to true (it's been working
fine for months with Prod Mode equal to false.) I thought perhaps a
test case had been missed when Prod Mode wasn't set at all, because
that is when I had seen the error before. But nope, it was... just me!

And darn it - I can't stand those people who raise false alarms!

Steve.

On 15 September 2011 02:00, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> I was laughing about the similarity with a different thread asking whether tapestry is ready for production.   That was funny as he'll.
>
> On Sep 14, 2011, at 1:46 PM, derkoe <ta...@gmail.com> wrote:
>
>> What you try doesn't work in 5.2.6 either (and I think it didn't work in any
>> Tapestry version before). This results in: "Construction of service
>> 'ApplicationDefaults' has failed due to recursion: the service depends on
>> itself in some way".
>>
>> This is quite logical since the SymbolSource needs the contribution to
>> ApplicationDefaults (since this is where symbols are added) - so you can't
>> refer to symbols when changing symbols (apart from using expansions
>> referencing other symbols). Otherwise you could change production-mode while
>> referencing it.
>>
>> --
>> Chris
>>
>> PS: I think Lenny was laughing about the post title "beta not ready for
>> production" (that's why it's a beta).
>>
>>
>> Steve Eynon wrote:
>>>
>>> Yep, looks like you can't inject SymbolSource into your
>>> ApplicationDefaults contribution method when ProdMode is set to true;
>>> bit of a pain because I was using it to extract my webapp version for
>>> setting as the tapestry.app-version.
>>>
>>> I'm not entirely happy with the contribution dependency tree changing
>>> when changing such an obvious flag - I'm sure others will run into the
>>> same issue, and probably just as they're going live too!
>>>
>>> Still, as Lenny says, it was bloody funny!
>>>
>>> Cheers,
>>>
>>> Steve.
>>>
>>
>>
>> --
>> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-beta-6-Not-Ready-For-Production-tp4802640p4803728.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I was laughing about the similarity with a different thread asking whether tapestry is ready for production.   That was funny as he'll. 

On Sep 14, 2011, at 1:46 PM, derkoe <ta...@gmail.com> wrote:

> What you try doesn't work in 5.2.6 either (and I think it didn't work in any
> Tapestry version before). This results in: "Construction of service
> 'ApplicationDefaults' has failed due to recursion: the service depends on
> itself in some way". 
> 
> This is quite logical since the SymbolSource needs the contribution to
> ApplicationDefaults (since this is where symbols are added) - so you can't
> refer to symbols when changing symbols (apart from using expansions
> referencing other symbols). Otherwise you could change production-mode while
> referencing it.
> 
> -- 
> Chris 
> 
> PS: I think Lenny was laughing about the post title "beta not ready for
> production" (that's why it's a beta).
> 
> 
> Steve Eynon wrote:
>> 
>> Yep, looks like you can't inject SymbolSource into your
>> ApplicationDefaults contribution method when ProdMode is set to true;
>> bit of a pain because I was using it to extract my webapp version for
>> setting as the tapestry.app-version.
>> 
>> I'm not entirely happy with the contribution dependency tree changing
>> when changing such an obvious flag - I'm sure others will run into the
>> same issue, and probably just as they're going live too!
>> 
>> Still, as Lenny says, it was bloody funny!
>> 
>> Cheers,
>> 
>> Steve.
>> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-beta-6-Not-Ready-For-Production-tp4802640p4803728.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by derkoe <ta...@gmail.com>.
What you try doesn't work in 5.2.6 either (and I think it didn't work in any
Tapestry version before). This results in: "Construction of service
'ApplicationDefaults' has failed due to recursion: the service depends on
itself in some way". 

This is quite logical since the SymbolSource needs the contribution to
ApplicationDefaults (since this is where symbols are added) - so you can't
refer to symbols when changing symbols (apart from using expansions
referencing other symbols). Otherwise you could change production-mode while
referencing it.

-- 
Chris 

PS: I think Lenny was laughing about the post title "beta not ready for
production" (that's why it's a beta).


Steve Eynon wrote:
> 
> Yep, looks like you can't inject SymbolSource into your
> ApplicationDefaults contribution method when ProdMode is set to true;
> bit of a pain because I was using it to extract my webapp version for
> setting as the tapestry.app-version.
> 
> I'm not entirely happy with the contribution dependency tree changing
> when changing such an obvious flag - I'm sure others will run into the
> same issue, and probably just as they're going live too!
> 
> Still, as Lenny says, it was bloody funny!
> 
> Cheers,
> 
> Steve.
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-beta-6-Not-Ready-For-Production-tp4802640p4803728.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Howard Lewis Ship <hl...@gmail.com>.
Nice trick ... I wonder what the Gradle equivalent is.  We may be
doing it the hard way right now.

On Thu, Sep 15, 2011 at 10:50 AM, Martin Strand
<do...@gmail.com> wrote:
> On Wed, 14 Sep 2011 15:57:11 +0200, Steve Eynon
> <st...@alienfactory.co.uk> wrote:
>
>> Yep, looks like you can't inject SymbolSource into your
>> ApplicationDefaults contribution method when ProdMode is set to true;
>> bit of a pain because I was using it to extract my webapp version for
>> setting as the tapestry.app-version.
>
>
> As a side note, an easy way to automatically set the version number is to
> read it from the jar's manifest:
>
> contributeApplicationDefaults(...)
> {
>
>  String version = YourModule.class.getPackage().getImplementationVersion();
>  if (version != null)
>  {
>    configuration.add(SymbolConstants.APPLICATION_VERSION, version);
>  }
>
>
>
> With Maven, use addDefaultImplementationEntries to add version info to the
> manifest:
>
> <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>  <artifactId>maven-jar-plugin</artifactId>
>  <configuration>
>    <archiveClasses>true</archiveClasses>
>    <archive>
>      <manifest>
>
>  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Martin Strand <do...@gmail.com>.
On Wed, 14 Sep 2011 15:57:11 +0200, Steve Eynon  
<st...@alienfactory.co.uk> wrote:

> Yep, looks like you can't inject SymbolSource into your
> ApplicationDefaults contribution method when ProdMode is set to true;
> bit of a pain because I was using it to extract my webapp version for
> setting as the tapestry.app-version.


As a side note, an easy way to automatically set the version number is to  
read it from the jar's manifest:

contributeApplicationDefaults(...)
{

   String version =  
YourModule.class.getPackage().getImplementationVersion();
   if (version != null)
   {
     configuration.add(SymbolConstants.APPLICATION_VERSION, version);
   }



With Maven, use addDefaultImplementationEntries to add version info to the  
manifest:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-jar-plugin</artifactId>
   <configuration>
     <archiveClasses>true</archiveClasses>
     <archive>
       <manifest>
         <addDefaultImplementationEntries>true</addDefaultImplementationEntries>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Yep, looks like you can't inject SymbolSource into your
ApplicationDefaults contribution method when ProdMode is set to true;
bit of a pain because I was using it to extract my webapp version for
setting as the tapestry.app-version.

I'm not entirely happy with the contribution dependency tree changing
when changing such an obvious flag - I'm sure others will run into the
same issue, and probably just as they're going live too!

Still, as Lenny says, it was bloody funny!

Cheers,

Steve.



On 14 September 2011 21:17, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> Not for nothing, but this post got me rolling on the floor!!!
>
> On Sep 14, 2011, at 9:06 AM, Steve Eynon wrote:
>
>> An addendum,
>>
>> It seems to be whenever "SymbolConstants.PRODUCTION_MODE" resolves to true.
>>
>> Hmm, I'd be very surprised if the T5 crew let something this obvious
>> slip through the net so I'll double check my configuration and Symbol
>> contributions just to make sure...
>>
>> Still, I love the way it blows up when ProdMode is set to true! The
>> irony puts a smile on my face!
>>
>> Steve.
>>
>> On 14 September 2011 20:50, Steve Eynon <st...@alienfactory.co.uk> wrote:
>>> This is neat,
>>>
>>> Application startup blows up with a Service Override recursion
>>> exception when IOC fails to resolve 'SymbolConstants.PRODUCTION_MODE'
>>> for the TapestryModule.productionModeOverrides() method!
>>>
>>> public static void productionModeOverrides(
>>>    MappedConfiguration<Class, Object> configuration,
>>>    @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode)
>>>
>>> I came across this little gotcha in T5.1 have been using the following
>>> method ever since.
>>>
>>> private static boolean inProductionMode() {
>>>        // can't inject ProdMode Symbol for if it's not defined... service
>>> recursion error!
>>>        return !"false".equalsIgnoreCase(System.getProperty("tapestry.production-mode",
>>> "true"));
>>> }
>>>
>>> That or you need to set a true / false value for the System Property
>>> "tapestry.production-mode" in your web / app server.
>>>
>>> Steve.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Not for nothing, but this post got me rolling on the floor!!!

On Sep 14, 2011, at 9:06 AM, Steve Eynon wrote:

> An addendum,
> 
> It seems to be whenever "SymbolConstants.PRODUCTION_MODE" resolves to true.
> 
> Hmm, I'd be very surprised if the T5 crew let something this obvious
> slip through the net so I'll double check my configuration and Symbol
> contributions just to make sure...
> 
> Still, I love the way it blows up when ProdMode is set to true! The
> irony puts a smile on my face!
> 
> Steve.
> 
> On 14 September 2011 20:50, Steve Eynon <st...@alienfactory.co.uk> wrote:
>> This is neat,
>> 
>> Application startup blows up with a Service Override recursion
>> exception when IOC fails to resolve 'SymbolConstants.PRODUCTION_MODE'
>> for the TapestryModule.productionModeOverrides() method!
>> 
>> public static void productionModeOverrides(
>>    MappedConfiguration<Class, Object> configuration,
>>    @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode)
>> 
>> I came across this little gotcha in T5.1 have been using the following
>> method ever since.
>> 
>> private static boolean inProductionMode() {
>>        // can't inject ProdMode Symbol for if it's not defined... service
>> recursion error!
>>        return !"false".equalsIgnoreCase(System.getProperty("tapestry.production-mode",
>> "true"));
>> }
>> 
>> That or you need to set a true / false value for the System Property
>> "tapestry.production-mode" in your web / app server.
>> 
>> Steve.
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Steve Eynon <st...@alienfactory.co.uk>.
An addendum,

It seems to be whenever "SymbolConstants.PRODUCTION_MODE" resolves to true.

Hmm, I'd be very surprised if the T5 crew let something this obvious
slip through the net so I'll double check my configuration and Symbol
contributions just to make sure...

Still, I love the way it blows up when ProdMode is set to true! The
irony puts a smile on my face!

Steve.

On 14 September 2011 20:50, Steve Eynon <st...@alienfactory.co.uk> wrote:
> This is neat,
>
> Application startup blows up with a Service Override recursion
> exception when IOC fails to resolve 'SymbolConstants.PRODUCTION_MODE'
> for the TapestryModule.productionModeOverrides() method!
>
> public static void productionModeOverrides(
>    MappedConfiguration<Class, Object> configuration,
>    @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode)
>
> I came across this little gotcha in T5.1 have been using the following
> method ever since.
>
> private static boolean inProductionMode() {
>        // can't inject ProdMode Symbol for if it's not defined... service
> recursion error!
>        return !"false".equalsIgnoreCase(System.getProperty("tapestry.production-mode",
> "true"));
> }
>
> That or you need to set a true / false value for the System Property
> "tapestry.production-mode" in your web / app server.
>
> Steve.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Hiya,

Cheers. As mentioned, it is caused by injecting the SymbolSource
service into the contributeApplicationDefaults() method of the Module
class.

Steve.

On 14 September 2011 23:11, Howard Lewis Ship <hl...@gmail.com> wrote:
> Just tested this ... apps run fine in production mode.  Something you
> are contributing somewhere must be the problem.  Please check your
> console for its operation trace, that should provide some insight into
> how you got yourself into a recursive service construction situation.
>
> On Wed, Sep 14, 2011 at 5:50 AM, Steve Eynon
> <st...@alienfactory.co.uk> wrote:
>> This is neat,
>>
>> Application startup blows up with a Service Override recursion
>> exception when IOC fails to resolve 'SymbolConstants.PRODUCTION_MODE'
>> for the TapestryModule.productionModeOverrides() method!
>>
>> public static void productionModeOverrides(
>>    MappedConfiguration<Class, Object> configuration,
>>    @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode)
>>
>> I came across this little gotcha in T5.1 have been using the following
>> method ever since.
>>
>> private static boolean inProductionMode() {
>>        // can't inject ProdMode Symbol for if it's not defined... service
>> recursion error!
>>        return !"false".equalsIgnoreCase(System.getProperty("tapestry.production-mode",
>> "true"));
>> }
>>
>> That or you need to set a true / false value for the System Property
>> "tapestry.production-mode" in your web / app server.
>>
>> Steve.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5.3-beta-6] Not Ready For Production!

Posted by Howard Lewis Ship <hl...@gmail.com>.
Just tested this ... apps run fine in production mode.  Something you
are contributing somewhere must be the problem.  Please check your
console for its operation trace, that should provide some insight into
how you got yourself into a recursive service construction situation.

On Wed, Sep 14, 2011 at 5:50 AM, Steve Eynon
<st...@alienfactory.co.uk> wrote:
> This is neat,
>
> Application startup blows up with a Service Override recursion
> exception when IOC fails to resolve 'SymbolConstants.PRODUCTION_MODE'
> for the TapestryModule.productionModeOverrides() method!
>
> public static void productionModeOverrides(
>    MappedConfiguration<Class, Object> configuration,
>    @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode)
>
> I came across this little gotcha in T5.1 have been using the following
> method ever since.
>
> private static boolean inProductionMode() {
>        // can't inject ProdMode Symbol for if it's not defined... service
> recursion error!
>        return !"false".equalsIgnoreCase(System.getProperty("tapestry.production-mode",
> "true"));
> }
>
> That or you need to set a true / false value for the System Property
> "tapestry.production-mode" in your web / app server.
>
> Steve.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org