Re: Console when running as a service.

2013-03-11 Thread André Warnier

Sam Takoy wrote:

Hi,

Just installed Tomcat 7 as a service (by running service install).

This is a change for me: historically, I've been running tomcat by running startup in 
tomcat/bin, but now I want to get with the times.

With my new, better way of running tomcat, how do I monitor with the server is 
writing to stdout and stderr? I know where to find the content 
(tomcat7-stderr.2013-03-11.log, etc.) but what is a good way to monitor it, 
i.e. see what's going on as it is happening?



Well, basically it is either the one or the other, can't have your cake and eat 
it, etc..
A Service or daemon, by definition, runs in the background and doesn't give you a 
real-time console to look at.
Under Unix/Linux, you could use a command like tail -f logfile which would display the 
end of the logfile as it is being written.  But I do not know if Windows has any 
equivalent thing.


Talking about getting with the times, maybe you are missing another evolutionary step 
here : virtualisation (see Vmware etc.).  Basically, this allows you to create a virtual 
machine in which to run Windows (and Tomcat), and to connect from a remote location to 
the (also virtual) console of that machine.  This would allow you to continue to run 
Tomcat in a command window (and see STDOUT/STDERR), without some of the inconvenients due 
to having to have a physical console to run it on.


HTH.

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



Re: Tomcat jdbc pool connection failover

2013-03-11 Thread André Warnier

amit shah wrote:

Hello,
I would like to know if the tomcat jdbc pool (7.0.34+) provides
connection failover capabilities i.e. to transparently close all the open
database connections and switch to a another database server on an
planned/unplanned database server outage event.
I read through the tomcat documentation but didn't find any details
related to this. If this feature is not supported are there any recommended
alternatives and any future plans to add this feature to the jdbc pool?


Hi.
This is not a direct answer to your question, and I am not able to provide one.
But one alternative to your above scenario which does exist, is to have a pool of Tomcats, 
each with its own database server.



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



RE: Console when running as a service.

2013-03-11 Thread Harris, Jeffrey E.


 -Original Message-
 From: André Warnier [mailto:a...@ice-sa.com]
 Sent: Monday, March 11, 2013 4:34 AM
 To: Tomcat Users List
 Subject: Re: Console when running as a service.

 Sam Takoy wrote:
  Hi,
 
  Just installed Tomcat 7 as a service (by running service install).
 
  This is a change for me: historically, I've been running tomcat by
 running startup in tomcat/bin, but now I want to get with the
 times.
 
  With my new, better way of running tomcat, how do I monitor with the
 server is writing to stdout and stderr? I know where to find the
 content (tomcat7-stderr.2013-03-11.log, etc.) but what is a good way to
 monitor it, i.e. see what's going on as it is happening?
 

 Well, basically it is either the one or the other, can't have your cake
 and eat it, etc..
 A Service or daemon, by definition, runs in the background and
 doesn't give you a real-time console to look at.
 Under Unix/Linux, you could use a command like tail -f logfile
 which would display the end of the logfile as it is being written.  But
 I do not know if Windows has any equivalent thing.


Yes, there are versions of tail for Windows; Google is our friend.  One version 
is at http://tailforwin32.sourceforge.net/.

 Talking about getting with the times, maybe you are missing another
 evolutionary step here : virtualisation (see Vmware etc.).  Basically,
 this allows you to create a virtual machine in which to run Windows
 (and Tomcat), and to connect from a remote location to the (also
 virtual) console of that machine.  This would allow you to continue to
 run Tomcat in a command window (and see STDOUT/STDERR), without some of
 the inconvenients due to having to have a physical console to run it
 on.

But some of the advantages of using a service (whether on a physical or virtual 
server) are automatic startup (without having to be logged into the server) at 
boot time, and the ability to restart the service or to take other action if 
the service should stop (presuming that the cause of the stoppage was not 
something that would prevent the service from starting again).

And the console only contains a limited amount of information (even considering 
the data accessible by scrolling back in the window), so if one is not 
constantly monitoring the console, one is likely to miss events that would also 
be captured in the log files.


 HTH.

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


This e-mail and any attachments are intended only for the use of the 
addressee(s) named herein and may contain proprietary information. If you are 
not the intended recipient of this e-mail or believe that you received this 
email in error, please take immediate action to notify the sender of the 
apparent error by reply e-mail; permanently delete the e-mail and any 
attachments from your computer; and do not disseminate, distribute, use, or 
copy this message and any attachments.

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



Re: Tomcat jdbc pool connection failover

2013-03-11 Thread Daniel Mikusa
On Mar 11, 2013, at 12:52 AM, amit shah wrote:

 Hello,
I would like to know if the tomcat jdbc pool (7.0.34+) provides
 connection failover capabilities i.e. to transparently close all the open
 database connections and switch to a another database server on an
 planned/unplanned database server outage event.
I read through the tomcat documentation but didn't find any details
 related to this. If this feature is not supported are there any recommended
 alternatives and any future plans to add this feature to the jdbc pool?

You might want to see if your JDBC driver will handle this for you.  I know 
that some do, like MySQL [1].

Dan

[1] - 
https://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html

 
 Thank you,
 Amit

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



Re: Console when running as a service.

2013-03-11 Thread André Warnier

Harris, Jeffrey E. wrote:



-Original Message-
From: André Warnier [mailto:a...@ice-sa.com]
Sent: Monday, March 11, 2013 4:34 AM
To: Tomcat Users List
Subject: Re: Console when running as a service.

Sam Takoy wrote:

Hi,

Just installed Tomcat 7 as a service (by running service install).

This is a change for me: historically, I've been running tomcat by

