You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dmitry Gusev <dm...@gmail.com> on 2015/07/28 11:09:46 UTC

Running tapestry app using embedded container in production

Hello,

Do you run tapestry apps in embedded container in production?

If yes, how do you configure embedded container (ports, SSL, valves, etc.)?

Maybe there's some tapestry integration that configures tomcat instance
using tapestry-ioc and symbols?

-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Running tapestry app using embedded container in production

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 28 Jul 2015 08:21:30 -0300, Dmitry Gusev <dm...@gmail.com>  
wrote:

> This is exactly how we do it currently with standalone tomcat, with one
> difference -- we implemented our own symbol resolution strategy to get
> symbols from an external file, instead of passing them all through  
> command line.

The company I work for does that as well.

> I was just curios if somebody created some tapestry module with  
> predefined set of tapestry symbols that would start & configure  
> container for us.
> This way we could still be able to override some symbols when needed as  
> we usually do in tapestry.

A friend and workmate wrote this:  
https://github.com/cakeface/tapestry-fat-jar.

"This is an exploratory project where I tested out running Tapestry 5  
using an embedded in a fat jar style packaging. The advantages of this  
approach are that you can package your jar and then just execute it on  
your server to get a working web application. There is no need to install  
a servlet container on the system."

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: Running tapestry app using embedded container in production

Posted by Dmitry Gusev <dm...@gmail.com>.
Hi Barry,

we use slf4j/logback passing
"-Dlogback.configurationFile=/path/to/config.xml" to JVM that's picked up
by tomcat
logback.xml sources shared app.properties file to get values for
configuring appenders, smth like this:

http://stackoverflow.com/questions/11105652/how-do-i-make-logback-read-a-properties-file-which-name-is-a-variable

We're using Sentry to collect errors, and file appender for the rest.

Don't know what logging Jenkins uses, but I suspect that you may override
its logging to use slf4j by placing slf4j bridges to shared classpath:
http://www.slf4j.org/legacy.html



On Tue, Jul 28, 2015 at 3:04 PM, Barry Books <tr...@gmail.com> wrote:

> How do you handle logging configuration? At first I used different
> log4j.properties files and specified which one to use on the command line
> but now I often deploy Jenkins in the same Tomcat so I switched to messing
> with the class path to get the right properties file. Neither solution is
> ideal. Anyone come up with anything else?
>
>
>
> On Tuesday, July 28, 2015, Dmitry Gusev <dm...@gmail.com> wrote:
>
> > Got it, thank you.
> >
> > This is exactly how we do it currently with standalone tomcat, with one
> > difference -- we implemented our own symbol resolution strategy to get
> > symbols from an external file, instead of passing them all through
> command
> > line.
> >
> > I was just curios if somebody created some tapestry module with
> predefined
> > set of tapestry symbols that would start & configure container for us.
> > This way we could still be able to override some symbols when needed as
> we
> > usually do in tapestry.
> >
> >
> >
> > On Tue, Jul 28, 2015 at 2:11 PM, Thilo Tanner <thilo.tanner@reprisk.com
> > <javascript:;>>
> > wrote:
> >
> > > Hi Dmitry,
> > >
> > > In our case, yes we hardcode and commit those credentials to our
> > > repositories. In my defense, we host all our code in-house and have
> > various
> > > other security measures in place. Database credentials are normally
> > > different from client host to client host and therefore such
> credentials
> > > are normally useless unless you also have access to this particular
> host.
> > >
> > > If you prefer to set your credentials directly on your host, use
> symbols
> > > (as described in the previous email) and make sure to correctly unset
> the
> > > shell environment variables after application startup. You could do
> > > something like this in your startup script:
> > >
> > > java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD
> -jar
> > > myapp.jar
> > >
> > > where myapp.db.username and myapp.db.password are user-defined T5
> > symbols.
> > >
> > > Using such a strategy, you can avoid committing your credentials.
> > >
> > > Best,
> > > Thilo
> > >
> > > --
> > > Thilo Tanner
> > > Technology Lead
> > >
> > > Direct +41 43 300 54 42
> > > Mobile +41 79 506 46 36
> > > thilo.tanner@reprisk.com <javascript:;>
> > >
> > > RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
> > > Tel. +41 43 300 54 40, Fax +41 43 300 54 46
> > > www.reprisk.com
> > >
> > > Follow us on Facebook or Twitter:
> > > www.facebook.com/RepRisk | www.twitter.com/RepRisk
> > >
> > > If you are not the intended recipient, please notify the sender - thank
> > > you.
> > >
> > >
> > >
> > >
> > >
> > >
> > > Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter <dmitry.gusev@gmail.com
> > <javascript:;>>:
> > >
> > > >Hi Thilo,
> > > >
> > > >So you're hardcoding all your staging/production settings in special
> > > >tapestry modules,
> > > >and committing them to the same source code repository as your app's
> > > >codebase, right?
> > > >
> > > >
> > > >On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <
> thilo.tanner@reprisk.com
> > <javascript:;>>
> > > >wrote:
> > > >
> > > >> Hi Dmitry,
> > > >>
> > > >> To configure our apps, we mainly use what Tapestry offers
> > > out-of-the-box.
> > > >> I recommend to create a dedicated Tapestry module for each of your
> > > >> environments as described here:
> > > >>
> > >
> >
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
> > > >>
> > > >> In such a module, you can override your database settings for
> example.
> > > >>
> > > >> Additional environment modules are then easy to load via command
> line.
> > > For
> > > >> example:
> > > >>
> > > >> java -Dtapestry.execution-mode=staging -jar myapp.war
> > > >>
> > > >> Compared to other injection containers, Tapestry’s IOC has lots of
> > > >> built-in features that will help you configuring your application.
> > > Another
> > > >> concept worth mentioning here are Symbols:
> > > >> http://tapestry.apache.org/symbols.html
> > > >> Symbols can be predefined, but also overridden during application
> > > startup
> > > >> (in fact, tapestry.execution-mode is a built-in T5 symbol used to
> load
> > > >> additional modules during startup)
> > > >>
> > > >> Best,
> > > >> Thilo
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <
> > dmitry.gusev@gmail.com <javascript:;>
> > > >:
> > > >>
> > > >> >Hi Thilo,
> > > >> >
> > > >> >and how in this case you configure your executable JAR?
> > > >> >
> > > >> >Are you using maven profiles & that war file contains all
> > > configuration,
> > > >> >or you create "universal" binary and provide configuration at
> runtime
> > > via
> > > >> >system properties or external .properties file?
> > > >> >
> > > >> >I know this should be pretty easy to code, just wondering if
> there's
> > > >> >anything ready that may be reused without reinventing the wheel.
> > > >> >
> > > >> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <
> > > thilo.tanner@reprisk.com <javascript:;>>
> > > >> >wrote:
> > > >> >
> > > >> >> Hi Dmitry,
> > > >> >>
> > > >> >> Yes, we are running T5.4 apps in production by embedding Undertow
> > > >> (Servlet
> > > >> >> container from Wildfly). With Tapestry, such a setup is
> relatively
> > > easy
> > > >> to
> > > >> >> achieve:
> > > >> >>
> > > >> >> You create an application class that bootstraps the Tapestry
> filter
> > > in
> > > >> >> Undertow:
> > > >> >>
> > > >>
> > >
> >
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
> > > >> >>
> > > >> >> Such a class will allow you to start your T5 app directly from a
> > main
> > > >> >> method (great for development).
> > > >> >>
> > > >> >> For a deployment, you can use the two following Maven plugins to
> > > >> generate
> > > >> >> „executable WAR files“:
> > > >> >>
> > > >> >> maven-war-plugin
> > > >> >> Define the main class in the manifest file (pointing to your
> > > bootstrap
> > > >> >> class above)
> > > >> >>
> > > >> >> spring-boot-maven-plugin
> > > >> >> The plugin will repackage your WAR file to make it executable (by
> > > using
> > > >> >> java -jar myapp.war); WAR files per-se are not directly
> executable.
> > > >> >>
> > > >> >>
> > > >> >> If you’re interested in such a solution, I can post more details
> > > here.
> > > >> >>
> > > >> >> Best regards,
> > > >> >> Thilo
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <
> > > dmitry.gusev@gmail.com <javascript:;>
> > > >> >:
> > > >> >>
> > > >> >> >Hello,
> > > >> >> >
> > > >> >> >Do you run tapestry apps in embedded container in production?
> > > >> >> >
> > > >> >> >If yes, how do you configure embedded container (ports, SSL,
> > valves,
> > > >> >> etc.)?
> > > >> >> >
> > > >> >> >Maybe there's some tapestry integration that configures tomcat
> > > instance
> > > >> >> >using tapestry-ioc and symbols?
> > > >> >> >
> > > >> >> >--
> > > >> >> >Dmitry Gusev
> > > >> >> >
> > > >> >> >AnjLab Team
> > > >> >> >http://anjlab.com
> > > >> >>
> > > >> >
> > > >> >
> > > >> >
> > > >> >--
> > > >> >Dmitry Gusev
> > > >> >
> > > >> >AnjLab Team
> > > >> >http://anjlab.com
> > > >>
> > > >
> > > >
> > > >
> > > >--
> > > >Dmitry Gusev
> > > >
> > > >AnjLab Team
> > > >http://anjlab.com
> > >
> >
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Running tapestry app using embedded container in production

