Re: How to run Tomcat as Service on windows start up.

2012-04-27 Thread Jacques Desodt
Hi Kiran,

On Windows 7, you can't run batch files as services.
See :
http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service

Your first step : compile the .bat file into .exe
Then create the service, and after change the service register values with
regedit.
This is a pure windows process, i think you'll have better answers using
Microsoft forums.

Best regards,
Jacques

2012/4/28 Kiran Badi 

> Hi,
>
> I have installed and added tomcat 7.0.11 to netbeans 7.01 and now I want
> it to run as windows service so that whenever I start windows, it should
> start up and run.
>
> Currently whenever I close netbeans it shut down tomcat along with it.
>
> PS : I cannot download and install the fresh copy since being a 7 months
> old developer I do not want to take the risk of breaking my existing
> setup.Time is my constraint.
>
> Can we create some startup bat file for windows 7 32 bit home premium and
> somehow push it on start up program list ?
>
> - Kiran
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tomcat.**apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


How to run Tomcat as Service on windows start up.

2012-04-27 Thread Kiran Badi

Hi,

I have installed and added tomcat 7.0.11 to netbeans 7.01 and now I want 
it to run as windows service so that whenever I start windows, it should 
start up and run.


Currently whenever I close netbeans it shut down tomcat along with it.

PS : I cannot download and install the fresh copy since being a 7 months 
old developer I do not want to take the risk of breaking my existing 
setup.Time is my constraint.


Can we create some startup bat file for windows 7 32 bit home premium 
and somehow push it on start up program list ?


- Kiran

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



Re: trying to install openjdk + tomcat -from source- ...

2012-04-27 Thread Albretch Mueller
~
 Well, you are right, but maybe you guys knew of complete installation
of an environment, which I had seen before, but for some reason can't
fidn now
~
 lbrtchx

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



Re: Javamelody and Struts

2012-04-27 Thread Miguel González Castaños

On 26/04/2012 15:51, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Miguel,

On 4/26/12 5:58 AM, Miguel González Castaños wrote:

On 26/04/2012 03:58, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE- Hash: SHA1

Miguel,

On 4/25/12 6:24 PM, Miguel González Castaños wrote:

Please post your SSLconfiguration (cleansed of
any passwords).

By the way, double checking the info from my web browser I get this
is a verisign class 3 secure server G3

It looks like you were using the "EV" intermediate certificates
before. This page[1] says that C3G3 certs are not frequently used
except for client certificates... is that what you've got?

[1] http://www.verisign.com/support/roots.html


I'm sorry but I come from the Apache world and I'm pretty new to
Tomcat. Also I have inherited this server and the configuration is
messy.

When you use Java, you generally have to work with keystores. It's
just a file full of keys and certificates. Think of a Java keystore as
all of the following httpd directives mashed together into a single
binary entity:

   SSLCertificateKeyFile
   SSLCertificateFile
   SSLCertificateChainFile
   SSLCACertificateFile

