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

2012-04-28 Thread Pid *
On 28 Apr 2012, at 06:51, Jacques Desodt jdes...@gmail.com wrote:

 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.

Woah there!

How is this less




 Best regards,
 Jacques

 2012/4/28 Kiran Badi ki...@poonam.org

 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.orgusers-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: mvn tomcat:deploy fails with HTTP response 401

2012-04-28 Thread Henrique Ordine
Thanks again for your help.

I added pluginRepositories to my POM, but if I use tomcat6:deploy or
tomcat6:run, Maven says:

The plugin 'org.apache.maven.plugins:maven-tomcat6-plugin' does not exist
or no valid version could be found

I'm using Maven, 2.2.0 by the way.

2012/4/27 Olivier Lamy ol...@apache.org

 Add
  pluginRepositories
pluginRepository
  idapache.snapshots/id
  nameApache Snapshots/name
  urlhttp://repository.apache.org/content/groups/snapshots-group/
 /url
  releases
enabledfalse/enabled
  /releases
  snapshots
enabledtrue/enabled
  /snapshots
/pluginRepository
  /pluginRepositories

 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 hord...@gmail.com:
  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 ol...@apache.org 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 hord...@gmail.com:
   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:
role rolename=tomcat/
role rolename=manager/
role rolename=manager-script/
user username=tomcat password=tomcat roles=tomcat/
user username=maventomcat password=maventomcat roles=manager/
user username=hordine password=hordine roles=manager,
   manager-script/
  
  
   I've added this server to my settings.xml:
   servers
  server
  idhordineLocalTomcat/id
  usernamehordine/username
  passwordhordine/password
  /server
   /servers
  
   And I've configured my POM like this:
  
   build
  
   finalNamehTask-web/finalName
  
pluginManagement
  
plugins
  
plugin
  
   groupIdorg.apache.tomcat.maven/groupId
  
 artifactIdtomcat-maven-plugin/artifactId
  
 version1.1/version
 
  Sure of that 
 
  But to test if your issue is fixed in trunk try
  version2.0-SNAPSHOT/version
 
  see mojo declaration and repositories here:
  http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html
 
  
 configuration
  
 urlhttp://localhost:8080/manager/url
  
 serverhordineLocalTomcat/server
  
 path/hTask-web/path
  
/configuration
  
/plugin
  
/plugins
  