Posted by Barry Books <tr...@gmail.com>.
I did implement an eager loading module a while ago. The nice thing about
that was you could also change the log levels dynamically, but after a
while maintaining it became too much work.

I like the stdout idea. It's simple and I was thinking about moving all my
logging to Apache Kafka so I could combine logs and do some analysis. This
way I can just pipe it to Kafka


Thanks


On Tuesday, July 28, 2015, Thilo Tanner <th...@reprisk.com> wrote:

> Hi Barry,
>
> As an example, we use two different strategies (depending on what we need):
>
> Easy solution:
> Create an executable WAR file and configure a normal console logger which
> writes everything to stdout. From there you pipe the log messages to a file
> of your choice. Something like:
>
> exec $JAVA_HOME/bin/java -jar $JAR >> $LOG 2>&1 &
>
> Less easy solution:
> Create an eager loading logging configuration service which configures the
> logging system according to your needs (for example output to a data
> directory which is configured via a T5 symbol). Logback for example is easy
> to configure programmatically.
>
> Either way, I strongly recommend to use a centralized system to collect
> all your logs (for example ELK), especially if you consider to distribute
> your application.
>
> Best,
> Thilo
>
>
>
>
>
> Am 28.07.15 14:04 schrieb "Barry Books" unter <trsvax@gmail.com
> <javascript:;>>:
>
> >How do you handle logging configuration? At first I used different
> >log4j.properties files and specified which one to use on the command line
> >but now I often deploy Jenkins in the same Tomcat so I switched to messing
> >with the class path to get the right properties file. Neither solution is
> >ideal. Anyone come up with anything else?
> >
> >
> >
> >On Tuesday, July 28, 2015, Dmitry Gusev <dmitry.gusev@gmail.com
> <javascript:;>> wrote:
> >
> >> Got it, thank you.
> >>
> >> This is exactly how we do it currently with standalone tomcat, with one
> >> difference -- we implemented our own symbol resolution strategy to get
> >> symbols from an external file, instead of passing them all through
> command
> >> line.
> >>
> >> I was just curios if somebody created some tapestry module with
> predefined
> >> set of tapestry symbols that would start & configure container for us.
> >> This way we could still be able to override some symbols when needed as
> we
> >> usually do in tapestry.
> >>
> >>
> >>
> >> On Tue, Jul 28, 2015 at 2:11 PM, Thilo Tanner <thilo.tanner@reprisk.com
> <javascript:;>
> >> <javascript:;>>
> >> wrote:
> >>
> >> > Hi Dmitry,
> >> >
> >> > In our case, yes we hardcode and commit those credentials to our
> >> > repositories. In my defense, we host all our code in-house and have
> >> various
> >> > other security measures in place. Database credentials are normally
> >> > different from client host to client host and therefore such
> credentials
> >> > are normally useless unless you also have access to this particular
> host.
> >> >
> >> > If you prefer to set your credentials directly on your host, use
> symbols
> >> > (as described in the previous email) and make sure to correctly unset
> the
> >> > shell environment variables after application startup. You could do
> >> > something like this in your startup script:
> >> >
> >> > java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD
> -jar
> >> > myapp.jar
> >> >
> >> > where myapp.db.username and myapp.db.password are user-defined T5
> >> symbols.
> >> >
> >> > Using such a strategy, you can avoid committing your credentials.
> >> >
> >> > Best,
> >> > Thilo
> >> >
> >> > --
> >> > Thilo Tanner
> >> > Technology Lead
> >> >
> >> > Direct +41 43 300 54 42
> >> > Mobile +41 79 506 46 36
> >> > thilo.tanner@reprisk.com <javascript:;> <javascript:;>
> >> >
> >> > RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
> >> > Tel. +41 43 300 54 40, Fax +41 43 300 54 46
> >> > www.reprisk.com
> >> >
> >> > Follow us on Facebook or Twitter:
> >> > www.facebook.com/RepRisk | www.twitter.com/RepRisk
> >> >
> >> > If you are not the intended recipient, please notify the sender -
> thank
> >> > you.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter <
> dmitry.gusev@gmail.com <javascript:;>
> >> <javascript:;>>:
> >> >
> >> > >Hi Thilo,
> >> > >
> >> > >So you're hardcoding all your staging/production settings in special
> >> > >tapestry modules,
> >> > >and committing them to the same source code repository as your app's
> >> > >codebase, right?
> >> > >
> >> > >
> >> > >On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <
> thilo.tanner@reprisk.com <javascript:;>
> >> <javascript:;>>
> >> > >wrote:
> >> > >
> >> > >> Hi Dmitry,
> >> > >>
> >> > >> To configure our apps, we mainly use what Tapestry offers
> >> > out-of-the-box.
> >> > >> I recommend to create a dedicated Tapestry module for each of your
> >> > >> environments as described here:
> >> > >>
> >> >
> >>
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
> >> > >>
> >> > >> In such a module, you can override your database settings for
> example.
> >> > >>
> >> > >> Additional environment modules are then easy to load via command
> line.
> >> > For
> >> > >> example:
> >> > >>
> >> > >> java -Dtapestry.execution-mode=staging -jar myapp.war
> >> > >>
> >> > >> Compared to other injection containers, Tapestry’s IOC has lots of
> >> > >> built-in features that will help you configuring your application.
> >> > Another
> >> > >> concept worth mentioning here are Symbols:
> >> > >> http://tapestry.apache.org/symbols.html
> >> > >> Symbols can be predefined, but also overridden during application
> >> > startup
> >> > >> (in fact, tapestry.execution-mode is a built-in T5 symbol used to
> load
> >> > >> additional modules during startup)
> >> > >>
> >> > >> Best,
> >> > >> Thilo
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <
> >> dmitry.gusev@gmail.com <javascript:;> <javascript:;>
> >> > >:
> >> > >>
> >> > >> >Hi Thilo,
> >> > >> >
> >> > >> >and how in this case you configure your executable JAR?
> >> > >> >
> >> > >> >Are you using maven profiles & that war file contains all
> >> > configuration,
> >> > >> >or you create "universal" binary and provide configuration at
> runtime
> >> > via
> >> > >> >system properties or external .properties file?
> >> > >> >
> >> > >> >I know this should be pretty easy to code, just wondering if
> there's
> >> > >> >anything ready that may be reused without reinventing the wheel.
> >> > >> >
> >> > >> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <
> >> > thilo.tanner@reprisk.com <javascript:;> <javascript:;>>
> >> > >> >wrote:
> >> > >> >
> >> > >> >> Hi Dmitry,
> >> > >> >>
> >> > >> >> Yes, we are running T5.4 apps in production by embedding
> Undertow
> >> > >> (Servlet
> >> > >> >> container from Wildfly). With Tapestry, such a setup is
> relatively
> >> > easy
> >> > >> to
> >> > >> >> achieve:
> >> > >> >>
> >> > >> >> You create an application class that bootstraps the Tapestry
> filter
> >> > in
> >> > >> >> Undertow:
> >> > >> >>
> >> > >>
> >> >
> >>
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
> >> > >> >>
> >> > >> >> Such a class will allow you to start your T5 app directly from a
> >> main
> >> > >> >> method (great for development).
> >> > >> >>
> >> > >> >> For a deployment, you can use the two following Maven plugins to
> >> > >> generate
> >> > >> >> „executable WAR files“:
> >> > >> >>
> >> > >> >> maven-war-plugin
> >> > >> >> Define the main class in the manifest file (pointing to your
> >> > bootstrap
> >> > >> >> class above)
> >> > >> >>
> >> > >> >> spring-boot-maven-plugin
> >> > >> >> The plugin will repackage your WAR file to make it executable
> (by
> >> > using
> >> > >> >> java -jar myapp.war); WAR files per-se are not directly
> executable.
> >> > >> >>
> >> > >> >>
> >> > >> >> If you’re interested in such a solution, I can post more details
> >> > here.
> >> > >> >>
> >> > >> >> Best regards,
> >> > >> >> Thilo
> >> > >> >>
> >> > >> >>
> >> > >> >>
> >> > >> >>
> >> > >> >>
> >> > >> >>
> >> > >> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <
> >> > dmitry.gusev@gmail.com <javascript:;> <javascript:;>
> >> > >> >:
> >> > >> >>
> >> > >> >> >Hello,
> >> > >> >> >
> >> > >> >> >Do you run tapestry apps in embedded container in production?
> >> > >> >> >
> >> > >> >> >If yes, how do you configure embedded container (ports, SSL,
> >> valves,
> >> > >> >> etc.)?
> >> > >> >> >
> >> > >> >> >Maybe there's some tapestry integration that configures tomcat
> >> > instance
> >> > >> >> >using tapestry-ioc and symbols?
> >> > >> >> >
> >> > >> >> >--
> >> > >> >> >Dmitry Gusev
> >> > >> >> >
> >> > >> >> >AnjLab Team
> >> > >> >> >http://anjlab.com
> >> > >> >>
> >> > >> >
> >> > >> >
> >> > >> >
> >> > >> >--
> >> > >> >Dmitry Gusev
> >> > >> >
> >> > >> >AnjLab Team
> >> > >> >http://anjlab.com
> >> > >>
> >> > >
> >> > >
> >> > >
> >> > >--
> >> > >Dmitry Gusev
> >> > >
> >> > >AnjLab Team
> >> > >http://anjlab.com
> >> >
> >>
> >>
> >>
> >> --
> >> Dmitry Gusev
> >>
> >> AnjLab Team
> >> http://anjlab.com
> >>
>