Also, you have to use an "alias" that Tomcat uses (it's "tomcat") as
the alias for the certificate to actually use for the server (as
opposed to any other certificates you might have in the keystore).


Maybe I'm wrong but should I add the CAcert somewhere in the SSL
connector?

There's no place to do that: the whole chain must be in the keystore,
including the CA root all the way down to your own certificate. You
may be able to get away with not having the very top-root CA
certificate... I haven't worked too much with Java keystores so it's
possible that there is a set of root, trusted certificates that are
inherited by all keystores, but there are many ways to
create/configure a ServerSocketFactory, so it's probably possible to
set one up both with or without that globally-recognized set of root
CA certs (i.e. those trusted by the JVM implicitly).

If you are getting this error in Javamelody, then you need to
configure Javamelody properly -- this isn't a Tomcat thing if web
browsers can connect properly to Tomcat via HTTPS.

Thanks for your answers, they have lead me to (partly) the solution.

I found some clues here:

http://h2.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&taskId=110&prodSeriesId=4164840&prodTypeId=18964&objectID=c03023432 



I didn't have to add the certificate to the tomcat keystore, but to the 
java keystore of the JRE


Now I get a javamelody error reporting the app hasn't been configured to 
use javamelody, so no more SSL handshake errors


Many thanks,

Miguel



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



Re: mvn tomcat:deploy fails with HTTP response 401

2012-04-27 Thread Olivier Lamy
Add
  

  apache.snapshots
  Apache Snapshots
  http://repository.apache.org/content/groups/snapshots-group/
  
false
  
  
true
  

  

Note now you must use tomcat6:run or tomcat7:run (depending tomcat
version you want to use).

I'd like to know the command line you are using ? It must be
tomcat6:deploy or tomcat7:deploy

2012/4/27 Henrique Ordine :
> Thanks for your reply.
>
> I made the changes that you suggested but tomcat:deploy still fails with the
> same error.
>
> tomcat:run works, but it was already working before.
>
> My POM file is attached, if you could have a look at it, it would be great.
> It's a small POM, I've only just started my App.
>
> Thanks in advance,
>
> Op 27 april 2012 12:14 schreef Olivier Lamy  het volgende:
>>
>> Hello,
>>
>> That's something which has been fixed in trunk (I will probably
>> release a 2.0 next week).
>>
>>
>> 2012/4/27 Henrique Ordine :
>> > Hi everybody,
>> >
>> > I'm trying to deploy my Maven Web App on my local Tomcat using the
>> > tomcat:deploy maven plugin, but the Manager application fails with a
>> > response code 401.
>> >
>> > I have Tomcat 6 installed on Mac OS Leopard, with Java 1.5. I manage to
>> > access my Tomcat/manager app with the user "hordine", that I configured
>> > and
>> > deploy
>> >
>> > I've configured my tomcat-users.xml, settings.xml, and POM files, like
>> > this:
>> >
>> > I've added this user to my tomcat-users.xml:
>> >  
>> >  
>> >  
>> >  
>> >  
>> >  
>> >
>> >
>> > I've added this server to my settings.xml:
>> > 
>> >    
>> >        hordineLocalTomcat
>> >        hordine
>> >        hordine
>> >    
>> > 
>> >
>> > And I've configured my POM like this:
>> >
>> > 
>> >
>> > hTask-web
>> >
>> >  
>> >
>> >  
>> >
>> >  
>> >
>> >         org.apache.tomcat.maven
>> >
>> >           tomcat-maven-plugin
>> >
>> >           1.1
>>
>> Sure of that 
>>
>> But to test if your issue is fixed in trunk try
>> 2.0-SNAPSHOT
>>
>> see mojo declaration and repositories here:
>> http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html
>>
>> >
>> >           
>> >
>> >   http://localhost:8080/manager
>> >
>> >   hordineLocalTomcat
>> >
>> >   /hTask-web
>> >
>> >  
>> >
>> >  
>> >
>> >  
>> >
>> >  
>> >
>> > 
>> >
>> >
>> > I'd appreciate any help.
>> >
>> > This is the entire error's stack trace:
>> >
>> > Embedded error: Server returned HTTP response code: 401 for URL:
>> > http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
>> > [INFO]
>> > 
>> > [INFO] Trace
>> > org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
>> > Tomcat manager
>> > at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
>> > at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
>> > at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
>> > at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>> > at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>> > at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>> > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>> > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>> > at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>> > at
>> > org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at
>> >
>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> > at
>> >
>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> > at java.lang.reflect.Method.invoke(Method.java:592)
>> > at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> > at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> > at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> > Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke
>> > Tomcat manager
>> > at
>> >
>> > org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:149)
>> > at
>> >
>> > org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:70)
>> > at
>> >
>> > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>> > at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>> > ... 17 more
>> > Caused by: java.io.IOException: Server returned HTTP response code: 401
>> > for
>> > URL

RE: Capturing System.out on a Mac

2012-04-27 Thread Caldarale, Charles R
> From: Dola Woolfe [mailto:dolac...@yahoo.com] 
> Subject: Re: Capturing System.out on a Mac

> I appreciate the point about logging, but what if I am using a 
> library that utilizes System.out?

Then you really, really need to file a bug report with the maintainers of the 
library for writing anti-social code.  In the meantime, you can modify the 
Tomcat startup script to redirect stdout to a pipe, and have one of the widely 
available utilities listen on that pipe and write it to a rotatable log file.

 - 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



Re: Capturing System.out on a Mac

2012-04-27 Thread Dola Woolfe
Thank you and Christopher!

I appreciate the point about logging, but what if I am using a library that 
utilizes System.out?

Thanks again,

Dola


- Original Message -
From: Derek Beauregard 
To: Tomcat Users List 
Cc: 
Sent: Friday, April 27, 2012 1:31 PM
Subject: Re: Capturing System.out on a Mac