/pluginManagement
  
   /build
  
  
   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-webwar=
   [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 

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

2012-04-28 Thread André Warnier

Jacques Desodt wrote:

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.


I think that it is a bit more complicated that that.
A .bat file compiled to a .exe will still not work properly as a Windows 
service.

The standard Tomcat installation for Windows does it right, by providing a correct 
service wrapper for the JVM which runs Tomcat.
The OP would probably, in the end, save himself some time by installing a proper 
Tomcat-as-a-Windows-service from the Tomcat website, and then arrange for Netbeans to talk 
to that one.




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



Does Tomcat Maven plugin support WAR overlays ?

2012-04-28 Thread Jeff MAURY
Hello,

I am facing the following problem with WAR overlays:
I have a first WAR, called skeleton, that contains all necessary stuff:
base web.xml, index.jsp and JAR dependencies.
I have another WAR whose first dependency is the skeleton which is (as of
yet) almost empty except for the slf4j_log4 dependency.
When i run tomcat7:run on the skeleton, everything is ok
When I run tomcat7:run on the second war, Tomcat start but I am not able to
use the application.
I have look at the mojo code and it seems it is using the web app source
directory (src/main/webapp) by default so as it is empty my case, it cannot
work.
AM I missing something ?

Thanks
Jeff


-- 
Jeff MAURY


Legacy code often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury


-- 
Jeff MAURY


Legacy code often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury


multiple mod_jk server mappings and JSESSIONID

2012-04-28 Thread Mike Wilson
I need to set up a configuration where a site's path space 
gets distributed over two servers and I'm looking at using 
mod_jk like this:

  Apache httpd
mod_jk
  workers.properties
workerA - serverA
workerB - serverB
  uriworkermap.properties
/*   = serverA
/path2/* = serverB
/path3/* = serverB
/path3/xyz/* = serverA

F ex / and /path1/ would be directed to serverA and 
/path2/ would be directed to serverB. This is all fine.

But how do I best solve the issue with each server setting 
its own JSESSIONID? The browser client will see one site 
with one domain and one JSESSIONID cookie, so this will 
cause interference between the two servers when switching 
between pages.

Does mod_jk offer any feature to solve this, or is my best 
bet to change the name of the JSESSIONID cookie on one of 
the servers?

Best regards
Mike Wilson


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



Re: multiple mod_jk server mappings and JSESSIONID

2012-04-28 Thread Rainer Jung

On 28.04.2012 16:52, Mike Wilson wrote:

I need to set up a configuration where a site's path space
gets distributed over two servers and I'm looking at using
mod_jk like this:

   Apache httpd
 mod_jk
   workers.properties
 workerA -  serverA
 workerB -  serverB
   uriworkermap.properties
 /*   = serverA
 /path2/* = serverB
 /path3/* = serverB
 /path3/xyz/* = serverA

F ex / and /path1/ would be directed to serverA and
/path2/ would be directed to serverB. This is all fine.

But how do I best solve the issue with each server setting
its own JSESSIONID? The browser client will see one site
with one domain and one JSESSIONID cookie, so this will
cause interference between the two servers when switching
between pages.

Does mod_jk offer any feature to solve this, or is my best
bet to change the name of the JSESSIONID cookie on one of
the servers?


No, there's no builtin feature for that in mod_jk. You could try to 
fiddle around with the Set-Cookie and Cookie headers using mod_headers. 
I suggest using a backend feature to switch cookie name there.


Note that the client should also respect the path when choosing the 
correct cookie in case multiple cookies match the server. I'd hope the 
longest path wins in case there are multuple matching paths. Did you 
test, whether there's actually a problem with those cookies?


Just in case: you can log the cookies in the server access log for 
debugging purposes by adding %{Set-Cookie}o and %{Cookie}i to your 
LogFormat in Apache.


Regards,

Rainer


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



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

2012-04-28 Thread Kiran Badi

Thanks for the all your suggestions,

How about running service.bat and registering tomcat7.exe as windows 
service , the one for which I already have a copy,


Below is the output I get,


C:\Program Files\Apache Software Foundation\Apache Tomcat 
7.0.11\binservice.bat

 install tomcat7.exe
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
Service will try to guess them from the registry.
Installing the service 'tomcat7.exe' ...
Using CATALINA_HOME:C:\Program Files\Apache Software 
Foundation\Apache Tomc

at 7.0.11
Using CATALINA_BASE:C:\Program Files\Apache Software 
Foundation\Apache Tomc

at 7.0.11
Using JAVA_HOME:
Using JRE_HOME: 
Using JVM:  auto
Failed installing 'tomcat7.exe' service

C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11\bin

and when check java home/jre variables, I see its already defined,


C:\Users\kiranecho %JRE_HOME%
C:\Program Files\Java\jre6

C:\Users\kiranecho %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_26

am I understanding something incorrect here ?





I just did some google and feel that there might be some
On 4/28/2012 5:01 PM, André Warnier wrote:

Jacques Desodt wrote:

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.


I think that it is a bit more complicated that that.
A .bat file compiled to a .exe will still not work properly as a 
Windows service.


The standard Tomcat installation for Windows does it right, by 
providing a correct service wrapper for the JVM which runs Tomcat.
The OP would probably, in the end, save himself some time by 
installing a proper Tomcat-as-a-Windows-service from the Tomcat 
website, and then arrange for Netbeans to talk to that one.




-
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: How to run Tomcat as Service on windows start up.

2012-04-28 Thread Mark Eggers
From: André Warnier a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Saturday, April 28, 2012 4:31 AM
Subject: Re: How to run Tomcat as Service on windows start up.
 
Jacques Desodt wrote:
 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.

I think that it is a bit more complicated that that.
A .bat file compiled to a .exe will still not work properly as a Windows 
service.

The standard Tomcat installation for Windows does it right, by providing a 
correct service wrapper for the JVM which runs Tomcat.
The OP would probably, in the end, save himself some time by installing a 
proper Tomcat-as-a-Windows-service from the Tomcat website, and then arrange 
for Netbeans to talk to that one.


NetBeans will not talk to the service very well.

NetBeans uses the .bat files (.sh on Linux / UNIX) to control Tomcat. From 
within NetBeans you can start, stop, and restart Tomcat, or run it in debug 
mode.

NetBeans will complain that it cannot find the startup.bat and shutdown.bat 
required to do these tasks if you install the service.

When I develop, I normally don't run Tomcat as a service. However, there are 
some systems where I need to run the service as well as develop. Here's what I 
do.

1. Install my primary Tomcat as a service

I usually make an Apache directory, and then start installing Tomcat underneath 
that.

I do not register this Tomcat with NetBeans since NetBeans cannot really 
control it properly.

2. Install development Tomcats

I then download the zip files for as many different versions of Tomcat as I 
need. Each gets unzipped and put in its own directory under the Apache 
directory.

3. Edit files

a. Service Tomcat
   Leave ports at 8080 in server.xml

   Edit tomcat-users.xml to set up manager-gui access

b. Non-service Tomcats
   Change shutdown port to be something different than the default 8005
   Change HTTP port to something different - 8090 perhaps
   Edit tomcat-users.xml to set up manager-script for NetBeans
      If this is pre-7 Tomcat, set up manager for NetBeans

4. Register Tomcats with NetBeans

Only register those Tomcats with NetBeans that you've installed by unzipping. 
Do not register the service Tomcat with NetBeans.

When you're developing, use the registered (non-service) Tomcats. When you want 
to run an application outside of NetBeans, use the manager application to 
deploy the web application to the service Tomct. The WAR file (from NetBeans' 
build command) will be found in Project-Name\dist.

This works for me. I have three Tomcats ( 5.5.35, 6.0.35, 7.0.27) registered 
with netBeans 7.1.1 (soon to be 7.1.2). I have a service Tomcat (7.0.27) 
running separately.

. . . . 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: Javamelody and Struts

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

On 23/04/2012 22:00, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Miguel,

On 4/23/12 3:57 PM, Miguel González Castaños wrote:

On 16/04/2012 12:43, Darryl Lewis wrote:

Make sure the monitoring code is before the struts call.

Start over again from scratch.

Same application running in Tomcat 6 but HTTP works fine using a 
javamelody.war deployed war that I access as a central container of the 
monitoring. I can't get access, however, to 
http://myweb/mycontext/monitoring still in this Tomcat 6 server.


Same webapp in Tomcat 5.5, I can't add the listener lines without 
breaking the Struts redirects configured in struts-config.xml


Where should I add the monitoring code and where?

Thanks,

Miguel

This message and any attachments are intended for the use of the addressee or 
addressees only. The unauthorised disclosure, use, dissemination or copying 
(either in whole or in part) of its content is not permitted. If you received 
this message in error, please notify the sender and delete it from your system. 
Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.


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



Running Swing app under Tomcat 6 on Linux

2012-04-28 Thread dgchristensen
My version info: 

• Tomcat 6.0.28 
• Java 1.6 
• Ubuntu 10.4 


I have a small debugging/monitoring app written in Java/Swing that I'd like to 
run inside Tomcat to help with debugging. The app is started by dynamically 
loading the monitoring class from a webservice running under Tomcat. The works 
in Windows (multiple flavors) but I'm having problems getting this running on 
Ubuntu. What I've tried so far: 

1) First error I got was an Headless exception. Since the app is a GUI app I 
can't run in headless mode. After searching around I changed Tomcat's library 
path (via -Djava.library.path in catalina.sh) to point to the client lib (ie. 
.../java-6-sun-1.6.0.26/jre/lib/i386/client) instead of the server lib. 

2) After changing the libs the next error was that DISPLAY wasn't set. After 
setting DISPLAY=0.0 in catalina.sh I get Can't connect to X11 with 
DISPLAY=0.0 error. I've tried different values for DISPLAY (e.g. 
localhost:0.0) and nothing makes a difference. I've also tried fiddling around 
with the policies in case there's a permissions error. See below for the call 
stack. 

The webservice app is a simple RESTEasy implementation. Since this works in 
Windows I'm assuming (perhaps erroneously) that this can work in Linux. Any 
help would be appreciated. 

Thanks, 
DG 

java . lang . InternalError : Can 't connect to X11 window server using ' : 0 . 
0 ' as the value of the DISPLAY variable. 
sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) 
sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52) 
sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155) 
java.security.AccessController.doPrivileged(Native Method) 
sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:131) 
java.lang.Class.forName0(Native Method) 
java.lang.Class.forName(Class.java:169) 
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
 
java.awt.Window.init(Window.java:380) 
java.awt.Window.init(Window.java:433) 
java.awt.Frame.init(Frame.java:403) 
java.awt.Frame.init(Frame.java:368) 
javax.swing.JFrame.init(JFrame.java:158) 
com.quinsoft.zeidon.objectbrowser.ObjectBrowser.startup(ObjectBrowser.java:60) 



Re: Javamelody and Struts

2012-04-28 Thread evernat
Hi Miguel,

First, javamelody.war is *optional*. I suggest to try javamelody without
using it.
You may read the user guide for help with this:
http://code.google.com/p/javamelody/wiki/UserGuide
(if you have an exception, please copy the complete stack-trace)

Then, there is an issue with Tomcat 5.5, only if you use javamelody v1.36.
See http://code.google.com/p/javamelody/issues/detail?id=207
It will be fixed in v1.37 soon.

Emeric


Miguel González Castaños wrote
 
 Start over again from scratch.
 
 Same application running in Tomcat 6 but HTTP works fine using a 
 javamelody.war deployed war that I access as a central container of the 
 monitoring. I can't get access, however, to 
 http://myweb/mycontext/monitoring still in this Tomcat 6 server.
 
 Same webapp in Tomcat 5.5, I can't add the listener lines without 
 breaking the Struts redirects configured in struts-config.xml
 
 Where should I add the monitoring code and where?
 
 Thanks,
 
 Miguel
 


--
View this message in context: 
http://tomcat.10.n6.nabble.com/Javamelody-and-Struts-tp4884442p4937283.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

-
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-28 Thread Olivier Lamy
Have a look here http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/index.html

there is a section regarding content to add in ~/.m2/settings.xml

or add the plugin declaration in the pom section buildpluginsplugin
(rather than pluginManagement)

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

2012/4/28 Henrique Ordine hord...@gmail.com:
 Thanks again for your help.

 I added pluginRepositories to my POM, but if I use tomcat6:deploy or
 tomcat6:run, Maven says:

 The plugin 'org.apache.maven.plugins:maven-tomcat6-plugin' does not exist
 or no valid version could be found

 I'm using Maven, 2.2.0 by the way.

 2012/4/27 Olivier Lamy ol...@apache.org

 Add
  pluginRepositories
    pluginRepository
      idapache.snapshots/id
      nameApache Snapshots/name
      urlhttp://repository.apache.org/content/groups/snapshots-group/
 /url
      releases
        enabledfalse/enabled
      /releases
      snapshots
        enabledtrue/enabled
      /snapshots
    /pluginRepository
  /pluginRepositories

 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 hord...@gmail.com:
  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 ol...@apache.org 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 hord...@gmail.com:
   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:
    role rolename=tomcat/
    role rolename=manager/
    role rolename=manager-script/
    user username=tomcat password=tomcat roles=tomcat/
    user username=maventomcat password=maventomcat roles=manager/
    user username=hordine password=hordine roles=manager,
   manager-script/
  
  
   I've added this server to my settings.xml:
   servers
      server
          idhordineLocalTomcat/id
          usernamehordine/username
          passwordhordine/password
      /server
   /servers
  
   And I've configured my POM like this:
  
   build
  
   finalNamehTask-web/finalName
  
    pluginManagement
  
    plugins
  
    plugin
  
           groupIdorg.apache.tomcat.maven/groupId
  
             artifactIdtomcat-maven-plugin/artifactId
  
             version1.1/version
 
  Sure of that 
 
  But to test if your issue is fixed in trunk try
  version2.0-SNAPSHOT/version
 
  see mojo declaration and repositories here:
  http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html
 
  
             configuration
  
     urlhttp://localhost:8080/manager/url
  
     serverhordineLocalTomcat/server
  
     path/hTask-web/path
  
    /configuration
  
    /plugin
  
    /plugins
  
    /pluginManagement
  
   /build
  
  
   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-webwar=
   [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
  
 

Re: mvn tomcat:deploy fails with HTTP response 401

2012-04-28 Thread Henrique Ordine
Awesome! I added the pluginGroup and it worked now.

Thank you!

2012/4/28 Olivier Lamy ol...@apache.org

 Have a look here
 http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/index.html

 there is a section regarding content to add in ~/.m2/settings.xml

 or add the plugin declaration in the pom section buildpluginsplugin
 (rather than pluginManagement)

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

 2012/4/28 Henrique Ordine hord...@gmail.com:
  Thanks again for your help.
 
  I added pluginRepositories to my POM, but if I use tomcat6:deploy or
  tomcat6:run, Maven says:
 
  The plugin 'org.apache.maven.plugins:maven-tomcat6-plugin' does not exist
  or no valid version could be found
 
  I'm using Maven, 2.2.0 by the way.
 
  2012/4/27 Olivier Lamy ol...@apache.org
 
  Add
   pluginRepositories
 pluginRepository
   idapache.snapshots/id
   nameApache Snapshots/name
   urlhttp://repository.apache.org/content/groups/snapshots-group/
  /url
   releases
 enabledfalse/enabled
   /releases
   snapshots
 enabledtrue/enabled
   /snapshots
 /pluginRepository
   /pluginRepositories
 
  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 hord...@gmail.com:
   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 ol...@apache.org 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 hord...@gmail.com:
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:
 role rolename=tomcat/
 role rolename=manager/
 role rolename=manager-script/
 user username=tomcat password=tomcat roles=tomcat/
 user username=maventomcat password=maventomcat
 roles=manager/
 user username=hordine password=hordine roles=manager,
manager-script/
   
   
I've added this server to my settings.xml:
servers
   server
   idhordineLocalTomcat/id
   usernamehordine/username
   passwordhordine/password
   /server
/servers
   
And I've configured my POM like this:
   
build
   
finalNamehTask-web/finalName
   
 pluginManagement
   
 plugins
   
 plugin
   
groupIdorg.apache.tomcat.maven/groupId
   
  artifactIdtomcat-maven-plugin/artifactId
   
  version1.1/version
  
   Sure of that 
  
   But to test if your issue is fixed in trunk try
   version2.0-SNAPSHOT/version
  
   see mojo declaration and repositories here:
  
 http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html
  
   
  configuration
   
  urlhttp://localhost:8080/manager/url
   
  serverhordineLocalTomcat/server
   
  path/hTask-web/path
   
 /configuration
   
 /plugin
   
 /plugins
   
 /pluginManagement
   
/build
   
   
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-webwar=
[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
   
   
 
 

Re: Does Tomcat Maven plugin support WAR overlays ?

2012-04-28 Thread Olivier Lamy
Salut Jeff,

Current Overlay support with tomcat6/7:run is very limited (only use
jars from WEB-INF/lib of the the war dependencies).
Perso, I use maven-dependency-plugin to extract war content (see
sample in this pom [1] ).
I agree it's hackhish :-) and having a better support as in the war
plugin could be better.
But didn't yet have any time to work on that. (can you create an issue
for that ?)
As my goal was to cut a release soon (ideally starting release process
next week, I'm not sure I will have time to work on that)

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

[1] 
http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/pom.xml

2012/4/28 Jeff MAURY jeffma...@jeffmaury.com:
 Hello,

 I am facing the following problem with WAR overlays:
 I have a first WAR, called skeleton, that contains all necessary stuff:
 base web.xml, index.jsp and JAR dependencies.
 I have another WAR whose first dependency is the skeleton which is (as of
 yet) almost empty except for the slf4j_log4 dependency.
 When i run tomcat7:run on the skeleton, everything is ok
 When I run tomcat7:run on the second war, Tomcat start but I am not able to
 use the application.
 I have look at the mojo code and it seems it is using the web app source
 directory (src/main/webapp) by default so as it is empty my case, it cannot
 work.
 AM I missing something ?

 Thanks
 Jeff


 --
 Jeff MAURY


 Legacy code often differs from its suggested alternative by actually
 working and scaling.
  - Bjarne Stroustrup

 http://www.jeffmaury.com
 http://riadiscuss.jeffmaury.com
 http://www.twitter.com/jeffmaury


 --
 Jeff MAURY


 Legacy code often differs from its suggested alternative by actually
 working and scaling.
  - Bjarne Stroustrup

 http://www.jeffmaury.com
 http://riadiscuss.jeffmaury.com
 http://www.twitter.com/jeffmaury

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



Re: multiple mod_jk server mappings and JSESSIONID

2012-04-28 Thread André Warnier

Mike Wilson wrote:
I need to set up a configuration where a site's path space 
gets distributed over two servers and I'm looking at using 
mod_jk like this:


  Apache httpd
mod_jk
  workers.properties
workerA - serverA
workerB - serverB
  uriworkermap.properties
/*   = serverA
/path2/* = serverB
/path3/* = serverB
/path3/xyz/* = serverA



You may have a problem with the above mappings, since
/* overlaps everything, and /path3/* overlaps /path3/xyz/*.
I am not sure that mod_jk mappings follow the principle of longest match wins.

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



Re: Running Swing app under Tomcat 6 on Linux

2012-04-28 Thread Mark Eggers
Comments and questions are in line. Please note I run Fedora / CentOS / Redhat 
and I'm not so familiar with Ubuntu.

- Original Message -

 From: dgchristen...@comcast.net dgchristen...@comcast.net
 To: users@tomcat.apache.org
 Cc: 
 Sent: Saturday, April 28, 2012 1:11 PM
 Subject: Running Swing app under Tomcat 6 on Linux
 
 My version info: 
 
     • Tomcat 6.0.28 
     • Java 1.6 
     • Ubuntu 10.4 
 
 
 I have a small debugging/monitoring app written in Java/Swing that I'd like 
 to run inside Tomcat to help with debugging. The app is started by
 dynamically  loading the monitoring class from a webservice running under
 Tomcat. The works in Windows (multiple flavors) but I'm having problems
 getting this running on Ubuntu. What I've tried so far: 

What does this give you that monitoring the application via JMX (see VisualVM, 
jconsole), and debugging with your favorite IDE (NetBeans, Eclipse, IntelliJ) 
doesn't give you? You can actually do both locally as well as remotely (with a 
little bit of setup).

 
 1) First error I got was an Headless exception. Since the app is a GUI app I 
 can't run in headless mode. After searching around I changed Tomcat's 
 library path (via -Djava.library.path in catalina.sh) to point to the 
 client lib (ie. .../java-6-sun-1.6.0.26/jre/lib/i386/client) instead of the
 server lib. 

Try setting JRE_HOME in the environment to point to a JRE installation instead. 
Or use JAVA_HOME and point to the JDK. Tomcat will figure things out.

If your environment is not set up by default to do that (mine is with custom.sh 
in /etc/profiles.d), create and use a setenv.sh script in CATALINA_HOME. In 
this set any CATALINA_OPTS, JAVA_OPTS, and other environment variables you need 
to.

 
 2) After changing the libs the next error was that DISPLAY wasn't set. After 
 setting DISPLAY=0.0 in catalina.sh I get Can't connect to X11 with 
 DISPLAY=0.0 error. I've tried different values for DISPLAY (e.g. 
 localhost:0.0) and nothing makes a difference. I've also tried fiddling 
 around with the policies in case there's a permissions error. See below for 
 the call stack. 

Are you running an X server? By that, are I mean is Ubuntu showing up in 
whatever GUI you've chosen (I guess Gnome 2 is that version's default)?

If you only have a command line interface, then there's no place to create the 
screen. You can play games with a virtual frame buffer, but that will just 
allow your program to run, but without any screen output (obviously).

Again, don't set the DISPLAY environment variable in catalina.sh. Set this in 
setenv.sh in the bin directory of CATALINA_HOME. There are lots of scenarios 
here. Three common ones come to mind.

1. Local X server

You're at the console and running in a GUI environment. The display environment 
variable should already be set (typically :0.0). If you start Tomcat with your 
application in this environment, the GUI interface should just appear.

2. Remote client, accessing the GUI via a VNC server (such as TightVNC)

Your display environment should already be set. For example, I'm currently on a 
remote CentOS 5.8 system via VNC. My DISPLAY environment variable is set to 
:0.2. If you start Tomcat with your application in this environment, the GUI 
interface should just appear in the VNC viewer (for example TightVNC).

3. Remote client, X server

Note that an X server means your PC is serving the screen, keyboard, and mouse 
to a remote client (your application). To accomplish this you'll have to have 
an X server running (if you're on Windows, try XMing), and you'll have to set 
the DISPLAY variable appropriately. Running Java swing applications in this 
fashion is not very pleasant especially if your program is graphics-intensive.

 The webservice app is a simple RESTEasy implementation. Since this works in 
 Windows I'm assuming (perhaps erroneously) that this can work in Linux. Any 
 help would be appreciated. 
 
 Thanks, 
 DG 
 
 java . lang . InternalError : Can 't connect to X11 window server using 
 ' : 0 . 0 ' as the value of the DISPLAY variable. 
 sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) 
 sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52) 
 sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155) 
 java.security.AccessController.doPrivileged(Native Method) 
 sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:131) 
 java.lang.Class.forName0(Native Method) 
 java.lang.Class.forName(Class.java:169) 
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
  
 
 java.awt.Window.init(Window.java:380) 
 java.awt.Window.init(Window.java:433) 
 java.awt.Frame.init(Frame.java:403) 
 java.awt.Frame.init(Frame.java:368) 
 javax.swing.JFrame.init(JFrame.java:158) 
 com.quinsoft.zeidon.objectbrowser.ObjectBrowser.startup(ObjectBrowser.java:60)
  



This should work just fine if you're running an X server on your Ubuntu system. 
The DISPLAY 

Re: Long timeout after aborted upload

2012-04-28 Thread Konstantin Kolinko
2012/4/27 Christopher Schultz ch...@christopherschultz.net:

 In the browser (Firefox 11.0 and 12.0 in our case), we can see the
 throbber work for a good 10-20 seconds *after* the upload has failed
 - -- our code has stopped running -- apparently waiting for something.


Just several notes

1. See config/context.html - swallowAbortedUploads

2. The throbber work is client-side issue. If it wastes his own
resources that is his own problem.
I would be more worried what is the load on the server and on the
network when this happens. (That would need some diagnosing work).

Just for starting - the status page in the Manager webapp shows the
current request processing threads and their status.

3. In GMail there is such a feature that when I make an attachment I
do not need to navigate to another page. The file is uploaded
asynchronously.

I wonder how it is done (Flash?) and whether you can have better error
handling at client side if you use similar approach.   E.g. JavaScript
detects that upload failed and then makes additional HTTP request to
get error details from the server.

Best regards,
Konstantin Kolinko

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