running startup in tomcat/bin, but now I want to get with the
times.

With my new, better way of running tomcat, how do I monitor with the

server is writing to stdout and stderr? I know where to find the
content (tomcat7-stderr.2013-03-11.log, etc.) but what is a good way to
monitor it, i.e. see what's going on as it is happening?
Well, basically it is either the one or the other, can't have your cake
and eat it, etc..
A Service or daemon, by definition, runs in the background and
doesn't give you a real-time console to look at.
Under Unix/Linux, you could use a command like tail -f logfile
which would display the end of the logfile as it is being written.  But
I do not know if Windows has any equivalent thing.



Yes, there are versions of tail for Windows; Google is our friend.  One version 
is at http://tailforwin32.sourceforge.net/.


Talking about getting with the times, maybe you are missing another
evolutionary step here : virtualisation (see Vmware etc.).  Basically,
this allows you to create a virtual machine in which to run Windows
(and Tomcat), and to connect from a remote location to the (also
virtual) console of that machine.  This would allow you to continue to
run Tomcat in a command window (and see STDOUT/STDERR), without some of
the inconvenients due to having to have a physical console to run it
on.


But some of the advantages of using a service (whether on a physical or virtual 
server) are automatic startup (without having to be logged into the server) at 
boot time, and the ability to restart the service or to take other action if 
the service should stop (presuming that the cause of the stoppage was not 
something that would prevent the service from starting again).

And the console only contains a limited amount of information (even considering 
the data accessible by scrolling back in the window), so if one is not 
constantly monitoring the console, one is likely to miss events that would also 
be captured in the log files.



I agree with all the above.

On the other hand, running in a console (or command window) as a normal process also has 
some advantages compared to running as a Service.  For example, a lot of standard Windows 
programs will not run, or not correctly, when used in a Service context (MS-Office 
programs for example). So if for some scenarios, it would be useful to use say MS-Word to 
produce a PDF version of a document, it is not possible (or very difficult) to trigger 
this from Tomcat when running as a Service. But it runs perfectly well when Tomcat runs in 
a command window.


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



Re: Tomcat jdbc pool connection failover

2013-03-11 Thread amit shah
Apparently we use Oracle as our data store while the solution you mentioned
is for mysql.

Is there a way tomcat can provide a notification after all its retries to
the database server have failed? This way at least I can create a new
connection pool configured to a different database server in order to
simulate a automatic connection failover from the application side. I
understand that this step would require time for the retries and creation
of new pool.

Thanks.


On Mon, Mar 11, 2013 at 6:15 PM, Daniel Mikusa dmik...@vmware.com wrote:

 On Mar 11, 2013, at 12:52 AM, amit shah wrote:

  Hello,
 I would like to know if the tomcat jdbc pool (7.0.34+) provides
  connection failover capabilities i.e. to transparently close all the open
  database connections and switch to a another database server on an
  planned/unplanned database server outage event.
 I read through the tomcat documentation but didn't find any
 details
  related to this. If this feature is not supported are there any
 recommended
  alternatives and any future plans to add this feature to the jdbc pool?

 You might want to see if your JDBC driver will handle this for you.  I
 know that some do, like MySQL [1].

 Dan

 [1] -
 https://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html

 
  Thank you,
  Amit

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




[OT] Console when running as a service.

2013-03-11 Thread Leo Donahue - RDSA IT
I would be curious to find out how many users run Tomcat from the console in a 
virtual machine environment.

When you remote into your virtual machine that is running Tomcat from the 
console, you must not be logging off of that session are you?  How do you keep 
the console window open, unless you just close the session?  When you remote 
back into your server after time passes, how do you know you will get the same 
session?

In our virtual environment, I've never been able to leave the console window 
running.  Something eventually kills the console window, so we've been running 
it as a service.

Leo




Re: Tomcat jdbc pool connection failover

2013-03-11 Thread André Warnier

Hi.
Don't top post.

amit shah wrote:

Apparently we use Oracle as our data store while the solution you mentioned
is for mysql.


And did you check if the Oracle JDBC driver provides such an option ?



Is there a way tomcat can provide a notification after all its retries to
the database server have failed? This way at least I can create a new
connection pool configured to a different database server in order to
simulate a automatic connection failover from the application side. I
understand that this step would require time for the retries and creation
of new pool.


I am not a Java specialist, but I would imagine that at least your application would get 
some kind of I/O exception when that happens on a read or a write.

Can you not catch that and do whatever you need to then ?
After all, even if the driver itself handles the primary case, there would still be a 
possibility that even your backup database server would also be unreachable, no ?




Thanks.


On Mon, Mar 11, 2013 at 6:15 PM, Daniel Mikusa dmik...@vmware.com wrote:


On Mar 11, 2013, at 12:52 AM, amit shah wrote:


Hello,
   I would like to know if the tomcat jdbc pool (7.0.34+) provides
connection failover capabilities i.e. to transparently close all the open
database connections and switch to a another database server on an
planned/unplanned database server outage event.
   I read through the tomcat documentation but didn't find any

details

related to this. If this feature is not supported are there any

recommended

alternatives and any future plans to add this feature to the jdbc pool?

You might want to see if your JDBC driver will handle this for you.  I
know that some do, like MySQL [1].

Dan

[1] -
https://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html


Thank you,
Amit

-
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: [OT] Console when running as a service.