Catalina.out should have anything written to stdout/stderr.  Be careful as
this file is not rotated and will grow for ever.  Any web apps should be
using logging and not System.out.

Also you could start tomcat with the 'run' command rather than the 'start'
command to run it in the foreground of your current shell.  (I wouldn't do
this in production)

-Derek

Derek Beauregard


-
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: Capturing System.out on a Mac

2012-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dola,

On 4/27/12 12:19 PM, Dola Woolfe wrote:
> We just switched from Windows to Mac. On Windows, when we started 
> tomcat in the command window, a new window would pop up that
> contains all the output of System.out.  But on a Mac, no new window
> shows up and we are missing all the output. Is there a quick fix to
> this?

If you use bin/startup.sh, standard output is redirected to
logs/catalina.out. It's acting just like it does on all UNIX-like systems.

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

iEYEARECAAYFAk+a6SwACgkQ9CaO5/Lv0PBH1QCghXrzcWkj7HJqL9oWk6+qoFSe
4c4AoKK6XsCGtLRU7l5f1X3I+/CACHCl
=bDXa
-END PGP SIGNATURE-

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



Re: Long timeout after aborted upload

2012-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/27/12 3:55 AM, André Warnier wrote:
> And the main issue is that, while it is uploading the data, the
> browser isn't reading anything from the webserver.

Yeah, I'm fairly sure that this is the problem.

> Sending a response to the browser including a "Connection: close" 
> header, just tells the browser that it will not be able to send
> *its next request* on the same HTTP/TCP connection, and that it
> will have to build a new connection.  But it doesn't impact the
> current request/response cycle.

Yes, I'm well aware of that.

> If this thing of stopping the browser waisting its time is really 
> important in your case, then on the base of the above, one could
> imagine a solution, based on for example a specialised browser
> "applet" which would send the file-to-upload using a separate HTTP
> request including an "Expect" header (see section 8.2.3), then
> waiting for the server to answer with a "100 Continue" response
> before sending the body.

Yeah, it's too bad I can't force the client to act like that. If I
could, I would object to the Content-Length immediately and then the
bytes would never even have to be sent.

Thanks,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+a54UACgkQ9CaO5/Lv0PBehgCfY6GhIdv6hwCLpYiBk8I47+CQ
XRkAoJzGRq075TdrNZ30zr9VyjFvcPS8
=X2KB
-END PGP SIGNATURE-

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



Re: Capturing System.out on a Mac

2012-04-27 Thread Derek Beauregard
Catalina.out should have anything written to stdout/stderr.  Be careful as
this file is not rotated and will grow for ever.  Any web apps should be
using logging and not System.out.

Also you could start tomcat with the 'run' command rather than the 'start'
command to run it in the foreground of your current shell.  (I wouldn't do
this in production)

-Derek

Derek Beauregard


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



Re: Capturing System.out on a Mac

2012-04-27 Thread Dola Woolfe
They don't contain the output of System.out?

Are you expecting them to?

RE: Websocket Questions

2012-04-27 Thread Konstantin Preißer
Hi Mark,
thank you for your reply.

> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org]
> Sent: Friday, April 27, 2012 5:37 PM
> To: Tomcat Users List
> Subject: Re: Websocket Questions
> 
> 
> At the moment, yes. There is probably a need for a separate timeout but
> there needs to be a timeout. You can use ping messages to avoid it.

Ok, thanks for the clarification.

> 
> The full stack would be useful. It might point to where things are
> going
> wrong.

Below is the full content of the hs_err_pid3144.log file. This Tomcat instance 
only had the Websocket application running. It seems it is not hard to 
reproduce the crash - when I tried it today with HTTP APR again (and Java 
1.7.0_04), Tomcat crashed after ~3 mins. In my Websockets App, I create a 
dedicated thread for each client that sends messages to the client (so that 
only one thread writes to a specific WsOutbound - I hope this is not forbidden 
;-) ). This is the thread in the stack trace, so it seems the error occurs when 
writing to the Socket. 

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x1000476d, pid=7584, tid=4604
#
# JRE version: 7.0_04-b20
# Java VM: Java HotSpot(TM) Client VM (23.0-b21 mixed mode, sharing windows-x86 
)
# Problematic frame:
# C  [tcnative-1.dll+0x476d]  Java_org_apache_tomcat_jni_Socket_send+0x8d
#
# Core dump written. Default location: 
C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\hs_err_pid7584.mdmp
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---  T H R E A D  ---