Re: Running tapestry app using embedded container in production

Posted by Thilo Tanner <th...@reprisk.com>.
Hi Barry,

As an example, we use two different strategies (depending on what we need):

Easy solution:
Create an executable WAR file and configure a normal console logger which writes everything to stdout. From there you pipe the log messages to a file of your choice. Something like:

exec $JAVA_HOME/bin/java -jar $JAR >> $LOG 2>&1 &

Less easy solution:
Create an eager loading logging configuration service which configures the logging system according to your needs (for example output to a data directory which is configured via a T5 symbol). Logback for example is easy to configure programmatically.

Either way, I strongly recommend to use a centralized system to collect all your logs (for example ELK), especially if you consider to distribute your application.

Best,
Thilo





Am 28.07.15 14:04 schrieb "Barry Books" unter <tr...@gmail.com>:

>How do you handle logging configuration? At first I used different
>log4j.properties files and specified which one to use on the command line
>but now I often deploy Jenkins in the same Tomcat so I switched to messing
>with the class path to get the right properties file. Neither solution is
>ideal. Anyone come up with anything else?
>
>
>
>On Tuesday, July 28, 2015, Dmitry Gusev <dm...@gmail.com> wrote:
>
>> Got it, thank you.
>>
>> This is exactly how we do it currently with standalone tomcat, with one
>> difference -- we implemented our own symbol resolution strategy to get
>> symbols from an external file, instead of passing them all through command
>> line.
>>
>> I was just curios if somebody created some tapestry module with predefined
>> set of tapestry symbols that would start & configure container for us.
>> This way we could still be able to override some symbols when needed as we
>> usually do in tapestry.
>>
>>
>>
>> On Tue, Jul 28, 2015 at 2:11 PM, Thilo Tanner <thilo.tanner@reprisk.com
>> <javascript:;>>
>> wrote:
>>
>> > Hi Dmitry,
>> >
>> > In our case, yes we hardcode and commit those credentials to our
>> > repositories. In my defense, we host all our code in-house and have
>> various
>> > other security measures in place. Database credentials are normally
>> > different from client host to client host and therefore such credentials
>> > are normally useless unless you also have access to this particular host.
>> >
>> > If you prefer to set your credentials directly on your host, use symbols
>> > (as described in the previous email) and make sure to correctly unset the
>> > shell environment variables after application startup. You could do
>> > something like this in your startup script:
>> >
>> > java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD -jar
>> > myapp.jar
>> >
>> > where myapp.db.username and myapp.db.password are user-defined T5
>> symbols.
>> >
>> > Using such a strategy, you can avoid committing your credentials.
>> >
>> > Best,
>> > Thilo
>> >
>> > --
>> > Thilo Tanner
>> > Technology Lead
>> >
>> > Direct +41 43 300 54 42
>> > Mobile +41 79 506 46 36
>> > thilo.tanner@reprisk.com <javascript:;>
>> >
>> > RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
>> > Tel. +41 43 300 54 40, Fax +41 43 300 54 46
>> > www.reprisk.com
>> >
>> > Follow us on Facebook or Twitter:
>> > www.facebook.com/RepRisk | www.twitter.com/RepRisk
>> >
>> > If you are not the intended recipient, please notify the sender - thank
>> > you.
>> >
>> >
>> >
>> >
>> >
>> >
>> > Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter <dmitry.gusev@gmail.com
>> <javascript:;>>:
>> >
>> > >Hi Thilo,
>> > >
>> > >So you're hardcoding all your staging/production settings in special
>> > >tapestry modules,
>> > >and committing them to the same source code repository as your app's
>> > >codebase, right?
>> > >
>> > >
>> > >On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <thilo.tanner@reprisk.com
>> <javascript:;>>
>> > >wrote:
>> > >
>> > >> Hi Dmitry,
>> > >>
>> > >> To configure our apps, we mainly use what Tapestry offers
>> > out-of-the-box.
>> > >> I recommend to create a dedicated Tapestry module for each of your
>> > >> environments as described here:
>> > >>
>> >
>> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
>> > >>
>> > >> In such a module, you can override your database settings for example.
>> > >>
>> > >> Additional environment modules are then easy to load via command line.
>> > For
>> > >> example:
>> > >>
>> > >> java -Dtapestry.execution-mode=staging -jar myapp.war
>> > >>
>> > >> Compared to other injection containers, Tapestry’s IOC has lots of
>> > >> built-in features that will help you configuring your application.
>> > Another
>> > >> concept worth mentioning here are Symbols:
>> > >> http://tapestry.apache.org/symbols.html
>> > >> Symbols can be predefined, but also overridden during application
>> > startup
>> > >> (in fact, tapestry.execution-mode is a built-in T5 symbol used to load
>> > >> additional modules during startup)
>> > >>
>> > >> Best,
>> > >> Thilo
>> > >>
>> > >>
>> > >>
>> > >>
>> > >> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <
>> dmitry.gusev@gmail.com <javascript:;>
>> > >:
>> > >>
>> > >> >Hi Thilo,
>> > >> >
>> > >> >and how in this case you configure your executable JAR?
>> > >> >
>> > >> >Are you using maven profiles & that war file contains all
>> > configuration,
>> > >> >or you create "universal" binary and provide configuration at runtime
>> > via
>> > >> >system properties or external .properties file?
>> > >> >
>> > >> >I know this should be pretty easy to code, just wondering if there's
>> > >> >anything ready that may be reused without reinventing the wheel.
>> > >> >
>> > >> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <
>> > thilo.tanner@reprisk.com <javascript:;>>
>> > >> >wrote:
>> > >> >
>> > >> >> Hi Dmitry,
>> > >> >>
>> > >> >> Yes, we are running T5.4 apps in production by embedding Undertow
>> > >> (Servlet
>> > >> >> container from Wildfly). With Tapestry, such a setup is relatively
>> > easy
>> > >> to
>> > >> >> achieve:
>> > >> >>
>> > >> >> You create an application class that bootstraps the Tapestry filter
>> > in
>> > >> >> Undertow:
>> > >> >>
>> > >>
>> >
>> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
>> > >> >>
>> > >> >> Such a class will allow you to start your T5 app directly from a
>> main
>> > >> >> method (great for development).
>> > >> >>
>> > >> >> For a deployment, you can use the two following Maven plugins to
>> > >> generate
>> > >> >> „executable WAR files“:
>> > >> >>
>> > >> >> maven-war-plugin
>> > >> >> Define the main class in the manifest file (pointing to your
>> > bootstrap
>> > >> >> class above)
>> > >> >>
>> > >> >> spring-boot-maven-plugin
>> > >> >> The plugin will repackage your WAR file to make it executable (by
>> > using
>> > >> >> java -jar myapp.war); WAR files per-se are not directly executable.
>> > >> >>
>> > >> >>
>> > >> >> If you’re interested in such a solution, I can post more details
>> > here.
>> > >> >>
>> > >> >> Best regards,
>> > >> >> Thilo
>> > >> >>
>> > >> >>
>> > >> >>
>> > >> >>
>> > >> >>
>> > >> >>
>> > >> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <
>> > dmitry.gusev@gmail.com <javascript:;>
>> > >> >:
>> > >> >>
>> > >> >> >Hello,
>> > >> >> >
>> > >> >> >Do you run tapestry apps in embedded container in production?
>> > >> >> >
>> > >> >> >If yes, how do you configure embedded container (ports, SSL,
>> valves,
>> > >> >> etc.)?
>> > >> >> >
>> > >> >> >Maybe there's some tapestry integration that configures tomcat
>> > instance
>> > >> >> >using tapestry-ioc and symbols?
>> > >> >> >
>> > >> >> >--
>> > >> >> >Dmitry Gusev
>> > >> >> >
>> > >> >> >AnjLab Team
>> > >> >> >http://anjlab.com
>> > >> >>
>> > >> >
>> > >> >
>> > >> >
>> > >> >--
>> > >> >Dmitry Gusev
>> > >> >
>> > >> >AnjLab Team
>> > >> >http://anjlab.com
>> > >>
>> > >
>> > >
>> > >
>> > >--
>> > >Dmitry Gusev
>> > >
>> > >AnjLab Team
>> > >http://anjlab.com
>> >
>>
>>
>>
>> --
>> Dmitry Gusev
>>
>> AnjLab Team
>> http://anjlab.com
>>

