Re: OSGi in Tomcat

2013-07-24 Thread Violeta Georgieva
2013/7/25 Leonardo Torres wrote:
>
> Thank´s. In my case, It´s not a problem the incompatibility. :)
>
> Sorry for my question, but in this case, I create a class that inherits
> from WebSocketServlet and use HttpService to register it?

You create a class that inherits WebSocketServlet and pack it as in normal
war.
Then install the archive in OSGi and that's all.
There is no need of HttpService.

If you are interested in Gemini Web we can move the discussion here [1]


Regards
Violeta

[1] http://www.eclipse.org/forums/index.php?t=thread&frm_id=153&;


Re: OSGi in Tomcat

2013-07-24 Thread Leonardo Torres
Thank´s. In my case, It´s not a problem the incompatibility. :)

Sorry for my question, but in this case, I create a class that inherits
from WebSocketServlet and use HttpService to register it?


On Wed, Jul 24, 2013 at 3:38 PM, Niki Dokovski  wrote:

> On Wed, Jul 24, 2013 at 9:07 PM, Leonardo Torres
> wrote:
>
> > Thank´s for reply.
> >
> > With Gemini, can I use the tomcat websocket implementation?
> >
>
> You can use proprietary org.apache.catalina.websocket implementation. That
> however is not compatible with JSR 356 APIs.
>
>
> >
> > On Wed, Jul 24, 2013 at 8:09 AM, Martin Gainty 
> > wrote:
> >
> > > asking your release manager to build an OSGI artifact with eclipse may
> be
> > > a bit of a stretch if this is a live production-ready system then you
> > will
> > > most likely be building at command-line with either ant or maven
> > >
> > > the trickiest part is interfacing to BND start and BND stop which can
> be
> > > accomplished with Activator sample code seen here
> > >
> > >
> >
> http://wso2.com/library/tutorials/develop-osgi-bundles-using-maven-bundle-plugin
> > >
> > > lets pick this thread on us...@maven.apache.org
> > >
> > > Martin
> > > __
> > > /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: Wed, 24 Jul 2013 13:30:01 +0300
> > > > Subject: Re: OSGi in Tomcat
> > > > From: miles...@gmail.com
> > > > To: users@tomcat.apache.org
> > > >
> > > > 2013/7/23 Leonardo Torres wrote:
> > > > >
> > > > > Thank´s for reply.
> > > > >
> > > > > Just one more question, If I want to use tomcat inside of OSGi
> > > > environment,
> > > > > how can I do that ?
> > > > >
> > > >
> > > > Check Gemini Web documentation:
> > > >
> > > > http://www.eclipse.org/gemini/web/documentation/
> > > > http://wiki.eclipse.org/Gemini/Web
> > > >
> > > > Regards
> > > > Violeta
> > >
> > >
> >
> >
> >
> > --
> > Obrigado
> > Leonardo Torres.
> >
>



-- 
Obrigado
Leonardo Torres.


Re: Confusion about session replication

2013-07-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Alec,

On 7/24/13 4:38 PM, Tomcat Random wrote:
> So set the LB stickiness to the same
> n number as in web.xml.

That's what I'd do, if...

>> "Assuming that the lb is updating the last-touch time for every
>> request mentioning the session"
> 
> Could you explain this a little further. How would the LB be
> monitoring requests mentioning the session. Would that be a request
> that had *JSessionID *in it?

Correct. The lb needs to know that a particular user should be sent to
a specific application server. Usually, that's done by sniffing the
JSESSIONID cookie, or by reading the "jsessionid" path parameter from
the URL. In either case, the lb needs to either keep a lookup table of
session ids and backend servers to which they are bound (I believe
this is how most lbs work) or be clever enough to know that Tomcat can
give it a hint as to the server's identity -- this is what mod_jk does.

mod_jk does not maintain a huge registry of session->server mappings.
Instead, the session id has the backend-server's identity embedded in
it (it comes from the "jvmRoute" attribute of the  element in
server.xml) and knows which jvmRoute maps to which app server (you
have to configure this yourself).

I suppose a non-mod_jk lb could be taught to do this kind of thing.
I've never used one, so I can't give you any specific advice.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJR8FDHAAoJEBzwKT+lPKRYt4MP/2DKgn+cAOZNSBpyttRf4gKe
ols2Y7yG15w04A+ymMaBc+vLNKAlafQMTrwkfCbfKsOP652ASs4JYIz/zXy0d5GT
IP0K2CWfhLnpoXcPxw9at7KagX8JBn+4qoQQyeZExda4x+2tnbPN1hOE1a2Aez5Y
a4NgQvggMN2azF43aJa3jlbO9jLRQDEWYXfgw9rtDALWMv+yS+c+a+wS2Fv2Nniz
I+w/yrTYFsR4IRF/upw2iHKG8SXlaJ/Q2rf3lAIP4yZtUyQPrbchs5bfnC8efpJC
CpKqmXeoQX2NH0zdOQsSIvRmmKEiKJJR6lnCoxq/ssQq16zbQG8Tb1c0GDdX4FzJ
LbMlO0XYGGnd5+X+CT4XtRxDoL8MCZf+qvYikSEO5LvTuuMdtO00JzDVvGb6qcsN
sFm28S4vN0z8P+bk9ioob5N76zWNoQAchxQtqTKJg/JI9KM/lKkQ1fw/NfcrW8Sc
AO3TrGPK2Bw0j7Q76hSDtvjiof9fk+6VgD40SEi09aneOo7a67wxq/2aPG8PchMO
eMFtICuDMX1qgDBM0mBU+ed0V1quWor1ax/20CXQYyY2BjfniEDlGz9aAn4JMz3b
OVwkHyPYmi6/FftgK4xAZM4AFlP7uRwxrYRqPuKRXu4R9wIxJwauYEoZ0p6n3Fax
jbGeRC/lwRjECS+djhEd
=8uP2
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Session replication advice

2013-07-24 Thread Tomcat Random
I have two physical servers running Tomcat 7.0.42, each running the same
webapp.

I'm interested in some advice with session replication. I'm not concerned
with fail-over, or high-availability. I just want to be able to have
sessions maintained when the user is routed to a different server by the
load balancer.

Is the documentation accurate in that just doing:

*Simply add

to your  or your  element to enable clustering.*

I've been through the docs and still a little confused as to the best way
to implement session replication.

TIA
Alec


Re: Confusion about session replication

2013-07-24 Thread Tomcat Random
Thanks Chris - Sorry for the unintended anonymity. My name's Alec.