2013-03-11 Thread Harris, Jeffrey E.


 -Original Message-
 From: Leo Donahue - RDSA IT [mailto:leodona...@mail.maricopa.gov]
 Sent: Monday, March 11, 2013 10:56 AM
 To: Tomcat Users List (users@tomcat.apache.org)
 Subject: [OT] Console when running as a service.

 I would be curious to find out how many users run Tomcat from the
 console in a virtual machine environment.

 When you remote into your virtual machine that is running Tomcat from
 the console, you must not be logging off of that session are you?  How
 do you keep the console window open, unless you just close the session?
 When you remote back into your server after time passes, how do you
 know you will get the same session?

 In our virtual environment, I've never been able to leave the console
 window running.  Something eventually kills the console window, so
 we've been running it as a service.

 Leo

We always run Tomcat as a service, but to answer your questions:

If you run Tomcat from a console, you cannot log off; otherwise, the 
application terminates.

You can disconnect from the session (not log off) and any applications already 
running keep running.  Normally, you would reconnect to the same session, but 
if you do not, you can use Terminal Services Manager to reconnect to the 
session (by default, Windows Server 2000 and 2003 allow two administrator 
sessions at the same time plus the local console connection; by default, 
Windows Server 2008 and later normally connect to the console session, although 
that can be changed by configuring local or domain group policies to allow 
multiple sessions as in Windows Server 2000 and 2003).

Although the default is that disconnecting a session leaves it running until 
someone either logs out of the session or reboots the server, many 
organizations set an idle time limit for disconnected or inactive sessions, and 
actually reset them after the time limit is reached, which is the same as 
logging out.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the 
addressee(s) named herein and may contain proprietary information. If you are 
not the intended recipient of this e-mail or believe that you received this 
email in error, please take immediate action to notify the sender of the 
apparent error by reply e-mail; permanently delete the e-mail and any 
attachments from your computer; and do not disseminate, distribute, use, or 
copy this message and any attachments.

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



Re: [OT] Console when running as a service.

2013-03-11 Thread André Warnier

Leo Donahue - RDSA IT wrote:

I would be curious to find out how many users run Tomcat from the console in a 
virtual machine environment.

When you remote into your virtual machine that is running Tomcat from the 
console, you must not be logging off of that session are you?  How do you keep 
the console window open, unless you just close the session?  When you remote 
back into your server after time passes, how do you know you will get the same 
session?

In our virtual environment, I've never been able to leave the console window 
running.  Something eventually kills the console window, so we've been running 
it as a service.



I do this all the time, on a series of servers (Tomcat or others), often on several 
servers at once from my laptop.
Using a vSphere Client or VNC for instance, does not logoff the user session or close any 
window when you connect/disconnect.   It is only MS Remote Desktop or Remote Console 
thingies who do that.


And both the above solutions require a password to connect to the console, so since there 
is no real physical console attached to the server, the fact of leaving this console 
logged-in is not any more of a security issue than anything else.


I am not advocating this solution as a universal solution to everything. There are cases 
when running as a Windows Service is more appropriate (or mandatory).  In some other 
cases, the above solutions are more practical. YMMV as they say.


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



Re: Console when running as a service.

2013-03-11 Thread Howard W. Smith, Jr.
On Mon, Mar 11, 2013 at 4:33 AM, André Warnier a...@ice-sa.com wrote:


 Well, basically it is either the one or the other, can't have your cake
 and eat it, etc..


wow, can't have your cake and eat it... that got me cracking up! funny! :)



 Under Unix/Linux, you could use a command like tail -f logfile which
 would display the end of the logfile as it is being written.  But I do not
 know if Windows has any equivalent thing.


On Windows Server 2003 and 2008, I use TextPad (which is a really great
file editor, similar to Multi-Edit, which I previously used many years ago
in the past). Anyway, TextPad always informs me when a file (that I'm
currently viewing in TextPad) has been updated, and then prompts me to load
the newly-updated file.


 Talking about getting with the times, maybe you are missing another
 evolutionary step here : virtualisation (see Vmware etc.).  Basically, this
 allows you to create a virtual machine in which to run Windows (and
 Tomcat), and to connect from a remote location to the (also virtual)
 console of that machine.  This would allow you to continue to run Tomcat in
 a command window (and see STDOUT/STDERR), without some of the inconvenients
 due to having to have a physical console to run it on.


Interesting. this is good to know.


Re: date format in Last-modified header

2013-03-11 Thread André Warnier

getridofthespam wrote:

Hi,

Google didn't give any relevant info so I try here.

I traced a tomcat request and noticed there where two different date formats in the 
last-modified header:

2012-12-13T09:52:02Z
and
Mon, 07 Jan 2013 21:49:08 GMT

What determines the format and where do the differences come from?



According to Perl's help, these formats orginate from :
They correspond to the C library routines strftime and ctime.

Searching Google for that, this page provides a lot more information :
http://linux.die.net/man/3/strftime

I am also sure that there must be an RFC (2616?) that mentions the various acceptable 
formats in HTTP. Mmmm. For example, searching Google for http rfc date format yields 
this : https://tools.ietf.org/html/rfc3339) (and also a reference to RFC 2616).


Now, how from there they make their way into Tomcat's last-modified headers, I wouldn't 
know.


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



Re: Tomcat jdbc pool connection failover

2013-03-11 Thread Shanti Suresh
On Mon, Mar 11, 2013 at 11:00 AM, André Warnier a...@ice-sa.com wrote:


 amit shah wrote:

 Apparently we use Oracle as our data store while the solution you
 mentioned
 is for mysql.


 And did you check if the Oracle JDBC driver provides such an option ?



 Is there a way tomcat can provide a notification after all its retries to
 the database server have failed? This way at least I can create a new
 connection pool configured to a different database server in order to
 simulate a automatic connection failover from the application side. I
 understand that this step would require time for the retries and creation
 of new pool.


 I am not a Java specialist, but I would imagine that at least your
 application would get some kind of I/O exception when that happens on a
 read or a write.
 Can you not catch that and do whatever you need to then ?
 After all, even if the driver itself handles the primary case, there would
 still be a possibility that even your backup database server would also be
 unreachable, no ?