Re: Running tapestry app using embedded container in production

Posted by Barry Books <tr...@gmail.com>.
How do you handle logging configuration? At first I used different
log4j.properties files and specified which one to use on the command line
but now I often deploy Jenkins in the same Tomcat so I switched to messing
with the class path to get the right properties file. Neither solution is
ideal. Anyone come up with anything else?



On Tuesday, July 28, 2015, Dmitry Gusev <dm...@gmail.com> wrote:

> Got it, thank you.
>
> This is exactly how we do it currently with standalone tomcat, with one
> difference -- we implemented our own symbol resolution strategy to get
> symbols from an external file, instead of passing them all through command
> line.
>
> I was just curios if somebody created some tapestry module with predefined
> set of tapestry symbols that would start & configure container for us.
> This way we could still be able to override some symbols when needed as we
> usually do in tapestry.
>
>
>
> On Tue, Jul 28, 2015 at 2:11 PM, Thilo Tanner <thilo.tanner@reprisk.com
> <javascript:;>>
> wrote:
>
> > Hi Dmitry,
> >
> > In our case, yes we hardcode and commit those credentials to our
> > repositories. In my defense, we host all our code in-house and have
> various
> > other security measures in place. Database credentials are normally
> > different from client host to client host and therefore such credentials
> > are normally useless unless you also have access to this particular host.
> >
> > If you prefer to set your credentials directly on your host, use symbols
> > (as described in the previous email) and make sure to correctly unset the
> > shell environment variables after application startup. You could do
> > something like this in your startup script:
> >
> > java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD -jar
> > myapp.jar
> >
> > where myapp.db.username and myapp.db.password are user-defined T5
> symbols.
> >
> > Using such a strategy, you can avoid committing your credentials.
> >
> > Best,
> > Thilo
> >
> > --
> > Thilo Tanner
> > Technology Lead
> >
> > Direct +41 43 300 54 42
> > Mobile +41 79 506 46 36
> > thilo.tanner@reprisk.com <javascript:;>
> >
> > RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
> > Tel. +41 43 300 54 40, Fax +41 43 300 54 46
> > www.reprisk.com
> >
> > Follow us on Facebook or Twitter:
> > www.facebook.com/RepRisk | www.twitter.com/RepRisk
> >
> > If you are not the intended recipient, please notify the sender - thank
> > you.
> >
> >
> >
> >
> >
> >
> > Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter <dmitry.gusev@gmail.com
> <javascript:;>>:
> >
> > >Hi Thilo,
> > >
> > >So you're hardcoding all your staging/production settings in special
> > >tapestry modules,
> > >and committing them to the same source code repository as your app's
> > >codebase, right?
> > >
> > >
> > >On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <thilo.tanner@reprisk.com
> <javascript:;>>
> > >wrote:
> > >
> > >> Hi Dmitry,
> > >>
> > >> To configure our apps, we mainly use what Tapestry offers
> > out-of-the-box.
> > >> I recommend to create a dedicated Tapestry module for each of your
> > >> environments as described here:
> > >>
> >
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
> > >>
> > >> In such a module, you can override your database settings for example.
> > >>
> > >> Additional environment modules are then easy to load via command line.
> > For
> > >> example:
> > >>
> > >> java -Dtapestry.execution-mode=staging -jar myapp.war
> > >>
> > >> Compared to other injection containers, Tapestry’s IOC has lots of
> > >> built-in features that will help you configuring your application.
> > Another
> > >> concept worth mentioning here are Symbols:
> > >> http://tapestry.apache.org/symbols.html
> > >> Symbols can be predefined, but also overridden during application
> > startup
> > >> (in fact, tapestry.execution-mode is a built-in T5 symbol used to load
> > >> additional modules during startup)
> > >>
> > >> Best,
> > >> Thilo
> > >>
> > >>
> > >>
> > >>
> > >> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <
> dmitry.gusev@gmail.com <javascript:;>
> > >:
> > >>
> > >> >Hi Thilo,
> > >> >
> > >> >and how in this case you configure your executable JAR?
> > >> >
> > >> >Are you using maven profiles & that war file contains all
> > configuration,
> > >> >or you create "universal" binary and provide configuration at runtime
> > via
> > >> >system properties or external .properties file?
> > >> >
> > >> >I know this should be pretty easy to code, just wondering if there's
> > >> >anything ready that may be reused without reinventing the wheel.
> > >> >
> > >> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <
> > thilo.tanner@reprisk.com <javascript:;>>
> > >> >wrote:
> > >> >
> > >> >> Hi Dmitry,
> > >> >>
> > >> >> Yes, we are running T5.4 apps in production by embedding Undertow
> > >> (Servlet
> > >> >> container from Wildfly). With Tapestry, such a setup is relatively
> > easy
> > >> to
> > >> >> achieve:
> > >> >>
> > >> >> You create an application class that bootstraps the Tapestry filter
> > in
> > >> >> Undertow:
> > >> >>
> > >>
> >
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
> > >> >>
> > >> >> Such a class will allow you to start your T5 app directly from a
> main
> > >> >> method (great for development).
> > >> >>
> > >> >> For a deployment, you can use the two following Maven plugins to
> > >> generate
> > >> >> „executable WAR files“:
> > >> >>
> > >> >> maven-war-plugin
> > >> >> Define the main class in the manifest file (pointing to your
> > bootstrap
> > >> >> class above)
> > >> >>
> > >> >> spring-boot-maven-plugin
> > >> >> The plugin will repackage your WAR file to make it executable (by
> > using
> > >> >> java -jar myapp.war); WAR files per-se are not directly executable.
> > >> >>
> > >> >>
> > >> >> If you’re interested in such a solution, I can post more details
> > here.
> > >> >>
> > >> >> Best regards,
> > >> >> Thilo
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <
> > dmitry.gusev@gmail.com <javascript:;>
> > >> >:
> > >> >>
> > >> >> >Hello,
> > >> >> >
> > >> >> >Do you run tapestry apps in embedded container in production?
> > >> >> >
> > >> >> >If yes, how do you configure embedded container (ports, SSL,
> valves,
> > >> >> etc.)?
> > >> >> >
> > >> >> >Maybe there's some tapestry integration that configures tomcat
> > instance
> > >> >> >using tapestry-ioc and symbols?
> > >> >> >
> > >> >> >--
> > >> >> >Dmitry Gusev
> > >> >> >
> > >> >> >AnjLab Team
> > >> >> >http://anjlab.com
> > >> >>
> > >> >
> > >> >
> > >> >
> > >> >--
> > >> >Dmitry Gusev
> > >> >
> > >> >AnjLab Team
> > >> >http://anjlab.com
> > >>
> > >
> > >
> > >
> > >--
> > >Dmitry Gusev
> > >
> > >AnjLab Team
> > >http://anjlab.com
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>

