Re: Question about setting CATALINA_OPTS when starting Tomcat using a Windows Service in Tomcat 7.0.54

2018-08-08 Thread Daniel Savard
Le mer. 8 août 2018 à 12:08, Louis Zipes  a écrit :

>
> Hi Calder,
> I can successfully start up as a Windows service and get JMX working BUT
> my problem is that Service doesn't stop cleanly (just repeating that
> problem in case it wasn't made clear).  It says the PORT is already in use
> which led me to try to use Catalina_Opts as per the suggestions on the
> internet.
>
> Port already in use: 8008; nested exception is:
>java.net.BindException: Address already in use: JVM_Bind
>
> If you were able to get JMX working and you can start AND stop the Tomcat
> service cleanly, do you mind sharing me your 'scrubbed'  Java tab contents
> as I can seem to get the right combination to get it to Start and Stop the
> service.
>
> Thanks, Louis
>
>
>
Louis,

I believe you need to understand a bit more how things are working with
Java and the JVM. The -D options are pretty straight forward for anyone
knowing how you define properties to the JVM on the command line. I already
told you everything you need to know to setup properly your Tomcat. Since
you were the one talking about CATALINA_OPTS I assumed you did know where
and how to setup the variable for your installation. Otherwise, just go in
the setup utility for Tomcat on Windows and put the
-Dcom.sun.management.conf.file=${catalina.base}/conf/abc.def entry there
without the CATALINA_OPTS= stanza since this one's intent is to set an
environment variable for the process to pick while the former is passing
directly the property to the JVM from the Tomcat Windows Setup dialog.
There is many ways to do things. Bottom line, you need to tell the JVM
where is the configuration file for JMX and put your properties in there as
any other properties file. This is standard stuff.

The effect is the JVM now knows your port is a JMX port and it will stop to
try to use it when it is already in use and free it cleanly.

Regards,

-
Daniel Savard


>
>


Re: Working JKS file for SSL from Tomcat8 doesn't work with Tomcat9

2018-08-08 Thread Mark Thomas

On 08/08/2018 20:22, Arnold Morein wrote:
I have a company-issued, signed SSL cert installed in my Tomcat 8 system 
and all is well.


I downloaded and set up Tomcat 9.0.10 and simply copied the same JKS 
file over to match my TC8 config.


[code]
         port="8443" 
protocol="org.apache.coyote.http11.Http11NioProtocol"

    scheme="https" secure="true" sslProtocol="TLS" />
[code]

[code]
SEVERE: Failed to initialize component [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException: Protocol handler initialization 
failed
     at 
org.apache.catalina.connector.Connector.initInternal(Connector.java:935)

     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
     at 
org.apache.catalina.core.StandardService.initInternal(StandardService.java:530)

     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
     at 
org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:852)

     at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
     at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
     at org.apache.catalina.startup.Catalina.load(Catalina.java:656)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     at 
sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45009)
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45012)

     at java.lang.reflect.Method.invoke(Method.java:498)
     at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491)
Caused by: java.lang.IllegalArgumentException: the trustAnchors 
parameter must be non-empty
     at 
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:114)
     at 
org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:85)

     at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:216)
     at 
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1043)

     at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:540)
     at 
org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
     at 
org.apache.catalina.connector.Connector.initInternal(Connector.java:932)

     ... 15 more
Caused by: java.security.InvalidAlgorithmParameterException: the 
trustAnchors parameter must be non-empty
     at 
java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)

     at java.security.cert.PKIXParameters.(PKIXParameters.java:157)
     at 
java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.java:130)
     at 
org.apache.tomcat.util.net.jsse.JSSEUtil.getParameters(JSSEUtil.java:389)
     at 
org.apache.tomcat.util.net.jsse.JSSEUtil.getTrustManagers(JSSEUtil.java:313)
     at 
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:112)

[code]

There is nothing wrong with the JKS files since SSL works fine with TC8. 
So why is this error appearing in TC9? They are both using JDK 1.8.0_172.


Tomcat 9.0.x and 8.5.x have stricter requirements than 8.0.x and will 
throw exceptions where 8.0.x doesn't.


Generally, a good place to start would be using keytool to list the 
contents of the trust store, confirm the password is correct and that 
the trust store contains at least one certificate.


Mark

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



three layers model

2018-08-08 Thread Loai Abdallatif
Dear All

I have java apps running over three tiers model ( Apache - modJK) , Tomcat
8.5.29, and postgress 9.4 cluster with repmgr and pgpool -- all the layers
use same OS Debian 8.10

we are planing to upgrade the OS to 9.5 and also upgrade the tomcat to
version 9 and JDK to version 9

Is there any comparability list for using these components ?