Current thread (0x00e19000):  JavaThread "Thread-48" daemon [_thread_in_native, 
id=4604, stack(0x049b,0x04a0)]

siginfo: ExceptionCode=0xc005, reading address 0x0020

Registers:
EAX=0x, EBX=0x04e4d230, ECX=0x049fd7d4, EDX=0x
ESP=0x049fd7b8, EBP=0x049ff7d8, ESI=0x00e19128, EDI=0x049fd7d4
EIP=0x1000476d, EFLAGS=0x00010246

Top of Stack: (sp=0x049fd7b8)
0x049fd7b8:   049fd7d4 049fd7d0 00e19000 049ff804
0x049fd7c8:    049ff7fc 0001 049ff881
0x049fd7d8:   1000489d 049ff80c  30303030
0x049fd7e8:   6c63227b 4e737361 22656d61 6241223a
0x049fd7f8:   61727473 654d7463 67617373 6f4d2f65
0x049fd808:   4d657375 6465766f 7373654d 22656761
0x049fd818:   6c63222c 746e6569 3a226449 222c3632
0x049fd828:   333a2278 222c3134 323a2279 307d3030 

Instructions: (pc=0x1000476d)
0x1000474d:   57 50 8b 45 1c 50 51 8b 8a 20 03 00 00 56 ff d1
0x1000475d:   8b 53 18 8d 85 f8 df ff ff 50 8b 43 0c 8b cf 51
0x1000476d:   8b 4a 20 50 ff d1 8b f0 eb 61 50 ff 15 94 44 0b
0x1000477d:   10 8b f8 83 c4 04 85 ff 75 16 8d 47 f4 5f 5e 5b 


Register to memory mapping:

EAX=0x is an unknown value
EBX=0x04e4d230 is an unknown value
ECX=0x049fd7d4 is pointing into the stack for thread: 0x00e19000
EDX=0x is an unknown value
ESP=0x049fd7b8 is pointing into the stack for thread: 0x00e19000
EBP=0x049ff7d8 is pointing into the stack for thread: 0x00e19000
ESI=0x00e19128 is an unknown value
EDI=0x049fd7d4 is pointing into the stack for thread: 0x00e19000