So set the LB stickiness to the same n
number as in web.xml.

"Assuming that the lb is updating the last-touch time for every request
mentioning the session"
Could you explain this a little further. How would the LB be monitoring
requests mentioning the session. Would that be a request that had *JSessionID
*in it?

TIA,
Alec



On Wed, Jul 24, 2013 at 2:30 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> To whom it may concern,
>
> (Might we know your real name? The above introduction feels so
> impersonal...)
>
> On 7/24/13 11:13 AM, Tomcat Random wrote:
> > Setup: - Two physical servers each running Tomcat 7.0.42 - Brocade
> > load balancer in front
> >
> > The load balancer is set to source IP persistence for 5 minutes.
> > This time can be changed of course.
> >
> > The thing I don't understand is 5 minutes or 5 hours - at then end
> > that time limit the user can be sent to the other server and lose
> > data stored in the session.
> >
> > So why do sticky sessions matter when session replication turned on
> > in Tomcat? Is a performance issue?
>
> Sticky sessions aren't really necessary when session replication is
> on. On the other hand, session information takes non-zero time to
> propagate between the members of the cluster, so using session
> stickiness may reduce the risk of out-of-date sessions when a user
> randomly switches servers in the middle of a series of high-rate requests.
>
> I would recommend setting the stickiness timeout to the same as the
> session timeout, assuming that the lb is updating the last-touch time
> for every request mentioning the session. If that's not happening,
> then it probably doesn't really matter what you set your session
> stickiness timeout to be.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJR8B08AAoJEBzwKT+lPKRY7mwQAMN3eUGpNJ3ZgHQaGQbQJsel
> z93LU7OvNVDK1/I5P0HWAezYJ7CCrjKAVBz2IjXqTyeODrS8l6ubc8HKCFexPZlG
> PNBzr4TGx+OeKrlkVGWA7w8mo8LFPcWIwxKmVHPaVHBa30B4SXFXiGqanycn04F/
> VRGFBCC1R3+NLhmn7Cag3ZpfhsnCN4a3XAYy0ZvrW/rARTOpGp68kccJppgv+Uab
> RYZzmGCYQZeLfI2j7BFaAntc38di9+O8X68N/nC4GqIzE+XvDD/ZkYFlvYtzBxNn
> k4MaoRS05KV53qbZrMqSldjU+heIfufB1mF+f/xXlPkOX/fZPVsH6fxEyuS6WPl5
> 4qd/Cs5XXNEvMbz/S4JY8ZtnmSONZr8xffHfJf9rUzNiVqcXGcIOkbg00ZHViUuF
> c/0ADkbrwe8nStChlRfj6h6xybiKo7404g90PA8Op3C4CwO22SOus4tCZdDwXw5H
> N9Kv6DORgPZlH9XaBJzEf6M1n1EruOI1pQ/LC9Lbc3pSAod4QRKbP1zDmfr61UG8
> MF2fsXmvCCIie70rA2xlTk7PRpTwhPCbs7DRDrh/GavPeBomtl43fJSLfNczBMq8
> zTpWfgSgOzOi+VR0+jV2JXQTCQ17nj4Jikl3VR3rUv+11C9rxOjB6vsc3Ir/FHju
> NKrqyHotyHH10s82Do4Z
> =Cr56
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: context problem

2013-07-24 Thread Edward W. Rouse
I had tried that before but thought I'd try again. Not working and I'm not
sure why. The external files are actual additional war files that act as
modifiers to add items to menus as well as other things. There are class
files, jar files in their WEB-INF/lib dirs , html, jsp, etc... And there
could be 0..50 depending on what options are needed.

They do all reside in the same directory that we treat as an extra webapps
directory, but it doesn't merge anything. So the old process was to go to
location A, grab war files (expanded) 1,2 and 3 and merge them into the
proper locations within the base war file (apparently in memory) so that it
looks like a single code base to tomcat. Again, worked in 5.5 not in 7.0.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, July 24, 2013 12:32 PM
To: Tomcat Users List
Subject: RE: context problem

> From: Edward W. Rouse [mailto:ero...@comsquared.com]
> Subject: context problem

> IDWMClassLoader extends WebappClassLoader. 

> I have been reading to docs to try and figure out how to get both the 
> normal webapp base directories and the outside the base directories to be
found.

I suspect you could do away with your IDWMClassLoader and simply use the
VirtualWebappLoader that's packaged with Tomcat.

http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoad
er_Implementation

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: OSGi in Tomcat

2013-07-24 Thread Niki Dokovski
On Wed, Jul 24, 2013 at 9:07 PM, Leonardo Torres
wrote:

> Thank´s for reply.
>
> With Gemini, can I use the tomcat websocket implementation?
>

You can use proprietary org.apache.catalina.websocket implementation. That
however is not compatible with JSR 356 APIs.


>
> On Wed, Jul 24, 2013 at 8:09 AM, Martin Gainty 
> wrote:
>
> > asking your release manager to build an OSGI artifact with eclipse may be
> > a bit of a stretch if this is a live production-ready system then you
> will
> > most likely be building at command-line with either ant or maven
> >
> > the trickiest part is interfacing to BND start and BND stop which can be
> > accomplished with Activator sample code seen here
> >
> >
> http://wso2.com/library/tutorials/develop-osgi-bundles-using-maven-bundle-plugin
> >
> > lets pick this thread on us...@maven.apache.org
> >
> > Martin
> > __
> > /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: Wed, 24 Jul 2013 13:30:01 +0300
> > > Subject: Re: OSGi in Tomcat
> > > From: miles...@gmail.com
> > > To: users@tomcat.apache.org
> > >
> > > 2013/7/23 Leonardo Torres wrote:
> > > >
> > > > Thank´s for reply.
> > > >
> > > > Just one more question, If I want to use tomcat inside of OSGi
> > > environment,
> > > > how can I do that ?
> > > >
> > >
> > > Check Gemini Web documentation:
> > >
> > > http://www.eclipse.org/gemini/web/documentation/
> > > http://wiki.eclipse.org/Gemini/Web
> > >
> > > Regards
> > > Violeta
> >
> >
>
>
>
> --
> Obrigado
> Leonardo Torres.
>


Re: Confusion about session replication

2013-07-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

To whom it may concern,

(Might we know your real name? The above introduction feels so
impersonal...)