How often does an unplanned outage occur?  It would seem drastic if an
unplanned database server outage occurs often.
For planned server outages, usually, the failover is done out-of-band with
Tomcat.  Please correct me if I am wrong.
Some simple options I can think of include:
* DNS mapping - map the DNS name of the Oracle server to the new IP address
of the second server - make sure that networkaddress.cache.ttl=1800 or
something other than -1 in the jre/lib/java.security file
* a loadbalancer listing both database servers with one inactive - then you
mark the secondary server as active, and the primary as inactive during
maintenance of the primary database server.

Thanks.

  -Shanti



 On Mon, Mar 11, 2013 at 6:15 PM, Daniel Mikusa dmik...@vmware.com
 wrote:

  On Mar 11, 2013, at 12:52 AM, amit shah wrote:

  Hello,
I would like to know if the tomcat jdbc pool (7.0.34+) provides
 connection failover capabilities i.e. to transparently close all the
 open
 database connections and switch to a another database server on an
 planned/unplanned database server outage event.
I read through the tomcat documentation but didn't find any

 details

 related to this. If this feature is not supported are there any

 recommended

 alternatives and any future plans to add this feature to the jdbc pool?

 You might want to see if your JDBC driver will handle this for you.  I
 know that some do, like MySQL [1].




Re: java.util.logging.SimpleFormatter vs org.apache.juli.OneLineFormatter

2013-03-11 Thread Jesse Farinacci
Greetings,

On Fri, Mar 8, 2013 at 8:38 PM, Jesse Farinacci jie...@gmail.com wrote:
 I am using Java 7, IBM JRE and Apache Tomcat 7.0.37. I am seeing a
 strange difference between java.util.logging.SimpleFormatter vs
 org.apache.juli.OneLineFormatter: namely, for my applications, the
 SimpleFormatter will produce log records with the Class name included
 but OneLineFormatter will not. The exact same application, with only
 changes to the .formatter are enough to show this change.

Thank you everyone for some good comments. I did not attach a formal
debugger, but I was able to brute force narrow down where the problem
is occurring: org.apache.juli.AsyncFileHandler. If I swap out
org.apache.juli.AsyncFileHandler with org.apache.juli.FileHandler then
the org.apache.juli.OneLineFormatter works just perfectly.

Here is the working configuration:

handlers = 1catalina.org.apache.juli.FileHandler,
2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler
.handlers = 1catalina.org.apache.juli.FileHandler

1catalina.org.apache.juli.FileHandler.level = ALL
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
1catalina.org.apache.juli.FileHandler.formatter =
org.apache.juli.OneLineFormatter

2localhost.org.apache.juli.FileHandler.level = ALL
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
2localhost.org.apache.juli.FileHandler.formatter =
org.apache.juli.OneLineFormatter

3manager.org.apache.juli.FileHandler.level = ALL
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.
3manager.org.apache.juli.FileHandler.formatter =
org.apache.juli.OneLineFormatter

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = ALL
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers
= 2localhost.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level
= ALL
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers
= 3manager.org.apache.juli.FileHandler

A swap to AsyncFileHandler shows the problem. Most times I see
null.null for className and methodName, but sometimes the className is
filled in and the methodName is null. So, perhaps, under heavy load,
AsyncFileHandler doesn't behave predictably with respect to some
LogRecord fields.

-Jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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



Re: Console when running as a service.

2013-03-11 Thread pid
On 11 Mar 2013, at 14:21, André Warnier a...@ice-sa.com wrote:

 So if for some scenarios, it would be useful to use say MS-Word to
 produce a PDF version of a document, it is not possible (or very difficult) 
 to trigger
 this from Tomcat when running as a Service.

Eek! Eek I say!


p

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



Re: Tomcat jdbc pool connection failover

2013-03-11 Thread Daniel Mikusa
On Mar 11, 2013, at 10:09 AM, amit shah wrote:

 Apparently we use Oracle as our data store while the solution you mentioned
 is for mysql.

I'm not an Oracle guy, but I'm pretty sure that it supports failover.  Not sure 
it's as simple as changing the JDBC URL though, you'll probably want to check 
with your DBA to figure out more.

 
 Is there a way tomcat can provide a notification after all its retries to
 the database server have failed?

This should throw an exception and indicate it was unable to create a 
connection.  I suppose that you could catch this and do something else.  It's 
not the best approach though.  I think the JDBC driver could handle this more 
seamlessly, since it's closer to the DB.

 This way at least I can create a new
 connection pool configured to a different database server in order to
 simulate a automatic connection failover from the application side. I
 understand that this step would require time for the retries and creation
 of new pool.

Perhaps you could create two datasources on startup, a primary and a secondary. 
 The application would always default to the primary, unless it couldn't get a 
connection.  Then it would use the secondary.  Not a great solution, but sounds 
similar to what you mentioned.

Dan



 
 Thanks.
 
 
 On Mon, Mar 11, 2013 at 6:15 PM, Daniel Mikusa dmik...@vmware.com wrote:
 
 On Mar 11, 2013, at 12:52 AM, amit shah wrote:
 
 Hello,
   I would like to know if the tomcat jdbc pool (7.0.34+) provides
 connection failover capabilities i.e. to transparently close all the open
 database connections and switch to a another database server on an
 planned/unplanned database server outage event.
   I read through the tomcat documentation but didn't find any
 details
 related to this. If this feature is not supported are there any
 recommended
 alternatives and any future plans to add this feature to the jdbc pool?
 
 You might want to see if your JDBC driver will handle this for you.  I
 know that some do, like MySQL [1].
 
 Dan
 
 [1] -
 https://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html
 
 
 Thank you,
 Amit
 
 -
 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: Console when running as a service.