Stack: [0x049b,0x04a0],  sp=0x049fd7b8,  free space=309k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [tcnative-1.dll+0x476d]  Java_org_apache_tomcat_jni_Socket_send+0x8d
J  org.apache.tomcat.jni.Socket.send(J[BII)I
J  org.apache.coyote.http11.upgrade.UpgradeAprProcessor.write(I)V
v  ~StubRoutines::call_stub
V  [jvm.dll+0x1296da]
V  [jvm.dll+0x1d837e]
V  [jvm.dll+0x1298c3]
V  [jvm.dll+0x129927]
V  [jvm.dll+0xd24af]
V  [jvm.dll+0x149987]
V  [jvm.dll+0x149af0]
V  [jvm.dll+0x17df89]
C  [msvcr100.dll+0x5c6de]  endthreadex+0x3a
C  [msvcr100.dll+0x5c788]  endthreadex+0xe4
C  [kernel32.dll+0x4d309]  BaseThreadInitThunk+0x12
C  [ntdll.dll+0x41603]  RtlInitializeExceptionChain+0x63
C  [ntdll.dll+0x415d6]  RtlInitializeExceptionChain+0x36

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J  org.apache.tomcat.jni.Socket.send(J[BII)I
J  org.apache.coyote.http11.upgrade.UpgradeAprProcessor.write(I)V
J  
org.apache.catalina.websocket.WsOutbound.doWriteBytes(Ljava/nio/ByteBuffer;Z)V
J  org.apache.catalina.websocket.WsOutbound.doWriteText(Ljava/nio/CharBuffer;Z)V
J  
org.apache.catalina.websocket.WsOutbound.writeTextMessage(Ljava/nio/CharBuffer;)V
J  test.MyWebsocketServlet$TestMessageInbound$1.run()V
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

---  P R O C E S S  ---

Java Threads: ( => current thread )
=>0x00e19000 JavaThread "Thread-48" daemon [_thread_in_native, id=4604, 
stack(0x049b,0x04a0)]
  0x045c4400 JavaThread "Thread-45" daemon [_thread_blocked, id=6036, 
stack(0x059e,0x05a3)]
  0x00e18c00 JavaThread "http-apr-8282-exec-10" daemon [_thread_blocked, 
id=8548, st

Re: Capturing System.out on a Mac

2012-04-27 Thread Henrique Ordine
Aren't the log files in your tomcat_home/logs directory enough?

Op 27 april 2012 18:19 schreef Dola Woolfe  het
volgende:

> Hi,
>
> We just switched from Windows to Mac. On Windows, when we started tomcat
> in the command window, a new window would pop up that contains all the
> output of System.out.  But on a Mac, no new window shows up and we are
> missing all the output. Is there a quick fix to this?
>
> Many thanks in advance,
>
> Dola
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Henrique Ordine

http://hordine.wordpress.com/


Re: mvn tomcat:deploy fails with HTTP response 401

2012-04-27 Thread Henrique Ordine
Thanks for your reply.

I made the changes that you suggested but tomcat:deploy still fails with
the same error.

tomcat:run works, but it was already working before.

My POM file is attached, if you could have a look at it, it would be great.
It's a small POM, I've only just started my App.

Thanks in advance,

Op 27 april 2012 12:14 schreef Olivier Lamy  het volgende:

> Hello,
>
> That's something which has been fixed in trunk (I will probably
> release a 2.0 next week).
>
>
> 2012/4/27 Henrique Ordine :
> > Hi everybody,
> >
> > I'm trying to deploy my Maven Web App on my local Tomcat using the
> > tomcat:deploy maven plugin, but the Manager application fails with a
> > response code 401.
> >
> > I have Tomcat 6 installed on Mac OS Leopard, with Java 1.5. I manage to
> > access my Tomcat/manager app with the user "hordine", that I configured
> and
> > deploy
> >
> > I've configured my tomcat-users.xml, settings.xml, and POM files, like
> this:
> >
> > I've added this user to my tomcat-users.xml:
> >  
> >  
> >  
> >  
> >  
> >  
> >
> >
> > I've added this server to my settings.xml:
> > 
> >
> >hordineLocalTomcat
> >hordine
> >hordine
> >
> > 
> >
> > And I've configured my POM like this:
> >
> > 
> >
> > hTask-web
> >
> >  
> >
> >  
> >
> >  
> >
> > org.apache.tomcat.maven
> >
> >   tomcat-maven-plugin
> >
> >   1.1
>
> Sure of that 
>
> But to test if your issue is fixed in trunk try
> 2.0-SNAPSHOT
>
> see mojo declaration and repositories here:
> http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html
>
> >
> >   
> >
> >   http://localhost:8080/manager
> >
> >   hordineLocalTomcat
> >
> >   /hTask-web
> >
> >  
> >
> >  
> >
> >  
> >
> >  
> >
> > 
> >
> >
> > I'd appreciate any help.
> >
> > This is the entire error's stack trace:
> >
> > Embedded error: Server returned HTTP response code: 401 for URL:
> > http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
> > [INFO]
> > 
> > [INFO] Trace
> > org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
> > Tomcat manager
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> > at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> > at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:592)
> > at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> > at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> > at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> > Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke
> > Tomcat manager
> > at
> >
> org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:149)
> > at
> >
> org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:70)
> > at
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> > ... 17 more
> > Caused by: java.io.IOException: Server returned HTTP response code: 401
> for
> > URL: http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
> > at
> >
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1196)
> > at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
> > at
> org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java:662)
> > at org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295)
> > at
> >
> org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
> > at
> >
> org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:85)
> > at
> >

Capturing System.out on a Mac

2012-04-27 Thread Dola Woolfe
Hi,

We just switched from Windows to Mac. On Windows, when we started tomcat in the 
command window, a new window would pop up that contains all the output of 
System.out.  But on a Mac, no new window shows up and we are missing all the 
output. Is there a quick fix to this?

Many thanks in advance,

Dola


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



Re: trying to install openjdk + tomcat -from source- ...

2012-04-27 Thread Mark Thomas
On 27/04/2012 16:18, Albretch Mueller wrote:
> ~
>  I have constantly run into various problems which I don't think are
> well explained in the build instructions
> ~
>  http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html

And that has what to do with Tomcat?

(clue: nothing)

Mark

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



Re: Websocket Questions