On 7/24/13 11:13 AM, Tomcat Random wrote:
> Setup: - Two physical servers each running Tomcat 7.0.42 - Brocade
> load balancer in front
> 
> The load balancer is set to source IP persistence for 5 minutes.
> This time can be changed of course.
> 
> The thing I don't understand is 5 minutes or 5 hours - at then end
> that time limit the user can be sent to the other server and lose
> data stored in the session.
> 
> So why do sticky sessions matter when session replication turned on
> in Tomcat? Is a performance issue?

Sticky sessions aren't really necessary when session replication is
on. On the other hand, session information takes non-zero time to
propagate between the members of the cluster, so using session
stickiness may reduce the risk of out-of-date sessions when a user
randomly switches servers in the middle of a series of high-rate requests.

I would recommend setting the stickiness timeout to the same as the
session timeout, assuming that the lb is updating the last-touch time
for every request mentioning the session. If that's not happening,
then it probably doesn't really matter what you set your session
stickiness timeout to be.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJR8B08AAoJEBzwKT+lPKRY7mwQAMN3eUGpNJ3ZgHQaGQbQJsel
z93LU7OvNVDK1/I5P0HWAezYJ7CCrjKAVBz2IjXqTyeODrS8l6ubc8HKCFexPZlG
PNBzr4TGx+OeKrlkVGWA7w8mo8LFPcWIwxKmVHPaVHBa30B4SXFXiGqanycn04F/
VRGFBCC1R3+NLhmn7Cag3ZpfhsnCN4a3XAYy0ZvrW/rARTOpGp68kccJppgv+Uab
RYZzmGCYQZeLfI2j7BFaAntc38di9+O8X68N/nC4GqIzE+XvDD/ZkYFlvYtzBxNn
k4MaoRS05KV53qbZrMqSldjU+heIfufB1mF+f/xXlPkOX/fZPVsH6fxEyuS6WPl5
4qd/Cs5XXNEvMbz/S4JY8ZtnmSONZr8xffHfJf9rUzNiVqcXGcIOkbg00ZHViUuF
c/0ADkbrwe8nStChlRfj6h6xybiKo7404g90PA8Op3C4CwO22SOus4tCZdDwXw5H
N9Kv6DORgPZlH9XaBJzEf6M1n1EruOI1pQ/LC9Lbc3pSAod4QRKbP1zDmfr61UG8
MF2fsXmvCCIie70rA2xlTk7PRpTwhPCbs7DRDrh/GavPeBomtl43fJSLfNczBMq8
zTpWfgSgOzOi+VR0+jV2JXQTCQ17nj4Jikl3VR3rUv+11C9rxOjB6vsc3Ir/FHju
NKrqyHotyHH10s82Do4Z
=Cr56
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: OT: How to use JSP outside of tomcat

2013-07-24 Thread Martin Gainty
 
Documentation hasnt caught up with functionality so its catch as catch can but 
this should get you to what you need

pom.xml
 

4.0.0
fu
bar


  
  org.codehaus.mojo.jspc
  jspc-maven-plugin
  
  false
  