2013-03-11 Thread André Warnier

p...@pidster.com wrote:

On 11 Mar 2013, at 14:21, André Warnier a...@ice-sa.com wrote:


So if for some scenarios, it would be useful to use say MS-Word to
produce a PDF version of a document, it is not possible (or very difficult) to 
trigger
this from Tomcat when running as a Service.


Eek! Eek I say!


+1. Eek, I tearfully and shamefully agree.
But still 90% or more of corporate internal documents are written as Word documents, and 
there is no open-source tool which can perfectly handle this shamefully proprietary format 
and convert it to some non-propietary format that one could still read in 10 year's time, 
so what is one to do if one wants to get some money to get one's children through computer 
school and pay for their iPhones, he ?


But the main point was that there are cases where running as a Service is the most 
appropriate way, and cases where it isn't.  And that modern technology often provides a 
variety of ways to achieve one's goals at minimum expense and frustration. And that many 
times it is not that the information on how to do something is not available, it is a 
matter of not knowing where or how to find it among the clutter.  So indicating some 
practical alternatives seemed the right thing to do here.





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



Re: Console when running as a service.

2013-03-11 Thread Mark Eggers

On 3/11/2013 11:20 AM, André Warnier wrote:

p...@pidster.com wrote:

On 11 Mar 2013, at 14:21, André Warnier a...@ice-sa.com wrote:


So if for some scenarios, it would be useful to use say MS-Word to
produce a PDF version of a document, it is not possible (or very
difficult) to trigger
this from Tomcat when running as a Service.


Eek! Eek I say!


+1. Eek, I tearfully and shamefully agree.
But still 90% or more of corporate internal documents are written as
Word documents, and there is no open-source tool which can perfectly
handle this shamefully proprietary format and convert it to some
non-propietary format that one could still read in 10 year's time, so
what is one to do if one wants to get some money to get one's children
through computer school and pay for their iPhones, he ?


Sigh, I agree if your constraint is perfectly then you're pretty much 
stuck. However, even Microsoft doesn't deal with their formats perfectly.