Working JKS file for SSL from Tomcat8 doesn't work with Tomcat9

2018-08-08 Thread Arnold Morein

I have a company-issued, signed SSL cert installed in my Tomcat 8 system and 
all is well.



I downloaded and set up Tomcat 9.0.10 and simply copied the same JKS file over 
to match my TC8 config.



[code]

        

[code]



[code]

SEVERE: Failed to initialize component [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:935)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at 
org.apache.catalina.core.StandardService.initInternal(StandardService.java:530)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at 
org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:852)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:656)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45009)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45012)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491)
Caused by: java.lang.IllegalArgumentException: the trustAnchors parameter must 
be non-empty
    at 
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:114)
    at 
org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:85)
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:216)
    at 
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1043)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:540)
    at 
org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:932)
    ... 15 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors 
parameter must be non-empty
    at 
java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
    at java.security.cert.PKIXParameters.(PKIXParameters.java:157)
    at 
java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.java:130)
    at org.apache.tomcat.util.net.jsse.JSSEUtil.getParameters(JSSEUtil.java:389)
    at 
org.apache.tomcat.util.net.jsse.JSSEUtil.getTrustManagers(JSSEUtil.java:313)
    at 
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:112)
[code]



There is nothing wrong with the JKS files since SSL works fine with TC8. So why 
is this error appearing in TC9? They are both using JDK 1.8.0_172.






Re: Domain name change in Tomcat

2018-08-08 Thread tomcat

Hi.
It is getting a bit confused and confusing here :
- the latest configuration that you indicate below, does not match the previous one which 
you indicated previously (see even further below).
- you are talking about "broke every site" (implying several "sites"). What do you mean 
exactly by "site" ? the "" tags which you list below (without the Alias) seem to 
point to a single "site" (if by "site" you mean one hostname).
- you also do not really "broke every site". What URL were you trying to use, when *your 
browser* responded with "this page cannot be displayed" ?
- did you look at the tomcat logfiles, when you got the error ? Maybe it provides some 
useful clue.

- about
>companytest.lbpondemand.com
: is that hostname registered in the DNS ?
(in other words : can you do "ping companytest.lbpondemand.com", and what does 
that respond ?)

All in all, that makes it a bit hard to guess what you mean and how we could 
help.


On 08.08.2018 17:39, Laurie Miller-Cook wrote:

Hi there

I tried entering an Alias, like so


companytest.lbpondemand.com



But this broke every site I had on the server, I got "This page can't be 
displayed"

I had to remove the Alias line and the reboot the server to get things working 
again.

Any ideas?

Laurie
-Original Message-
From: Igor Cicimov 
Sent: Tuesday, August 07, 2018 11:49 PM
To: Tomcat Users List 
Subject: Re: Domain name change in Tomcat

On Wed, 8 Aug 2018 1:52 am Laurie Miller-Cook < 
laurie.miller-c...@larmerbrown.com> wrote:


Hi there,

I have an issue where I need to either change the URL of a Website in
Tomcat.

The current URL is https://training.ondemand.com and this needs to be
changed to https://wbt.ondemand.com (we have a wildcard SSL
certificate)

In my server.xml I have the following


 
 


Can I change the host name to wbt.ondemand.com and everything will
still work or as I expect am I going to have to build a new site from scratch?

All the best

Laurie



Just use Alias inside the Host
https://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Host_Name_Aliases





-
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: Question about setting CATALINA_OPTS when starting Tomcat using a Windows Service in Tomcat 7.0.54

2018-08-08 Thread Louis Zipes

Hi Calder,
I can successfully start up as a Windows service and get JMX working BUT my 
problem is that Service doesn't stop cleanly (just repeating that problem in 
case it wasn't made clear).  It says the PORT is already in use which led me to 
try to use Catalina_Opts as per the suggestions on the internet.

Port already in use: 8008; nested exception is:
   java.net.BindException: Address already in use: JVM_Bind

If you were able to get JMX working and you can start AND stop the Tomcat 
service cleanly, do you mind sharing me your 'scrubbed'  Java tab contents as I 
can seem to get the right combination to get it to Start and Stop the service.

Thanks, Louis

-Original Message-
From: calder [mailto:calder@gmail.com]
Sent: Wednesday, August 08, 2018 12:01 PM
To: Tomcat Users List
Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat using a 
Windows Service in Tomcat 7.0.54

- - - external message, proceed with caution - - -


I configured my "Tomcat as a Service" a couple days ago for remote JMC

a) navigate to Tomcat's "bin" subdir
b) execute: tomcat7w  //ES//"type service name here"
c) go to Java tab
d) add the properties in the "Java Options" text area
e) select OK and restart Tomcat Service


On Wednesday, August 8, 2018, Louis Zipes  wrote:

> Thanks for the assistance!  See my comments below:
>
> >You put this to setenv.bat in your bin directory. If the setenv.bat file
> does not exist, create it
>
> -- My problem throughout this is that I'm starting up my Tomcat using
> Windows service so setenv.bat and catalina.bat seems to be ignored in that
> scenario.   Correct me if I'm wrong but everything on Google mentions this.
>
> >Note that you can also set your properties in CATALINA_OPTS directly,
> i.e. you'd delete the line above in setenv.bat and paste in:
>
> -- When you say 'Set Catalina_Opts directly' do you mean the Environment
> variable  or some other location?
>
> -Original Message-
> From: Marek Czernek [mailto:mczer...@redhat.com]
> Sent: Wednesday, August 08, 2018 9:39 AM
> To: users@tomcat.apache.org
> Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
> using a Windows Service in Tomcat 7.0.54
>
> - - - external message, proceed with caution - - -
>
>
> Hi Louis,
>
> try the following format:
>
> set
> CATALINA_OPTS="-Dcom.sun.management.conf.file=%
> CATALINA_BASE%\conf\abc.efg"
>
> In the above, %CATALINA_BASE% is a bariable that should be resolved by
> Tomcat. If it is not, I made a mistake in the variable name, but I think
> it should work (you could also try %catalina.base%).
>
> You put this to setenv.bat in your bin directory. If the setenv.bat file
> does not exist, create it. Note that you can also set your properties in
> CATALINA_OPTS directly, i.e. you'd delete the line above in setenv.bat
> and paste in:
>
> set CATALINA_OPTS="-Dproperty1=value1 -Dproperty2=value2" etc. When you
> start Tomcat, it should read all the properties in CATALINA_OPTS and
> show you the properties at the beginning of the log.
>
> Hope this helps.
>
> On 08/08/2018 03:10 PM, Louis Zipes wrote:
> > Hi Daniel,
> > I apologize if maybe it is my lack of knowledge but I don't think I
> understand the actual way to write the line 'Set Catalina_Opts ='  in this
> management file that I'm going to reference in the Java window/tabe in the
> Tomcat 7w GUI.
> >
> > In my management.properties file (in the /CONF folder which is where
> also the server.xml file sits) I have the following
> >
> > com.sun.management.jmxremote
> > com.sun.management.jmxremote.port=8008
> > com.sun.management.jmxremote.authenticate=false
> > com.sun.management.jmxremote.ssl=false
> > java.rmi.server.hostname=
> >
> > How do I set these as my CATALINA_OPTS values?  I have tried various
> 'SET CATALINA_OPTS...' options but I can't seem to write it the correct way
> for Windows.  I have even tried to set the CATALINA_OPTS option, pointing
> to the management.properties file in the Java tab in the Tomcat7w GUI but I
> get an error that the Class can't be found so I must be writing it wrong.
> >
> > Thanks for the continued assistance.
> >
> > - Louis
> >
> >
> >
> > -Original Message-
> > From: Daniel Savard [mailto:daniel.sav...@gmail.com]
> > Sent: Friday, August 03, 2018 11:57 PM
> > To: Tomcat Users List
> > Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
> using a Windows Service in Tomcat 7.0.54
> >
> > - - - external message, proceed with caution - - -
> >
> >
> > Le ven. 3 août 2018 à 12:03, Louis Zipes  a écrit
> :
> >
> >> Good catch!!  I still had 'd' in front of my lines so once I removed
> those
> >> JMX starts up using Management.properties file but as you mentioned it
> >> doesn't really change the behavior at all and the Service still doesn't
> >> stop cleanly.  So is there a way to force the JMX to use CATALINA_OPTS
> in
> >> this file.  Something like SET CATALINA_OPTS = 'JMX settings'?
> >>
> >> That is if the JMX 

Re: Question about setting CATALINA_OPTS when starting Tomcat using a Windows Service in Tomcat 7.0.54

2018-08-08 Thread calder
I configured my "Tomcat as a Service" a couple days ago for remote JMC

a) navigate to Tomcat's "bin" subdir
b) execute: tomcat7w  //ES//"type service name here"
c) go to Java tab
d) add the properties in the "Java Options" text area
e) select OK and restart Tomcat Service


On Wednesday, August 8, 2018, Louis Zipes  wrote:

> Thanks for the assistance!  See my comments below:
>
> >You put this to setenv.bat in your bin directory. If the setenv.bat file
> does not exist, create it
>
> -- My problem throughout this is that I'm starting up my Tomcat using
> Windows service so setenv.bat and catalina.bat seems to be ignored in that
> scenario.   Correct me if I'm wrong but everything on Google mentions this.
>
> >Note that you can also set your properties in CATALINA_OPTS directly,
> i.e. you'd delete the line above in setenv.bat and paste in:
>
> -- When you say 'Set Catalina_Opts directly' do you mean the Environment
> variable  or some other location?
>
> -Original Message-
> From: Marek Czernek [mailto:mczer...@redhat.com]
> Sent: Wednesday, August 08, 2018 9:39 AM
> To: users@tomcat.apache.org
> Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
> using a Windows Service in Tomcat 7.0.54
>
> - - - external message, proceed with caution - - -
>
>
> Hi Louis,
>
> try the following format:
>
> set
> CATALINA_OPTS="-Dcom.sun.management.conf.file=%
> CATALINA_BASE%\conf\abc.efg"
>
> In the above, %CATALINA_BASE% is a bariable that should be resolved by
> Tomcat. If it is not, I made a mistake in the variable name, but I think
> it should work (you could also try %catalina.base%).
>
> You put this to setenv.bat in your bin directory. If the setenv.bat file
> does not exist, create it. Note that you can also set your properties in
> CATALINA_OPTS directly, i.e. you'd delete the line above in setenv.bat
> and paste in:
>
> set CATALINA_OPTS="-Dproperty1=value1 -Dproperty2=value2" etc. When you
> start Tomcat, it should read all the properties in CATALINA_OPTS and
> show you the properties at the beginning of the log.
>
> Hope this helps.
>
> On 08/08/2018 03:10 PM, Louis Zipes wrote:
> > Hi Daniel,
> > I apologize if maybe it is my lack of knowledge but I don't think I
> understand the actual way to write the line 'Set Catalina_Opts ='  in this
> management file that I'm going to reference in the Java window/tabe in the
> Tomcat 7w GUI.
> >
> > In my management.properties file (in the /CONF folder which is where
> also the server.xml file sits) I have the following
> >
> > com.sun.management.jmxremote
> > com.sun.management.jmxremote.port=8008
> > com.sun.management.jmxremote.authenticate=false
> > com.sun.management.jmxremote.ssl=false
> > java.rmi.server.hostname=
> >
> > How do I set these as my CATALINA_OPTS values?  I have tried various
> 'SET CATALINA_OPTS...' options but I can't seem to write it the correct way
> for Windows.  I have even tried to set the CATALINA_OPTS option, pointing
> to the management.properties file in the Java tab in the Tomcat7w GUI but I
> get an error that the Class can't be found so I must be writing it wrong.
> >
> > Thanks for the continued assistance.
> >
> > - Louis
> >
> >
> >
> > -Original Message-
> > From: Daniel Savard [mailto:daniel.sav...@gmail.com]
> > Sent: Friday, August 03, 2018 11:57 PM
> > To: Tomcat Users List
> > Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
> using a Windows Service in Tomcat 7.0.54
> >
> > - - - external message, proceed with caution - - -
> >
> >
> > Le ven. 3 août 2018 à 12:03, Louis Zipes  a écrit
> :
> >
> >> Good catch!!  I still had 'd' in front of my lines so once I removed
> those
> >> JMX starts up using Management.properties file but as you mentioned it
> >> doesn't really change the behavior at all and the Service still doesn't
> >> stop cleanly.  So is there a way to force the JMX to use CATALINA_OPTS
> in
> >> this file.  Something like SET CATALINA_OPTS = 'JMX settings'?
> >>
> >> That is if the JMX running on CATALINA_OPTS is indeed the answer.
> >> Basically, trying to mimic the setenv file that is not used by the
> Window
> >> Service.
> >>
> >> -Original Message-
> >> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> >> Sent: Friday, August 03, 2018 11:52 AM
> >> To: users@tomcat.apache.org
> >> Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
> >> using a Windows Service in Tomcat 7.0.54
> >>
> >> - - - external message, proceed with caution - - -
> >>
> >>
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA256
> >>
> >> Louis,
> >>
> >> On 8/3/18 11:32 AM, Louis Zipes wrote:
> >>> Hi Daniel, I tried your suggestion and while I think it is now
> >>> acknowledging the existence of the management.properties file
> >>> (Windows Service wouldn't start if I purposely misspelled
> >>> 'managemenX.properties') but it doesn't seem to be actually working
> >>> (JMX can't connect).
> >>>
> >>> What I did:
> >>>
> >>> I 

RE: Domain name change in Tomcat

2018-08-08 Thread Laurie Miller-Cook
Hi there

I tried entering an Alias, like so


companytest.lbpondemand.com



But this broke every site I had on the server, I got "This page can't be 
displayed"

I had to remove the Alias line and the reboot the server to get things working 
again.

Any ideas?

Laurie 
-Original Message-
From: Igor Cicimov  
Sent: Tuesday, August 07, 2018 11:49 PM
To: Tomcat Users List 
Subject: Re: Domain name change in Tomcat

On Wed, 8 Aug 2018 1:52 am Laurie Miller-Cook < 
laurie.miller-c...@larmerbrown.com> wrote:

> Hi there,
>
> I have an issue where I need to either change the URL of a Website in 
> Tomcat.
>
> The current URL is https://training.ondemand.com and this needs to be 
> changed to https://wbt.ondemand.com (we have a wildcard SSL 
> certificate)
>
> In my server.xml I have the following
>
>  unpackWARs="true" autoDeploy="true">
>  className="org.apache.catalina.valves.AccessLogValve" directory="logs"
>prefix="Training_access_log" suffix=".txt"
>pattern="%h %l %u %t %r %s %b" />
> 
>
>
> Can I change the host name to wbt.ondemand.com and everything will 
> still work or as I expect am I going to have to build a new site from scratch?
>
> All the best
>
> Laurie
>