2012-04-27 Thread Mark Thomas
On 27/04/2012 15:51, Konstantin Preißer wrote:
> Hi all,
> 
> I'm using Tomcat 7.0.27 with Native 1.1.23 on Windows Server 2008
> 32-bit with Java 1.7.0_03.
> 
> Recently I started a project which uses Websockets. It is a simple
> app where the clients submit the current mouse position to the
> server, and the server then broadcasts the position of that user to
> all other connected users.
> 
> To see how the Websocket Implementation in Tomcat works, I read the
> Chat example
> (http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_27/webapps/examples/WEB-INF/classes/websocket/chat/ChatWebSocketServlet.java)
> from Johno Crawford.
> 
> 1. It seems that the connector's "connectionTimeout" attribute is
> used to determine when the Websocket connection should be closed
> after inactivity. Is this intended?

At the moment, yes. There is probably a need for a separate timeout but
there needs to be a timeout. You can use ping messages to avoid it.

> 2. Is there experience of using the HTTP APR connector with
> Websockets? When I tried to use Websockets with that connector, the
> JVM crashed in tcnative-1.dll some minutes after Tomcat was started:

It has been tested as much as the others.

> # # A fatal error has been detected by the Java Runtime Environment: 
> # #  EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x1000476d,
> pid=3144, tid=9820 # # JRE version: 7.0_03-b05 # Java VM: Java
> HotSpot(TM) Client VM (22.1-b02 mixed mode, sharing windows-x86 ) #
> Problematic frame: # C  [tcnative-1.dll+0x476d] # # Core dump
> written. Default location:
> C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\hs_err_pid3144.mdmp

The full stack would be useful. It might point to where things are going
wrong.

Mark

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



trying to install openjdk + tomcat -from source- ...

2012-04-27 Thread Albretch Mueller
~
 I have constantly run into various problems which I don't think are
well explained in the build instructions
~
 http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html
~
 and I have also searched and searched to no avail
~
 Actually I am having problems with openjdk version 7 and 8 (either is fine)
~
 Any sugestions?
~
 thanks
 lbrtchx

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



Websocket Questions

2012-04-27 Thread Konstantin Preißer
Hi all,

I'm using Tomcat 7.0.27 with Native 1.1.23 on Windows Server 2008 32-bit with 
Java 1.7.0_03.

Recently I started a project which uses Websockets. It is a simple app where 
the clients submit the current mouse position to the server, and the server 
then broadcasts the position of that user to all other connected users.

To see how the Websocket Implementation in Tomcat works, I read the Chat 
example 
(http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_27/webapps/examples/WEB-INF/classes/websocket/chat/ChatWebSocketServlet.java)
 from Johno Crawford.

1.
It seems that the connector's "connectionTimeout" attribute is used to 
determine when the Websocket connection should be closed after inactivity. Is 
this intended? At first, I wondered why Tomcat closes the Websocket connection 
after a relative short time of about 20 seconds, until I realized that the 
default server.xhml has a connectionTimeout of 2.

2. Is there experience of using the HTTP APR connector with Websockets? When I 
tried to use Websockets with that connector, the JVM crashed in tcnative-1.dll 
some minutes after Tomcat was started:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x1000476d, pid=3144, tid=9820
#
# JRE version: 7.0_03-b05
# Java VM: Java HotSpot(TM) Client VM (22.1-b02 mixed mode, sharing windows-x86 
)
# Problematic frame:
# C  [tcnative-1.dll+0x476d]
#
# Core dump written. Default location: 
C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\hs_err_pid3144.mdmp
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

When I switched to HTTP BIO however, everything worked fine.


Thanks!

Regards,
Konstantin Preißer


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



Re: "High Level" question. Managing dynamic vhost deployments...

2012-04-27 Thread Dave Shevett

On 4/27/12 4:27 AM, André Warnier wrote:

It seems that you have already most of the parts done, and are just
missing the "persistent" part of the  entries in server.xml.
It would seem like a fairly easy task, with a bit of scripting, to have
a template server.xml with some kind of an "include" tag (à la ), and whenever you create a new Host dynamically,
adding it to some table, and rewriting the server.xml with the
appropriate  entries inserted in the template.
This way, whenever you restart Tomcat, it would "remember" these Hosts.
The script to re-create the server.xml could be inserted in your Tomcat
startup mechanism.