An alternate solution (which I've not played with in a very long time) 
could be:


http://poi.apache.org/

This could remove the requirement for interacting with a desktop 
application when dealing with some Microsoft formats.



But the main point was that there are cases where running as a Service
is the most appropriate way, and cases where it isn't.  And that modern
technology often provides a variety of ways to achieve one's goals at
minimum expense and frustration. And that many times it is not that the
information on how to do something is not available, it is a matter of
not knowing where or how to find it among the clutter.  So indicating
some practical alternatives seemed the right thing to do here.


I know how to do the original request in Eclipse and NetBeans, but I 
don't have a quick handle on how to do this for Tomcat running as a 
Windows service.


There were several hits with a quick search, but since I've not used any 
of the projects I'm a bit reluctant to mention them.


. . . . just my two cents.
/mde/


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



Re: [OT] Console when running as a service.

2013-03-11 Thread André Warnier

Mark Eggers wrote:

On 3/11/2013 11:20 AM, André Warnier wrote:

p...@pidster.com wrote:

On 11 Mar 2013, at 14:21, André Warnier a...@ice-sa.com wrote:


So if for some scenarios, it would be useful to use say MS-Word to
produce a PDF version of a document, it is not possible (or very
difficult) to trigger
this from Tomcat when running as a Service.


Eek! Eek I say!


+1. Eek, I tearfully and shamefully agree.
But still 90% or more of corporate internal documents are written as
Word documents, and there is no open-source tool which can perfectly
handle this shamefully proprietary format and convert it to some
non-propietary format that one could still read in 10 year's time, so
what is one to do if one wants to get some money to get one's children
through computer school and pay for their iPhones, he ?


Sigh, I agree if your constraint is perfectly then you're pretty much 
stuck. However, even Microsoft doesn't deal with their formats perfectly.




Marking this OT now, because we are deriving significantly from the OP's 
original question.

My definition of perfectly in this case, is pretty much undistinguishable from what the 
user himself would get if he told MS-Office : save this MS-Office document as PDF.
For 95% of MS-Office documents, OpenOffice for instance (which is no problem to run inside 
a Service context) will do a very good job.  Unfortunately, there are 5% of documents for 
which it will produce something of which the look (and even sometimes the content) differs 
significantly from the original document, and from the same PDF produced by MS-Office 
itself.  And 5% of hundreds of documents per day is a large number of documents.
For some users and some documents it doesn't really matter all that much, but for some 
others it does.  So again, it depends on the exact circumstances.


We have a similar issue with PDFs.  There are umpteen libraries out there which create 
PDFs, some of them better than others.  Some of them produce PDFs which are really buggy - 
in the sense of really not respecting the published PDF specification. But they can still 
be opened by the Adobe Acrobat Reader, which is the reference that most users refer to 
(If I can open it with Acrobat, then it's a correct PDF).  This is basically wrong, 
because the Adobe Acrobat Reader is rather tolerant, and will open and display some PDFs 
which are obviously sloppy.  But it forces us to also create tools which can read and 
process such sloppy PDFs, and maybe thus accept a PDF which the next generation of readers 
won't be able to open.


Sigh. Sometimes being correct and abiding by the rules conflicts with being practical, and 
one has to navigate between them as judiciously as possible.


An alternate solution (which I've not played with in a very long time) 
could be:


http://poi.apache.org/

This could remove the requirement for interacting with a desktop 
application when dealing with some Microsoft formats.




Thanks, I'll have a look at it (maybe again).
There exist a number of such alternatives. Some are better for some documents, worse for 
others.  And over time, some get better and some get worse (slower development, do not 
keep in sync with new document versions).  We are always on the lookout for the best 
alternative of the moment, and try to structure our applications so that we can switch the 
tools we use without too much fuss.
It is always a bit like walking along quicksands though, because the variety of ways in 
which people manage to screw up real-world documents is amazing; and because in all 
document formats, there is always this feature creep which developers seem to be unable 
to stop themselves from falling for.
So you have to spend a considerable amount of time on testing over a large volume of 
documents before you can really accept any tool as good enough.


All of this to say that using an (MS or other) desktop application is not the way we would 
prefer to do things, but that since it is the reference used by our customers, we are 
sometimes forced to do this.  And since some of these applications do not exist in a 
version that can be used without problems in a Service context, we sometimes have no 
better choice than to run the application using it, as a desktop application itself.


Which after all and roundabout, brings us back to the original OP's question.

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



[OT] Re: Console when running as a service.

2013-03-11 Thread verlag.preis...@t-online.de
Hi André,


-Original-Nachricht-
 Von: André Warnier a...@ice-sa.com
 An: Tomcat Users List users@tomcat.apache.org
 Betreff: Re: Console when running as a service.
 Datum: Mon, 11 Mar 2013 19:20:23 +0100


 +1. Eek, I tearfully and shamefully agree.
 But still 90% or more of corporate internal documents are written as
 Word documents, and there is no open-source tool which can perfectly
 handle this shamefully proprietary format and convert it to some
 non-propietary format that one could still read in 10 year's time, so
 what is one to do if one wants to get some money to get one's children
 through computer school and pay for their iPhones, he ?

I guess with proprietary format you mean the old/outdated .doc format? :)

This has been superseded (since 2006/2007) by the Office Open XML format which 
has been standardized as ECMA-376 and ISO/IEC 29500 [1], for which a public 
documentation is available, so I wouldn't call this proprietary. ;-)

However, you're probably right that a lot of already existing word documents 
are still in the old .doc format instead of .docx.


Regards,
Konstantin Preißer

[1] http://en.wikipedia.org/wiki/Office_Open_XML



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



Re: Tomcat jdbc pool connection failover

2013-03-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Amit,

On 3/11/13 12:52 AM, amit shah wrote:
 Hello, I would like to know if the tomcat jdbc pool (7.0.34+)
 provides connection failover capabilities i.e. to transparently
 close all the open database connections and switch to a another
 database server on an planned/unplanned database server outage
 event. I read through the tomcat documentation but didn't find any
 details related to this. If this feature is not supported are there
 any recommended alternatives and any future plans to add this
 feature to the jdbc pool?

This is usually done at the driver level. What database are you using?

- -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/

iEYEAREIAAYFAlE+PYkACgkQ9CaO5/Lv0PAAtgCeIMaEODHLFvVqG5losN1EApM6
CxMAnRyRG7Qdx3hI+uQ4pD4yx07p++tx
=UVeg
-END PGP SIGNATURE-

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



Re: date format in Last-modified header

2013-03-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

To whom it may concern,

On 3/11/13 11:17 AM, getridofthespam wrote:
 Google didn't give any relevant info so I try here.
 
 I traced a tomcat request and noticed there where two different
 date formats in the last-modified header: 2012-12-13T09:52:02Z and 
 Mon, 07 Jan 2013 21:49:08 GMT
 
 What determines the format and where do the differences come from?

RFC 2616 (HTTP)[1] does not directly reference RFC 2822 (Internet
Message Format), but that's the format that's being used -- covered in
section 3.3 [2]. That's where the format that begins with the day-of-week.

I'm surprised that Tomcat ever emits anything that looks like
MMddTHHmmssZZ -- that's ISO 8601 date formats. Since ISO 8601
predates HTTP, I'm not sure why that wasn't chosen. But HTTP has some
old crap that should have never been put into the protocol from day
one, so why not an insane date format specification?

- -chris

[1] http://tools.ietf.org/html/rfc2616#section-13.3.1
[2] http://tools.ietf.org/html/rfc2822#section-3.3
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlE+Qm4ACgkQ9CaO5/Lv0PBWZgCgtPmB6J8EVB6nZgOv57EmEvvX
ScsAniX9s6fDJNmHFAbbfDuDClo7T1X5
=VS3F
-END PGP SIGNATURE-

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



Re: [OT] Re: Console when running as a service.

2013-03-11 Thread André Warnier

verlag.preis...@t-online.de wrote:

Hi André,


-Original-Nachricht-

Von: André Warnier a...@ice-sa.com
An: Tomcat Users List users@tomcat.apache.org
Betreff: Re: Console when running as a service.
Datum: Mon, 11 Mar 2013 19:20:23 +0100




+1. Eek, I tearfully and shamefully agree.
But still 90% or more of corporate internal documents are written as
Word documents, and there is no open-source tool which can perfectly
handle this shamefully proprietary format and convert it to some
non-propietary format that one could still read in 10 year's time, so
what is one to do if one wants to get some money to get one's children
through computer school and pay for their iPhones, he ?


I guess with proprietary format you mean the old/outdated .doc format? :)

This has been superseded (since 2006/2007) by the Office Open XML format which 
has been standardized as ECMA-376 and ISO/IEC 29500 [1], for which a public 
documentation is available, so I wouldn't call this proprietary. ;-)

However, you're probably right that a lot of already existing word documents 
are still in the old .doc format instead of .docx.



This is still [OT], and I like the subject, so let's elaborate a bit.
The above paragraph responded to an Eek, so it wasn't really meant as 
technically accurate.
But yes, by proprietary I did mean mainly the .doc, .xls and .ppt formats (and their 
associated template formats). And yes, there are still plenty of those around.
For instance, we recently processed a customer archive of more than 100,000 documents, in 
which there was a mixture of .doc, .xls, .ppt, .docx, .xlsx, .pptx, .pdf, .tiff, .txt and 
a few more.
But even if one talks about the supposedly open OpenXML formats .docx, .xlsx and .pptx, 
I have been unable so far to find any non-MS tool which can accurately process say more 
than 95% of your average collection of such documents without introducing some significant 
distorsions in the result, or corrupting or losing some content.  So I have to suppose 
that either of the following is true :
- the published specification is not accurate enough to cover all the cases one finds in 
real-world OpenXML documents
- the programmers who read these specifications are incapable of creating software that 
will accurately handle 100% of the documents which are created in this format
- the people who published this specification deliberately made it obscure so that others 
would have trouble interpreting it correctly
- the people who published this specification are deliberately making software that 
creates documents that violate the specification, to make life miserable for everyone 
else, particularly their commercial and non-commercial competition
- the people who published this specification are unwillingly making software that creates 
documents that violate the specification through sheer incompetence
- the people who published this specification are making software that creates documents 
that violate the specification, because they just don't care and because they published 
this specification only so that they could claim to support open-source trends and 
non-proprietary standards
- the programmers who read this specification are unwilling to create software that will 
accurately handle 100% of the documents which are created in this format, just to make a 
point about the spirit of open-source and how bad the companies who make proprietary 
software really are


..or more probably, a mixture of all the above.

And the practical result for everyone else it that it is a mess.

But I must add that I am not complaining about it too much, because if it wasn't so, I 
would not have either a product or a job. So please, MS and others, keep on adding new 
features, standards, revisions, versions, interpretations and new software which follows 
them or not, and I will happily spend time cleaning it all up for my bewildered customers.
(And, with a wink but nonetheless a background of seriousness, I would hasard to guess 
that the situation isn't too different when one reflects about Java and Tomcat).






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



Re: date format in Last-modified header

2013-03-11 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

To whom it may concern,

On 3/11/13 11:17 AM, getridofthespam wrote:

Google didn't give any relevant info so I try here.

I traced a tomcat request and noticed there where two different
date formats in the last-modified header: 2012-12-13T09:52:02Z and 
Mon, 07 Jan 2013 21:49:08 GMT


What determines the format and where do the differences come from?


RFC 2616 (HTTP)[1] does not directly reference RFC 2822 (Internet
Message Format), but that's the format that's being used -- covered in
section 3.3 [2]. That's where the format that begins with the day-of-week.

I'm surprised that Tomcat ever emits anything that looks like
MMddTHHmmssZZ -- that's ISO 8601 date formats. Since ISO 8601
predates HTTP, I'm not sure why that wasn't chosen. But HTTP has some
old crap that should have never been put into the protocol from day
one, so why not an insane date format specification?



Just by coincidence, I happened to be looking at some HTTP/DAV output right now (from 
Apache's DAV), and I noticed this :

...
D:getcontenttypeapplication/pdf/D:getcontenttype
lp1:creationdate2012-12-21T09:25:53Z/lp1:creationdate
lp1:getlastmodifiedFri, 21 Dec 2012 09:25:53 GMT/lp1:getlastmodified
lp1:getcontentlength1009325/lp1:getcontentlength
lp1:resourcetype/
...

So there we have these 2 formats within a same HTTP response from the same module on the 
same server and about the same file, both of which could obviously have used the same format.

Why make it simple when complicated will do ?




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



Having WebSocket Issues (Tomcat 8)

2013-03-11 Thread Nick Williams
I'm trying to create what I thought was a very simple WebSocket example, but 
boy have I had difficulties…

I started by basically coping the EchoAnnotation example from the Tomcat 
examples. However, it was like my endpoint was never getting instantiated. (Is 
this temporary? Will Tomcat 8 ultimately scan for and instantiate these 
endpoints? Or will the server container always have to be created manually?)

I then noticed the listener that the examples application was using to 
initialize the container and add the endpoints. I didn't want to tie my example 
to the Tomcat classes, so I tried to do it a bit more generically based on the 
WebSocket API. Below you will find the listener I created. It compiles just 
fine, but on deployment I get the very unusual error further down. What's up 
with this? Is this just an example of Tomcat being behind the RC1 API?

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import javax.websocket.server.ServerContainer;
import javax.websocket.server.ServerContainerProvider;

@WebListener
public class WebSocketInitializerListener implements ServletContextListener
{
@Override
public void contextInitialized(ServletContextEvent servletContextEvent)
{
try
{
ServerContainer container = 
ServerContainerProvider.getServerContainer();
container.addEndpoint(EchoEndpoint.class);
}
catch (Exception e)
{
System.err.println(e.toString());
e.printStackTrace(System.err);
throw new RuntimeException(Could not start WebSocket container.);
}
}

@Override
public void contextDestroyed(ServletContextEvent servletContextEvent)
{

}
}

SEVERE: Exception sending context initialized event to listener instance of 
class com.wrox.WebSocketInitializerListener
java.lang.IllegalAccessError: tried to access method 
javax.websocket.server.ServerContainerProvider.getServerContainer()Ljavax/websocket/server/ServerContainer;
 from class com.wrox.WebSocketInitializerListener
at 
com.wrox.WebSocketInitializerListener.contextInitialized(WebSocketInitializerListener.java:17)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4769)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
at 
org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1492)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:487)
at 
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at 
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
at 
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:468)
at 
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:487)
at 
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at 
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
at 
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1465)
at 
javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:75)
at 
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1306)
at 
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1398)
at 
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 