Just use Alias inside the Host
https://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Host_Name_Aliases

>

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



Re: Tomcat 9 does not work with war file named along with revision number

2018-08-08 Thread Mark Thomas
On 08/08/18 15:20, premsudhan jaikumar wrote:
> Hello everyone,
> 
> Did some more digging into this issue am facing with various other tomcat 
> versions and it appears other than Tomcat version 7 all higher versions are 
> having this behavior, I tried with Tomcat8.0 , 8.5. & 9.0 and all has the 
> same issue.
> 
> It throws the below error
> 
> SEVERE [http-nio-8080-exec-7] 
> org.apache.catalina.core.StandardHostValve.custom Exception Processing 
> ErrorPage[exceptionType=java.lang.Exception, location=/uncaughtException]
> javax.servlet.ServletException: Could not resolve view with name 
> 'uncaughtException' in servlet with name 'dispatcher'
> 
> Any ideas, pointers to further investigate this? Appreciate any help on this. 
> Thanks.

This works fine for me.

You need to create the simplest possible web application - ideally a
single JSP or servlet - that demonstrates the problem. Chances are, in
reducing the issue to the simplest cause, you'll find the root cause. If
not, the community will be able to recreate the issue and investigate.

Mark

> 
> -Prem
> 
> 
> From: premsudhan jaikumar
> Sent: Tuesday, August 07, 2018 11:53 AM
> To: 'users@tomcat.apache.org' 
> Subject: Tomcat 9 does not work with war file named along with revision number
> 
> Hi
> Am trying to deploy an application in Tomcat version 9.10,it has application 
> war file name like For Eg: app-name##r123.war file. And I can see its not 
> recognizing the context path from the exploded war. If I rename the war file 
> name without revision number it works fine.
> 
> from Tomcat documentation I can see that this naming convention is supported 
> - https://tomcat.apache.org/tomcat-9.0-doc/config/http.html however it 
> doesn't seem to work.
> 
> The same war file works with Tomcat7 without any issues.Did anyone face this 
> issue ?
> 
> 
> -Prem
> 
> 


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



RE: Tomcat 9 does not work with war file named along with revision number

2018-08-08 Thread premsudhan jaikumar
Hello everyone,

Did some more digging into this issue am facing with various other tomcat 
versions and it appears other than Tomcat version 7 all higher versions are 
having this behavior, I tried with Tomcat8.0 , 8.5. & 9.0 and all has the same 
issue.

It throws the below error

SEVERE [http-nio-8080-exec-7] org.apache.catalina.core.StandardHostValve.custom 
Exception Processing ErrorPage[exceptionType=java.lang.Exception, 
location=/uncaughtException]
javax.servlet.ServletException: Could not resolve view with name 
'uncaughtException' in servlet with name 'dispatcher'

Any ideas, pointers to further investigate this? Appreciate any help on this. 
Thanks.

-Prem


From: premsudhan jaikumar
Sent: Tuesday, August 07, 2018 11:53 AM
To: 'users@tomcat.apache.org' 
Subject: Tomcat 9 does not work with war file named along with revision number

Hi
Am trying to deploy an application in Tomcat version 9.10,it has application 
war file name like For Eg: app-name##r123.war file. And I can see its not 
recognizing the context path from the exploded war. If I rename the war file 
name without revision number it works fine.

from Tomcat documentation I can see that this naming convention is supported - 
https://tomcat.apache.org/tomcat-9.0-doc/config/http.html however it doesn't 
seem to work.

The same war file works with Tomcat7 without any issues.Did anyone face this 
issue ?


-Prem



RE: Question about setting CATALINA_OPTS when starting Tomcat using a Windows Service in Tomcat 7.0.54

2018-08-08 Thread Louis Zipes
Thanks for the assistance!  See my comments below:

>You put this to setenv.bat in your bin directory. If the setenv.bat file does 
>not exist, create it

-- My problem throughout this is that I'm starting up my Tomcat using Windows 
service so setenv.bat and catalina.bat seems to be ignored in that scenario.   
Correct me if I'm wrong but everything on Google mentions this.

>Note that you can also set your properties in CATALINA_OPTS directly, i.e. 
>you'd delete the line above in setenv.bat and paste in:

-- When you say 'Set Catalina_Opts directly' do you mean the Environment 
variable  or some other location?

-Original Message-
From: Marek Czernek [mailto:mczer...@redhat.com]
Sent: Wednesday, August 08, 2018 9:39 AM
To: users@tomcat.apache.org
Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat using a 
Windows Service in Tomcat 7.0.54

- - - external message, proceed with caution - - -


Hi Louis,

try the following format:

set
CATALINA_OPTS="-Dcom.sun.management.conf.file=%CATALINA_BASE%\conf\abc.efg"

In the above, %CATALINA_BASE% is a bariable that should be resolved by
Tomcat. If it is not, I made a mistake in the variable name, but I think
it should work (you could also try %catalina.base%).

You put this to setenv.bat in your bin directory. If the setenv.bat file
does not exist, create it. Note that you can also set your properties in
CATALINA_OPTS directly, i.e. you'd delete the line above in setenv.bat
and paste in:

set CATALINA_OPTS="-Dproperty1=value1 -Dproperty2=value2" etc. When you
start Tomcat, it should read all the properties in CATALINA_OPTS and
show you the properties at the beginning of the log.

Hope this helps.