Re: Running tapestry app using embedded container in production

Posted by Dmitry Gusev <dm...@gmail.com>.
Got it, thank you.

This is exactly how we do it currently with standalone tomcat, with one
difference -- we implemented our own symbol resolution strategy to get
symbols from an external file, instead of passing them all through command
line.

I was just curios if somebody created some tapestry module with predefined
set of tapestry symbols that would start & configure container for us.
This way we could still be able to override some symbols when needed as we
usually do in tapestry.



On Tue, Jul 28, 2015 at 2:11 PM, Thilo Tanner <th...@reprisk.com>
wrote:

> Hi Dmitry,
>
> In our case, yes we hardcode and commit those credentials to our
> repositories. In my defense, we host all our code in-house and have various
> other security measures in place. Database credentials are normally
> different from client host to client host and therefore such credentials
> are normally useless unless you also have access to this particular host.
>
> If you prefer to set your credentials directly on your host, use symbols
> (as described in the previous email) and make sure to correctly unset the
> shell environment variables after application startup. You could do
> something like this in your startup script:
>
> java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD -jar
> myapp.jar
>
> where myapp.db.username and myapp.db.password are user-defined T5 symbols.
>
> Using such a strategy, you can avoid committing your credentials.
>
> Best,
> Thilo
>
> --
> Thilo Tanner
> Technology Lead
>
> Direct +41 43 300 54 42
> Mobile +41 79 506 46 36
> thilo.tanner@reprisk.com
>
> RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
> Tel. +41 43 300 54 40, Fax +41 43 300 54 46
> www.reprisk.com
>
> Follow us on Facebook or Twitter:
> www.facebook.com/RepRisk | www.twitter.com/RepRisk
>
> If you are not the intended recipient, please notify the sender - thank
> you.
>
>
>
>
>
>
> Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:
>
> >Hi Thilo,
> >
> >So you're hardcoding all your staging/production settings in special
> >tapestry modules,
> >and committing them to the same source code repository as your app's
> >codebase, right?
> >
> >
> >On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <th...@reprisk.com>
> >wrote:
> >
> >> Hi Dmitry,
> >>
> >> To configure our apps, we mainly use what Tapestry offers
> out-of-the-box.
> >> I recommend to create a dedicated Tapestry module for each of your
> >> environments as described here:
> >>
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
> >>
> >> In such a module, you can override your database settings for example.
> >>
> >> Additional environment modules are then easy to load via command line.
> For
> >> example:
> >>
> >> java -Dtapestry.execution-mode=staging -jar myapp.war
> >>
> >> Compared to other injection containers, Tapestry’s IOC has lots of
> >> built-in features that will help you configuring your application.
> Another
> >> concept worth mentioning here are Symbols:
> >> http://tapestry.apache.org/symbols.html
> >> Symbols can be predefined, but also overridden during application
> startup
> >> (in fact, tapestry.execution-mode is a built-in T5 symbol used to load
> >> additional modules during startup)
> >>
> >> Best,
> >> Thilo
> >>
> >>
> >>
> >>
> >> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <dmitry.gusev@gmail.com
> >:
> >>
> >> >Hi Thilo,
> >> >
> >> >and how in this case you configure your executable JAR?
> >> >
> >> >Are you using maven profiles & that war file contains all
> configuration,
> >> >or you create "universal" binary and provide configuration at runtime
> via
> >> >system properties or external .properties file?
> >> >
> >> >I know this should be pretty easy to code, just wondering if there's
> >> >anything ready that may be reused without reinventing the wheel.
> >> >
> >> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <
> thilo.tanner@reprisk.com>
> >> >wrote:
> >> >
> >> >> Hi Dmitry,
> >> >>
> >> >> Yes, we are running T5.4 apps in production by embedding Undertow
> >> (Servlet
> >> >> container from Wildfly). With Tapestry, such a setup is relatively
> easy
> >> to
> >> >> achieve:
> >> >>
> >> >> You create an application class that bootstraps the Tapestry filter
> in
> >> >> Undertow:
> >> >>
> >>
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
> >> >>
> >> >> Such a class will allow you to start your T5 app directly from a main
> >> >> method (great for development).
> >> >>
> >> >> For a deployment, you can use the two following Maven plugins to
> >> generate
> >> >> „executable WAR files“:
> >> >>
> >> >> maven-war-plugin
> >> >> Define the main class in the manifest file (pointing to your
> bootstrap
> >> >> class above)
> >> >>
> >> >> spring-boot-maven-plugin
> >> >> The plugin will repackage your WAR file to make it executable (by
> using
> >> >> java -jar myapp.war); WAR files per-se are not directly executable.
> >> >>
> >> >>
> >> >> If you’re interested in such a solution, I can post more details
> here.
> >> >>
> >> >> Best regards,
> >> >> Thilo
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <
> dmitry.gusev@gmail.com
> >> >:
> >> >>
> >> >> >Hello,
> >> >> >
> >> >> >Do you run tapestry apps in embedded container in production?
> >> >> >
> >> >> >If yes, how do you configure embedded container (ports, SSL, valves,
> >> >> etc.)?
> >> >> >
> >> >> >Maybe there's some tapestry integration that configures tomcat
> instance
> >> >> >using tapestry-ioc and symbols?
> >> >> >
> >> >> >--
> >> >> >Dmitry Gusev
> >> >> >
> >> >> >AnjLab Team
> >> >> >http://anjlab.com
> >> >>
> >> >
> >> >
> >> >
> >> >--
> >> >Dmitry Gusev
> >> >
> >> >AnjLab Team
> >> >http://anjlab.com
> >>
> >
> >
> >
> >--
> >Dmitry Gusev
> >
> >AnjLab Team
> >http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Running tapestry app using embedded container in production