Re: Having WebSocket Issues (Tomcat 8)

2013-03-11 Thread Nick Williams
I got this working by changing ServerContainerProvider#getServerContainer() to 
be public, per the spec. I submitted bug 54671 with patch.

However, I do still have the original question: Will I always need to use a 
listener to add my endpoints programmatically like I did below? Or will Tomcat 
eventually scan for endpoints? The examples downloadable from the GlassFish 
project just work ... there is no listener or call to 
ServerContainerProvider.getServerContainer(). Not sure if that's GlassFish 
doing something special that's not in the spec, or if the Tomcat implementation 
just doesn't have this feature yet.

N

On Mar 11, 2013, at 4:59 PM, Nick Williams wrote:

 I'm trying to create what I thought was a very simple WebSocket example, but 
 boy have I had difficulties…
 
 I started by basically coping the EchoAnnotation example from the Tomcat 
 examples. However, it was like my endpoint was never getting instantiated. 
 (Is this temporary? Will Tomcat 8 ultimately scan for and instantiate these 
 endpoints? Or will the server container always have to be created manually?)
 
 I then noticed the listener that the examples application was using to 
 initialize the container and add the endpoints. I didn't want to tie my 
 example to the Tomcat classes, so I tried to do it a bit more generically 
 based on the WebSocket API. Below you will find the listener I created. It 
 compiles just fine, but on deployment I get the very unusual error further 
 down. What's up with this? Is this just an example of Tomcat being behind the 
 RC1 API?
 
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 import javax.servlet.annotation.WebListener;
 import javax.websocket.server.ServerContainer;
 import javax.websocket.server.ServerContainerProvider;
 
 @WebListener
 public class WebSocketInitializerListener implements ServletContextListener
 {
@Override
public void contextInitialized(ServletContextEvent servletContextEvent)
{
try
{
ServerContainer container = 
 ServerContainerProvider.getServerContainer();
container.addEndpoint(EchoEndpoint.class);
}
catch (Exception e)
{
System.err.println(e.toString());
e.printStackTrace(System.err);
throw new RuntimeException(Could not start WebSocket container.);
}
}
 
@Override
public void contextDestroyed(ServletContextEvent servletContextEvent)
{
 
}
 }
 
 SEVERE: Exception sending context initialized event to listener instance of 
 class com.wrox.WebSocketInitializerListener
 java.lang.IllegalAccessError: tried to access method 
 javax.websocket.server.ServerContainerProvider.getServerContainer()Ljavax/websocket/server/ServerContainer;
  from class com.wrox.WebSocketInitializerListener
   at 
 com.wrox.WebSocketInitializerListener.contextInitialized(WebSocketInitializerListener.java:17)
   at 
 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4769)
   at 
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at 
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
   at 
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
   at 
 org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1492)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:487)
   at 
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
   at 
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
   at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
   at 
 org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:468)
   at 
 org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:487)
   at 
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
   at 
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
   at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
   at 
 