Yeah, this seems sort of like a double-approach.  I'd need to get Tomcat 
to enable the vhosts, and also have something that would 'dump' that 
information to server.xml.


I think the better approach is what Chuck pointed me to - the 
host-manager application seems to allow dynamic vhost generation in the 
running environment, what it needs is a hook to 'regen' the server.xml 
(or dump the XML for the  entries for easy inclusion back into the 
server.xml).


So one last question before I start tearing into host-manager - what I'm 
guessing it's doing is using JMX calls to tomcat-core (Note, I've done 
zilcho work with Tomcat internals yet, so sorry if this is way off) and 
dynamically creating / updating vhosts.  If that's the case, it should 
be pretty easy to modify it to dump the XML, or write a command line 
tool that does the same thing.


Is this sane?  :)

H.

-d

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



Re: mvn tomcat:deploy fails with HTTP response 401

2012-04-27 Thread Olivier Lamy
Hello,

That's something which has been fixed in trunk (I will probably
release a 2.0 next week).


2012/4/27 Henrique Ordine :
> Hi everybody,
>
> I'm trying to deploy my Maven Web App on my local Tomcat using the
> tomcat:deploy maven plugin, but the Manager application fails with a
> response code 401.
>
> I have Tomcat 6 installed on Mac OS Leopard, with Java 1.5. I manage to
> access my Tomcat/manager app with the user "hordine", that I configured and
> deploy
>
> I've configured my tomcat-users.xml, settings.xml, and POM files, like this:
>
> I've added this user to my tomcat-users.xml:
>  
>  
>  
>  
>  
>  
>
>
> I've added this server to my settings.xml:
> 
>    
>        hordineLocalTomcat
>        hordine
>        hordine
>    
> 
>
> And I've configured my POM like this:
>
> 
>
> hTask-web
>
>  
>
>  
>
>  
>
>         org.apache.tomcat.maven
>
>           tomcat-maven-plugin
>
>           1.1

Sure of that 

But to test if your issue is fixed in trunk try 2.0-SNAPSHOT

see mojo declaration and repositories here:
http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html

>
>           
>
>   http://localhost:8080/manager
>
>   hordineLocalTomcat
>
>   /hTask-web
>
>  
>
>  
>
>  
>
>  
>
> 
>
>
> I'd appreciate any help.
>
> This is the entire error's stack trace:
>
> Embedded error: Server returned HTTP response code: 401 for URL:
> http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
> [INFO]
> 
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
> Tomcat manager
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:592)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke
> Tomcat manager
> at
> org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:149)
> at
> org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:70)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> ... 17 more
> Caused by: java.io.IOException: Server returned HTTP response code: 401 for
> URL: http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1196)
> at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
> at org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java:662)
> at org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295)
> at
> org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
> at
> org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:85)
> at
> org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:141)
> ... 20 more
>
>
> --
> Henrique Ordine
>
> http://hordine.wordpress.com/



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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



mvn tomcat:deploy fails with HTTP response 401

2012-04-27 Thread Henrique Ordine
Hi everybody,

I'm trying to deploy my Maven Web App on my local Tomcat using the
tomcat:deploy maven plugin, but the Manager application fails with a
response code 401.

I have Tomcat 6 installed on Mac OS Leopard, with Java 1.5. I manage to
access my Tomcat/manager app with the user "hordine", that I configured and
deploy

I've configured my tomcat-users.xml, settings.xml, and POM files, like this:

I've added this user to my tomcat-users.xml:
  
  
  
  
  
  


I've added this server to my settings.xml:


hordineLocalTomcat
hordine
hordine



And I've configured my POM like this:



hTask-web

 

 

  

 org.apache.tomcat.maven

   tomcat-maven-plugin

   1.1

   

   http://localhost:8080/manager

   hordineLocalTomcat

   /hTask-web

  

  

 

 




I'd appreciate any help.

This is the entire error's stack trace:

Embedded error: Server returned HTTP response code: 401 for URL:
http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
[INFO]

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke
Tomcat manager
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke
Tomcat manager
at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:149)
at
org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:70)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
... 17 more
Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL: http://localhost:8080/manager/deploy?path=%2FhTask-web&war=
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1196)
at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
at org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java:662)
at org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295)
at
org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:85)
at
org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:141)
... 20 more


-- 
Henrique Ordine

http://hordine.wordpress.com/


Re: "High Level" question. Managing dynamic vhost deployments...