${basedir}/myapp/src/main/webapp/
 


  **/*.jsp

   

   

   1.6

   1.6




 compile



 


...

 
mvn -e -X compile

http://mojo.codehaus.org/jspc/jspc-compilers/jspc-compiler-tomcat6/index.html
http://mojo.codehaus.org/jspc/jspc-maven-plugin/usage.html

HTH
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: Wed, 24 Jul 2013 13:22:36 -0400
> Subject: OT: How to use JSP outside of tomcat
> From: aryeh.fried...@gmail.com
> To: users@tomcat.apache.org
> 
> I have a number of documents that are very template like and ideal for
> JSP that are 1) not intended for the web and 2) need to be
> automatically batch processed (the output stored in output files).
> How do I call the JSP processor from them command line? (it takes
> tomcat too long to see updated files for the purpose I have in mind)
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
  

Re: OSGi in Tomcat

2013-07-24 Thread Leonardo Torres
Thank´s for reply.

With Gemini, can I use the tomcat websocket implementation?


On Wed, Jul 24, 2013 at 8:09 AM, Martin Gainty  wrote:

> asking your release manager to build an OSGI artifact with eclipse may be
> a bit of a stretch if this is a live production-ready system then you will
> most likely be building at command-line with either ant or maven
>
> the trickiest part is interfacing to BND start and BND stop which can be
> accomplished with Activator sample code seen here
>
> http://wso2.com/library/tutorials/develop-osgi-bundles-using-maven-bundle-plugin
>
> lets pick this thread on us...@maven.apache.org
>
> Martin
> __
> /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: Wed, 24 Jul 2013 13:30:01 +0300
> > Subject: Re: OSGi in Tomcat
> > From: miles...@gmail.com
> > To: users@tomcat.apache.org
> >
> > 2013/7/23 Leonardo Torres wrote:
> > >
> > > Thank´s for reply.
> > >
> > > Just one more question, If I want to use tomcat inside of OSGi
> > environment,
> > > how can I do that ?
> > >
> >
> > Check Gemini Web documentation:
> >
> > http://www.eclipse.org/gemini/web/documentation/
> > http://wiki.eclipse.org/Gemini/Web
> >
> > Regards
> > Violeta
>
>



-- 
Obrigado
Leonardo Torres.


RE: context problem

2013-07-24 Thread Edward W. Rouse
Thanks for the response, let’s work backwards.

3 – yes

2 – looked at and not applicable in this case

1 – The custom classLoader is set fine and it works, except it doesn’t
loader the classes from the webapp base dir, only the outside base dir.

 

Also, if I leave out the custom classLoader by removing the contect.xml
file, the webapp works fine but doesn’t have access to the external optional
files. The whole point of the custom classLoader is to get the optional
external files in addition to the standard base files; and it used to work
for tomcat 5.5 and doesn’t for 7.0 due to changes. I am trying to figure out
which changes are core to this issue and how to work around them.

 

Maybe I should have said that the old process that worked was set up to look
outside the webapp base for additional, optional files for additional,
optional functionality (packaged as exploded war files) and allow access to
those files, treating those files as having precedence over core files. This
was an extension model implemented by a developer who is no longer here and
it worked very well. Now I have to figure out how to get that same
functionality to work in tomcat 7; but so far have only been able to get one
or the other, not both together as an integrated whole.

 

From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Wednesday, July 24, 2013 1:02 PM
To: ero...@comsquared.com
Subject: RE: context problem

 

jars require permission to access and set the classLoader 
here is an example of tomcat-juli.jar which sets ContextClassLoader
1)$CATALINA_HOME/conf/catalina.policy 
 
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
permission java.lang.RuntimePermission "setContextClassLoader";

http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html

2)
 any JAR file that contains Servlet API classes will be explicitly ignored
by the classloader 
 
 
http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html
 

3)
can i assume the context.xml is in webapps/WebAppName/META-INF/context.xml ?

Martin Gainty 
__ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und
Vertraulichkeitanmerkung/Note de déni et de confidentialité

 

Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése
nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi
alkalmazhatósága sincs.  Mivel az electronikus üzenetek könnyen
megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet
tartalma miatt.

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.



 

> From: ero...@comsquared.com
> To: users@tomcat.apache.org
> Subject: context problem
> Date: Wed, 24 Jul 2013 12:21:42 -0400
> 
> I have a web app that worked in version 5.5, not working in version 7.0.
The
> Context.xml is:
> 
> 
> 
> 
> 
>  className="com.comsquared.idw.catalina.ext.IDWMFileDirContext" />
> 
>  loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader"/>
> 
>  type="javax.sql.DataSource"
factory="com.comsquared.idwm.DataSourceFactory"
> />
> 
> 
> 
> 
> 
> IDWMFileDirContext extend FileDirContext, IDWMClassLoader extends
> WebappClassLoader. When IDWMFileDirContext is called, it is called with
the
> default (no arg) constructor, which first calls super();, then imports the
> outside the webapp base jar files. That works fine. Then the
IDWMClassLoader
> is called, which uses the (ClassLoader parent) constructor and again,
calls
> super(parent). Parent is org.apache.catalina.loader.StandardClassLoader
and
> seems to be ok.
> 
> 
> 
> But the next step, loading the DataSource from the DataSourceFactory fails
> with a ClassNotFoundException. That class is in the webapps normal
> WEB-INF/classes directory.
> 
> 
> 
> I have been reading to docs to try and figure out how to get both the
normal
> webapp base directories and the outside the base directories to be found.
> The major difference is that the Loader in 5.5 looked like this:
> 
> 
> 
>  loaderClass="co

Re: OT: How to use JSP outside of tomcat

2013-07-24 Thread Michael-O

Am 2013-07-24 19:22, schrieb Aryeh Friedman:

I have a number of documents that are very template like and ideal for
JSP that are 1) not intended for the web and 2) need to be
automatically batch processed (the output stored in output files).
How do I call the JSP processor from them command line? (it takes
tomcat too long to see updated files for the purpose I have in mind)


Use FreeMarker or Velocity for that. JSP was not designed for that.

Michael


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



OT: How to use JSP outside of tomcat

2013-07-24 Thread Aryeh Friedman
I have a number of documents that are very template like and ideal for
JSP that are 1) not intended for the web and 2) need to be
automatically batch processed (the output stored in output files).
How do I call the JSP processor from them command line? (it takes
tomcat too long to see updated files for the purpose I have in mind)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Local VisualVM connection to Tomcat

2013-07-24 Thread honyk
On 2013-06-28 Christopher Schultz wrote:
> On 6/27/13 5:17 PM, honyk wrote:
> > On 2013-06-27 Christopher Schultz wrote:
> >> On 6/27/13 4:31 PM, honyk wrote:
> >>> I am constantly encountering PermGen errors despite quite high
> >>> PermGen limit (even 512m) and many options set - approx once a
> >>> week under not heavy load.
> >>
> >> Like what kinds of options? What kind of load? What does the
> >> error look like? Are you re-deploying your webapp without
> >> restarting Tomcat, or do you bust PermGen even with a single
> >> deployment?
> >
> > Tomcat runs as service using these Java opts (tomcat7w.exe) -
> > single line
> >
> > -Duser.language=en -XX:MaxPermSize=512m -XX:+DisableExplicitGC
> > -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
> >
> > Originally I used Apache JkMount/Worker to hide that port number.
> > In that case there were listed these errors in the tomcat err log:
> > Exception in thread "ajp-bio-8009-exec-7"
> > java.lang.OutOfMemoryError: PermGen space
> 
> I recommend that you run with -XX:+HeapDumpOnOutOfMemoryError and
> possibly also with -XX:HeapDumpPath=[path to where you want your heap
> dumps to go].

All my options were specified on a single line and thus ignored.
This is the reason why I was getting PermGen errors constantly even when high 
values were specified...

My default value is approx. 85 MB and when all my web apps are invoked, cca 90 
MB is needed. 

Currently I use these settings (JDK 7):
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Duser.language=en
-XX:+DisableExplicitGC
-XX:MaxPermSize=128m
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=C:/DataStorage/tomcat-heap-dump
-XX:OnOutOfMemoryError=""C:\trunk\Tools\Macros\TomcatKiller\task.bat %p""

I removed following options as they seem to be obsolete (?) in JDK 7:
-XX:+CMSClassUnloadingEnabled 
-XX:+CMSPermGenSweepingEnabled

Now my tomcat instance works fine. When OOME occurs (I hope it will never 
happen :), dump is created and my script executed (taskkill /F /PID %1 + 
sending e-mail to me). The tomcat windows service is set to restart itself one 
minute after the first failure (which is triggered when process is killed). My 
apps are simple tools and reports, nothing critical, so I hope this autokilling 
doesn't harm.

I still cannot profile the JVM locally, but this is not an issue any more. For 
basic tomcat monitoring the JMX capabilities are sufficent. But my thread in 
VisualVM forum is still opened and in case of any update I'll let you know.

Thanks you guys for your hints, I learned a lot from your responses recently!

Regards, Jan


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat failure without apparent reason (PermGen?)

2013-07-24 Thread honyk
On 2013-07-23 Christopher Schultz wrote:
> On 7/22/13 3:11 PM, honyk wrote:
> > I am reusing my recent thread of not related subject with some
> > updates...
> >
> > On 2013-06-28 Christopher Schultz wrote:
> >> On 6/27/13 5:17 PM, honyk wrote:
> >>> On 2013-06-27 Christopher Schultz wrote:
>  On 6/27/13 4:31 PM, honyk wrote:
> > I am constantly encountering PermGen errors despite quite
> > high PermGen limit (even 512m) and many options set -
> > approx once a week under not heavy load.
> 
>  Like what kinds of options? What kind of load? What does the
>  error look like? Are you re-deploying your webapp without
>  restarting Tomcat, or do you bust PermGen even with a single
>  deployment?
> >>>
> >>> Tomcat runs as service using these Java opts (tomcat7w.exe) -
> >>> single line
> >>>
> >>> -Duser.language=en -XX:MaxPermSize=512m -XX:+DisableExplicitGC
> >>> -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
> >>>
> >>> Originally I used Apache JkMount/Worker to hide that port
> >>> number. In that case there were listed these errors in the
> >>> tomcat err log: Exception in thread "ajp-bio-8009-exec-7"
> >>> java.lang.OutOfMemoryError: PermGen space
> >>
> >> I recommend that you run with -XX:+HeapDumpOnOutOfMemoryError
> >> and possibly also with -XX:HeapDumpPath=[path to where you want
> >> your heap dumps to go]. If/when your service busts PermGen, you
> >> should be able to inspect the dump and see what all the
> >> java.lang.Class objects are. I suppose it's possible that you
> >> have a lot of intern'd String objects as well (if you are on Java
> >> 1.6 or lower... you didn't say), but it's usually java.lang.Class
> >> objects.
> >>
> >>> Now I use proxypass like this (hoping this is preffered way):
> >>> ProxyPass /my-app ajp://localhost:8009/my-app
> >>>
> >>> and in this case I can see just Exception in thread
> >>> "ajp-bio-8009-exec-4" without any details (but I suppose it is
> >>> the same PermGen one)
> >
> > I've set that recommended options, but when that
> > 'ajp-bio-8009-exec-NN' exception is thrown (recorded in the tomcat
> > err log), no heap dump is created in the specified (and existing)
> > folder: -XX:HeapDumpPath=C:\DataStorage\tomcat-heap-dump
> 
> What was the original thread's subject line? It's hard to get the
> context of your question from what you have included, here. Remember,
> nobody is paying as close attention to your problem as you are...

Sorry for this confusion. But this is rather a completely new topic.

Briefly, if there is just 'ajp-bio-8009-exec-4' exception without further 
details in the tomcat error log, can I somehow get those details? Should I 
change the log level somewhere?

Now I know it was really because of insufficient PermGen. Maybe in this case 
not all exceptions were 'written' to the log properly...

I am still curious. It could be useful for future reference.

Jan


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: context problem

2013-07-24 Thread Caldarale, Charles R
> From: Edward W. Rouse [mailto:ero...@comsquared.com] 
> Subject: context problem

> IDWMClassLoader extends WebappClassLoader. 

> I have been reading to docs to try and figure out how to get both the normal
> webapp base directories and the outside the base directories to be found.

I suspect you could do away with your IDWMClassLoader and simply use the 
VirtualWebappLoader that's packaged with Tomcat.

http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoader_Implementation

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



context problem

2013-07-24 Thread Edward W. Rouse
I have a web app that worked in version 5.5, not working in version 7.0. The
Context.xml is:

 



  

  

  



 

IDWMFileDirContext extend FileDirContext, IDWMClassLoader extends
WebappClassLoader. When IDWMFileDirContext is called, it is called with the
default (no arg) constructor, which first calls super();, then imports the
outside the webapp base jar files. That works fine. Then the IDWMClassLoader
is called, which uses the (ClassLoader parent) constructor and again, calls
super(parent). Parent is org.apache.catalina.loader.StandardClassLoader and
seems to be ok.

 

But the next step, loading the DataSource from the DataSourceFactory fails
with a ClassNotFoundException. That class is in the webapps normal
WEB-INF/classes directory.

 

I have been reading to docs to try and figure out how to get both the normal
webapp base directories and the outside the base directories to be found.
The major difference is that the Loader in 5.5 looked like this:

 



 

And useSystemClassLoaderAsParent isn't recognized and delegate has no
effect.

 

Any hints as to where to look would be a big help.



RE: JMX monitoring of tomcat service

2013-07-24 Thread honyk
On 2013-07-23 honyk wrote:
> On 2013-07-23 Cédric Couralet wrote:
> > 2013/7/23 honyk :
> > > Dear All,
> > >
> > > I run tomcat as service on Windows Server 2008 R2. I am not able to
> > monitor
> > > it locally yet (discussed in another thread) so in the meantime I
> am
> > trying
> > > to establish JMX connection to it acc. to this guide:
> > > http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html
> > >
> > > All params are changed using tomcat7w.exe (in the Java options text
> > field)
> > > and then the service is restarted.
> > >
> > > I am experiencing several weird issues:
> > > 1) Basic settings (single line):
> > > -Dcom.sun.management.jmxremote
> > > -Dcom.sun.management.jmxremote.port=9090
> > > -Dcom.sun.management.jmxremote.ssl=false
> > > -Dcom.sun.management.jmxremote.authenticate=false
> >
> > If these properties are on the same line in the java options tab, it
> > won't work they need to be on different lines.
> 
> Ooops...
> 
> What a shame. Looking into various sources it really seems to be my
> fatal mistake. I'll check tomorrow.

Yes. Using options on separate lines does the job. Now it works as expected.

> > > b) When credentials files were specified, there were still
> > 'FileNotFound'
> > > errors in the log (even when absolute paths were used):
> > > -Dcom.sun.management.jmxremote
> > > -Dcom.sun.management.jmxremote.port=9090
> > > -Dcom.sun.management.jmxremote.authenticate=true
> > > -
> >
> Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
> > > -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access
> > > -Dcom.sun.management.jmxremote.ssl=false
> >
> > When launching tomcat as a service, without changing the default
> > configuration, it will start in the system32 folder (or something
> else
> > on Win 2008) and not in the tomcat folder. So the path for password
> > file and acces file should be absolute
> 
> I tried absolute paths as well, but this result is most likely related
> to
> the above case - all my Java options were on the single line, thus most
> likely ignored completely.

Yes. The same problem as above. I prefer this method as it allows me
connecting the server remotely even through the firewall. Now only two ports
needs to be opened (those defined in the server.xml). In this case only the
following three options are required (if authentication is not needed - this
server runs in the local network only):

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

Thanks a lot!
Jan


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JSVC - two processes running as root

2013-07-24 Thread Rainer Jung
On 24.07.2013 17:34, Rainer Jung wrote:
> On 18.07.2013 21:27, Shridev Makim wrote:
>> Hello,
>> We are trying to run tomcat7 as a daemon using JSVC in SunOS environment.
>> The compiled jsvc executable is owned by root. We have modified daemon.sh
>> that bundles with tomcat7 for our environment to run our tomcat instance.
>> When we execute this shell script, it creates two processes and both the
>> processes are owned by root as shown below (output of ps -ef | grep jsvc):
>>
>> root  9109  9108   2 15:15:03 ?   0:37
>> /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home
>> /doc/dmadmin6/product/jdk6/jd
>> root  9108 1   0 15:15:03 ?   0:00
>> /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home
>> /doc/dmadmin6/product/jdk6/jd
>>
>> We are running the shell script as a non privileged user (dmadmin6) and we
>> are even passing this user name with -user switch to jsvc. We were
>> expecting the child process (pid 9109) to be run as a non privileged user
>> (dmadmin6) in our case. Anyone else has experienced this?
>>
>> Currently in production we have tomcat 6 configured to run with jsvc and in
>> that environment we see that the child process is running as a non
>> privileged user.
>>
>> Thanks in advance for your help!
> 
> Might not be related, but: Default shell on Solaris produces two
> processes when a command is called via
> 
> sh -c "somecommand arg1 arg2"
> 
> One process is the shell, the second one the command after "-c". This
> differs from Linux where you will only see the second one.
> 
> /usr/bin/sh shows the behaviour, /usr/bin/ksh and /usr/xpg4/bin/sh do
> not. You could try to run everything with one of those other two shells
> to quickly check whether that fixes the problem. You'll have to
> experiment a bit, which shell(s) to switch, the one that executes
> daemon.sh, the login shell of user dmadmin6 etc.

Sorry, that has likely not to do with it. A more structured approach:

Process 9108 is the parent of 9109 so it seems the 9108 should go away
and not stay in the process table.

Use "pstack 9108" (or whatever the current parent process PID is) and
post the results here. That'll show us where it "hangs".

And probably it would be nice to use the latest version of jsvc so we
don't need to debug old problems.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JSVC - two processes running as root

2013-07-24 Thread Rainer Jung
On 18.07.2013 21:27, Shridev Makim wrote:
> Hello,
> We are trying to run tomcat7 as a daemon using JSVC in SunOS environment.
> The compiled jsvc executable is owned by root. We have modified daemon.sh
> that bundles with tomcat7 for our environment to run our tomcat instance.
> When we execute this shell script, it creates two processes and both the
> processes are owned by root as shown below (output of ps -ef | grep jsvc):
> 
> root  9109  9108   2 15:15:03 ?   0:37
> /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home
> /doc/dmadmin6/product/jdk6/jd
> root  9108 1   0 15:15:03 ?   0:00
> /doc/dmadmin6/product/tomcat7/bin/jsvc -java-home
> /doc/dmadmin6/product/jdk6/jd
> 
> We are running the shell script as a non privileged user (dmadmin6) and we
> are even passing this user name with -user switch to jsvc. We were
> expecting the child process (pid 9109) to be run as a non privileged user
> (dmadmin6) in our case. Anyone else has experienced this?
> 
> Currently in production we have tomcat 6 configured to run with jsvc and in
> that environment we see that the child process is running as a non
> privileged user.
> 
> Thanks in advance for your help!

Might not be related, but: Default shell on Solaris produces two
processes when a command is called via

sh -c "somecommand arg1 arg2"

One process is the shell, the second one the command after "-c". This
differs from Linux where you will only see the second one.

/usr/bin/sh shows the behaviour, /usr/bin/ksh and /usr/xpg4/bin/sh do
not. You could try to run everything with one of those other two shells
to quickly check whether that fixes the problem. You'll have to
experiment a bit, which shell(s) to switch, the one that executes
daemon.sh, the login shell of user dmadmin6 etc.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Confusion about session replication

2013-07-24 Thread Tomcat Random
Setup:
- Two physical servers each running Tomcat 7.0.42
- Brocade load balancer in front

The load balancer is set to source IP persistence for 5 minutes. This time
can be changed of course.

The thing I don't understand is 5 minutes or 5 hours - at then end that
time limit the user can be sent to the other server and lose data stored in
the session.

So why do sticky sessions matter when session replication turned on in
Tomcat? Is a performance issue?

TIA


RE: [OT] Enable session persistence between two tomcat nodes behind load balancer

2013-07-24 Thread Jeffrey Janner
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Wednesday, July 24, 2013 9:57 AM
> To: Tomcat Users List
> Subject: Re: [OT] Enable session persistence between two tomcat nodes
> behind load balancer
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> Jeffrey,
> 
> On 7/23/13 5:51 PM, Jeffrey Janner wrote:
> >> -Original Message- From: Christopher Schultz
> >> [mailto:ch...@christopherschultz.net] Sent: Monday, July 22, 2013
> >> 5:45 PM To: Tomcat Users List Subject: Re:[OT] Enable session
> >> persistence between two tomcat nodes behind load balancer
> >>
> >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
> >>
> >> Jeffrey,
> >>
> >> On 7/22/13 10:00 AM, Jeffrey Janner wrote:
>  -Original Message- From: vi...@thepenguin.org
>  [mailto:vi...@thepenguin.org] Sent: Saturday, July 20, 2013
>  7:25 AM To: Tomcat Users List Subject: Enable session persistence
>  between
> >> two
>  tomcat nodes behind load balancer
> 
>  Hello:
> 
>  I have been searching for an answer to how to set this up. I find
> a
>  lot of posts on session persistence but none seem to describe how
>  to set it up. Is there a simple explanation out there that tells
> me
>  how I go about setting up session persistence (with Apache, I
> would
>  just set up memcached on the db server and configure the memcache
>  module on each Apache instance to point to the memcached and it
>  works). I don't need opcode persistence. I just want the tomcats
> to
>  either a) direct all session traffic to a single node or b) make
>  the two tomcats aware of all sessions. Can someone point me in the
>  right direction? I am not a java coder, but if code changes need
> to
>  be made, I can work through it.
> 
>  Thanks,
> 
>  Vicki
> 
> 
> >>>
> >>> Vicki - I think you've got your terms a little mixed up here, but
> >>> not much. From your description what you are really looking for is
> >> session
> >>> "replication". You are in luck, because the default server.xml has
> a
> >>> commented out section on how to set up replication right there (at
> >>> least up to Tomcat 6.x). You also want to review the documentation
> >>> on replication on the Tomcat website for your release
> >>> (http://tomcat.apache.org). I said "not much" above, because
> >>> replication relies on persistence-ability, meaning they both need
> >>> the same basic setup in order to work. As I recall from looking
> into
> >>> it (but not setting up a production setup), you must declare your
> >>> sessions persistable in your code for either function to work
> >>> properly. Jeff p.s. In case you're wondering why not production,
> >> turns
> >>> out our initial dev team put way too much info in the session to
> >>> make replication a feasible option for us at the time.  I think
> >>> we've been whittling it away over time, but haven't tried it since
> >>> the first effort.
> >>
> >> I've written (but not actually used - it was just a
> >> proof-of-concept) a Filter and HttpSession wrapper that can wrap
> >> session data in an object wrapper whose only member is a transient
> >> Object reference[1]. This will allow you to throw "huge" objects
> into
> >> the session that won't be sent across the wire (only their empty
> >> wrappers will be sent).
> >>
> >> If your application will tolerate a session attribute "suddenly"
> >> being null, and can recover from that by re-building the necessary
> >> data, you could use the same trick to enable Tomcat's session
> >> persistence.
> >>
> >> - -chris
> >>
> >> [1] You can also do something similar with WeakReference objects,
> >> which allows you to keep huge amounts of data cached in your
> sessions
> >> but allow the garbage collector to discard some of that cached data
> >> if it's getting low on memory.
> >
> > Thanks for the insight Chris, but I seriously doubt our code is that
> > resilient. Besides, I'd much rather have code that's done "right"
> > rather than a bunch of band-aids to work around the issues.
> 
> Honestly, I consider this to be a valid technique for caching rather
> than just a band-aid. But the underlying code has to be tolerant, of
> course.
> 
> > Having a similar discussion right now about an issue that could be
> > fixed in under 10 lines of code changes, a rebuild, and an update of
> > the affected client (a phoneapp), but I'm have to deal with it in a
> > massive configuration change because that's "easier" for the dev
> team.
> > (Codespeack for "no one really knows how to modify phoneapp").
> 
> Hah... the justification is probably that the "code has already been
> tested" and configuration changes don't require re-testing. Introduce
> them to the concept of automated/unit testing :)
> 
> - -chris
In this case it really is the code-speak.  Of course, configuration changes are 
vulnerable to bugs as well and also require testing.  Discovered 

RE: [OT] Enable session persistence between two tomcat nodes behind load balancer

2013-07-24 Thread Jeffrey Janner
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Wednesday, July 24, 2013 9:57 AM
> To: Tomcat Users List
> Subject: Re: [OT] Enable session persistence between two tomcat nodes
> behind load balancer
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> Jeffrey,
> 
> On 7/23/13 5:51 PM, Jeffrey Janner wrote:
> >> -Original Message- From: Christopher Schultz
> >> [mailto:ch...@christopherschultz.net] Sent: Monday, July 22, 2013
> >> 5:45 PM To: Tomcat Users List Subject: Re:[OT] Enable session
> >> persistence between two tomcat nodes behind load balancer
> >>
> >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
> >>
> >> Jeffrey,
> >>
> >> On 7/22/13 10:00 AM, Jeffrey Janner wrote:
>  -Original Message- From: vi...@thepenguin.org
>  [mailto:vi...@thepenguin.org] Sent: Saturday, July 20, 2013
>  7:25 AM To: Tomcat Users List Subject: Enable session persistence
>  between
> >> two
>  tomcat nodes behind load balancer
> 
>  Hello:
> 
>  I have been searching for an answer to how to set this up. I find
> a
>  lot of posts on session persistence but none seem to describe how
>  to set it up. Is there a simple explanation out there that tells
> me
>  how I go about setting up session persistence (with Apache, I
> would
>  just set up memcached on the db server and configure the memcache
>  module on each Apache instance to point to the memcached and it
>  works). I don't need opcode persistence. I just want the tomcats
> to
>  either a) direct all session traffic to a single node or b) make
>  the two tomcats aware of all sessions. Can someone point me in the
>  right direction? I am not a java coder, but if code changes need
> to
>  be made, I can work through it.
> 
>  Thanks,
> 
>  Vicki
> 
> 
> >>>
> >>> Vicki - I think you've got your terms a little mixed up here, but
> >>> not much. From your description what you are really looking for is
> >> session
> >>> "replication". You are in luck, because the default server.xml has
> a
> >>> commented out section on how to set up replication right there (at
> >>> least up to Tomcat 6.x). You also want to review the documentation
> >>> on replication on the Tomcat website for your release
> >>> (http://tomcat.apache.org). I said "not much" above, because
> >>> replication relies on persistence-ability, meaning they both need
> >>> the same basic setup in order to work. As I recall from looking
> into
> >>> it (but not setting up a production setup), you must declare your
> >>> sessions persistable in your code for either function to work
> >>> properly. Jeff p.s. In case you're wondering why not production,
> >> turns
> >>> out our initial dev team put way too much info in the session to
> >>> make replication a feasible option for us at the time.  I think
> >>> we've been whittling it away over time, but haven't tried it since
> >>> the first effort.
> >>
> >> I've written (but not actually used - it was just a
> >> proof-of-concept) a Filter and HttpSession wrapper that can wrap
> >> session data in an object wrapper whose only member is a transient
> >> Object reference[1]. This will allow you to throw "huge" objects
> into
> >> the session that won't be sent across the wire (only their empty
> >> wrappers will be sent).
> >>
> >> If your application will tolerate a session attribute "suddenly"
> >> being null, and can recover from that by re-building the necessary
> >> data, you could use the same trick to enable Tomcat's session
> >> persistence.
> >>
> >> - -chris
> >>
> >> [1] You can also do something similar with WeakReference objects,
> >> which allows you to keep huge amounts of data cached in your
> sessions
> >> but allow the garbage collector to discard some of that cached data
> >> if it's getting low on memory.
> >
> > Thanks for the insight Chris, but I seriously doubt our code is that
> > resilient. Besides, I'd much rather have code that's done "right"
> > rather than a bunch of band-aids to work around the issues.
> 
> Honestly, I consider this to be a valid technique for caching rather
> than just a band-aid. But the underlying code has to be tolerant, of
> course.
> 
> > Having a similar discussion right now about an issue that could be
> > fixed in under 10 lines of code changes, a rebuild, and an update of
> > the affected client (a phoneapp), but I'm have to deal with it in a
> > massive configuration change because that's "easier" for the dev
> team.
> > (Codespeack for "no one really knows how to modify phoneapp").
> 
> Hah... the justification is probably that the "code has already been
> tested" and configuration changes don't require re-testing. Introduce
> them to the concept of automated/unit testing :)
> 
> - -chris

In this case it really is the code-speak.  Of course, configuration changes are 
vulnerable to bugs as well and also require testing.  Discovered

Re: [OT] Enable session persistence between two tomcat nodes behind load balancer

2013-07-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jeffrey,

On 7/23/13 5:51 PM, Jeffrey Janner wrote:
>> -Original Message- From: Christopher Schultz
>> [mailto:ch...@christopherschultz.net] Sent: Monday, July 22, 2013
>> 5:45 PM To: Tomcat Users List Subject: Re:[OT] Enable session
>> persistence between two tomcat nodes behind load balancer
>> 
>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
>> 
>> Jeffrey,
>> 
>> On 7/22/13 10:00 AM, Jeffrey Janner wrote:
 -Original Message- From: vi...@thepenguin.org 
 [mailto:vi...@thepenguin.org] Sent: Saturday, July 20, 2013
 7:25 AM To: Tomcat Users List Subject: Enable session
 persistence between
>> two
 tomcat nodes behind load balancer
 
 Hello:
 
 I have been searching for an answer to how to set this up. I
 find a lot of posts on session persistence but none seem to
 describe how to set it up. Is there a simple explanation out
 there that tells me how I go about setting up session
 persistence (with Apache, I would just set up memcached on
 the db server and configure the memcache module on each
 Apache instance to point to the memcached and it works). I 
 don't need opcode persistence. I just want the tomcats to
 either a) direct all session traffic to a single node or b)
 make the two tomcats aware of all sessions. Can someone point
 me in the right direction? I am not a java coder, but if code
 changes need to be made, I can work through it.
 
 Thanks,
 
 Vicki
 
 
>>> 
>>> Vicki - I think you've got your terms a little mixed up here,
>>> but not much. From your description what you are really looking
>>> for is
>> session
>>> "replication". You are in luck, because the default server.xml
>>> has a commented out section on how to set up replication right
>>> there (at least up to Tomcat 6.x). You also want to review the
>>> documentation on replication on the Tomcat website for your
>>> release (http://tomcat.apache.org). I said "not much" above,
>>> because replication relies on persistence-ability, meaning they
>>> both need the same basic setup in order to work. As I recall
>>> from looking into it (but not setting up a production setup),
>>> you must declare your sessions persistable in your code for
>>> either function to work properly. Jeff p.s. In case you're
>>> wondering why not production,
>> turns
>>> out our initial dev team put way too much info in the session
>>> to make replication a feasible option for us at the time.  I
>>> think we've been whittling it away over time, but haven't tried
>>> it since the first effort.
>> 
>> I've written (but not actually used - it was just a
>> proof-of-concept) a Filter and HttpSession wrapper that can wrap
>> session data in an object wrapper whose only member is a
>> transient Object reference[1]. This will allow you to throw
>> "huge" objects into the session that won't be sent across the
>> wire (only their empty wrappers will be sent).
>> 
>> If your application will tolerate a session attribute "suddenly"
>> being null, and can recover from that by re-building the
>> necessary data, you could use the same trick to enable Tomcat's
>> session persistence.
>> 
>> - -chris
>> 
>> [1] You can also do something similar with WeakReference objects,
>> which allows you to keep huge amounts of data cached in your
>> sessions but allow the garbage collector to discard some of that
>> cached data if it's getting low on memory.
> 
> Thanks for the insight Chris, but I seriously doubt our code is
> that resilient. Besides, I'd much rather have code that's done
> "right" rather than a bunch of band-aids to work around the
> issues.

Honestly, I consider this to be a valid technique for caching rather
than just a band-aid. But the underlying code has to be tolerant, of
course.

> Having a similar discussion right now about an issue that could be 
> fixed in under 10 lines of code changes, a rebuild, and an update
> of the affected client (a phoneapp), but I'm have to deal with it
> in a massive configuration change because that's "easier" for the
> dev team.  (Codespeack for "no one really knows how to modify 
> phoneapp").

Hah... the justification is probably that the "code has already been
tested" and configuration changes don't require re-testing. Introduce
them to the concept of automated/unit testing :)

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJR7+tLAAoJEBzwKT+lPKRYe8kQAMMOKRhHck6wjeNFzC+S64b7
GVo7VlEnCBAS+IoKbsOMsU3yb09D6Y90j3C6A7Mik7bpe7Qwg197D4+3N2stR7Rj
NkDHOk43gXe53rsxIo63ZPXFkW+zI++1vA4do3GLj5hYz+MdhzKJmMcUHf5i8fEK
PD7mvsWwk7MOrQdZSgRUOYbaRsO6MKPyOOJOiCYZ/6o8Ug7n0jInZXvq0X2w9qf9
Kg6p7daggoKiBrFjcRng+cIyfKa4mYFqZSrk/Y+bbBar1ny20XSvqRO5bnuFq08W
hEfJQwDMI4h0z9GkCAHSoXk/e3sM1RUN5VQlqG7LQ8OInxZ5PPIsq1QmrL9hhaux
5UkrvhNYl5pljqVXec6pW

RE: OSGi in Tomcat

2013-07-24 Thread Martin Gainty
asking your release manager to build an OSGI artifact with eclipse may be a bit 
of a stretch if this is a live production-ready system then you will most 
likely be building at command-line with either ant or maven

the trickiest part is interfacing to BND start and BND stop which can be 
accomplished with Activator sample code seen here
http://wso2.com/library/tutorials/develop-osgi-bundles-using-maven-bundle-plugin
 
lets pick this thread on us...@maven.apache.org

Martin 
__ 
/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: Wed, 24 Jul 2013 13:30:01 +0300
> Subject: Re: OSGi in Tomcat
> From: miles...@gmail.com
> To: users@tomcat.apache.org
> 
> 2013/7/23 Leonardo Torres wrote:
> >
> > Thank´s for reply.
> >
> > Just one more question, If I want to use tomcat inside of OSGi
> environment,
> > how can I do that ?
> >
> 
> Check Gemini Web documentation:
> 
> http://www.eclipse.org/gemini/web/documentation/
> http://wiki.eclipse.org/Gemini/Web
> 
> Regards
> Violeta
  

Re: OSGi in Tomcat

2013-07-24 Thread Violeta Georgieva
2013/7/23 Leonardo Torres wrote:
>
> Thank´s for reply.
>
> Just one more question, If I want to use tomcat inside of OSGi
environment,
> how can I do that ?
>

Check Gemini Web documentation:

http://www.eclipse.org/gemini/web/documentation/
http://wiki.eclipse.org/Gemini/Web

Regards
Violeta