On 08/08/2018 03:10 PM, Louis Zipes wrote:
> Hi Daniel,
> I apologize if maybe it is my lack of knowledge but I don't think I 
> understand the actual way to write the line 'Set Catalina_Opts ='  in this 
> management file that I'm going to reference in the Java window/tabe in the 
> Tomcat 7w GUI.
>
> In my management.properties file (in the /CONF folder which is where also the 
> server.xml file sits) I have the following
>
> com.sun.management.jmxremote
> com.sun.management.jmxremote.port=8008
> com.sun.management.jmxremote.authenticate=false
> com.sun.management.jmxremote.ssl=false
> java.rmi.server.hostname=
>
> How do I set these as my CATALINA_OPTS values?  I have tried various 'SET 
> CATALINA_OPTS...' options but I can't seem to write it the correct way for 
> Windows.  I have even tried to set the CATALINA_OPTS option, pointing to the 
> management.properties file in the Java tab in the Tomcat7w GUI but I get an 
> error that the Class can't be found so I must be writing it wrong.
>
> Thanks for the continued assistance.
>
> - Louis
>
>
>
> -Original Message-
> From: Daniel Savard [mailto:daniel.sav...@gmail.com]
> Sent: Friday, August 03, 2018 11:57 PM
> To: Tomcat Users List
> Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat using 
> a Windows Service in Tomcat 7.0.54
>
> - - - external message, proceed with caution - - -
>
>
> Le ven. 3 août 2018 à 12:03, Louis Zipes  a écrit :
>
>> Good catch!!  I still had 'd' in front of my lines so once I removed those
>> JMX starts up using Management.properties file but as you mentioned it
>> doesn't really change the behavior at all and the Service still doesn't
>> stop cleanly.  So is there a way to force the JMX to use CATALINA_OPTS in
>> this file.  Something like SET CATALINA_OPTS = 'JMX settings'?
>>
>> That is if the JMX running on CATALINA_OPTS is indeed the answer.
>> Basically, trying to mimic the setenv file that is not used by the Window
>> Service.
>>
>> -Original Message-
>> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
>> Sent: Friday, August 03, 2018 11:52 AM
>> To: users@tomcat.apache.org
>> Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
>> using a Windows Service in Tomcat 7.0.54
>>
>> - - - external message, proceed with caution - - -
>>
>>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>> Louis,
>>
>> On 8/3/18 11:32 AM, Louis Zipes wrote:
>>> Hi Daniel, I tried your suggestion and while I think it is now
>>> acknowledging the existence of the management.properties file
>>> (Windows Service wouldn't start if I purposely misspelled
>>> 'managemenX.properties') but it doesn't seem to be actually working
>>> (JMX can't connect).
>>>
>>> What I did:
>>>
>>> I created a copy of an existing logging.properties file already in
>>> the CONF folder, renamed it management.properties, and removed all
>>> contents of it and put in:
>> Just FYI, there is nothing magical about an existing properties file.
>> It's just a text file with name=value items in it.
>>
>>> Dcom.sun.management.jmxremote
>>> Dcom.sun.management.jmxremote.port=8008
>>> Dcom.sun.management.jmxremote.authenticate=false
>>> Dcom.sun.management.jmxremote.ssl=false
>>> Djava.rmi.server.hostname=
>> I don't think you want those 

Re: Question about setting CATALINA_OPTS when starting Tomcat using a Windows Service in Tomcat 7.0.54

2018-08-08 Thread Marek Czernek

Hi Louis,

try the following format:

set 
CATALINA_OPTS="-Dcom.sun.management.conf.file=%CATALINA_BASE%\conf\abc.efg"


In the above, %CATALINA_BASE% is a bariable that should be resolved by 
Tomcat. If it is not, I made a mistake in the variable name, but I think 
it should work (you could also try %catalina.base%).


You put this to setenv.bat in your bin directory. If the setenv.bat file 
does not exist, create it. Note that you can also set your properties in 
CATALINA_OPTS directly, i.e. you'd delete the line above in setenv.bat 
and paste in:


set CATALINA_OPTS="-Dproperty1=value1 -Dproperty2=value2" etc. When you 
start Tomcat, it should read all the properties in CATALINA_OPTS and 
show you the properties at the beginning of the log.


Hope this helps.

On 08/08/2018 03:10 PM, Louis Zipes wrote:

Hi Daniel,
I apologize if maybe it is my lack of knowledge but I don't think I understand 
the actual way to write the line 'Set Catalina_Opts ='  in this management file 
that I'm going to reference in the Java window/tabe in the Tomcat 7w GUI.

In my management.properties file (in the /CONF folder which is where also the 
server.xml file sits) I have the following

com.sun.management.jmxremote
com.sun.management.jmxremote.port=8008
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
java.rmi.server.hostname=

How do I set these as my CATALINA_OPTS values?  I have tried various 'SET 
CATALINA_OPTS...' options but I can't seem to write it the correct way for 
Windows.  I have even tried to set the CATALINA_OPTS option, pointing to the 
management.properties file in the Java tab in the Tomcat7w GUI but I get an 
error that the Class can't be found so I must be writing it wrong.

Thanks for the continued assistance.

- Louis



-Original Message-
From: Daniel Savard [mailto:daniel.sav...@gmail.com]
Sent: Friday, August 03, 2018 11:57 PM
To: Tomcat Users List
Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat using a 
Windows Service in Tomcat 7.0.54

- - - external message, proceed with caution - - -


Le ven. 3 août 2018 à 12:03, Louis Zipes  a écrit :


Good catch!!  I still had 'd' in front of my lines so once I removed those
JMX starts up using Management.properties file but as you mentioned it
doesn't really change the behavior at all and the Service still doesn't
stop cleanly.  So is there a way to force the JMX to use CATALINA_OPTS in
this file.  Something like SET CATALINA_OPTS = 'JMX settings'?

That is if the JMX running on CATALINA_OPTS is indeed the answer.
Basically, trying to mimic the setenv file that is not used by the Window
Service.

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Friday, August 03, 2018 11:52 AM
To: users@tomcat.apache.org
Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
using a Windows Service in Tomcat 7.0.54

- - - external message, proceed with caution - - -


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Louis,

On 8/3/18 11:32 AM, Louis Zipes wrote:

Hi Daniel, I tried your suggestion and while I think it is now
acknowledging the existence of the management.properties file
(Windows Service wouldn't start if I purposely misspelled
'managemenX.properties') but it doesn't seem to be actually working
(JMX can't connect).

What I did:

I created a copy of an existing logging.properties file already in
the CONF folder, renamed it management.properties, and removed all
contents of it and put in:

Just FYI, there is nothing magical about an existing properties file.
It's just a text file with name=value items in it.


Dcom.sun.management.jmxremote
Dcom.sun.management.jmxremote.port=8008
Dcom.sun.management.jmxremote.authenticate=false
Dcom.sun.management.jmxremote.ssl=false
Djava.rmi.server.hostname=

I don't think you want those leading D characters. Is that a
copy/paste error?


-Dcom.sun.management.config.file= C:\ \Tomcat\conf\management.properties

Daniel usually knows what he's talking about, but I'll be surprised if
Tomcat doesn't fail the same way after making these changes... you are
just moving the configuration from one place (multiple system
properties) to another (one system property pointing to another file
of properties).

- -chris


As Christopher said, you this file management.properties can be named
whatever abc.efg would do the same and in that file you have
attribute=value pairs, everything that concerns the com.sun.management.xxx
properties. Then you pass the name of that file as a single option to the
JVM with -Dcom.sun.management.config.file=${catalina.base}/conf/abc.efg and
remove everything else from the CATALINA_OPTS which is in the configuration
file. I strongly suggest to locate this file in the same directory as the
server.xml file and use the ${catalina.base} variable asis and litterally
into the 
CATALINA_OPTS="-Dcom.sun.management.conf.file=${catalina.base}/conf/abc.efg"
definition.

I skipped other 

RE: Question about setting CATALINA_OPTS when starting Tomcat using a Windows Service in Tomcat 7.0.54

2018-08-08 Thread Louis Zipes
Hi Daniel,
I apologize if maybe it is my lack of knowledge but I don't think I understand 
the actual way to write the line 'Set Catalina_Opts ='  in this management file 
that I'm going to reference in the Java window/tabe in the Tomcat 7w GUI.

In my management.properties file (in the /CONF folder which is where also the 
server.xml file sits) I have the following

com.sun.management.jmxremote
com.sun.management.jmxremote.port=8008
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
java.rmi.server.hostname=

How do I set these as my CATALINA_OPTS values?  I have tried various 'SET 
CATALINA_OPTS...' options but I can't seem to write it the correct way for 
Windows.  I have even tried to set the CATALINA_OPTS option, pointing to the 
management.properties file in the Java tab in the Tomcat7w GUI but I get an 
error that the Class can't be found so I must be writing it wrong.

Thanks for the continued assistance.

- Louis



-Original Message-
From: Daniel Savard [mailto:daniel.sav...@gmail.com]
Sent: Friday, August 03, 2018 11:57 PM
To: Tomcat Users List
Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat using a 
Windows Service in Tomcat 7.0.54

- - - external message, proceed with caution - - -


Le ven. 3 août 2018 à 12:03, Louis Zipes  a écrit :

> Good catch!!  I still had 'd' in front of my lines so once I removed those
> JMX starts up using Management.properties file but as you mentioned it
> doesn't really change the behavior at all and the Service still doesn't
> stop cleanly.  So is there a way to force the JMX to use CATALINA_OPTS in
> this file.  Something like SET CATALINA_OPTS = 'JMX settings'?
>
> That is if the JMX running on CATALINA_OPTS is indeed the answer.
> Basically, trying to mimic the setenv file that is not used by the Window
> Service.
>
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, August 03, 2018 11:52 AM
> To: users@tomcat.apache.org
> Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat
> using a Windows Service in Tomcat 7.0.54
>
> - - - external message, proceed with caution - - -
>
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Louis,
>
> On 8/3/18 11:32 AM, Louis Zipes wrote:
> > Hi Daniel, I tried your suggestion and while I think it is now
> > acknowledging the existence of the management.properties file
> > (Windows Service wouldn't start if I purposely misspelled
> > 'managemenX.properties') but it doesn't seem to be actually working
> > (JMX can't connect).
> >
> > What I did:
> >
> > I created a copy of an existing logging.properties file already in
> > the CONF folder, renamed it management.properties, and removed all
> > contents of it and put in:
>
> Just FYI, there is nothing magical about an existing properties file.
> It's just a text file with name=value items in it.
>
> > Dcom.sun.management.jmxremote
> > Dcom.sun.management.jmxremote.port=8008
> > Dcom.sun.management.jmxremote.authenticate=false
> > Dcom.sun.management.jmxremote.ssl=false
> > Djava.rmi.server.hostname=
>
> I don't think you want those leading D characters. Is that a
> copy/paste error?
>
> > -Dcom.sun.management.config.file= C:\  > structure>\Tomcat\conf\management.properties
>
> Daniel usually knows what he's talking about, but I'll be surprised if
> Tomcat doesn't fail the same way after making these changes... you are
> just moving the configuration from one place (multiple system
> properties) to another (one system property pointing to another file
> of properties).
>
> - -chris
>

As Christopher said, you this file management.properties can be named
whatever abc.efg would do the same and in that file you have
attribute=value pairs, everything that concerns the com.sun.management.xxx
properties. Then you pass the name of that file as a single option to the
JVM with -Dcom.sun.management.config.file=${catalina.base}/conf/abc.efg and
remove everything else from the CATALINA_OPTS which is in the configuration
file. I strongly suggest to locate this file in the same directory as the
server.xml file and use the ${catalina.base} variable asis and litterally
into the 
CATALINA_OPTS="-Dcom.sun.management.conf.file=${catalina.base}/conf/abc.efg"
definition.

I skipped other configuration files for authentication, in my case I am
authenticating the users against the Active Directory database. So, the
informations I gave for the content of the configuration file is incomplete
and do not necessarily apply to your case, that's why I didn't bother to
put it in my original post. But, you may have to use extra properties for
you particular situation.

Why did I say to put everything in the configuration file for
com.sun.management.config.file? Because that way, the JVM knows these are
for JMX and knows the port is for JMX and will not run into a nonesense
when stopping the service saying the port is already in use. That's why you
should put this