2012-04-27 Thread André Warnier

Dave Shevett wrote:
Hey folks - I've gotten great help on the list before, I'm looking for 
some guidance on how to approach this...


I have a hosted service that deploys / provisions vhosts running a 
prepackaged .war app.  I'd like to be able to 'spin up' a vhost on the 
fly, without restarting tomcat.


What I'm doing now is:
* Create a directory in /etc/tomcat6/Catalina/vhostname/
* Create a ROOT.xml in that dir that has docBase=[sharedwarfilename]...> for the vhost

* Edit server.xml to make a new Host entry
* Restart tomcat

The app goes live (there's an Apache httpd front end with a wildcard on 
the domain that's using ajp: connections to Tomcat, so 
foo.domainname.com will look for a vhost of that name on the Tomcat 
server).


This works, but is a pain because it requires a tomcat restart and a 
manual file edit.


What I want to do be able to do is bring up a vhost, maybe via the 
Tomcat manager, without doing a restart.  I can deploy a .war file easy, 
but the vhost entry wouldn't wake up.


My understanding is I can make the vhosts go active via a script or tool 
that uses JMX calls to Tomcat to configure up the vhost, but my 
understanding is this configuration is mutable - if Tomcat restarts, all 
the vhost configurations disappear, and I have to 'reprovision it'.


Is it possible to spin up and down vhosts like this without restarting 
tomcat, and if so, what's the preferred methodology that makes it 
reproduceable, if the configuration is only in memory, and will 
disappear if/when tomcat restarts?




I read somewhere that there exists an old African proverb which says : if you want to eat 
an elephant, you have to do it one little piece at a time.


It seems that you have already most of the parts done, and are just missing the 
"persistent" part of the  entries in server.xml.
It would seem like a fairly easy task, with a bit of scripting, to have a template 
server.xml with some kind of an "include" tag (à la ), and 
whenever you create a new Host dynamically, adding it to some table, and rewriting the 
server.xml with the appropriate  entries inserted in the template.

This way, whenever you restart Tomcat, it would "remember" these Hosts.
The script to re-create the server.xml could be inserted in your Tomcat startup 
mechanism.

Not discounting the other excellent and more elaborate suggestions received on the list, 
you may want to have a look at such a simple alternative.


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



Re: Long timeout after aborted upload

2012-04-27 Thread André Warnier

Christopher,

Christopher Schultz wrote:
...


Since Tomcat appears to be idle pretty much right away, the issue has
to be either mod_jk or httpd, or the browser itself. Is there anything
I can do at the web server level to sever the connection ASAP? Or is
this just a stubborn browser that refuses to give up until the last
byte has been sent?

You have to think of it this way : there is a lot of machinery and piping and intermediate 
holding tanks between the browser which is uploading the file, and ultimately your Tomcat 
webapp.  So even when your webapp whistles "stop!", there will be a significant delay 
before that filters down to the browser.
And the main issue is that, while it is uploading the data, the browser isn't reading 
anything from the webserver.  There is no "out of band" mechanism in HTTP for the 
webserver to tell the browser to stop in the middle of an upload (which is just "sending a 
HTTP request").  The only way is for the webserver to shut down the connection on which 
the browser is writing, which would cause the browser to experience a "Connection reset" 
error (which doesn't look very nice).
Other than that, the browser will only look for a response, when it has finished sending 
its request (which sounds logical, when you think about it).
Even to achieve the closing of the upload connection, you would need a mechanism for your 
webapp to be able to tell the closest possible "node" to the browser, to drop that 
connection.  There is no such standard mechanism. (And between the browser and your 
webserver, there can be proxies etc.).


Sending a response to the browser including a "Connection: close" header, just tells the 
browser that it will not be able to send *its next request* on the same HTTP/TCP 
connection, and that it will have to build a new connection.  But it doesn't impact the 
current request/response cycle.


This all being said, this section of the HTTP RFC provides some interesting clues : 
http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html


If this thing of stopping the browser waisting its time is really important in your case, 
then on the base of the above, one could imagine a solution, based on for example a 
specialised browser "applet" which would send the file-to-upload using a separate HTTP 
request including an "Expect" header (see section 8.2.3), then waiting for the server to 
answer with a "100 Continue" response before sending the body.

(And hoping that the webserver handles this properly).
It seems worth a try, but it also seems fairly complicated to do right.

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