Posted by Thilo Tanner <th...@reprisk.com>.
Hi Dmitry,

In our case, yes we hardcode and commit those credentials to our repositories. In my defense, we host all our code in-house and have various other security measures in place. Database credentials are normally different from client host to client host and therefore such credentials are normally useless unless you also have access to this particular host.

If you prefer to set your credentials directly on your host, use symbols (as described in the previous email) and make sure to correctly unset the shell environment variables after application startup. You could do something like this in your startup script:

java -Dmyapp.db.username=DB_USERNAME -Dmyapp.db.password=DB_PASSWORD -jar myapp.jar

where myapp.db.username and myapp.db.password are user-defined T5 symbols.

Using such a strategy, you can avoid committing your credentials.

Best,
Thilo

--
Thilo Tanner
Technology Lead

Direct +41 43 300 54 42
Mobile +41 79 506 46 36
thilo.tanner@reprisk.com

RepRisk AG, Stampfenbachstrasse 42, 8006 Zurich, Switzerland
Tel. +41 43 300 54 40, Fax +41 43 300 54 46
www.reprisk.com   

Follow us on Facebook or Twitter:
www.facebook.com/RepRisk | www.twitter.com/RepRisk

If you are not the intended recipient, please notify the sender - thank you.






Am 28.07.15 12:54 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:

>Hi Thilo,
>
>So you're hardcoding all your staging/production settings in special
>tapestry modules,
>and committing them to the same source code repository as your app's
>codebase, right?
>
>
>On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <th...@reprisk.com>
>wrote:
>
>> Hi Dmitry,
>>
>> To configure our apps, we mainly use what Tapestry offers out-of-the-box.
>> I recommend to create a dedicated Tapestry module for each of your
>> environments as described here:
>> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
>>
>> In such a module, you can override your database settings for example.
>>
>> Additional environment modules are then easy to load via command line. For
>> example:
>>
>> java -Dtapestry.execution-mode=staging -jar myapp.war
>>
>> Compared to other injection containers, Tapestry’s IOC has lots of
>> built-in features that will help you configuring your application. Another
>> concept worth mentioning here are Symbols:
>> http://tapestry.apache.org/symbols.html
>> Symbols can be predefined, but also overridden during application startup
>> (in fact, tapestry.execution-mode is a built-in T5 symbol used to load
>> additional modules during startup)
>>
>> Best,
>> Thilo
>>
>>
>>
>>
>> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:
>>
>> >Hi Thilo,
>> >
>> >and how in this case you configure your executable JAR?
>> >
>> >Are you using maven profiles & that war file contains all configuration,
>> >or you create "universal" binary and provide configuration at runtime via
>> >system properties or external .properties file?
>> >
>> >I know this should be pretty easy to code, just wondering if there's
>> >anything ready that may be reused without reinventing the wheel.
>> >
>> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <th...@reprisk.com>
>> >wrote:
>> >
>> >> Hi Dmitry,
>> >>
>> >> Yes, we are running T5.4 apps in production by embedding Undertow
>> (Servlet
>> >> container from Wildfly). With Tapestry, such a setup is relatively easy
>> to
>> >> achieve:
>> >>
>> >> You create an application class that bootstraps the Tapestry filter in
>> >> Undertow:
>> >>
>> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
>> >>
>> >> Such a class will allow you to start your T5 app directly from a main
>> >> method (great for development).
>> >>
>> >> For a deployment, you can use the two following Maven plugins to
>> generate
>> >> „executable WAR files“:
>> >>
>> >> maven-war-plugin
>> >> Define the main class in the manifest file (pointing to your bootstrap
>> >> class above)
>> >>
>> >> spring-boot-maven-plugin
>> >> The plugin will repackage your WAR file to make it executable (by using
>> >> java -jar myapp.war); WAR files per-se are not directly executable.
>> >>
>> >>
>> >> If you’re interested in such a solution, I can post more details here.
>> >>
>> >> Best regards,
>> >> Thilo
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <dmitry.gusev@gmail.com
>> >:
>> >>
>> >> >Hello,
>> >> >
>> >> >Do you run tapestry apps in embedded container in production?
>> >> >
>> >> >If yes, how do you configure embedded container (ports, SSL, valves,
>> >> etc.)?
>> >> >
>> >> >Maybe there's some tapestry integration that configures tomcat instance
>> >> >using tapestry-ioc and symbols?
>> >> >
>> >> >--
>> >> >Dmitry Gusev
>> >> >
>> >> >AnjLab Team
>> >> >http://anjlab.com
>> >>
>> >
>> >
>> >
>> >--
>> >Dmitry Gusev
>> >
>> >AnjLab Team
>> >http://anjlab.com
>>
>
>
>
>-- 
>Dmitry Gusev
>
>AnjLab Team
>http://anjlab.com

Re: Running tapestry app using embedded container in production

Posted by Dmitry Gusev <dm...@gmail.com>.
Hi Thilo,

So you're hardcoding all your staging/production settings in special
tapestry modules,
and committing them to the same source code repository as your app's
codebase, right?


On Tue, Jul 28, 2015 at 1:47 PM, Thilo Tanner <th...@reprisk.com>
wrote:

> Hi Dmitry,
>
> To configure our apps, we mainly use what Tapestry offers out-of-the-box.
> I recommend to create a dedicated Tapestry module for each of your
> environments as described here:
> http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes
>
> In such a module, you can override your database settings for example.
>
> Additional environment modules are then easy to load via command line. For
> example:
>
> java -Dtapestry.execution-mode=staging -jar myapp.war
>
> Compared to other injection containers, Tapestry’s IOC has lots of
> built-in features that will help you configuring your application. Another
> concept worth mentioning here are Symbols:
> http://tapestry.apache.org/symbols.html
> Symbols can be predefined, but also overridden during application startup
> (in fact, tapestry.execution-mode is a built-in T5 symbol used to load
> additional modules during startup)
>
> Best,
> Thilo
>
>
>
>
> Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:
>
> >Hi Thilo,
> >
> >and how in this case you configure your executable JAR?
> >
> >Are you using maven profiles & that war file contains all configuration,
> >or you create "universal" binary and provide configuration at runtime via
> >system properties or external .properties file?
> >
> >I know this should be pretty easy to code, just wondering if there's
> >anything ready that may be reused without reinventing the wheel.
> >
> >On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <th...@reprisk.com>
> >wrote:
> >
> >> Hi Dmitry,
> >>
> >> Yes, we are running T5.4 apps in production by embedding Undertow
> (Servlet
> >> container from Wildfly). With Tapestry, such a setup is relatively easy
> to
> >> achieve:
> >>
> >> You create an application class that bootstraps the Tapestry filter in
> >> Undertow:
> >>
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
> >>
> >> Such a class will allow you to start your T5 app directly from a main
> >> method (great for development).
> >>
> >> For a deployment, you can use the two following Maven plugins to
> generate
> >> „executable WAR files“:
> >>
> >> maven-war-plugin
> >> Define the main class in the manifest file (pointing to your bootstrap
> >> class above)
> >>
> >> spring-boot-maven-plugin
> >> The plugin will repackage your WAR file to make it executable (by using
> >> java -jar myapp.war); WAR files per-se are not directly executable.
> >>
> >>
> >> If you’re interested in such a solution, I can post more details here.
> >>
> >> Best regards,
> >> Thilo
> >>
> >>
> >>
> >>
> >>
> >>
> >> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <dmitry.gusev@gmail.com
> >:
> >>
> >> >Hello,
> >> >
> >> >Do you run tapestry apps in embedded container in production?
> >> >
> >> >If yes, how do you configure embedded container (ports, SSL, valves,
> >> etc.)?
> >> >
> >> >Maybe there's some tapestry integration that configures tomcat instance
> >> >using tapestry-ioc and symbols?
> >> >
> >> >--
> >> >Dmitry Gusev
> >> >
> >> >AnjLab Team
> >> >http://anjlab.com
> >>
> >
> >
> >
> >--
> >Dmitry Gusev
> >
> >AnjLab Team
> >http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Running tapestry app using embedded container in production

Posted by Thilo Tanner <th...@reprisk.com>.
Hi Dmitry,

To configure our apps, we mainly use what Tapestry offers out-of-the-box. I recommend to create a dedicated Tapestry module for each of your environments as described here: http://tapestry.apache.org/configuration.html#Configuration-SettingExecutionModes

In such a module, you can override your database settings for example.

Additional environment modules are then easy to load via command line. For example:

java -Dtapestry.execution-mode=staging -jar myapp.war

Compared to other injection containers, Tapestry’s IOC has lots of built-in features that will help you configuring your application. Another concept worth mentioning here are Symbols: http://tapestry.apache.org/symbols.html
Symbols can be predefined, but also overridden during application startup (in fact, tapestry.execution-mode is a built-in T5 symbol used to load additional modules during startup)

Best,
Thilo




Am 28.07.15 12:06 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:

>Hi Thilo,
>
>and how in this case you configure your executable JAR?
>
>Are you using maven profiles & that war file contains all configuration,
>or you create "universal" binary and provide configuration at runtime via
>system properties or external .properties file?
>
>I know this should be pretty easy to code, just wondering if there's
>anything ready that may be reused without reinventing the wheel.
>
>On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <th...@reprisk.com>
>wrote:
>
>> Hi Dmitry,
>>
>> Yes, we are running T5.4 apps in production by embedding Undertow (Servlet
>> container from Wildfly). With Tapestry, such a setup is relatively easy to
>> achieve:
>>
>> You create an application class that bootstraps the Tapestry filter in
>> Undertow:
>> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
>>
>> Such a class will allow you to start your T5 app directly from a main
>> method (great for development).
>>
>> For a deployment, you can use the two following Maven plugins to generate
>> „executable WAR files“:
>>
>> maven-war-plugin
>> Define the main class in the manifest file (pointing to your bootstrap
>> class above)
>>
>> spring-boot-maven-plugin
>> The plugin will repackage your WAR file to make it executable (by using
>> java -jar myapp.war); WAR files per-se are not directly executable.
>>
>>
>> If you’re interested in such a solution, I can post more details here.
>>
>> Best regards,
>> Thilo
>>
>>
>>
>>
>>
>>
>> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:
>>
>> >Hello,
>> >
>> >Do you run tapestry apps in embedded container in production?
>> >
>> >If yes, how do you configure embedded container (ports, SSL, valves,
>> etc.)?
>> >
>> >Maybe there's some tapestry integration that configures tomcat instance
>> >using tapestry-ioc and symbols?
>> >
>> >--
>> >Dmitry Gusev
>> >
>> >AnjLab Team
>> >http://anjlab.com
>>
>
>
>
>-- 
>Dmitry Gusev
>
>AnjLab Team
>http://anjlab.com

Re: Running tapestry app using embedded container in production

Posted by Dmitry Gusev <dm...@gmail.com>.
Hi Thilo,

and how in this case you configure your executable JAR?

Are you using maven profiles & that war file contains all configuration,
or you create "universal" binary and provide configuration at runtime via
system properties or external .properties file?

I know this should be pretty easy to code, just wondering if there's
anything ready that may be reused without reinventing the wheel.

On Tue, Jul 28, 2015 at 12:30 PM, Thilo Tanner <th...@reprisk.com>
wrote:

> Hi Dmitry,
>
> Yes, we are running T5.4 apps in production by embedding Undertow (Servlet
> container from Wildfly). With Tapestry, such a setup is relatively easy to
> achieve:
>
> You create an application class that bootstraps the Tapestry filter in
> Undertow:
> http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment
>
> Such a class will allow you to start your T5 app directly from a main
> method (great for development).
>
> For a deployment, you can use the two following Maven plugins to generate
> „executable WAR files“:
>
> maven-war-plugin
> Define the main class in the manifest file (pointing to your bootstrap
> class above)
>
> spring-boot-maven-plugin
> The plugin will repackage your WAR file to make it executable (by using
> java -jar myapp.war); WAR files per-se are not directly executable.
>
>
> If you’re interested in such a solution, I can post more details here.
>
> Best regards,
> Thilo
>
>
>
>
>
>
> Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:
>
> >Hello,
> >
> >Do you run tapestry apps in embedded container in production?
> >
> >If yes, how do you configure embedded container (ports, SSL, valves,
> etc.)?
> >
> >Maybe there's some tapestry integration that configures tomcat instance
> >using tapestry-ioc and symbols?
> >
> >--
> >Dmitry Gusev
> >
> >AnjLab Team
> >http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Running tapestry app using embedded container in production

Posted by Simon Raveh <si...@icann.org>.
Hi Thilo,

I'm planing to follow the same process, do you mind sharing some more
information and examples. Are you using tapestry-spring integartion if
yes, any specific configuration I should look for

Thanks,
Simon 

On 7/28/15 2:30 AM, "Thilo Tanner" <th...@reprisk.com> wrote:

>Hi Dmitry,
>
>Yes, we are running T5.4 apps in production by embedding Undertow
>(Servlet container from Wildfly). With Tapestry, such a setup is
>relatively easy to achieve:
>
>You create an application class that bootstraps the Tapestry filter in
>Undertow: 
>http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a
>-servlet-deployment
>
>Such a class will allow you to start your T5 app directly from a main
>method (great for development).
>
>For a deployment, you can use the two following Maven plugins to generate
>„executable WAR files“:
>
>maven-war-plugin
>Define the main class in the manifest file (pointing to your bootstrap
>class above)
>
>spring-boot-maven-plugin
>The plugin will repackage your WAR file to make it executable (by using
>java -jar myapp.war); WAR files per-se are not directly executable.
>
>
>If you’re interested in such a solution, I can post more details here.
>
>Best regards,
>Thilo
>
>
>
>
>
>
>Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:
>
>>Hello,
>>
>>Do you run tapestry apps in embedded container in production?
>>
>>If yes, how do you configure embedded container (ports, SSL, valves,
>>etc.)?
>>
>>Maybe there's some tapestry integration that configures tomcat instance
>>using tapestry-ioc and symbols?
>>
>>-- 
>>Dmitry Gusev
>>
>>AnjLab Team
>>http://anjlab.com
>?B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB�
>?�?[��X��ܚX�K??K[XZ[?�?\�\��][��X��ܚX�P??\?\�?�K�\?X�?K�ܙ�B��܈?Y??]?[ۘ[??�
>�[X[�?�??K[XZ[?�?\�\��Z?[????\?\�?�K�\?X�?K�ܙ�B

Re: Running tapestry app using embedded container in production

Posted by Thilo Tanner <th...@reprisk.com>.
Hi Dmitry,

Yes, we are running T5.4 apps in production by embedding Undertow (Servlet container from Wildfly). With Tapestry, such a setup is relatively easy to achieve:

You create an application class that bootstraps the Tapestry filter in Undertow: http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#creating-a-servlet-deployment

Such a class will allow you to start your T5 app directly from a main method (great for development).

For a deployment, you can use the two following Maven plugins to generate „executable WAR files“:

maven-war-plugin
Define the main class in the manifest file (pointing to your bootstrap class above)

spring-boot-maven-plugin
The plugin will repackage your WAR file to make it executable (by using java -jar myapp.war); WAR files per-se are not directly executable.


If you’re interested in such a solution, I can post more details here.

Best regards,
Thilo






Am 28.07.15 11:09 schrieb "Dmitry Gusev" unter <dm...@gmail.com>:

>Hello,
>
>Do you run tapestry apps in embedded container in production?
>
>If yes, how do you configure embedded container (ports, SSL, valves, etc.)?
>
>Maybe there's some tapestry integration that configures tomcat instance
>using tapestry-ioc and symbols?
>
>-- 
>Dmitry Gusev
>
>AnjLab Team
>http://anjlab.com