Re: Having WebSocket Issues (Tomcat 8)

2013-03-11 Thread Mark Thomas
On 11/03/2013 22:38, Nick Williams wrote:
 However, I do still have the original question: Will I always need to
 use a listener to add my endpoints programmatically like I did below?
 Or will Tomcat eventually scan for endpoints? The examples
 downloadable from the GlassFish project just work ... there is no
 listener or call to ServerContainerProvider.getServerContainer(). Not
 sure if that's GlassFish doing something special that's not in the
 spec, or if the Tomcat implementation just doesn't have this feature
 yet.

The SCI should be scanning for them already.

Mark

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



Re: Having WebSocket Issues (Tomcat 8)

2013-03-11 Thread Nick Williams

On Mar 11, 2013, at 5:50 PM, Mark Thomas wrote:

 On 11/03/2013 22:38, Nick Williams wrote:
 However, I do still have the original question: Will I always need to
 use a listener to add my endpoints programmatically like I did below?
 Or will Tomcat eventually scan for endpoints? The examples
 downloadable from the GlassFish project just work ... there is no
 listener or call to ServerContainerProvider.getServerContainer(). Not
 sure if that's GlassFish doing something special that's not in the
 spec, or if the Tomcat implementation just doesn't have this feature
 yet.
 
 The SCI should be scanning for them already.
 

My endpoint class was not get recognized/instantiated. I had a breakpoint in 
the constructor and I never hit it. Only when I added the listener that called 
addEndpoint(EchoEndpoint.class) did it start getting instantiated (and I 
started hitting the breakpoint and being able to call the endpoint). However, I 
have now deleted the listener, and the endpoint is still getting instantiated. 
I'm very confused. I didn't change a line of code in the endpoint. It's exactly 
like it was before, when it wasn't getting instantiated. *scratches head*

I'm going crazy over here…

Oh, well. It least it's working.

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



Tomcat as a service: system tray?

2013-03-11 Thread Sam Takoy
Hi,

This is related to the questions that I asked yesterday and got such insightful 
responses (thanks!).

If I am running Tomcat as a Windows service, is it possible to control it 
through a System Tray icon?

(By the way, I don't know where to report irrelevant typos in the 
documentation, but 
http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html says system 
try.)

Thank you!

Sam