Re: [EXT]Re: jakartaee-migration-1.0.7 migration tool failure

2024-02-08 Thread Rob Sargent



> On Feb 8, 2024, at 9:04 AM, Rick Noel  wrote:
> 
> I built  my app in Eclipse  and the build path is set to use the migrated 
> jar.
> It compiles without error on Eclipse and using the migrated jar.  I have that 
> same migrated jar in the Tomcat lib
> But when tomcat 10 compiles it does not compile
> 
> I have also used the migration tool on my .war that runs in Tomcat 9 and that 
> war still fails with same compile error.
> 
> So to summarize. the migration tool fails to convert third party jar 
> xmlrpc-server3.1.3.jar
> And it also fails when I use it on my .war ran through the migration tool.
> 
> 
> Rick Noel
> Systems Programmer | Westwood One
> rn...@westwoodone.com
> 

Can you build from the command  line?  Who knows what eclipse does under the 
covers 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Posting questions

2024-01-05 Thread Rob Sargent



On 1/5/24 07:31, Jalaj Asher wrote:

Omkar,
2 questions
1. when you say processes what processes are you seeing being invoked and does 
it stop at 200 processes. May be a screen shot might help
2. does the tomcat have read write privilege on all its folders ? If not does 
giving those rights help ?



Do screen shots will make it through to the readers? Text from ps might 
be safer.


Re: JSP include not working

2023-12-05 Thread Rob Sargent




On 12/5/23 12:01, Niranjan Rao wrote:

Greetings,

I'm missing something obvious and hoping that someone can point my 
nose in right direction.



We have a application WAR file that works fine on tomcat 7.0.78. We're 
trying to migrate this application to 9.0.82. When trying to hit the 
pages, I'm getting error JSP file not found at WEB-INF/location>. The app works fine in tomcat version 7. We have other 
applications which use similar pattern and are working fine on tomcat 9.



I've checked and checked and confirmed file exists at desired 
location. Only significant difference between migrated apps and this 
app I noticed was web.xml points version 4.0 where it works and 3.0 
where it does not. Changing version to 4.0 in broken app did not help.



The applications use Spring and serve JSP through spring controllers. 
Problematic application seems to be initializing properly based on 
application logs, just that it's not able to include JSP. Any log 
files do not show any exception trace, but access log file logs the 
error with 500 status code.




Case sensitive file names, perhaps.



Am I missing something obvious?

Regards,

Niranjan




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



Re: Get Client Certificate Information

2023-06-21 Thread Rob Sargent



> On Jun 21, 2023, at 11:29 AM, Timothy Ward  wrote:
> 
> I tried the following:
> 
> import javax.servlet.http.HttpServletRequest;
> import javax.security.cert.Certificate;
> import javax.security.cert.X509Certificate;
> 
> X509Certificate[] certs = (X509Certificate[])
> getHttpServletRequest().getAttribute("jakarta.servlet.request.X509Certificate");
> 
> and I'm getting:
> 
> [Error]  (1: 0): GrabCert:33: error: cannot find symbol,
> [Error]  (1: 0):   X509Certificate[] certs = (X509Certificate[])
> getHttpServletRequest().getAttribute("jakarta.servlet.request.X509Certificate");,
> [Error]  (1: 0): ^,
> [Error]  (1: 0):   symbol:   method getHttpServletRequest(),
> [Error]  (1: 0):   location: class GrabCert, [Error]  (1: 0): 1 error
> 

If I lined that up correctly, it seems to be pointing at “getAttribute”. Is 
your getHttpServletRequest giving you what you expect?


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



Re: Crypto Randomly Not Getting Initialized

2023-06-13 Thread Rob Sargent

In /etc/rc.local I have:


--
sleep 120s
systemctl start tomcat9

-

I put the sleep in back a couple of years ago that for some reason 
'fixed' this same random, intermittent crypto file exception.





You mentioned earlier that you had recently tried a 3 minute delay, to 
no effect.  Did you try any delay longer than 3 minutes? Maybe something 
ridiculous like 15m?  It could be that whatever was taking two minutes 
before is now taking much longer.


No change in file permissions at or above the "unlimited" dir?


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



Re: SOAP HTTP error: "HTTP/1.1 400 Bad Request" after upgrade to 8.5.89.

2023-06-02 Thread Rob Sargent




On 6/2/23 14:00, jonmcalexan...@wellsfargo.com.INVALID wrote:

Good afternoon,

Have a team that just upgraded to 8.5.89 from 8.5.72 and started getting these 
messages in the logs:

[2023/06/01][01:05:10.012] : [INIT] - EPMSend (init) - EPMSend = SOAP
[2023/06/01][01:05:10.012] : [INIT] - EPMSend (init) - SOAPPort = 8443
[2023/06/01][01:05:10.012] : [INIT] - EPMSend (init) - SOAPPath =
[2023/06/01][01:05:10.012] : [INIT] - EPMSend (init) - SOAPURL = 
...
[2023/06/01][17:31:01.157] : [EPMSEND] - EPMSend - Established Socket to send 
EPM messages
[2023/06/01][17:31:01.227] : [EPMSEND] - EPMSend - Error not 200 OK. HTTP error: 
"HTTP/1.1 400 Bad Request"  See reply txt message in XMLPathOut directory for 
g:\vdata\epmxml/001-HOU-02-20230530-0001-I-X-200-UPDATEUOW-20230601080446029.xml
[2023/06/01][17:31:01.380] : [INIT] - EPMSend (init) - EPMSend = SOAP

Is anyone aware of what could potentially be the cause?

Thank you.


Is there nothing useful in either

XMLPathOut

or

g:\vdata\epmxml/001-HOU-02-20230530-0001-I-X-200-UPDATEUOW-20230601080446029.xml



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



Re: AW: Too many certificates in chain?!? Help!

2023-05-23 Thread Rob Sargent




On 5/23/23 10:13, James H. H. Lampert wrote:

On 5/23/23 8:31 AM, Christopher Schultz wrote:
Can you dump the whole cert (e.g. keytool -list -v -alias 'certname') 
for each cert and see if any of the certificates specify a maximum 
chain length somewhere? Evidently, it's an extension to the X.509 spec:


Comparing one that worked with one that blew up, they have the same 
values for all of the "basic constraints" sections: the site cert shows

BasicConstraints:[
  CA:false
  PathLen: undefined
]


the intermediate cert shows

BasicConstraints:[
  CA:true
  PathLen:0
]



Does pathLen:0 mean "no limit" or "no go"?


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



Re: WebappClassLoaderBase error when upgrading Tomcat 8 to 8.5

2023-05-01 Thread Rob Sargent




On 5/1/23 14:36, Christopher Schultz wrote:

Jeremy,

On 5/1/23 14:22, Jeremy Nguyen wrote:

I'm trying to upgrade Tomcat 8 to 8.5 and I'm getting a
nullpointerexception within 
WebappClassLoaderBase.CombinedEnumeration.inc.
It seems to occur when it's trying to initialize commons-logging 
LogFactory

for any class specified in Web.xml, and it's calling
getResources("commons-logging.properties") which I never had. Is it
required in 8.5? Even if I put it in conf/, it's not being picked up.

We're running Tomcat using a wrapper and it's erroring out here:
https://github.com/CodeGerm/osgi-server/blob/master/plugins/org.cg.dao.webcontainer/src/org/cg/dao/webcontainer/tomcat/TomcatWrapper.java#L185 



I posted my web.xml and error trace here as well:
https://stackoverflow.com/questions/76139108/web-xml-configuration-is-broken-when-upgrading-to-tomcat-8-5-and-spring-5-1 



I have no idea how this is throwing an NPE. The only pointer being 
dereferenced by the inc() method is "sources":


2773    private boolean inc() {
2774    while (index < sources.length) {
2775    if (sources[index].hasMoreElements()) {
2776    return true;
2777    }
2778    index++;
2779    }
2780    return false;
2781    }

That member (sources) is instantiated in the one-and-only-one 
constructor:


    CombinedEnumeration(Enumeration enum1, Enumeration 
enum2) {

    @SuppressWarnings("unchecked")
    Enumeration[] sources = new Enumeration[] { enum1, 
enum2 };

    this.sources = sources;
    }

Also weird is that this throws NPE on line 2775 and not 2774. I can't 
explain how line 2775 could throw an NPE if line 2774 did not.


>:/


Is the null pointer in the index'th position of source, not source itself?



I use Tomcat 8.5.x and I have never had a commons-logging.properties 
file, and I use some components which are surely causing 
commons-logging LogFactory to initialize, and I've never seen this 
problem before.


-chris

-
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: Apache Tomcat 10.0.26 Shortcut issue in our environment - Need Help

2023-04-05 Thread Rob Sargent


> On Apr 5, 2023, at 5:04 AM, P M, SRIHARIKUMAR (Consultant) 
>  wrote:
> 
> 
> Hi Team,
>  
> While validating source for Apache Tomcat 10.0.26, The shortcut is throwing 
> error while launching. Please find the results below
>  
> Tomcat Version : 10.0.26
>  
> Operating system : Windows 10
>  
> Dependency : JAVA SDK 11 is installed.
>  
> Error : “ The item referred to by this shortcut cannot be accessed. You may 
> not have appropriate Permission”.
>  
> Method tried but still could not make shortcut work:
>  
> Searched in Google and tried removing shortcut and created manually.
> Rebooted the system and checked.
> Started the Tomcat Service Manually and checked.
> Provided Permission to the Shortcut pointing exe and tried.
> Tried more than 5 Machines to make sure if its due to any machine related 
> issue.
>  
> Error while launching Configure Tomcat Shortcut.
>  
>  

Pictures don’t work on this list. Get the text (as text)
> 
>  
>  
> Error while launching Monitor Tomcat Shortcut.
>  
>  
> 
>  
>  
> Error while launching Tomcat Manager Shortcut.
>  
>  
> 
>  
>  
> Thanks & Regards
> Sriharikumar PM
>  
>  


Re: Excluded service.bat From Maven Artefact

2023-03-15 Thread Rob Sargent




On 3/15/23 22:01, LANDER Tim wrote:

Hi, I've noticed that service.bat and Tomcat.exe (Actually all exe's: 
https://github.com/apache/tomcat/blob/6de806a21adc68a23aa4043c67c0d80bbab1c458/build.xml#L2825-L2828)
 are excluded from the tomcat maven artefact (org.apache.tomcat:tomcat). What's 
the reason for this? I couldn't find it documented anywhere.

This makes it a bit annoying trying to add tomcat to a (Windows) installer. I 
know I can download and extract those files from
archieve.apache.org, but it makes automating this process unnecessarily 
annoying.
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


Isn't Tomcat a java app, using jar files?

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



Re: catalina.out, was Re: Connector definitions

2023-03-08 Thread Rob Sargent




On 3/8/23 13:47, Rob Sargent wrote:



On 3/8/23 12:54, James H. H. Lampert wrote:

On 3/8/23 11:35 AM, Mark Thomas wrote:

Check logging.properties and/or how you have stdout redirected in 
your start-up scripts.


Thanks.
All I see different in logging.properties is that on the Midrange box 
(installed from the ZIP file from Apache's Tomcat site), it has 
"catalina.org.apache.juli.AsyncFileHandler.maxDays = 90" clauses, 
whereas on the cloud Linux (probably installed with yum or apt), it 
doesn't.


And if (adopting root authority) I do a "find -name catalina.sh" or a 
"find -name startup.sh" on a cloud Linux box, I find *nothing.* Which 
is remarkable in itself.




Assuming you're starting in the right place, try "find-name catalina.\*"


"find -name" of course



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



Re: catalina.out, was Re: Connector definitions

2023-03-08 Thread Rob Sargent




On 3/8/23 12:54, James H. H. Lampert wrote:

On 3/8/23 11:35 AM, Mark Thomas wrote:

Check logging.properties and/or how you have stdout redirected in 
your start-up scripts.


Thanks.
All I see different in logging.properties is that on the Midrange box 
(installed from the ZIP file from Apache's Tomcat site), it has 
"catalina.org.apache.juli.AsyncFileHandler.maxDays = 90" clauses, 
whereas on the cloud Linux (probably installed with yum or apt), it 
doesn't.


And if (adopting root authority) I do a "find -name catalina.sh" or a 
"find -name startup.sh" on a cloud Linux box, I find *nothing.* Which 
is remarkable in itself.




Assuming you're starting in the right place, try "find-name catalina.\*"


Not that it's of more than academic interest.

--
JHHL

-
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: Log rotation issue

2023-02-26 Thread Rob Sargent




On 2/26/23 19:28, Ragavendhiran Bhiman (rabhiman) wrote:

Hi

we are facing log rotation issue in apache tomcat. Our configurations like below

handlers = 1catalina.org.apache.juli.AsyncFileHandler, 
2localhost.org.apache.juli.AsyncFileHandler, 
3manager.org.apache.juli.AsyncFileHandler, 
4host-manager.org.apache.juli.AsyncFileHandler

.handlers = 1catalina.org.apache.juli.AsyncFileHandler


# Handler specific properties.
# Describes specific configuration info for Handlers.


1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.rotatable = false

2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.rotatable = false

3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.

4admin.org.apache.juli.FileHandler.level = FINE
4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4admin.org.apache.juli.FileHandler.prefix = admin.

5host-manager.org.apache.juli.FileHandler.level = FINE
5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5host-manager.org.apache.juli.FileHandler.prefix = host-manager.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter


Have you tried change .level = FINE to .level = INFO?

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



Re: Tomcat for Apple silicon coming soon?

2023-01-23 Thread Rob Sargent




On 1/23/23 12:29, m...@cvkimball.com wrote:


Dear Folks,

I installed Java JDK 17 and Tomcat 10.1 on my better half's Mac Pro 
M1-based processor. It ran without problems!




You have to admit that that is painfully close to "Works on my box". ;)


Thanks,

Chris


-
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: Tomcat 10 on Windows 11 error

2022-12-30 Thread Rob Sargent




On 12/30/22 17:59, Shawn Heisey wrote:

On 12/30/22 17:03, Carles Franquesa wrote:
Once downloaded, installed, and configured in the settings of the 
netbeans project, the error has changed, what always is very hopeful.


Now, the thing is that the compiler gives this new output:

image.png

Tried to modify the compiler options in the project properties,
image.png
but, obviously, is not the place.

Do you now where should I modify the compiler option Xbootclasspath?

And I feel sorry for not having checked exactly "URLEncoder.encode 
TomcatManagerImpl". Trust me when I say I have been googling so far 
as extenuation...


The mailing list ate your image attachments.  Nobody can see them.

You need to put the images on a file sharing site and provide a URL 
like you did for the first message on the thread.


The later message says you got it working, so I guess the images are 
no longer needed.


Better yet, copy as text, paste here.  You're just dealing with compiler 
output and a config file after all.



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



Re: apache-tomcat-9.0.70 >> JNDI look up fails in a different thread context class loader !!

2022-12-13 Thread Rob Sargent




On 12/13/22 22:25, dineshk wrote:

  Hi Mark,
I guess you are right , I tried with simple web application and JNDI look up 
fails in both tomcat 7.x and 9.x if the current thread context class loader is 
changed but strangely when we deploy our application which uses hibernate 
(4.3.11) , it does work in tomcat 7.x  but not in 9.x. Not sure what is causing 
this to work in tomcat 7.x and not in tomcat 9.x.
Secondly , is this implementation "JNDI binding with context class loader" 
tomcat specific as it  works in both JBoss EAP and IBM WebSphere , any inputs why JNDI 
look up works in these application servers and not in tomcat?
RegardsDinesh

 On Tuesday, December 13, 2022 at 02:06:06 PM GMT+5:30, dineshk 
 wrote:
  
  
Hi Mark,

I guess you are right , I tried with simple web application and JNDI look up 
fails in both tomcat 7.x and 9.x if the current thread context class loader is 
changed but strangely when we deploy our application which uses hibernate 
(4.3.11) , it does work in tomcat 7.x  but not in 9.x. Not sure what is causing 
this to work in tomcat 7.x and not in tomcat 9.x.
Secondly , is this implementation "JNDI binding with context class loader" 
tomcat specific as it  works in both JBoss EAP and IBM WebSphere , any inputs why JNDI 
look up works in these application servers and not in tomcat?
RegardsDinesh
     On Monday, December 12, 2022 at 09:49:50 PM GMT+5:30, Mark Thomas 
 wrote:
  
  On 12/12/2022 16:07, dineshk wrote:
Looks like you've repeated you previous post?  Did you have new 
information you meant to share?



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



Re: EOL of Apache Tomcat 8.5 & 9

2022-12-13 Thread Rob Sargent




On 12/13/22 09:07, EXT-Denton, Sam T wrote:

This is probably answered somewhere, but will Tomcat 9 support Jakarta EE as 
well as Java EE?
  
Sam Denton

Advisor, Solutions Architect
Mobile (314) 827-4017
24x7 SBS Suppot (405) 312-9936

Advanced Leave Notice: I will be out from Fri, 12/23, thru Fri, 12/30

Pretty sure the reason 9.0 gets it's own life cycle and "9.10." stuff is 
that it, 9, will NOT support jakarta.  It's an imports thing for one, so 
unless your version of java has conditional compilation...


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



Re: Starting Tomcat 10 at bootup

2022-11-27 Thread Rob Sargent




On 11/27/22 10:05, Amn Ojee Uw wrote:
Thank you folks for the help, but as you might've guess, I am not well 
verse in Tomcat, I am just a student of it, let alone trouble shooting 
it. So, in '/opt/tomecat/opt' I found these files, which just might be 
able to shed some light in the eyes of a experienced Tomecat user.



== currurnt.out ==

/opt/tomcat/bin/catalina.sh: 1: eval: 
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: not found
/opt/tomcat/bin/catalina.sh: 1: eval: 
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: not found
/opt/tomcat/bin/catalina.sh: 1: eval: 
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: not found
/opt/tomcat/bin/catalina.sh: 1: eval: 
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: not found
/opt/tomcat/bin/catalina.sh: 1: eval: 
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: not found
/opt/tomcat/bin/catalina.sh: 1: eval: 
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: not found




What is the date of "currurnt.out" (ls -l currurnt.out)?  Please don't 
show a screen shot, just the text.  Is '/opt/tomecate/opt' the actual 
location?
Do you have JAVA_HOME or JAVAHOME set in your environment?  echo 
$JAVA_HOME; echo $JAVAHOME



== localhost.2022-11-27.log ==

27-Nov-2022 11:52:28.422 INFO [main] 
org.apache.catalina.core.ApplicationContext.log ContextListener: 
contextInitialized()
27-Nov-2022 11:52:28.422 INFO [main] 
org.apache.catalina.core.ApplicationContext.log SessionListener: 
contextInitialized()
27-Nov-2022 11:52:28.435 INFO [main] 
org.apache.catalina.core.ApplicationContext.log ContextListener: 
attributeAdded('StockTicker', 'async.Stockticker@186978a6')
27-Nov-2022 11:53:07.817 INFO [Thread-1] 
org.apache.catalina.core.ApplicationContext.log SessionListener: 
contextDestroyed()
27-Nov-2022 11:53:07.817 INFO [Thread-1] 
org.apache.catalina.core.ApplicationContext.log ContextListener: 
contextDestroyed()




Where is this log found and is this log from manually starting tomcat 
(using catalina.sh) or from systemctl start tomcat.  We see here that 
java has in fact been found, tomcat has started and found a web-app 
(Stockticker) I believe.  Then stopped.  I assume there are more lines 
in the log file?



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



Re: Starting Tomcat 10 at bootup

2022-11-26 Thread Rob Sargent



> On Nov 26, 2022, at 4:54 AM, Amn Ojee Uw  wrote:
> 
> Please excuse my ignorance, buy what log would that be and how can I get to 
> it?
> 
> On 2022-11-26 2:23 a.m., Thomas Hoffmann (Speed4Trade GmbH) wrote:
>>> -Ursprüngliche Nachricht-
>>> Von: Rob Sargent 
>>> Gesendet: Samstag, 26. November 2022 06:32
>>> An: Tomcat Users List 
>>> Betreff: Re: Starting Tomcat 10 at bootup
>>> 
>>> 
>>>> On Nov 25, 2022, at 4:28 PM, Amn Ojee Uw 
>>> wrote:
>>>> Hey folks!
>>>> 
>>>> The issue :
>>>> ~~~
>>>> 
>>>> I just installed 'apache-tomcat-10.0.27.tar.gz' in my Debian 11 (stable) 
>>>> box,
>>> running OpenjDK 17.0.4, this was done following the recommendation on 'How
>>> to Install Apache Tomcat on Debian 11 (Step by Step)
>>> <https://www.linuxtechi.com/how-to-install-apache-tomcat-on-debian/> '.
>>> With the exception of the java installation, I followed the steps up to 
>>> section 8
>>> where I get this error :
>>>> */sudo systemctl restart tomcat/**/
>>>> /**/Job for tomcat.service failed because the control process exited
>>>> with error code./**/ /**/See "systemctl status tomcat.service" and
>>>> "journalctl -xe" for details./*
>>>> 
>>>> I followed the recommendation of the error message and I get this :
>>>> 
>>>> systemctl status tomcat.service
>>>> ● tomcat.service - Tomcat webs servlet container
>>>>  Loaded: loaded (/etc/systemd/system/tomcat.service; *enabled*; vendor
>>> preset>
>>>>  Active: activating (auto-restart) (Result: exit-code) since Fri 
>>>> 2022-11-25>
>>>> Process: 86949 ExecStart=/opt/tomcat/bin/startup.sh (code=exited,
>>> status=0/>
>>>> Process: 86960 ExecStop=/opt/tomcat/bin/shutdown.sh (code=exited,
>>> status=1/>
>>>> CPU: 38ms
>>>> 
>>>> My Imperfect Solution
>>>> ~~~
>>>> 
>>>> If from the command prompt or a shell script, I run this code sudo
>>> '/opt/tomcat/bin/catalina.sh run', Tomcat runs nicely, but it grabs the 
>>> Terminal,
>>> if I close the Terminal, Tomcat just stops working. Obviously not a perfect
>>> solution.
>>>> I am a newcomer to the Linux world, but in Windows I had the same issue, 
>>>> so I
>>> wonder if this is a potential bug.
>>>> Please help me resolve this issue or let me know how to report this bug. 
>>>> (This
>>> would be my first contribution to the team, so I am rightfully exited).
>>>> Thanks in advance.
>>> What do the logs have to say?
>>> 
>> Syslog and Tomcat-Logs should provide more information.
>> Systemctl usually doesn’t help much even if it tells you to look at it 
>> 
>> Btw: You can also run the sh-file with ampersand at the end to get back to 
>> your console.
>> 
>> -
>> 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
> 
The startup.sh file in your first post will likely name the log file. Or look 
in /var/log or in /opt/tomcat. Likely named catalina.out but that’s a guess
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Starting Tomcat 10 at bootup

2022-11-25 Thread Rob Sargent


> On Nov 25, 2022, at 4:28 PM, Amn Ojee Uw  wrote:
> 
> Hey folks!
> 
> The issue :
> ~~~
> 
> I just installed 'apache-tomcat-10.0.27.tar.gz' in my Debian 11 (stable) box, 
> running OpenjDK 17.0.4, this was done following the recommendation on 'How to 
> Install Apache Tomcat on Debian 11 (Step by Step) 
>  '. With 
> the exception of the java installation, I followed the steps up to section 8 
> where I get this error :
> 
> */sudo systemctl restart tomcat/**/
> /**/Job for tomcat.service failed because the control process exited with 
> error code./**/
> /**/See "systemctl status tomcat.service" and "journalctl -xe" for details./*
> 
> I followed the recommendation of the error message and I get this :
> 
> systemctl status tomcat.service
> ● tomcat.service - Tomcat webs servlet container
>  Loaded: loaded (/etc/systemd/system/tomcat.service; *enabled*; vendor 
> preset>
>  Active: activating (auto-restart) (Result: exit-code) since Fri 
> 2022-11-25>
> Process: 86949 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, 
> status=0/>
> Process: 86960 ExecStop=/opt/tomcat/bin/shutdown.sh (code=exited, 
> status=1/>
> CPU: 38ms
> 
> My Imperfect Solution
> ~~~
> 
> If from the command prompt or a shell script, I run this code sudo 
> '/opt/tomcat/bin/catalina.sh run', Tomcat runs nicely, but it grabs the 
> Terminal, if I close the Terminal, Tomcat just stops working. Obviously not a 
> perfect solution.
> 
> I am a newcomer to the Linux world, but in Windows I had the same issue, so I 
> wonder if this is a potential bug.
> 
> Please help me resolve this issue or let me know how to report this bug. 
> (This would be my first contribution to the team, so I am rightfully exited).
> 
> Thanks in advance.

What do the logs have to say?  



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



listing (db) resources

2022-11-22 Thread Rob Sargent
I trying to get the list of available db resources to send to a web 
page.   My context.xml file below is generated at startup since the 
user(s) and dbs change regularly and I would like to see "who's on 
first" from my monitor servlet.  I tried context.getEnvironment() but 
that's empty.  Is there programmatic access t the list of Resource names?


   

   

   

  
  
   



Re: JNDI resourse name value

2022-11-07 Thread Rob Sargent



On 11/7/22 14:26, Christopher Schultz wrote:

Rob,

On 11/7/22 14:09, Rob Sargent wrote:

Are there any semantics to Resourse name attributes?

Or is  no more or less valid 
than 


As far as Tomcat is concerned, it's basically the Wild West.

Some other application servers (usually the "enterprise" ones) are 
super strict about where things go in the JNDI space. It's very common 
to see JDBC connections placed into 
java:comp/env/jdbc/[connection-name] but I think technically you could 
put them just about anywhere.


If you put them somewhere else, someone's gonna say "hey, what the 
heck are you doing that for?" because, well, #conventions.


-chris



Thank you.  Indeed  I use

   Context sgsContext  = (Context) ic.lookup("java:/comp/env");

but I am playing fast and loose with resource names within that 
context.  Is that a foot gun?


rjs


JNDI resourse name value

2022-11-07 Thread Rob Sargent

Are there any semantics to Resourse name attributes?

Or is  no more or less valid than 



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



Re: Need an answer for below query _ high critical for Middleware end in my team

2022-11-04 Thread Rob Sargent



On 11/4/22 08:10, Ganesan, Prabu wrote:


Hi team

Can you please help me with following:

What purpose does the values in the Environment tags and the values 
inside context.xml serve?


What purpose does the WatchedResource tags and the values inside the 
context.xml serve?


(Explain how the Tomcat components and different context settings are 
related (in the underlying packages)




1. Patience, please
2. Which parts of the relevant documentation are not clear?


Re: Partial commit (Transaction rollback )

2022-10-31 Thread Rob Sargent




On 10/30/22 23:42, Mohan T wrote:

Dear All,

We are using the Tomcat with the following combination.

We are facing partial commit  (Transaction is not getting rolled back).

App Server   Apache tomcat server: apache-tomcat- 9.0.65.0
JDK version  openjdk version "11.0.16" 2022-07-19 LTS 
OpenJDK Runtime Environment (Red_Hat-11.0.16.0.8-1.el7openjdkportable) (build 
11.0.16+8-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.16.0.8-1.el7openjdkportable) (build 
11.0.16+8-LTS, mixed mode)
Database  Oracle Database 19c Standard Edition 2 
Release 19.0.0.0.0 - Production
Operating System   Red Hat Enterprise Linux release 8.6 (Ootpa)

How to identify / overcome this issue.


What indication do  you have that this is a Tomcat issue?


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



Re: Apache Tomcat started, but error 404

2022-10-24 Thread Rob Sargent


> On Oct 24, 2022, at 8:36 AM, Christopher Schultz 
>  wrote:
> 
> Darious,
> 
> On 10/24/22 04:10, Strib wrote:
>> Due to the security echelon of the network, I can not send the entire
>> stacktrace.
>> However, I can say that it also states the web app archives are not
>> starting. (IllegalStateException: Error starting child).
>> Prominent "caused by" lines state bean creation errors, or instantiating
>> [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception;
>> nested exception is
>> org.hibernate.tool.schema.extract.spi.SchemaExtractionException...
> 
> This could be almost anything.
> 
> Tomcat does not package Hibernate, so this is something your application is 
> trying to do. Maybe there is an error extracting a schema or something?
> 
> If you can't share the stack trace with this community, than this community 
> will be unable to help you. You will have to get help from internal corporate 
> resources.
> 
> -chris

Two likely places to look: 1) Connectivity to the database 2)permissions within 
the db server.   Both should write in the server’s log and the latter should 
report in the app’s log.

Re: About granting permissions to Tomcat JVM

2022-10-09 Thread Rob Sargent



> On Oct 9, 2022, at 8:54 AM, Martin Moore  wrote:
> 
> @thomas.hoffm...@speed4trade.com.invalid
>   how to use the debugger in this
> case ?any documentation pls ?
> @Rob Sargent i posted most of the methods used in the app, but yes JVM is
> holding off on deleting the file...

I think this might be a config issue. What is the full Java command with 
variables expanded

> 
>> Le dim. 9 oct. 2022 à 17:31, Thomas Hoffmann (Speed4Trade GmbH)
>>  a écrit :
>> 
>> Hello,
>> 
>>> About the methods i use in the application along with file.delete()
>> (which is
>>> what this post is about) I use File[] files = new
>>> File("C:\\SomeFolder").listFiles();
>>> file.getName();
>>> file.lastModified()
>>> Path path = Paths.get(fileName);
>>> Would any of these cause the lock on the file ?
>> 
>> They don't look suspicious to me. What you could do is, use the debugger
>> to go step by step.
>> In parallel, use the ProcessExplorer to see at which point the file handle
>> appears.
>> Maybe it is more hidden in some other routines which might use a
>> MappedByteBuffer to read or write.
>> 
>> 
>>> 
>>> Le dim. 9 oct. 2022 à 16:03, Thomas Hoffmann (Speed4Trade GmbH)
>>>  a écrit :
>>> 
>>>> 
>>>>> -Ursprüngliche Nachricht-
>>>>> Von: Martin Moore 
>>>>> Gesendet: Sonntag, 9. Oktober 2022 15:37
>>>>> An: thomas.hoffm...@speed4trade.com.invalid; Tomcat Users List
>>>>> 
>>>>> Betreff: Re: About granting permissions to Tomcat JVM
>>>>> 
>>>>> the ProcessExplorer shows that a Java process is running on the file
>>>>> and
>>>> this
>>>>> only after actually performing the delete from Java.
>>>> 
>>>> 
>>>> Some possibilities for file locking.
>>>> - the upload process didn’t close the streams properly
>>>> - You use http2 and sendfile
>>>> - You are using a MappedByteBuffer before deletion:
>>>> https://bugs.openjdk.org/browse/JDK-4724038
>>>> 
>>>> ... just some ideas which cause file locking ...
>>>> 
>>>>> Le dim. 9 oct. 2022 à 15:23, Thomas Hoffmann (Speed4Trade GmbH)
>>>>>  a écrit :
>>>>> 
>>>>>> Hello,
>>>>>> this might be a behavior of the underlying OS.
>>>>>> If the file is locked, it is marked for deletion and when the file
>>>>>> lock is released, the file is physically deleted.
>>>>>> 
>>>>>> Maybe you can check with ProcessExplorer from MS whether there is
>>>>>> an open file handle on this file.
>>>>>> 
>>>>>> Greetings,
>>>>>> Thomas
>>>>>> 
>>>>>>> -Ursprüngliche Nachricht-
>>>>>>> Von: Martin Moore 
>>>>>>> Gesendet: Sonntag, 9. Oktober 2022 09:56
>>>>>>> An: Tomcat Users List ;
>>>>>>> ma...@apache.org
>>>>>>> Betreff: Re: About granting permissions to Tomcat JVM
>>>>>>> 
>>>>>>> Hello Mark,
>>>>>>> 
>>>>>>> I don't know if the SecurityManager is enabled or not (how to
>>>>>>> disable it
>>>>>>> btw?)
>>>>>>> I set the env var CATALINA_HOME to be C:/Program
>>>>>>> Files/Apache-Tomcat-8/ The files in question are stored in
>>>>>>> Desktop/SomeFolder
>>>>>>> 
>>>>>>> Thanks.
>>>>>>> 
>>>>>>> Le dim. 9 oct. 2022 à 08:00, Mark Thomas  a
>>>>>>> écrit
>>>> :
>>>>>>> 
>>>>>>>> On 08/10/2022 17:36, Martin Moore wrote:
>>>>>>>>> Hello,
>>>>>>>>> 
>>>>>>>>> I am facing a problem using Tomcat V8 with my J2ee app that
>>>>>>>>> deletes
>>>>>>>> (using
>>>>>>>>> file.delete() Java 8) a file from disk (Windows). The file
>>>>>>>>> is actually deleting only on application level meaning that
>>>>>>>>> the application does not see the file anymore but if i open
>>>>>>>>> the folder i still see the file which
>>>>>>>> is
>&g

Re: About granting permissions to Tomcat JVM

2022-10-09 Thread Rob Sargent



> On Oct 8, 2022, at 9:36 AM, Martin Moore  wrote:
> 
> Hello,
> 
> I am facing a problem using Tomcat V8 with my J2ee app that deletes (using
> file.delete() Java 8) a file from disk (Windows). The file is actually
> deleting only on application level meaning that the application does not
> see the file anymore but if i open the folder i still see the file which is
> then locked by Java process. I only get the file to be removed physically
> when i close the Tomcat instance.
> 
> Does this problem relate to permissions in catalina.policy ?
> How to solve this?

This has a familiar ring to it.  Can we see your entire java command (minus 
secrets) and any environment variables which have a capital X.  I suspect the 
JVM is holding off on deleting the file until exit and IIRC there’s a setting 
for that.  But it has been a while since I dealt with this.



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



Re: Install CA signed certificate on Tomcat 9

2022-09-30 Thread Rob Sargent


> On Sep 30, 2022, at 5:17 AM, Janardhanan, Veni  
> wrote:
> 
> 
> Hi Chris,
>  
> I executed the command that you asked and below is it’s output.
>  

Paste the text of the output. Not a screen shot

> 
> 
>  


Re: AW: MaxRequestWorkers error

2022-09-27 Thread Rob Sargent




On 9/27/22 14:37, Thomas Hoffmann (Speed4Trade GmbH) wrote:


How much memory did you configure for your java environment? --> Xmx Parameter
If the java process eats too much memory, you can write a memory dump when an 
OOM exception occurs.
E.g. with the parameters: -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/var/logs/javadump.dmp"
You can also open a JMX port and inspect the memory using during runtime, e.g. 
with VirtualVM https://visualvm.github.io/


Pretty sure Thomas mean "VisualVM"

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



Re: Tomcat 8.5.8x patch upgrade failing

2022-09-23 Thread Rob Sargent




On 9/23/22 09:20, Cannatella, Douglas wrote:

Hi All,

We are currently using Tomcat 8.5.53 and tried to upgrade patch 8.5.81 & 8.5.82 
using Ivanti Patch tool.
Our project is using OpenJDK version: 1.8.0_242, Microsoft Framework 4.0.0 
running TR/ OneSource Indirect Tax Determination
Ivanti patch tool has overlayed Tomcat service running on the D drive, on the C 
drive including war files and registry settings.  Is there any way to manual 
install >patches to keep Tomcat version 8.5.82 current on the D drive which is 
running Catalina under Windows 2019 Server.
Do I need capture logs which one's and capture Tomcat access 
log
 , or threadumps?
Next steps to download Tomcat manual installation on DEV environment?
Next step to download Apache Tomcat(r) - Apache Tomcat 8 Software 
Downloads windows-x64.zip?
https://cwiki.apache.org/confluence/display/TOMCAT/Troubleshooting+and+Diagnostics
Apache Tomcat 8 (8.5.82) - Tomcat 
Setup

Doug


You might have more luck on sites specific to Ivanti or OneSource?

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



Re: Tomcat 8.5.82

2022-09-22 Thread Rob Sargent




On 9/22/22 14:00, Cannatella, Douglas wrote:

Hi All,

We are currently using Tomcat 8.5.53 and tried to upgrade patch 8.5.81 & 8.5.82 
using Ivanti Patch tool.
Our project is using OpenJDK version: 1.8.0_242, Microsoft Framework 4.0.0 
running TR/ OneSource Indirect Tax Determination
The patch has overlayed Tomcat running on the D drive to the C drive including war 
files and registry settings.  Is there any way to manual install >patches to 
keep Tomcat version 8.5.82 current on the D drive this is running Catalina under 
Windows 2019 Server.
How long till the next patch for Tomcat to occur and its expected EOL for this 
version?

Doug



As to EOL, earlier today, Mark sent this out

The official position is:
- No end of life decisions have yet been made for Tomcat 8.5.x onwards.
- Any such decisions will provide at least 12 months notice.

Based on past experience, I'd *guess* that:
- Tomcat 8.5.x will no EOL no earlier than 31 March 2024
- Tomcat 9.0.x will be EOL no earlier than 31 March 2027

There is no need up update the specification version in your web 
application to run on a newer version of Tomcat


Mark


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



Re: Increase in GC Pause time in tomcat http2 9.0.56

2022-08-30 Thread Rob Sargent




On 8/30/22 06:11, Arshiya Shariff wrote:

Hi All ,
We have migrated our application (which transports http/2 packets)  from 
embedded tomcat version 9.0.38 to 9.0.56 in production .

We observe that , in 9.0.56 mixed GC occurs less frequently than in 9.0.38 , 
but when it happens there are GC Pauses for more than 1 second , which is 
causing the application to be unresponsive during that time and as a side 
effect we are facing other issues like delay in WINDOW_UPDATE frames being sent.

Has anyone faced similar issue with increased GC Pause time ?

Thanks and Regards
Arshiya Shariff


And no change to the JVM?

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



Re: embeded tomcat apache-jasper dependency

2022-08-15 Thread Rob Sargent



On 8/15/22 19:55, Shakila Rajaiah wrote:

Earlier Noelette replied:
It looks like you have multiple locations/instances of the same jar 
file (jasper-el.jar by the looks of the error message). This is 
typically included with tomcat. Are you also including a version with 
your application?


I think that I accidently did. Please look at the steps I tried. I am 
unable to remove these .jar files from Eclipse. Therefore I keep 
getting the error. Any help will do





Hello Mark Thomas, Noelette Stout, & Tomcat Users,


I am trying to deploy two war files to Tomcat server. The first 
application deploys fine. The second application is erroring out and 
this is the error I am getting:



11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server version 
name:   Apache Tomcat/9.0.46
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server built:   
  May 8 2021 17:35:52 UTC
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server version 
number: 9.0.46.0
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Name:     
 Windows Server 2012 R2
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Version:     6.3
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Architecture:   
  amd64
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Java Home:     
 C:\Program Files\Java\jre1.8.0_291
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Version:     
 1.8.0_291-b10
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:     
Oracle Corporation
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:   
   C:\apache-tomcat-9.0.46
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:   
   C:\apache-tomcat-9.0.46
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: 
-Djava.util.logging.config.file=C:\apache-tomcat-9.0.46\conf\logging.properties
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Djdk.tls.ephemeralDHKeySize=2048
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Dignore.endorsed.dirs=
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Dcatalina.base=C:\apache-tomcat-9.0.46
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Dcatalina.home=C:\apache-tomcat-9.0.46
11-Aug-2022 10:04:21.393 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Djava.io.tmpdir=C:\apache-tomcat-9.0.46\temp
11-Aug-2022 10:04:21.414 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The 
Apache Tomcat Native library which allows using OpenSSL was not found 
on the java.library.path: [C:\Program 
Files\Java\jre1.8.0_291\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Prog
ram Files (x86)\Common 
Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\apache-maven-3.8.1\bin;C:\Program 
Files\Java\jre1.8.0_291\bin;C:\Program 
Files\Java\jre1.8.0_291;C:\apache-tomcat-9.0.45;C:\apache-tomcat-9.0.45\bi
n;C:\Program Files\Java\jdk1.8.0_291\bin;C:\Program Files 
(x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data 
Studio\bin;.]
11-Aug-2022 10:04:21.862 INFO [main] 
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler 
["http-nio-8080"]
11-Aug-2022 10:04:21.971 INFO [main] 
org.apache.catalina.startup.Catalina.load Server initialization in 
[842] milliseconds
11-Aug-2022 10:04:22.002 INFO [main] 
org.apache.catalina.core.StandardService.startInternal Starting 
service [Catalina]
11-Aug-2022 10:04:22.002 INFO [main] 
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet 
engine: [Apache Tomcat/9.0.46]
11-Aug-2022 10:04:22.033 INFO [main] 
org.apache.catalina.startup.HostConfig.deployWAR Deploying web 
application archive [C:\apache-tomcat-9.0.46\webapps\ROOT.war]
11-Aug-2022 10:04:25.971 SEVERE [main] 
org.apache.catalina.startup.HostConfig.deployWAR Error deploying web 
application 

Re: Publishing Tomcat webapp

2022-07-16 Thread Rob Sargent




On 7/16/22 16:14, Amn wrote:
You read my mind! I was going to ask this very question, if not 
today... tomorrow.

I am looking forward to see the replies to this question.

On 2022-07-15 5:22 a.m., Jasmin Ćatić wrote:

Hello,

Can someone please give me a step by step guide on how to make my tomcat
webapp available online with a domain name.
Thanks.

Regards,
JC


How do you (both) access your "webapp" today?

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



Re: Precompile JSP error using webapp-jspc.ant.xml (tomcat stuffed)

2022-06-23 Thread Rob Sargent



> On Jun 23, 2022, at 12:53 AM, Markus Reich  wrote:
> 
> yes, it seems that in the pom tomcat 10 is specified, does this make any
> difference?
> 10.0.18
> 
>> Am Do., 23. Juni 2022 um 08:30 Uhr schrieb Rob Sargent <
>> rsarg...@xmission.com>:
>> 
>> 

Yes. Quite big difference between v9 and v10. 
You must read the release notes.  And your initial post mentions a v9 doc page. 
Stick with a single tomcat release
>> 
>>> On Jun 22, 2022, at 11:36 PM, Markus Reich 
>> wrote:
>>> 
>>> Hi,
>>> 
>>> I'm trying to precompile a JSF application, I follow the instructions on
>>> https://tomcat.apache.org/tomcat-9.0-doc/graal.html.
>>> 
>>> I got a lot of errors like
>>> Caused by: java.lang.ClassCastException: class
>>> com.sun.faces.taglib.jsf_core.CoreValidator cannot be cast to class
>>> jakarta.servlet.jsp.tagext.TagLibraryValidator
>>> (com.sun.faces.taglib.jsf_core.CoreValidator and
>>> jakarta.servlet.jsp.tagext.TagLibraryValidator are in unnamed module of
>>> loader org.apache.tools.ant.AntClassLoader
>>> 
>>> The header in JSP is
>>> <%@page contentType="text/html"%>
>>> <%@page pageEncoding="UTF-8"%>
>>> 
>>> <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
>>> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
>>> 
>>> <%@taglib prefix="t" uri="/WEB-INF/eclnt"%>
>>> 
>>> regards
>>> Meex
>> 
>> Are you sure you haven’t included something from Tomcat v10?
>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
> 
> -- 
> *Markus Reich*
> Waldweg 62
> 6393 St. Ulrich am Pillersee
> reich.mar...@gmail.com

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



Re: Precompile JSP error using webapp-jspc.ant.xml (tomcat stuffed)

2022-06-23 Thread Rob Sargent



> On Jun 22, 2022, at 11:36 PM, Markus Reich  wrote:
> 
> Hi,
> 
> I'm trying to precompile a JSF application, I follow the instructions on
> https://tomcat.apache.org/tomcat-9.0-doc/graal.html.
> 
> I got a lot of errors like
> Caused by: java.lang.ClassCastException: class
> com.sun.faces.taglib.jsf_core.CoreValidator cannot be cast to class
> jakarta.servlet.jsp.tagext.TagLibraryValidator
> (com.sun.faces.taglib.jsf_core.CoreValidator and
> jakarta.servlet.jsp.tagext.TagLibraryValidator are in unnamed module of
> loader org.apache.tools.ant.AntClassLoader
> 
> The header in JSP is
> <%@page contentType="text/html"%>
> <%@page pageEncoding="UTF-8"%>
> 
> <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
> 
> <%@taglib prefix="t" uri="/WEB-INF/eclnt"%>
> 
> regards
> Meex

Are you sure you haven’t included something from Tomcat v10?



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



Re: cert/key config woes

2022-06-15 Thread Rob Sargent

Chris,
Back at my desk and going through you notes again.

On 6/14/22 14:43, Rob Sargent wrote:


Let's get one thing working at a time. I reviewed this thread, and I 
honestly can't figure out exactly what you are trying to do. Can you 
please clarify?


1. "I want to get Tomcat working as a server with a TLS 
Certificate." This can be self-signed, or it can be signed by a real 
Certificate Authority. The process is almost the same, except you 
have to send something to the CA.


2. "I want to get Tomcat working as a server with a TLS Certificate, 
AND I want to demand that all clients connecting also present a 
client-certificate to authenticate."


Which of the above is it?

I believe I can live with #1.  I'm using a self-signed cert for sure.


Okay, that's good because it reduces the complexity of this whole 
operation by ~50%.


Because the server-side cert is self-signed, it likely means that each 
client will have to import the server-cert into the /client/ 
trust-store. Either that, of you can "ignore warnings" but IMO that's 
a significant reduction in security. We can talk about that, later.





Your server should not have to configure a trust store, full stop.

It the moment it's name in the read-in properties file but not actually 
acted on in the code.  TODO!


You might not need it. You only need a trust store if you want 
option #2 from above.



The clients get them from command line -D properties

     defvs += F"
    -Djavax.net.ssl.keyStore=/ppr/certs/sgs10.0.2.118.p12
    -Djavax.net.ssl.keyStoreType=PKCS12
    -Djavax.net.ssl.keyStorePassword=changeit"
     defvs += F" -Djavax.net.ssl.trustStore=/ppr/certs/fullca.p12
    -Djavax.net.ssl.trustStoreType=PKCS12
    -Djavax.net.ssl.trustStorePassword=changeit"

But as I said "It's working" so I'm likely to let sleeping dogs lie.


Okay, so if your clients (connecting you your Tomcat, right?) are 
using keystores, then... it sounds like you want option #2
My embedded tomcat is mainly there to mediate between db and analysis 
clients.  I just need the traffic between the two to be encrypted.


You mention 3 parties: HTTP clients, HTTP server (Tomcat), and db. 
Which links must be encrypted? (I would answer "all links should be 
encrypted", but encrypting between app <- -> db is a whole different 
process.)


I am under an edict to encrypt ALL traffic within my AWS set-up.  I have 
the tomcat-postgres using SSL (verify-full).  This is NOT a high traffic 
situation.


I'll re-re-read the rest of your message until I get it right.

Thanks ever so much.
rjs

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



Re: cert/key config woes

2022-06-15 Thread Rob Sargent



> On Jun 15, 2022, at 7:45 AM, Christopher Schultz 
>  wrote:
> 
> Rob,
> 
>> On 6/14/22 15:38, Rob Sargent wrote:
>> On 6/14/22 13:06, Christopher Schultz wrote:
>> Thanks so much for your perseverance.
> 
> No problem. Anything to avoid doing $work.

Away from my desk this morning but will retool accordingly asap

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



Re: cert/key config woes

2022-06-14 Thread Rob Sargent




On 6/14/22 13:06, Christopher Schultz wrote:

Thanks so much for your perseverance.

On 6/14/22 14:43, Rob Sargent wrote:

Let's get one thing working at a time. I reviewed this thread, and I 
honestly can't figure out exactly what you are trying to do. Can you 
please clarify?


1. "I want to get Tomcat working as a server with a TLS Certificate." 
This can be self-signed, or it can be signed by a real Certificate 
Authority. The process is almost the same, except you have to send 
something to the CA.


2. "I want to get Tomcat working as a server with a TLS Certificate, 
AND I want to demand that all clients connecting also present a 
client-certificate to authenticate."


Which of the above is it?

I believe I can live with #1.  I'm using a self-signed cert for sure.



My server gets the locations from a properties file and uses

     Connector connector = new Connector();
     connector.setPort(tcport);
     connector.setSecure(true);
     addBaseConnectorConfig(connector);
     connectorSetTest(connector, "SSLEnabled", "true");
     connectorSetTest(connector, "sslProtocol", "TLS");
     connectorSetTest(connector, "keyAlias",
    System.getProperty("SGSSRVR_keystoreAlias"));
     connectorSetTest(connector, "keystorePass",
    System.getProperty("SGSSRVR_keystorePwd"));
     connectorSetTest(connector, "keystoreFile",
    keyFile.getAbsolutePath());
     connectorSetTest(connector, "keystoreType",
    System.getProperty("SGSSRVR_storeType"));


What is connectorSetTest()?

Sorry that's just a helper routine which tests the result of 
Connector.setProperty()
and here we can see I don't actually use truststore so that puts 
the lie to have my claim.


You might not need it. You only need a trust store if you want option 
#2 from above.



The clients get them from command line -D properties

     defvs += F"
    -Djavax.net.ssl.keyStore=/ppr/certs/sgs10.0.2.118.p12
    -Djavax.net.ssl.keyStoreType=PKCS12
    -Djavax.net.ssl.keyStorePassword=changeit"
     defvs += F" -Djavax.net.ssl.trustStore=/ppr/certs/fullca.p12
    -Djavax.net.ssl.trustStoreType=PKCS12
    -Djavax.net.ssl.trustStorePassword=changeit"

But as I said "It's working" so I'm likely to let sleeping dogs lie.


Okay, so if your clients (connecting you your Tomcat, right?) are 
using keystores, then... it sounds like you want option #2
My embedded tomcat is mainly there to mediate between db and analysis 
clients.  I just need the traffic between the two to be encrypted.  
Shortest route to that is all I'm after.
10.0.2.118 is the server and that's where I make my (one and only) 
self-signed cert.  That gets added to fullca.p12 (selfie + cacerts).




It all boils down to this:

1. Every pair of entities in a TLS connection are called "peers".

2. Any peer can choose to require the other one to authenticate.

3. In practice, servers *always* authenticate to the clients by 
presenting a certificate. It's up to the client to decide if the cert 
is acceptable. (This is where self-signed versus CA-signed comes into 
play. If you control the client, don't bother paying a CA a bunch of 
money for what copy/paste can solve for you.) The client maintains a 
trust store for this purpose.


The server manages this behind the scenes using a key store. A trust 
store is not required, because this part doesn't require clients to 
authenticate to servers.


(Technically, Java calls these things KeyStores no matter what. A 
"trust store" is just a KeyStore used for trust. Don't let that 
confuse you. I will always refer to a file-containing-a-key-and-cert 
as a "key store" and a 
file-containing-a-bunch-of-certificates-to-be-trusted as a "trust store.)


4. In public, clients almost never authenticate themselves. So you 
only need to deal with the "server part". If you want the server to 
authenticate the client, then you just flip everything backwards and 
layer it on top of what you already had:


  4a. Server needs a trust tore, filled with the certs from the clients
  4b. Clients each need a key store, containing the client's key+cert

That's pretty much it.



That helps a lot.  Basically I had the responsibilities reversed.  I 
have a couple of other configuration annoyances to fix and will clean 
"stores" as well.


Thanks every so much.

-chris

-
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: cert/key config woes

2022-06-14 Thread Rob Sargent




On 6/14/22 12:43, Rob Sargent wrote:



On 6/2/22 16:06, Rob Sargent wrote:


I'm starting both the server and the client with both key and 
trust. Does that bite?


I would avoid giving access to the key to anything that doesn't 
absolutely need it. Usually, only the server needs access to the key.


-chris

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




Back from vacation but none the wiser for having visited Harvard!

I have my environment working again but not with supplying both 
keystore and truststore to both the server and the client. Clearly 
scrogged somewhere

EDIT
 but not WITHOUT supplying both...

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



Re: cert/key config woes

2022-06-14 Thread Rob Sargent



On 6/2/22 16:06, Rob Sargent wrote:


I'm starting both the server and the client with both key and trust. 
Does that bite?


I would avoid giving access to the key to anything that doesn't 
absolutely need it. Usually, only the server needs access to the key.


-chris

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




Back from vacation but none the wiser for having visited Harvard!

I have my environment working again but not with supplying both keystore 
and truststore to both the server and the client.  Clearly scrogged 
somewhere


My server gets the locations from a properties file and uses

    Connector connector = new Connector();
    connector.setPort(tcport);
    connector.setSecure(true);
    addBaseConnectorConfig(connector);
    connectorSetTest(connector, "SSLEnabled", "true");
    connectorSetTest(connector, "sslProtocol", "TLS");
    connectorSetTest(connector, "keyAlias",
   System.getProperty("SGSSRVR_keystoreAlias"));
    connectorSetTest(connector, "keystorePass",
   System.getProperty("SGSSRVR_keystorePwd"));
    connectorSetTest(connector, "keystoreFile",
   keyFile.getAbsolutePath());
    connectorSetTest(connector, "keystoreType",
   System.getProperty("SGSSRVR_storeType"));

and here we can see I don't actually use truststore so that puts the 
lie to have my claim.


The clients get them from command line -D properties

    defvs += F"
   -Djavax.net.ssl.keyStore=/ppr/certs/sgs10.0.2.118.p12
   -Djavax.net.ssl.keyStoreType=PKCS12
   -Djavax.net.ssl.keyStorePassword=changeit"
    defvs += F" -Djavax.net.ssl.trustStore=/ppr/certs/fullca.p12
   -Djavax.net.ssl.trustStoreType=PKCS12
   -Djavax.net.ssl.trustStorePassword=changeit"

But as I said "It's working" so I'm likely to let sleeping dogs lie.

rjs


Re: cert/key config woes

2022-06-02 Thread Rob Sargent



I'm starting both the server and the client with both key and trust. 
Does that bite?


I would avoid giving access to the key to anything that doesn't 
absolutely need it. Usually, only the server needs access to the key.


-chris

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


Roger that.  I'll rejigger that when I get back mid june.

Thanks a ton,
rjs


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



Re: cert/key config woes

2022-06-02 Thread Rob Sargent



    java  -Djavax.net.ssl.keyStore=/ppr/certs/sgstrust.p12
    -Djavax.net.ssl.keyStoreType=PKCS12 
-Djavax.net.ssl.keyStorePassword=p1

    -Djavax.net.ssl.trustStore=/ppr/certs/fullca.p12
    -Djavax.net.ssl.trustStoreType=PKCS12
    -Djavax.net.ssl.trustStorePassword=p2
    --oper=1 --seg=id --json-dir=/ppr/report --acc=10.0.2.118:15002
    --dbn={dbn} --eff={dbu} -env=AWS


Does that launch your Tomcat JVM or your client? (Or both?)


Sorry, I missed this question.  That's the client (on a new spun-up EC2)
The server also gets both key and trust.



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



Re: cert/key config woes

2022-06-02 Thread Rob Sargent
Hang on.  I'm panicking.  I have a plane to catch in 3 hours and need 
this working by then.


   ws s3 cp fullca.p12 s3://691459864434-sgs-source/certs/sgstrust.p12

splatting one file on top of the other



Midway through this email when you last came in:  "Not running" is 
spot-on becase...



The current problem is actaully

   Jun 02, 2022 6:01:27 PM org.apache.coyote.AbstractProtocol init
   INFO: Initializing ProtocolHandler ["https-jsse-nio-10.0.2.118-15002"]
   Jun 02, 2022 6:01:27 PM org.apache.catalina.util.LifecycleBase
   handleSubClassException
   SEVERE: Failed to initialize component [Connector[HTTP/1.1-15002]]
   org.apache.catalina.LifecycleException: Protocol handler
   initialization failed
    at
   org.apache.catalina.connector.Connector.initInternal(Connector.java:1049)

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

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

    at
   org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    at
   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
    at
   edu.utah.camplab.server.SGSSelector.kickOff(SGSSelector.java:175)
    at
   edu.utah.camplab.server.SGSSelector.run(SGSSelector.java:187)
    at java.base/java.lang.Thread.run(Thread.java:833)
   Caused by: java.lang.IllegalArgumentException: Alias name [sgsAgent]
   does not identify a key entry
    at
   
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:107)

    at
   
org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:71)

    at
   org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:234)
    at
   
org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227)

    at
   org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1240)

    at
   org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:603)
    at
   
org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:80)

    at
   org.apache.catalina.connector.Connector.initInternal(Connector.java:1046)

    ... 10 more
   Caused by: java.io.IOException: Alias name [sgsAgent] does not
   identify a key entry
    at
   org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:337)

    at
   org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:247)

    at
   
org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:105)

    ... 17 more

but I believe the alias is in place, both places

   ## check, different files
   [ec2-user@ip-10-0-2-118 certs]ls -l fullca.p12 sgstrust.p12
   -rw-rw-r-- 1 ec2-user ec2-user 281500 Jun  2 17:12 fullca.p12
   -rw-rw-r-- 1 ec2-user ec2-user   2726 Jun  2 17:13 sgstrust.p12

   ## checks for alias
   [ec2-user@ip-10-0-2-118 certs]$ keytool -storetype pkcs12 -list
   -keystore sgstrust.p12 -alias sgsAgent -storepass changeit
   sgsAgent, Jun 2, 2022, PrivateKeyEntry,
   Certificate fingerprint (SHA-256):
   
65:F1:9C:07:37:C4:13:A8:82:D5:09:E7:51:F9:C0:E2:94:E4:41:64:F1:41:86:E6:60:5F:50:87:A8:13:74:17

   [ec2-user@ip-10-0-2-118 certs]$ keytool -storetype pkcs12 -list
   -keystore fullca.p12 -alias sgsAgent -storepass changeit
   sgsAgent, Jun 2, 2022, trustedCertEntry,
   Certificate fingerprint (SHA-256):
   
65:F1:9C:07:37:C4:13:A8:82:D5:09:E7:51:F9:C0:E2:94:E4:41:64:F1:41:86:E6:60:5F:50:87:A8:13:74:17


   ## upload to s3
   [ec2-user@ip-10-0-2-118 certs]$ aws s3 cp fullca.p12
   s3://691459864434-sgs-source/certs/fullca.p12
   upload: ./fullca.p12 to s3://691459864434-sgs-source/certs/fullca.p12
   [ec2-user@ip-10-0-2-118 certs]$ aws s3 cp sgstrust.p12
   s3://691459864434-sgs-source/certs/sgstrust.p12
   aws s3 cp sgstrust.p12 s3://691459864434-sgs-source/certs/sgstrust.p12
   upload: ./sgstrust.p12 to
   s3://691459864434-sgs-source/certs/sgstrust.p12

   ## program downloads p12 filesfrom s3


To your latest


I add my cert to truststore.


   Which one? Are you using client certs for mutual-TLS or just
   plain-old "I only need to trust the server" checking?

I add sgstrust to fullca.  I think the latter mode is fine


   If it's vanilla, then you need:

   1. Key + cert in the key store used by the Tomcat 
   2. cert in the trust store used by the client (optional if it's
   signed by a trusted CA)

   Remember if your key store from #1 has more than one cert+key in it,
   Tomcat will choose the first one (which is basically a crap-shoot,
   

Re: cert/key config woes

2022-06-02 Thread Rob Sargent



On 6/2/22 11:43, Rob Sargent wrote:



I had this overall configuration working until I 'terminated' the 
AWS server instance and am trying to rebuild.


Could a lack of network connectivity between client and server 
present this same symptom?


Hmm. Your SAN looks okay to me. Are you 100% sure you have that 
certificate configured in Tomcat? ARe you using some other component 
in front of Tomcat? You should be able to connect using:


$ openssl s_client -showcerts -connect 10.0.2.118:443

This will dump the certificate actually presented by the server. You 
can copy/paste that into:


$ openssl x509 -text

and get the details to make sure the SAN appears there.

-chris

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

Thanks Chris, given your vote of confidence I realized I had not 
updated the keystore file with my recently regenerated cert.
Also forgot to mention this is tomcat 9.0.63 embedded in my app, 
running java17 (correto) at AWS


But I think I'm going backwards.

Hang on.  I'm panicking.  I have a plane to catch in 3 hours and need 
this working by then.


   ws s3 cp fullca.p12 s3://691459864434-sgs-source/certs/sgstrust.p12

splatting one file on top of the other


Re: cert/key config woes

2022-06-02 Thread Rob Sargent



I had this overall configuration working until I 'terminated' the AWS 
server instance and am trying to rebuild.


Could a lack of network connectivity between client and server 
present this same symptom?


Hmm. Your SAN looks okay to me. Are you 100% sure you have that 
certificate configured in Tomcat? ARe you using some other component 
in front of Tomcat? You should be able to connect using:


$ openssl s_client -showcerts -connect 10.0.2.118:443

This will dump the certificate actually presented by the server. You 
can copy/paste that into:


$ openssl x509 -text

and get the details to make sure the SAN appears there.

-chris

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

Thanks Chris, given your vote of confidence I realized I had not updated 
the keystore file with my recently regenerated cert.
Also forgot to mention this is tomcat 9.0.63 embedded in my app, running 
java17 (correto) at AWS


But I think I'm going backwards.

my actual java command is pretty much this:

   java  -Djavax.net.ssl.keyStore=/ppr/certs/sgstrust.p12
   -Djavax.net.ssl.keyStoreType=PKCS12 -Djavax.net.ssl.keyStorePassword=p1
   -Djavax.net.ssl.trustStore=/ppr/certs/fullca.p12
   -Djavax.net.ssl.trustStoreType=PKCS12
   -Djavax.net.ssl.trustStorePassword=p2
   --oper=1 --seg=id --json-dir=/ppr/report --acc=10.0.2.118:15002
   --dbn={dbn} --eff={dbu} -env=AWS


I add my cert to truststore.  Do I need both trust and key stores on the 
commandline.  sgstrust.p12 is made by converting x509 key/cert. 
fullca.p12 has the worlds CA certs plus mine.

But now I'm hitting

   java.net.ConnectException
    at
   
java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:573)

    at
   
java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)

    at
   edu.utah.camplab.sgs.AbstractSGSRun.canConnect(AbstractSGSRun.java:386)
    at
   edu.utah.camplab.sgs.AbstractSGSRun.init(AbstractSGSRun.java:296)
    at
   edu.utah.camplab.sgs.AbstractSGSOptions.init(AbstractSGSOptions.java:37)

    at edu.utah.camplab.sgs.SGSChase.init(SGSChase.java:76)
    at edu.utah.camplab.sgs.SGSChase.init(SGSChase.java:85)
    at edu.utah.camplab.app.SGSPValue.(SGSPValue.java:68)
    at edu.utah.camplab.app.SGSPValue.main(SGSPValue.java:27)
   Caused by: java.net.ConnectException
    at
   
java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1047)

    at
   
java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)

    at
   
java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)

    at
   
java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)

    at
   
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)

    at
   
java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)

    at
   
java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)

    at
   
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)

    at
   
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

    at
   
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

    at java.base/java.lang.Thread.run(Thread.java:833)
   Caused by: java.nio.channels.ClosedChannelException
    at
   java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)

    at
   
java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)

    at
   java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)

    at
   
java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)

    at
   
java.base/java.security.AccessController.doPrivileged(AccessController.java:569)

    at
   
java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)

    ... 9 more

in code unchanged since it last worked.



cert/key config woes

2022-06-01 Thread Rob Sargent

This part always confuses me

I supply the trust and key store files on the command line and I see the 
SAN for the tomcat server IP (in ObjectId #3). I try to connect to 
tomcat by host-IP and port.  Here's the text of the keystore sent in.


   Keystore type: PKCS12
   Keystore provider: SUN

   Your keystore contains 1 entry

   Alias name: sgsagent
   Creation date: Jun 2, 2022
   Entry type: trustedCertEntry

   Owner: EMAILADDRESS=rob.sarg...@utah.edu,
   CN=ip-10-0-2-118.us-west-2.compute.internal, OU=PPR, O=University of
   Utah, L=Salt Lake City, ST=UT, C=US
   Issuer: EMAILADDRESS=rob.sarg...@utah.edu,
   CN=ip-10-0-2-118.us-west-2.compute.internal, OU=PPR, O=University of
   Utah, L=Salt Lake City, ST=UT, C=US
   Serial number: 2f543ea5b1ce847034a34dfb4d26ecbdac1959d5
   Valid from: Thu Jun 02 03:12:01 UTC 2022 until: Sat Jul 02 03:12:01
   UTC 2022
   Certificate fingerprints:
 SHA1:
   61:92:93:E7:A1:05:85:ED:66:6F:BC:6C:76:7E:CA:E8:7F:A7:0D:93
 SHA256:
   
23:85:E4:85:08:93:B1:4C:D7:40:47:E7:EF:3F:8F:5F:FC:FA:CA:57:0F:B1:4C:A8:3F:25:AE:D7:98:0C:4B:28
   Signature algorithm name: SHA256withRSA
   Subject Public Key Algorithm: 2048-bit RSA key
   Version: 3

   Extensions:

   #1: ObjectId: 2.5.29.35 Criticality=false
   AuthorityKeyIdentifier [
   KeyIdentifier [
   : F4 FC 13 D9 FC 1C C1 A0   DB 0A 81 28 C0 EF DC FF ...(
   0010: 28 64 81 BE    (d..
   ]
   ]

   #2: ObjectId: 2.5.29.19 Criticality=false
   BasicConstraints:[
  CA:true
  PathLen: no limit
   ]

   #3: ObjectId: 2.5.29.17 Criticality=false
   SubjectAlternativeName [
  IPAddress: 10.0.2.118
   ]

   #4: ObjectId: 2.5.29.14 Criticality=false
   SubjectKeyIdentifier [
   KeyIdentifier [
   : F4 FC 13 D9 FC 1C C1 A0   DB 0A 81 28 C0 EF DC FF ...(
   0010: 28 64 81 BE    (d..
   ]
   ]

but I get

   javax.net.ssl.SSLHandshakeException: No subject alternative names
   matching IP address 10.0.2.118 found
    at
   
java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:578)
    at
   
java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)
    at
   edu.utah.camplab.sgs.AbstractSGSRun.canConnect(AbstractSGSRun.java:386)
    at
   edu.utah.camplab.sgs.AbstractSGSRun.init(AbstractSGSRun.java:296)
    at
   edu.utah.camplab.sgs.AbstractSGSOptions.init(AbstractSGSOptions.java:37)
    at edu.utah.camplab.sgs.SGSChase.init(SGSChase.java:76)
    at edu.utah.camplab.sgs.SGSChase.init(SGSChase.java:85)
    at edu.utah.camplab.app.SGSPValue.(SGSPValue.java:68)
    at edu.utah.camplab.app.SGSPValue.main(SGSPValue.java:27)
   Caused by: javax.net.ssl.SSLHandshakeException: No subject
   alternative names matching IP address 10.0.2.118 found
   Then comes my summary log:
   03:52:04.752 [main] ERROR edu.utah.camplab.sgs.AbstractSGSRun -
   cannot get to saver, trying 10.0.2.118:15002
   Could not establish connection to 10.0.2.118:15002
   from
    if (! canConnect() ) {
  logger.error("cannot get to saver, trying {}:{}",
   getAccumulationHost(), getAccumulationPort());
  throw new RuntimeException(String.format("Could not establish
   connection to %s:%d", getAccumulationHost(), getAccumulationPort()));
    }

  protected boolean canConnect() {
    boolean retval = false;
    String weburl = String.format("https://%s:%d;,
   getAccumulationHost(), getAccumulationPort());

    try {
  HttpRequest request = HttpRequest.newBuilder()
    .header("dbrole", getProjectName())
    .header("dbname", getDbName())
    .header("dbhost", System.getProperty("SGSSRVR_databaseHost",
   "localhost"))
    .uri(URI.create(weburl+"/sgs/webmonitor"))
    .build();
  HttpResponse response = getHttpClient().send(request,
   HttpResponse.BodyHandlers.ofString());
  retval = response.statusCode() == 200;
    }
    catch (IOException  | InterruptedException ie) {
  retval = false;
  ie.printStackTrace();
    }
    return retval;
  }


I had this overall configuration working until I 'terminated' the AWS 
server instance and am trying to rebuild.


Could a lack of network connectivity between client and server present 
this same symptom?


Re: AW: embeded tomcat apache-jasper dependency

2022-05-18 Thread Rob Sargent



On 5/18/22 12:21, Rob Sargent wrote:



On 5/17/22 01:24, Mark Thomas wrote:

On 17/05/2022 08:13, Thomas Hoffmann (Speed4Trade GmbH) wrote:

Hello,


-Ursprüngliche Nachricht-
Von: Rob Sargent 
Gesendet: Dienstag, 17. Mai 2022 00:38
An: users@tomcat.apache.org
Betreff: embeded tomcat apache-jasper dependency

I'm seeing a new-to-me deployment failure and am at a loss to explain.


Using tomcat 9-0-63 (and getting

 Caused by: java.lang.IllegalArgumentException: More than one
 fragment with the name [org_apache_jasper_el] was found. This 
is not

 legal with relative ordering. See section 8.2.2 2c of the Servlet
 specification for details. Consider using absolute ordering.
      at



Any pointers appreciated.
rjs


This message probably refers to web-fragments.
They are usually located at: /META-INF/web-fragment.xml

Within this XML there can be an ordering element  an a 
name element .


Maybe you can inspect the jars for this file.


It looks like you are packaging at least one of the standard Tomcat 
JARs (either jasper-el.jar or tomcat-embed-el.jar) in your web 
application. That will trigger this error.


Mark

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

Thank you.  Deleting /everything/ and starting over from scratch 
should be my first instinct, rather than last...



I do still get an exception at startup

   SEVERE: Servlet [jsp] in web application [/sgs] threw load() exception
   java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet
    at
   
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1412)
    at
   
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
    at
   
org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:534)
    at
   
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:515)
    at
   
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:149)
    at
   
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1070)
    at
   org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
    at
   
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
    at
   
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)
    at
   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at
   
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
    at
   
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
    at
   java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at
   
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at
   
java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
    at
   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
    at
   org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
    at
   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at
   
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
    at
   
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
    at
   java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at
   
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at
   
java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
    at
   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
    at
   
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
    at
   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at
   
org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
    at
   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at
   
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
    at
   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
    at
   edu.utah.camplab.server.SGSSelector.kickOff(SGSSelector.java:175)
    at edu.utah.camplab.server.SGSSelector.run(SGSSelector.java:187)
    at java.base/java.lang.Thread.run(Thread.java:833)

so I'm not completely clear of the hurdle.  But I'm not using JSPs so 
I'll leave this for now - but maybe that's why I had a jasper dependency.





Re: AW: embeded tomcat apache-jasper dependency

2022-05-18 Thread Rob Sargent



On 5/17/22 01:24, Mark Thomas wrote:

On 17/05/2022 08:13, Thomas Hoffmann (Speed4Trade GmbH) wrote:

Hello,


-Ursprüngliche Nachricht-
Von: Rob Sargent 
Gesendet: Dienstag, 17. Mai 2022 00:38
An: users@tomcat.apache.org
Betreff: embeded tomcat apache-jasper dependency

I'm seeing a new-to-me deployment failure and am at a loss to explain.


Using tomcat 9-0-63 (and getting

 Caused by: java.lang.IllegalArgumentException: More than one
 fragment with the name [org_apache_jasper_el] was found. This 
is not

 legal with relative ordering. See section 8.2.2 2c of the Servlet
 specification for details. Consider using absolute ordering.
      at



Any pointers appreciated.
rjs


This message probably refers to web-fragments.
They are usually located at: /META-INF/web-fragment.xml

Within this XML there can be an ordering element  an a name 
element .


Maybe you can inspect the jars for this file.


It looks like you are packaging at least one of the standard Tomcat 
JARs (either jasper-el.jar or tomcat-embed-el.jar) in your web 
application. That will trigger this error.


Mark

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

Thank you.  Deleting /everything/ and starting over from scratch should 
be my first instinct, rather than last...




embeded tomcat apache-jasper dependency

2022-05-16 Thread Rob Sargent

I'm seeing a new-to-me deployment failure and am at a loss to explain.


Using tomcat 9-0-63 (and getting

   Caused by: java.lang.IllegalArgumentException: More than one
   fragment with the name [org_apache_jasper_el] was found. This is not
   legal with relative ordering. See section 8.2.2 2c of the Servlet
   specification for details. Consider using absolute ordering.
    at
   
org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2262)
    at
   
org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2220)


My dependency manager (gradle) finds mention of jasper as an explicit 
dependency


 \--- project :webapp
  +--- project :transport (*)
  +--- com.fasterxml.jackson.core:jackson-databind:2.11.4 (*)
  +--- com.fasterxml.jackson.core:jackson-core:2.11.4
  +--- com.fasterxml.jackson.core:jackson-annotations:2.11.4
  +---
   com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4 (*)
  +--- javax.servlet:javax.servlet-api:3.1.0
  +--- javax.servlet.jsp:javax.servlet.jsp-api:2.3.3
  +--- org.apache.tomcat.embed:tomcat-embed-core:9.0.+ ->
   9.0.63
  |    \--- org.apache.tomcat:tomcat-annotations-api:9.0.63
  +--- org.apache.tomcat.embed:tomcat-embed-jasper:9.0.+ ->
   9.0.63
  |    +---
   org.apache.tomcat.embed:tomcat-embed-core:9.0.63 (*)
  |    +--- org.apache.tomcat.embed:tomcat-embed-el:9.0.63
  |    \--- org.eclipse.jdt:ecj:3.18.0
  +---
   org.apache.tomcat.embed:tomcat-embed-logging-juli:9.0.0.M6
  +--- org.apache.tomcat:tomcat-jdbc:9.0.+ -> 9.0.63
  |    \--- org.apache.tomcat:tomcat-juli:9.0.63
  +--- org.apache.tomcat:tomcat-dbcp:9.0.+ -> 9.0.63
  |    \--- org.apache.tomcat:tomcat-juli:9.0.63
  +--- org.apache.tomcat:tomcat-juli:9.0.+ -> 9.0.63
  \--- org.slf4j:slf4j-api:1.7.7 -> 1.7.32

I see no evidence of even a single instance of the string 
"org_apache_jasper_el" (not even just "jasper") in any xml file in the 
deployment directory.


Even if I remove the jasper dependency (I'm not using JSF) and rebuild 
(distTar) the project I get the same complaint (more than one jasper 
fragment).




Any pointers appreciated.
rjs





Re: Migration JDK11 - Tomcat 9 - NoClassDefFoundError: java/sql/Statement

2022-03-29 Thread Rob Sargent




On 3/29/22 10:54, Senguttuvan, Gopalakrishnan (CWM-NR) wrote:

Hi Thomas,

Thanks for the response.
This issue occurred when I have start the Tomcat server in Linux-QA machine.


Regards,
Gopalakrishnan S


Double check your runtime environment - something there is out of whack 
I suspect.


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



Re: Fwd: tomcat 9.50 - rewrite rule question

2022-03-24 Thread Rob Sargent




On 3/24/22 13:27, Peter Chiu wrote:

Application builder->Your application->Shared Components->Application
Definition Attributes->Properties->Friendly URLs



And that does what, exactly?


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



Re: Maybe a stupid (Windows related) question

2022-03-22 Thread Rob Sargent




On 3/22/22 11:21, Rony G. Flatscher (Apache) wrote:

For debugging purposes I downloaded the zip-version of Tomcat 10.0.18 and start 
it up using
%CATALINA_HOME%\bin\startup.bat.

This will create by default a separate process (terminal, commandline window) 
in which Tomcat runs
and dispatches all output including stdout and stderr output into that window.

By contrast the Windows service installation would redirect stdout and stderr 
by default to
%CATALINA_HOME%\logs\ using "tomcat10-stderr.yyy-mm-dd.log" and 
"tomcat10-stdout.-mm-dd.log" as
their name. The same would be desired for the "startup.bat" version of Tomcat 
10.

Searched  and
 to no avail. Searching 
the Internet the best
I could find
was

which indeed redirects the Tomcat startup information to
%CATALINA_HOME%\logs\catalina.-mm-dd.log, but not stdout and stderr which 
do not get redirected.
Using redirections directly in "startup.bat" or "catalina.bat" as suggested 
further down in the
serverfault.com did not yield the desired redirection.

Probably I have been doing something wrong in the past hours and not seeing the 
forest for the trees
anymore I kindly request help: what is needed to successfully redirect stderr 
and stdout to
%CATALINA_HOME%\logs after unzipping Tomcat 10 and starting it on Windows using
%CATALINA_HOME%\bin\startup.bat?

TIA for any help/pointer!

---rony



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


Maybe startup.bat > your.log

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



Re: correct usage of properties to supply database port

2022-03-12 Thread Rob Sargent



> On Mar 12, 2022, at 9:59 AM, Christopher Schultz 
>  wrote:
> 
> Rob,
> 
Chris, 
Yes I see that. Wasn’t really worried about context at the time of that post. I 
would argue though that the message is a tad obtuse. 

I’ll clean up the code generating that context.xml. Luckily it only breaks 
logging so far. With a proper jdbc url I get a functioning tomcat (again).
Thanks to all
rjs
> It's right here, from your original message:
> 
>   Mar 10, 2022 8:34:32 AM org.apache.tomcat.util.digester.Digester
>   endElement
>   WARNING: No rules found matching [Context/Context/Valve]
>   Mar 10, 2022 8:34:32 AM org.apache.tomcat.util.digester.Digester
>   endElement
>   WARNING: No rules found matching [Context/Context]
> 
> -chris
> 
> -
> 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: correct usage of properties to supply database port

2022-03-11 Thread Rob Sargent



> On Mar 11, 2022, at 8:17 AM, Thomas Hoffmann (Speed4Trade GmbH) 
>  wrote:
> 
> 
> 
>> -Ursprüngliche Nachricht-
>> Von: Rob Sargent 
>> Gesendet: Freitag, 11. März 2022 15:14
>> An: Tomcat Users List 
>> Betreff: Re: correct usage of properties to supply database port
>> 
>> 
>> 
>>>> On Mar 11, 2022, at 6:50 AM, Mark H. Wood  wrote:
>>> 
>>> On Thu, Mar 10, 2022 at 09:40:48AM -0700, Rob Sargent wrote:
>>>> About context/context/value:  I have this context.xml. Is the value
>>>> correctly inside the outer Context?
>>>> 
>>>>   
>>>> 
>>>>  >>>  name="jdbc/sgsdb/tbar"
>>>>  url="jdbc:postgresql://localhost:5432:/tbar"
>>>>  driverClassName="org.postgresql.Driver"
>>>>  type="javax.sql.DataSource"
>>>>  factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
>>>>  testWhileIdle="false"
>>>>  testOnBorrow="true"
>>>>  testOnReturn="false"
>>>>  validationInterval="3"
>>>>  validationQuery="select 1"
>>>>  timeBetweenEvictionRunsMillis="3"
>>>>  maxActive="50"
>>>>  initialSize="3"
>>>>  maxWait="1"
>>>>  removeAbandonedTimeout="3600"
>>>>  removeAbandoned="true"
>>>>  minEvictableIdleTimeMillis="3"
>>>>  minIdle="1"
>>>>  maxIdle="5"
>>>>  logAbandoned="true"
>>>>  username="shoc"
>>>>  password="password"
>>>>  />
>>>> 
>>>>  
>>>>>>>className="org.apache.catalina.valves.AccessLogValve"
>>>>prefix="sgs_access"
>>>>directory="${SGSSRVR_AccessLogDir}"
>>>>maxDays="7">
>>>>
>>>>  
>>>>   
>>> 
>>> I don't think you can nest s that way, and I'm not sure what
>>> it would mean.  I would remove the inner  pair.
>>> 
>>> --
>>> Mark H. Wood
>>> Lead Technology Analyst
>> 
>> Thanks. I’ll take a look at that. I don’t see any related error messages but 
>> I’ll
>> check my logging.
>> Thanks
>> 
>> 
> Nesting of Context is not allowed as far as I know.
> The documentation tells, which parent nodes/Elements are allowed , e.g. valve:
> https://tomcat.apache.org/tomcat-10.0-doc/config/valve.html
> only allowed in host, Context or Engine Element.
> 
> 
Ok. Thanks for digging in to that. I am not able to investigate (or correct) at 
the moment 


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



Re: correct usage of properties to supply database port

2022-03-11 Thread Rob Sargent



> On Mar 11, 2022, at 6:50 AM, Mark H. Wood  wrote:
> 
> On Thu, Mar 10, 2022 at 09:40:48AM -0700, Rob Sargent wrote:
>> About context/context/value:  I have this context.xml. Is the value 
>> correctly inside the outer Context?
>> 
>>
>> 
>>   >   name="jdbc/sgsdb/tbar"
>>   url="jdbc:postgresql://localhost:5432:/tbar"
>>   driverClassName="org.postgresql.Driver"
>>   type="javax.sql.DataSource"
>>   factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
>>   testWhileIdle="false"
>>   testOnBorrow="true"
>>   testOnReturn="false"
>>   validationInterval="3"
>>   validationQuery="select 1"
>>   timeBetweenEvictionRunsMillis="3"
>>   maxActive="50"
>>   initialSize="3"
>>   maxWait="1"
>>   removeAbandonedTimeout="3600"
>>   removeAbandoned="true"
>>   minEvictableIdleTimeMillis="3"
>>   minIdle="1"
>>   maxIdle="5"
>>   logAbandoned="true"
>>   username="shoc"
>>   password="password"
>>   />
>> 
>>   
>> > className="org.apache.catalina.valves.AccessLogValve"
>> prefix="sgs_access"
>> directory="${SGSSRVR_AccessLogDir}"
>> maxDays="7">
>> 
>>   
>>
> 
> I don't think you can nest s that way, and I'm not sure what
> it would mean.  I would remove the inner  pair.
> 
> -- 
> Mark H. Wood
> Lead Technology Analyst

Thanks. I’ll take a look at that. I don’t see any related error messages but 
I’ll check my logging. 
Thanks 


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



Re: correct usage of properties to supply database port

2022-03-10 Thread Rob Sargent
I think I see the problem:  and extra colon has snuck in to the url - 
localhost:5432*":"*/tbar


Sorry for the noise.

On 3/10/22 09:40, Rob Sargent wrote:
Using tomcat 9.0.58 I have a propertiesfile supplied to my embedded 
tomcat which includes


SGSSRVR_databasePort     = 5432
SGSSRVR_databaseHost        = localhost




correct usage of properties to supply database port

2022-03-10 Thread Rob Sargent
Using tomcat 9.0.58 I have a propertiesfile supplied to my embedded 
tomcat which includes


   SGSSRVR_databasePort     = 5432
   SGSSRVR_databaseHost        = localhost

and in my app-specific web.xml I have

   
    databaseHost
   ${SGSSRVR_databaseHost}
   java.lang.String
  
  
    databasePort
   ${SGSSRVR_databasePort}
   java.lang.Integer
  

but at tomcat startup several warnings which confuse me and a fatal error:

   INFO: Starting service [Tomcat]
   Mar 10, 2022 8:34:32 AM org.apache.catalina.core.StandardEngine
   startInternal
   INFO: Starting Servlet engine: [Apache Tomcat/9.0.59]
   Mar 10, 2022 8:34:32 AM org.apache.tomcat.util.digester.Digester
   endElement
   WARNING: No rules found matching [Context/Context/Valve]
   Mar 10, 2022 8:34:32 AM org.apache.tomcat.util.digester.Digester
   endElement
   WARNING: No rules found matching [Context/Context]
   Mar 10, 2022 8:34:32 AM org.apache.catalina.startup.ContextConfig
   getDefaultWebXmlFragment
   INFO: No global web.xml found
   Mar 10, 2022 8:34:33 AM org.postgresql.util.PGPropertyUtil
   convertPgPortToInt
   WARNING: JDBC URL invalid port number:
   Mar 10, 2022 8:34:33 AM org.apache.tomcat.jdbc.pool.ConnectionPool init
   SEVERE: Unable to create initial connections of pool.
   java.sql.SQLException: Driver:org.postgresql.Driver@1ecfa525
   returned null for URL:jdbc:postgresql://localhost:5432:/tbar


The main surprise to me is the "invalid port number".  Am I correct in 
using the ${property-name} in web.xml?  The main() reads the properties 
file, for sure.



About context/context/value:  I have this context.xml. Is the value 
correctly inside the outer Context?


   

  

  
    
    
  
   




Re: Odd EL resolution issue - java.lang.NoClassDefFoundError: package/Class1 (wrong name: package/class1)

2022-02-08 Thread Rob Sargent




On 2/8/22 08:11, Robert Turner wrote:

Okay. Yep, my most recent suspicion was correct -- it's related to the
Docker bind to a local folder containing the webapps. As such, I believe
it's a Docker issue of some sort and not Tomcat specific. However, you may
want to understand it more completely in any case.

Thanks for your help Mark, Rob S and Neil.


Is docker the new regexp?  You know: I had a problem. Used docker to 
solve it.  Now I have two problems.


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



Re: Odd EL resolution issue - java.lang.NoClassDefFoundError: package/Class1 (wrong name: package/class1)

2022-02-07 Thread Rob Sargent




On 2/7/22 19:13, Robert Turner wrote:

So, I've gone back and double-checked as much as I can (Tomcat version, JDK
version), and the classpath, and I have identical classpaths in both
environments (except the sort order of the URLs per "level" of
ClassLoader), and I've re-verified the behaviour:
  - fails in the docker environment
  - works locally
(Same WAR file on both).

I guess I'm in to one of the following approaches next:
  - build a debug version of Tomcat, and step through the code that breaks
and see if I can figure out why (not that I have time to do this of
course...but might be necessary)
  - construct a trivial application reproduction, along with docker layout,
and see if anyone else can reproduce... (assuming anyone else has time to
do that of course...)

Anyone got any suggestions of what to look into next?


On Mon, Feb 7, 2022 at 5:05 PM Rob Sargent  wrote:


As you appear averse to sharing names of things, seems you will need to 
do a lot of extra clean-up before you can share a docker image. Make 
sure you're clear on what NoClassDefFoundError indicates (present at 
compile time, absent at runtime) and how that translates to docker-ness 
(of which I know naught).



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



Re: Odd EL resolution issue - java.lang.NoClassDefFoundError: package/Class1 (wrong name: package/class1)

2022-02-07 Thread Rob Sargent




On 2/7/22 14:50, Robert Turner wrote:

All

I'm hoping that someone can point me in the right direction as this issue
has been baffling me all day, and I'm starting to run out of ideas of what
to look at next.

The logic below is working without issue until I move our test environment
into a Docker container. I'm using the same Tomcat version, and the same
JDK in both the container and the non-container environments.


I've got some EL in a JSP page, for example (simplified):

  ${class1.field}


And an attribute is set on the page context as follows:

final package1.Class1 objectValue = ...; // either value object of Class1
or null
pageContext.setAttribute("class1", objectValue);


Now, when objectValue is pointing to a valid object, everything is okay.
But when objectValue is null, this is where things get peculiar (and I get
both a working and non-working behaviour in the different environments).

I can easily work around the issue by changing the EL to:

   ${not empty class1 ? class1.field : ''$}

But it is my understanding that EL should handle nulls on it's own, and
this shouldn't be necessary.


In the failure situation in the docker container, I'm seeing a
NoClassDefFoundError exception for "package1/Class1" below [1] during the
JSP page "rendering". Things work fine outside the docker container.


It might be worth noting that in my case, the attribute name is of the same
name as the actual class (with the first letter being lowercase for the
attribute instead of uppercase in the class).

Note that I've also replaced my actual package name and class names with
"package1" and "Class1", and the attribute name with "class", but they
translate 1-to-1 as in what I've provided here and do not use reserved
names.


I've done a bit of digging into the EL scope resolution code in Tomcat, and
I'm suspecting it might be related to how it chooses the scope of the
object. Possibly related to maybe looking for static aspects of the class,
or something like that. After reviewing the Servlet / JSP / EL
documentation, I also haven't found anything obvious that would suggest
what the problem might be.

Hopefully someone has encountered this before and can nudge me in the right
direction.

Thanks in advance,

Robert



[1]
Caused by: java.lang.NoClassDefFoundError: package1/Class1 (wrong name:
package1/class1)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2478)
at
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:870)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1371)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1215)
at javax.el.ImportHandler.findClass(ImportHandler.java:477)
at javax.el.ImportHandler.resolveClass(ImportHandler.java:421)
at
javax.servlet.jsp.el.ScopedAttributeELResolver.getValue(ScopedAttributeELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:124)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:93)
at org.apache.el.parser.AstValue.getValue(AstValue.java:136)
at org.apache.el.parser.AstFunction.getValue(AstFunction.java:188)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
at
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:692)
at


And you're sure package1 is on the classpath of the docker version?


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



Re: birthdate of AbstractHttp11Protocol.setRejectIllegalHeader

2022-01-16 Thread Rob Sargent
And bingo! 9.0.31.  Please pardon my “find” skills


> On Jan 16, 2022, at 3:05 AM, Mark Thomas  wrote:
> 
> On 15/01/2022 22:24, Rob Sargent wrote:
>> Wow.  On 
>> https://nightlies.apache.org/tomcat/tomcat-9.0.x/docs/changelog.html 
>> <https://nightlies.apache.org/tomcat/tomcat-9.0.x/docs/changelog.html> my 
>> chrome browser find of “AbstractHttp11Protocol" locates one instance down in 
>> 9.0.2.  Find of setReject gets me zero hits??
>> None of the 17 hits for “deprecate", to my eye, pertain to changes in 
>> handling headers (I expected to locate a reference to the deprecation of 
>> AbstractHttp11Protocol.setRejectIllegalHeaderName).
>> I’m very confused.
> 
> It is referenced under the property name, not the setter name so you need to 
> look for "rejectIllegalHeaderName"
> 
> Mark
> 
> 
>> For what it’s worth, I’m dealing with a misconfiguration in vaadin(v14) and 
>> spring-boot dependencies and I am trying to work out compatible versions of 
>> these.  I’ve located the relevant releases of vaadin which break the spring 
>> dependencies and am heading over there now, so this Apache issue is of less 
>> importance to me.
>> Thanks,
>> rjs
>>> On Jan 15, 2022, at 4:21 AM, Mark Thomas  wrote:
>>> 
>>> On 15/01/2022 02:42, Rob Sargent wrote:
>>>> With version number as a surrogate date.  I didn’t see any mention in the 
>>>> changelog.
>>> 
>>> Look again. I see it in
>>> 
>>> https://nightlies.apache.org/tomcat/tomcat-9.0.x/docs/changelog.html
>>> https://nightlies.apache.org/tomcat/tomcat-8.5.x/docs/changelog.html
>>> 
>>> You won't see in 10.0.x or 10.1.x because the change occurred before the 
>>> branches were created. In those cases it is covered by the general entry 
>>> for the first version in the change log.
>>> 
>>> Mark
>>> 
>>> -
>>> 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
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
> <mailto:users-unsubscr...@tomcat.apache.org>
> For additional commands, e-mail: users-h...@tomcat.apache.org 
> <mailto:users-h...@tomcat.apache.org>


Re: birthdate of AbstractHttp11Protocol.setRejectIllegalHeader

2022-01-15 Thread Rob Sargent
Wow.  On https://nightlies.apache.org/tomcat/tomcat-9.0.x/docs/changelog.html 
my chrome browser find of “AbstractHttp11Protocol" locates one instance down in 
9.0.2.  Find of setReject gets me zero hits??
None of the 17 hits for “deprecate", to my eye, pertain to changes in handling 
headers (I expected to locate a reference to the deprecation of 
AbstractHttp11Protocol.setRejectIllegalHeaderName).

I’m very confused.

For what it’s worth, I’m dealing with a misconfiguration in vaadin(v14) and 
spring-boot dependencies and I am trying to work out compatible versions of 
these.  I’ve located the relevant releases of vaadin which break the spring 
dependencies and am heading over there now, so this Apache issue is of less 
importance to me.

Thanks,
rjs

> On Jan 15, 2022, at 4:21 AM, Mark Thomas  wrote:
> 
> On 15/01/2022 02:42, Rob Sargent wrote:
>> With version number as a surrogate date.  I didn’t see any mention in the 
>> changelog.
> 
> Look again. I see it in
> 
> https://nightlies.apache.org/tomcat/tomcat-9.0.x/docs/changelog.html
> https://nightlies.apache.org/tomcat/tomcat-8.5.x/docs/changelog.html
> 
> You won't see in 10.0.x or 10.1.x because the change occurred before the 
> branches were created. In those cases it is covered by the general entry for 
> the first version in the change log.
> 
> Mark
> 
> -
> 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



birthdate of AbstractHttp11Protocol.setRejectIllegalHeader

2022-01-14 Thread Rob Sargent
With version number as a surrogate date.  I didn’t see any mention in the 
changelog.

Thanks,
rjs


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



Re: Do I Need Network NameSpaces to Solve This Tomcat+Connector/J Problem?

2021-12-30 Thread Rob Sargent


> On Dec 30, 2021, at 4:33 PM, Eric Robinson  wrote:
> 
> Hi Rob,
> 
>>> On Dec 30, 2021, at 4:03 PM, Eric Robinson 
>> wrote:
>>> 
>>> Chris,
>>> 
>>> If I want to ignore the vendor's recommendation and try connection
>> pooling anyway, is that something I can enable with a config file setting, 
>> or do
>> they actually have to trigger it from within their code?
>>> 
>> 

>> Up thread, didn’t you say tomcat was the client?  Are servlets in tomcat
>> making db requests?  What database system is under this?
>>> 
> 
> Yes, tomcat is the client and the database is MySQL. There are, in fact, many 
> tomcat instances on the same server, each connecting to its own dedicated 
> MySQL database located in a farm of MySQL servers.
> 

And then each tomcat instance has a single  identifying the db 
server?  It could be possible to redirect that Resource to a Connector/J 
fronting MySQL.  It would not be perfectly seamless but could be pretty quick, 
per tomcat instance.


 -Original Message-
 From: Eric Robinson >>> >
 Sent: Thursday, December 30, 2021 12:00 PM
 To: Tomcat Users List >>> >
 Subject: RE: Do I Need Network NameSpaces to Solve This
 Tomcat+Connector/J Problem?
 
 Chris,
 
> Not pooling connections will very likely negatively affect performance.
> 
> When you say "they ... have an issue with connection pooling" do you
> mean that they have a technical problem, or do you mean that there
> is some ill- conceived policy against them?
> 
> Oh, maybe they are paranoid about cross-client leakage between
> connections. Well, if the application can't be trusted not to leak
> that kind of info, then it can't be trusted to make the connections
> properly in the first place.
> 
> -chris
> 
 
 Hard to say what their issue is. We've asked about implementing it
 before, but they don't support it. You know how software companies
 are. Maybe they had a technical problem with it years ago and have just
>> not revisited it.
 They're stuck in a rut and there is too much inertia to get them out of it.
 
 --Eric
 
 
 
 
 Disclaimer : This email and any files transmitted with it are
 confidential and intended solely for intended recipients. If you are
 not the named addressee you should not disseminate, distribute, copy
 or alter this email. Any views or opinions presented in this email
 are solely those of the author and might not represent those of
 Physician Select Management. Warning: Although Physician Select
 Management has taken reasonable precautions to ensure no viruses are
 present in this email, the company cannot accept responsibility for any
>> loss or damage arising from the use of this email or attachments.
>>> Disclaimer : This email and any files transmitted with it are confidential 
>>> and
>> intended solely for intended recipients. If you are not the named addressee
>> you should not disseminate, distribute, copy or alter this email. Any views 
>> or
>> opinions presented in this email are solely those of the author and might not
>> represent those of Physician Select Management. Warning: Although
>> Physician Select Management has taken reasonable precautions to ensure
>> no viruses are present in this email, the company cannot accept 
>> responsibility
>> for any loss or damage arising from the use of this email or attachments.
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> 
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
> Disclaimer : This email and any files transmitted with it are confidential 
> and intended solely for intended recipients. If you are not the named 
> addressee you should not disseminate, distribute, copy or alter this email. 
> Any views or opinions presented in this email are solely those of the author 
> and might not represent those of Physician Select Management. Warning: 
> Although Physician Select Management has taken reasonable precautions to 
> ensure no viruses are present in this email, the company cannot accept 
> responsibility for any loss or damage arising from the use of this email or 
> attachments.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
> 
> For additional commands, e-mail: users-h...@tomcat.apache.org 
> 


Re: Do I Need Network NameSpaces to Solve This Tomcat+Connector/J Problem?

2021-12-30 Thread Rob Sargent


> On Dec 30, 2021, at 4:03 PM, Eric Robinson  wrote:
> 
> Chris,
> 
> If I want to ignore the vendor's recommendation and try connection pooling 
> anyway, is that something I can enable with a config file setting, or do they 
> actually have to trigger it from within their code?
> 

Up thread, didn’t you say tomcat was the client?  Are servlets in tomcat making 
db requests?  What database system is under this?
> 
>> -Original Message-
>> From: Eric Robinson > >
>> Sent: Thursday, December 30, 2021 12:00 PM
>> To: Tomcat Users List > >
>> Subject: RE: Do I Need Network NameSpaces to Solve This
>> Tomcat+Connector/J Problem?
>> 
>> Chris,
>> 
>>> Not pooling connections will very likely negatively affect performance.
>>> 
>>> When you say "they ... have an issue with connection pooling" do you
>>> mean that they have a technical problem, or do you mean that there is
>>> some ill- conceived policy against them?
>>> 
>>> Oh, maybe they are paranoid about cross-client leakage between
>>> connections. Well, if the application can't be trusted not to leak
>>> that kind of info, then it can't be trusted to make the connections
>>> properly in the first place.
>>> 
>>> -chris
>>> 
>> 
>> Hard to say what their issue is. We've asked about implementing it before,
>> but they don't support it. You know how software companies are. Maybe
>> they had a technical problem with it years ago and have just not revisited 
>> it.
>> They're stuck in a rut and there is too much inertia to get them out of it.
>> 
>> --Eric
>> 
>> 
>> 
>> 
>> Disclaimer : This email and any files transmitted with it are confidential 
>> and
>> intended solely for intended recipients. If you are not the named addressee
>> you should not disseminate, distribute, copy or alter this email. Any views 
>> or
>> opinions presented in this email are solely those of the author and might not
>> represent those of Physician Select Management. Warning: Although
>> Physician Select Management has taken reasonable precautions to ensure
>> no viruses are present in this email, the company cannot accept 
>> responsibility
>> for any loss or damage arising from the use of this email or attachments.
> Disclaimer : This email and any files transmitted with it are confidential 
> and intended solely for intended recipients. If you are not the named 
> addressee you should not disseminate, distribute, copy or alter this email. 
> Any views or opinions presented in this email are solely those of the author 
> and might not represent those of Physician Select Management. Warning: 
> Although Physician Select Management has taken reasonable precautions to 
> ensure no viruses are present in this email, the company cannot accept 
> responsibility for any loss or damage arising from the use of this email or 
> attachments.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
> 
> For additional commands, e-mail: users-h...@tomcat.apache.org 
> 


Re: servletcontext.log filename

2021-12-01 Thread Rob Sargent




On 12/1/21 12:32 PM, Mark Thomas wrote:

On 01/12/2021 19:24, Rob Sargent wrote:
I'm using an embedded tomcat (ver9.0.54) and I don't see how to 
name/redirect the output of ServletContext.log(String).


I see in the manual

    This logging is performed according to the Tomcat logging
    configuration. You cannot overwrite it in a web application.

I missing the "Tomcat logging config" bit, I guess.


Each web application gets its own logger and these messages are 
directed there. The loggers are named along these lines:



org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/examples]

Adjust as necessary for your engine name, host name and context path.

Mark


Call off the dogs: I found the logs (carefully hidden in stdout...)

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



Re: servletcontext.log filename

2021-12-01 Thread Rob Sargent




On 12/1/21 12:32 PM, Mark Thomas wrote:

On 01/12/2021 19:24, Rob Sargent wrote:
I'm using an embedded tomcat (ver9.0.54) and I don't see how to 
name/redirect the output of ServletContext.log(String).


I see in the manual

    This logging is performed according to the Tomcat logging
    configuration. You cannot overwrite it in a web application.

I missing the "Tomcat logging config" bit, I guess.


Each web application gets its own logger and these messages are 
directed there. The loggers are named along these lines:



org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/examples]

Adjust as necessary for your engine name, host name and context path.

Mark



I'm sorry, but my servlet calls to log("something") seem to be going to 
/dev/null.  I can't find them anywhere.  I'm operating on a CentOS 7 not 
under my management (so no IDE to look at the values of interest).



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



servletcontext.log filename

2021-12-01 Thread Rob Sargent
I'm using an embedded tomcat (ver9.0.54) and I don't see how to 
name/redirect the output of ServletContext.log(String).


I see in the manual

   This logging is performed according to the Tomcat logging
   configuration. You cannot overwrite it in a web application.

I missing the "Tomcat logging config" bit, I guess.




Re: help with Valve

2021-11-23 Thread Rob Sargent




On 11/23/21 10:55 AM, Mark Thomas wrote:

On 23/11/2021 17:42, Rob Sargent wrote:
Thank you.  Does this look like a believable deployment (presuming 
the property is in fact set)?


    cat ./localhost/sgs/META-INF/context-valve.xml
   
   


No.

A context.xml file placed in META-INF must be called context.xml

The contents needs to look like this:


    
    



Note the quotes on maxDays. The parser might let you get away without 
them but the standard Tomcat config files always use them.





Double thank-you.

Mark

-
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: help with Valve

2021-11-23 Thread Rob Sargent
Thank you.  Does this look like a believable deployment (presuming the 
property is in fact set)?


   cat ./localhost/sgs/META-INF/context-valve.xml
  
  


On 11/23/21 10:38 AM, Mark Thomas wrote:

On 23/11/2021 16:48, Rob Sargent wrote:

Is the Access Log Valve available for use in an embedded environment?


Yes.

Mark


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





help with Valve

2021-11-23 Thread Rob Sargent

Is the Access Log Valve available for use in an embedded environment?


Re: Help Needed

2021-08-06 Thread Rob Sargent
> 
> On Aug 6, 2021, at 8:31 PM, Mohan T  wrote:
> 
> Dear All,
> 
> Any inputs on this. We are not getting a break in this.

Did upgrading change anything?
You may want to layout your configuration and why you think it should work. 
Which version of Java, etc?
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: More information, Re: Tomcat 8.5.68 failing on takeoff!

2021-08-06 Thread Rob Sargent



> On Aug 6, 2021, at 10:17 AM, Konstantin Kolinko  
> wrote:
> 
> пт, 6 авг. 2021 г. в 01:33, James H. H. Lampert
> :
>> org.xml.sax.SAXNotRecognizedException: Feature:
>> http://apache.org/xml/features/allow-java-encodings
>>
>> org.apache.crimson.parser.XMLReaderImpl.setFeature(XMLReaderImpl.java:213)
>>
>> org.apache.crimson.jaxp.SAXParserImpl.setFeatures(SAXParserImpl.java:143)
>>org.apache.crimson.jaxp.SAXParserImpl.(SAXParserImpl.java:126)
>>
>> org.apache.crimson.jaxp.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:113)
>>
>> org.apache.crimson.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:141)
> 
> Try to find what *.jar file in your system contains the above classes.
> 
> E.g. searching for string "crimson" in *.jar files.
> That string will be visible in the archive file as it is a name of a 
> directory.
> 
> HTH.
> 
I have a bash function which does this moderately well.  Happy to share it, if 
needed.

> -
> 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: Connector Port Issue

2021-08-05 Thread Rob Sargent


> Caused by: java.lang.IllegalArgumentException: No SSLHostConfig 
> element was found with the hostName [_default_] to match the 
> defaultSSLHostConfigName for the connector [https-jsse-nio-9443]
> 

Isn’t that the real issue?


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



Re: Request for Help

2021-07-24 Thread Rob Sargent


> On Jul 23, 2021, at 10:42 PM, Mohan T  wrote:
> 
> Dear All,
>  
> We are using tomcat 8.5.35 on SUse Linux. 
>  
> We are facing a issue while launching the help files. 
>  /
> We deployed the help files in the 
> /home/ilas/tomcat8.5_tech/apache-tomcat-8.5.35/webapps/hub#rvwhelp.
>  
> The help files are packaged as 
> /hub/rvwhelp/implementation/1/Hlprolemaster_rolemaster_1.htm.
>  
> When launching the help file through the application the launched help file 
> is not in proper format.
>  
> It must appear as below. (This is from another environment with different 
> application server)

this list strips attachments generally.  You will have to describe your problem 
with words alone.

What is the “different application server” running?




Re: [Possible Spam] Re: HTTP/2 Memory Leak

2021-07-08 Thread Rob Sargent



On 7/8/21 3:17 PM, Mark A. Claassen wrote:

Ok.  That didn’t seem to work.  I will investigate further and try to find a 
way to send that information.

It is not that busy a server, but the memory use increases very quickly.  Doing 
a class_histogram shows MessageBytes growing by the thousands every 30 minutes.

(We have a temporary monitor script in place that does a GC and then prints a 
class_histogram every half hour to help us pinpoint what is happening.)

Thanks,
Mark


Perhaps you've done this already, but

   grep -R 'static HashMap' src

might locate some potential culprits.



Re: Urgent Help

2021-06-23 Thread Rob Sargent

I dropped a couple lines in the C/P, ammended below

On 6/23/21 1:35 PM, Rob Sargent wrote:



Please provide a list of all the JAR files under WEB-INF/lib in your 
WAR file.


+1 and maybe also everything in $CATALINA_BASE/lib as well, just in 
case your Tomcat lib directory has had things added.


-chris

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


If looking for the source(s) of a given class, here's a bash function

function jargrep {
    sdir=`pwd`
    target=$1
    if [[ "$target"x == "x" ]]
    then
    printf "need at least search value, with optional starting dir\n"
    printf "use colon sep'd list for multiple, non-redundant dirs
(eg CLASSPATH)"
    return
    fi
    cdir=`pwd`
    finded=
    if [ "$2"x != "x" ]
    then
    cdir=( $(echo "$2" | sed s/:/\ /g) )
    fi

    for d in ${cdir[@]}; do
    cd $d
    if [[ $JARGREP_DEBUG ]]; then printf "TOPDIR is now: %s\n" $d; fi
 for jlist in `find . -name \*.jar`
 do
     if [[ $JARGREP_DEBUG ]]; then printf "checking %s/%s for
%s\n" $d $jlist $target; fi
     for founds in `jar tf $jlist | grep $1`
     do
        if [[ $JARGREP_DEBUG ]]; then printf "full founds: %s\n"
"$founds"; fi
    printf "Found in %s as %s\n" $jlist ${founds}
     finded=1
     done
 done
    cd ..
    done


    if [ ! $finded ]; then echo "I got nothin' from ${cdir[@]}"; fi
    cd $sdir

}
which takes the class name (e.g. ServletContext) and an optional 
starting dir (default to .) and scans any found jars for anything 
remotely similar.







Re: CATALINA_OPTS vs JAVA_OPTS

2021-06-16 Thread Rob Sargent



> On Jun 16, 2021, at 8:36 AM, Noelette Stout  wrote:
> 
> If I have a setenv.sh file that contains:
> CATALINA_OPTS="-server -Xms2048m -Xmx5g"
> JAVA_OPTS="... -Xms2048m -Xmx4g .."
> 
> How much memory is actually being allocated to tomcat and the applications
> it is serving up?
> 
> -- 
> Noelette Stout

Which version of Java?
> 
> ITS Enterprise Applications - Application Administrator - Senior
> 
> Business Administration Building, Rm 109L
> 921 South 8th Ave 8037
> Idaho State University
> Pocatello ID 83209
> E-mail: stounoel "at" isu "dot" edu
> Desk: 208-282-2554

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



Re: Pi Based Java Work

2021-05-28 Thread Rob Sargent




On 5/28/21 6:21 PM, John Dale wrote:

Tried sending another email .. doesn't appear to have worked.
Internet hicupped.

It's working just like Ubuntu in the cloud.

Pi 4 is very fast, but I'm also running DB2DOM (middleware microkernel
miniaturized O/R M, Html5 IDE, and Virtual Web Server).

MariaDB has a sorting/limit problem that I haven't reported, yet (had
to work around it).

Tomcat, OpenJDK, and Raspbian are all humming along together on a 4gig Pi 4.

DB2DOM is stateless so load balancing is pretty straightforward.

Thinking about extending DB2DOM to use an Object Database (oh yeah, I said it).

What are you working on?

Hit me back.

John


What build tool(s) are you using?  I'm on an ubu desktop, which may or 
may not have tomcat "installed" but I'm developing a standard 3-tier app 
with embedded tomcat 9.0.46 (which certainly wouldn't be installed by 
apt).  I use gradle to manage dependencies, etc.  I can get what-ever 
version of which-ever shiny object I want.  (Then the whole 
kit-and-kaboodle get deployed at AWS. And it's working!)







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



abandoned connections

2021-05-26 Thread Rob Sargent
I think I have all my calls for new connections in try/with blocks, but 
things went bump in the night at AWS/RDS yesterday and I'm wondering if 
I missed one or if the try/with isn't as safe as I thought.


   00:10:12.201 [https-jsse-nio-10.0.2.28-15002-exec-11] INFO
   edu.utah.camplab.jx.PayloadFromMux -
   bulk."rjs_GEV15_20_074d449b_c3ba_499f_83e3_f48427fe0156": Begin
   transfer from bulk to segment
   26-May-2021 00:10:55.092 WARNING [Tomcat JDBC Pool
   Cleaner[1731185718:1621976215058]]
   org.apache.tomcat.jdbc.pool.ConnectionPool.abandon Connection has
   been abandoned PooledConnection[org.postgresql.jdbc.PgConnection@2e\
   cd1168]:java.lang.Exception
    at
   
org.apache.tomcat.jdbc.pool.ConnectionPool.getThreadDump(ConnectionPool.java:1163)
    at
   
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:816)
    at
   
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:660)
    at
   
org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:198)
    at
   
org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:132)
    at
   
org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:90)
    at
   
edu.utah.camplab.servlet.AbstractSGSServlet.getDbConn(AbstractSGSServlet.java:123)
    at
   
edu.utah.camplab.servlet.AbstractSGSServlet.getDbConn(AbstractSGSServlet.java:105)
    at
   
edu.utah.camplab.servlet.PayloadSaveServlet.doPost(PayloadSaveServlet.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)

in my tomcat log.  I see *nothing* that matches this in the AWS/RDS log 
views.


And here's the getDbConn call in the doPost method (though I see it has 
a superfluous close() call):


  protected void doPost(HttpServletRequest req, HttpServletResponse
   resp) {
    //HashMap> pmap = getParameterMap(req);
    logger.error("payload save called");
    try (Connection copyConn = getDbConn(req, resp)) {
    ObjectMapper jsonMapper = JsonMapper.builder().addModule(new
   JavaTimeModule()).build();
    jsonMapper.setSerializationInclusion(Include.NON_NULL);

    AbstractPayload payload =
   jsonMapper.readValue(req.getInputStream(), AbstractPayload.class);
    logger.error("received payload");
    String redoUrl =
   String.format("jdbc:postgresql://%s:%d/%s", getDbHost(),
   getDbPort(), getDbName(req));
    payload.setConnection(copyConn);
    payload.setDbUrl(redoUrl);
    payload.write();
    logger.error("finished db write");
    resp.setContentType("plain/text");
    resp.setStatus(200);
    resp.getOutputStream().write("SGS_OK".getBytes());
    resp.getOutputStream().flush();
    resp.getOutputStream().close();
    copyConn.close();
  }
    catch
   (com.fasterxml.jackson.databind.exc.MismatchedInputException mie) {
  logger.error("transform failed: " + mie.getMessage());
  resp.setContentType("plain/text");
  resp.setStatus(461);
  sendBadNews(resp, mie, "json formatting issue, perhaps");
    }
    catch (IOException | SQLException ioe) {
  resp.setStatus(460);
  sendBadNews(resp, ioe, "database trouble, likely");
    }
  }





Re: tomcat timeout

2021-04-15 Thread Rob Sargent




On 4/15/21 12:23 PM, Mohamed Eliyas Abdul Kadar wrote:

I am using tomcat 9.0.41. In my web application, when executing a query to 
fetch data for reporting it is taking time more than 2 minutes. The request is 
getting time out after 50s. Please let me know how to increase the data base 
timeout to 5 mins.
This communication and its attachments contain confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this communication. Please notify 
the sender immediately if you have received this communication by mistake and 
delete or destroy this communication. Communications cannot be guaranteed to be 
secured or error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. The sender therefore 
does not accept liability for any errors or omissions in the contents of this 
communication which arise as a result of transmission. If verification is 
required please request a hard-copy version. NeoGenomics Laboratories, 12701 
Commonwealth Dr, Fort Myers, FL 33913, http://www.neogenomics.com (2021)

Are you sure you're not better off focusing on why your query is taking 
so long.  How much data are you reading through and how much are you 
returning to the web client?



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



Re: [OT] Again with the missing headers

2021-04-12 Thread Rob Sargent


> On Apr 12, 2021, at 2:04 PM, Christopher Schultz 
>  wrote:
> 
> Mark,
> 
> On 4/12/21 04:16, Mark Thomas wrote:
>> maxHttpHeaderSize only applies to Tomcat reading requests from clients. It 
>> has no impact on the headers Tomcat sends to the client.
>> Given that the issue is size dependent and the the header is missing only on 
>> the larger responses, I would guess that the Servlet is writing the header 
>> after the response has been committed in those cases and is, therefore, 
>> being lost.
>> In HTTP, headers usually come before the body. When generating a response, 
>> Tomcat will buffer the response body until either there is an explicit flush 
>> or explicit commit or the buffer is full at which point an implicit flush 
>> occurs.
>> When a flush (implicit or explicit) occurs, if the response is not committed 
>> at that point then the response is automatically committed. Committing the 
>> response == writing the response headers.
>> You typically want to ensure that the Servlet writes all the headers before 
>> it writes the response body.
>> There are alternative options:
>> 1. Use a large enough response buffer to buffer the entire response. Keep in 
>> mind you need to have enough free memory for every concurrent request to 
>> have a buffer this large whether it uses it or not.
>> 2. Servlet 4 (Tomcat 9 onwards) added support for trailer headers (see RFC 
>> 7230 section 4.4). These can be used with chunked encoding and allows header 
>> values to be written after the response body. You might want to confirm that 
>> the client you are using supports trailer headers.
> 
> Notably the HttpClient client class provided by Java 9+ *does* support 
> trailers in the response from the server. Unfortunately, it doesn't support 
> sending trailers *to* the server, which is a shame.
> 
> -chris

I can live with to-client only!  Now to figure out the setting.
Thanks all.

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


Re: Again with the missing headers

2021-04-12 Thread Rob Sargent


> On Apr 12, 2021, at 8:43 AM, Rob Sargent  wrote:
> 
> 
> 
> 
> Begin forwarded message:
> 
>> From: Konstantin Kolinko 
>> Date: April 12, 2021 at 8:38:14 AM MDT
>> To: Tomcat Users List 
>> Subject: Re: Again with the missing headers
>> Reply-To: Tomcat Users List 
>> 
>> пн, 12 апр. 2021 г. в 16:20, Rob Sargent :
>>> 
>>> Thank you.
>>> 
>>> Can you suggest a way to confirm the problem is size related? Or are you 
>>> convinced by the numbers shown?
>> 
>> Look at "ServletResponse.isCommitted()"
>> 
>> https://cwiki.apache.org/confluence/display/TOMCAT/Specifications#Specifications-JavaServletSpecifications
>> https://javaee.github.io/javaee-spec/javadocs/javax/servlet/ServletResponse.html#isCommitted--
>> 
>>> The client is a Java 15 app so there’s a chance I could use trailer 
>>> headers. I’m not explicitly using chunked encoding currently.
>>> 
>>> I don’t like the idea of buffering the entire response as this is the part 
>>> of my setup where there are likely thousands of nearly simultaneous 
>>> requests and the server isn’t that beefy.
>>> 
>>> And I take it there is no mechanism in tomcat 9 to force the headers out on 
>>> an implicit flush?  Or other mechanism which ensures headers are sent?
>> 
>> What are those headers, and what code at what place sets them?
>> 
>> BTW,
>> an AccessLogValve can be configured to log a value of a response
>> header with "%{xxx}o" pattern.
>> https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Log_Valve
>> 
>> 
>> https://tomcat.apache.org/lists.html#tomcat-users
>> -> 6. " Top-posting is bad.”
I’m sorry, I didn’t get the impression this was a bottom-post list.  Thanks for 
informing me.

The datum of concern is handled via the session.

  //Hold the offset of the first explicit marker in the chased
  //segment.  That marker at most 16th locus up-stream of
  //segment. Less at pter.  There are more markers found within the
  //spanning cliques but these are not at predictable positions
  private void setRebase(HttpServletRequest req, Integer value) {
req.getSession().setAttribute("rebase", value);
  }

  private Integer getRebase(HttpServletRequest req) {
return (Integer)(req.getSession().getAttribute("rebase"));
  }

I confess, in preparing this response I noticed that I start sending the first 
lines of the streamed data then set the header as follows:
  response.setHeader("rebaseSegment", "" + getRebase(req));
then the remainder of the stream.  I’ll correct that and see if that plays into 
the behaviour at all.

The isCommitted() will come in handy too.  Thanks for that.

rjs







Re: Again with the missing headers

2021-04-12 Thread Rob Sargent
Thank you. 

Can you suggest a way to confirm the problem is size related? Or are you 
convinced by the numbers shown?

The client is a Java 15 app so there’s a chance I could use trailer headers. 
I’m not explicitly using chunked encoding currently. 

I don’t like the idea of buffering the entire response as this is the part of 
my setup where there are likely thousands of nearly simultaneous requests and 
the server isn’t that beefy. 

And I take it there is no mechanism in tomcat 9 to force the headers out on an 
implicit flush?  Or other mechanism which ensures headers are sent?

I may split the large ones off to a separate endpoint to give those a larger 
buffer. The datum returned in the header is very much tied to the payload. 
Would a multi-part response make sense?  Sticking the datum into the payload 
steam would be very difficult. 

Thanks again for your insights. They are indeed helpful. 

rjs

> On Apr 12, 2021, at 2:16 AM, Mark Thomas  wrote:
> 
> maxHttpHeaderSize only applies to Tomcat reading requests from clients. It 
> has no impact on the headers Tomcat sends to the client.
> 
> Given that the issue is size dependent and the the header is missing only on 
> the larger responses, I would guess that the Servlet is writing the header 
> after the response has been committed in those cases and is, therefore, being 
> lost.
> 
> In HTTP, headers usually come before the body. When generating a response, 
> Tomcat will buffer the response body until either there is an explicit flush 
> or explicit commit or the buffer is full at which point an implicit flush 
> occurs.
> 
> When a flush (implicit or explicit) occurs, if the response is not committed 
> at that point then the response is automatically committed. Committing the 
> response == writing the response headers.
> 
> You typically want to ensure that the Servlet writes all the headers before 
> it writes the response body.
> 
> There are alternative options:
> 1. Use a large enough response buffer to buffer the entire response. Keep in 
> mind you need to have enough free memory for every concurrent request to have 
> a buffer this large whether it uses it or not.
> 
> 2. Servlet 4 (Tomcat 9 onwards) added support for trailer headers (see RFC 
> 7230 section 4.4). These can be used with chunked encoding and allows header 
> values to be written after the response body. You might want to confirm that 
> the client you are using supports trailer headers.
> 
> HTH,
> 
> Mark
> 
> 
>> On 11/04/2021 23:53, Rob Sargent wrote:
>> I should mention that this is entirely on localhost (running linux) and 
>> using https.
>>> On 4/11/21 8:31 AM, Rob Sargent wrote:
>>> Thanks, I’ll go back to reading headers first.
>>> I did not mean to imply the header content differed significantly. The 
>>> header value is always an integer (< 100).
>>> 
>>>> On Apr 10, 2021, at 11:10 PM, Brian Wolfe  wrote:
>>>> 
>>>> So i'm not too familiar with tomcat 9. However, I did notice that
>>>> maxHttpHeaderSize
>>>> default is supposed to be 8KB in 9. That is set on the connector. Which
>>>> affects both request and response headers.
>>>> 
>>>> https://tomcat.apache.org/tomcat-9.0-doc/config/http.html
>>>> 
>>>> Did you try that?
>>>> 
>>>> If i'm not mistaken about a stream of content. the response headers should
>>>> be the first thing that is received by the client. Then the body can be
>>>> split and transmitted along the connection.
>>>> 
>>>>> On Sat, Apr 10, 2021 at 10:06 PM Rob Sargent  
>>>>> wrote:
>>>>> 
>>>>> I saw this mentioned a couple years ago, on tomcat 7, but don't see
>>>>> anything recent on this topic and I'm using 9.0.43.  Of 59 separate
>>>>> requests to same servlet three repeatedly do not have the header entry
>>>>> added by the servlet to the response.  The remaining 56 all have the
>>>>> header/value.  The three consistently lose the header.
>>>>> 
>>>>> Size matters?  The 56 which succeed are on average 203 units in payload
>>>>> size while the bad boys are 7K,10K,13K units. (And I'm guessing about
>>>>> 100 bytes per unit)
>>>>> 
>>>>> The clients streams the payload from the response, and I've tried
>>>>> getting the header both before and after the stream has been read.
>>>>> 
>>>>> Any clues as to where the missing header goes?  Does the servlet not
>>>>> send it or is it in some /other/ response?
>>>>&g

Re: Again with the missing headers

2021-04-11 Thread Rob Sargent
I should mention that this is entirely on localhost (running linux) and 
using https.



On 4/11/21 8:31 AM, Rob Sargent wrote:

Thanks, I’ll go back to reading headers first.
I did not mean to imply the header content differed significantly. The header 
value is always an integer (< 100).


On Apr 10, 2021, at 11:10 PM, Brian Wolfe  wrote:

So i'm not too familiar with tomcat 9. However, I did notice that
maxHttpHeaderSize
default is supposed to be 8KB in 9. That is set on the connector. Which
affects both request and response headers.

https://tomcat.apache.org/tomcat-9.0-doc/config/http.html

Did you try that?

If i'm not mistaken about a stream of content. the response headers should
be the first thing that is received by the client. Then the body can be
split and transmitted along the connection.


On Sat, Apr 10, 2021 at 10:06 PM Rob Sargent  wrote:

I saw this mentioned a couple years ago, on tomcat 7, but don't see
anything recent on this topic and I'm using 9.0.43.  Of 59 separate
requests to same servlet three repeatedly do not have the header entry
added by the servlet to the response.  The remaining 56 all have the
header/value.  The three consistently lose the header.

Size matters?  The 56 which succeed are on average 203 units in payload
size while the bad boys are 7K,10K,13K units. (And I'm guessing about
100 bytes per unit)

The clients streams the payload from the response, and I've tried
getting the header both before and after the stream has been read.

Any clues as to where the missing header goes?  Does the servlet not
send it or is it in some /other/ response?

Thanks,
rjs



--
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/


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





Re: Again with the missing headers

2021-04-11 Thread Rob Sargent
Thanks, I’ll go back to reading headers first. 
I did not mean to imply the header content differed significantly. The header 
value is always an integer (< 100).

> On Apr 10, 2021, at 11:10 PM, Brian Wolfe  wrote:
> 
> So i'm not too familiar with tomcat 9. However, I did notice that
> maxHttpHeaderSize
> default is supposed to be 8KB in 9. That is set on the connector. Which
> affects both request and response headers.
> 
> https://tomcat.apache.org/tomcat-9.0-doc/config/http.html
> 
> Did you try that?
> 
> If i'm not mistaken about a stream of content. the response headers should
> be the first thing that is received by the client. Then the body can be
> split and transmitted along the connection.
> 
>> On Sat, Apr 10, 2021 at 10:06 PM Rob Sargent  wrote:
>> 
>> I saw this mentioned a couple years ago, on tomcat 7, but don't see
>> anything recent on this topic and I'm using 9.0.43.  Of 59 separate
>> requests to same servlet three repeatedly do not have the header entry
>> added by the servlet to the response.  The remaining 56 all have the
>> header/value.  The three consistently lose the header.
>> 
>> Size matters?  The 56 which succeed are on average 203 units in payload
>> size while the bad boys are 7K,10K,13K units. (And I'm guessing about
>> 100 bytes per unit)
>> 
>> The clients streams the payload from the response, and I've tried
>> getting the header both before and after the stream has been read.
>> 
>> Any clues as to where the missing header goes?  Does the servlet not
>> send it or is it in some /other/ response?
>> 
>> Thanks,
>> rjs
>> 
>> 
> 
> -- 
> Thanks,
> Brian Wolfe
> https://www.linkedin.com/in/brian-wolfe-3136425a/


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



Again with the missing headers

2021-04-10 Thread Rob Sargent
I saw this mentioned a couple years ago, on tomcat 7, but don't see 
anything recent on this topic and I'm using 9.0.43.  Of 59 separate 
requests to same servlet three repeatedly do not have the header entry 
added by the servlet to the response.  The remaining 56 all have the 
header/value.  The three consistently lose the header.


Size matters?  The 56 which succeed are on average 203 units in payload 
size while the bad boys are 7K,10K,13K units. (And I'm guessing about 
100 bytes per unit)


The clients streams the payload from the response, and I've tried 
getting the header both before and after the stream has been read.


Any clues as to where the missing header goes?  Does the servlet not 
send it or is it in some /other/ response?


Thanks,
rjs



small error in log documentation

2021-03-15 Thread Rob Sargent
Last sentence of Introduction on 
https://tomcat.apache.org/tomcat-9.0-doc/logging.html


   If it used directly or indirectly by your logging library then
   elements of it will be shared across web applications because it is
   loaded by the system class loader.

I think in needs to be "If it is used"





Re: module muddle

2021-03-15 Thread Rob Sargent
A little late in responding to Mark's questions.  Been on a  short 
walk-about.


On 3/11/21 12:17 PM, Mark Thomas wrote:

On 11/03/2021 19:08, Rob Sargent wrote:
I've started getting this error, though I've been running fine since 
days of "localhost" issue help.


    class org.apache.tomcat.dbcp.dbcp2.BasicDataSource cannot be cast to
    class org.apache.tomcat.jdbc.pool.DataSource
    (org.apache.tomcat.dbcp.dbcp2.BasicDataSource is in unnamed module
    of loader 'app'; org.apache.tomcat.jdbc.pool.DataSource is in
    unnamed module of loader
    org.apache.catalina.loader.ParallelWebappClassLoader @33c9efd6)

I'm most confused by the "'app'" loader.   Who's is that?  I doesn't 
look like a TC thing.  I have a package called "app" which includes 
the main() of my embedded server.


Apologies as I'm not fully up on the modules notion and was 
blissfully getting by without dealing with that.  Until now. You can 
find me over in the Java Organization section of hell.


Which database connection pool do you want to use?

Tomcat's package renamed copy of Apache Commons DBCP
or
Tomcat's own JDBC Pool?

(there isn't much to choose between them these days).

How is the DataSource defined?


My context.xml is as follows

   
  
  
  
   


Do you know what code is triggering the failing cast?


  public DataSource getDataSource(String dbname) {
 DataSource lookupDS = null;
 try {
   InitialContext ic = new InitialContext();
   Context sgsContext  = (Context) ic.lookup("java:/comp/env");
//*** this next line is the cast which blows up.
   lookupDS = (org.apache.tomcat.jdbc.pool.DataSource) 
sgsContext.lookup("jdbc/sgsdb/"+dbname);

 }
 catch (javax.naming.NamingException ne) {
   lookupDS = null;
   log(ne.getMessage()); //TODO
 }
    return lookupDS;
  }



The app loader is one of the class loaders in the standard Java class 
loader hierarchy. I forget the exact details. Google should be able to 
tell you that.

Got it.


Mark

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





module muddle

2021-03-11 Thread Rob Sargent
I've started getting this error, though I've been running fine since 
days of "localhost" issue help.


   class org.apache.tomcat.dbcp.dbcp2.BasicDataSource cannot be cast to
   class org.apache.tomcat.jdbc.pool.DataSource
   (org.apache.tomcat.dbcp.dbcp2.BasicDataSource is in unnamed module
   of loader 'app'; org.apache.tomcat.jdbc.pool.DataSource is in
   unnamed module of loader
   org.apache.catalina.loader.ParallelWebappClassLoader @33c9efd6)

I'm most confused by the "'app'" loader.   Who's is that?  I doesn't 
look like a TC thing.  I have a package called "app" which includes the 
main() of my embedded server.


Apologies as I'm not fully up on the modules notion and was blissfully 
getting by without dealing with that.  Until now.  You can find me over 
in the Java Organization section of hell.


rjs


Re: reload vs restart

2021-03-02 Thread Rob Sargent
Chris,


> On Mar 2, 2021, at 9:46 AM, Christopher Schultz 
>  wrote:
> 
> So you just have a single Tomcat node? Yeah, you are going to want to use 
> parallel deployment unless you can be VERY careful about your JVM restarts.
> 
> You will also need to familiarize yourself with using the Manager application 
> because IIRC old versions of the application will not automatically stop and 
> undeploy once their session-count goes to zero. That means if you leave your 
> server running for 1 month and deploy each week, you'll end up with 4 (or 5) 
> copies of the application in memory, most of which are probably no longer 
> used.
> 
> Login with the Manager to see which ones are no longer used and then simply 
> undeploy them to clean up.
> 
Pretty sure I’ll just be careful about how and when I add new customers.  I’m 
not nearly clever enough to properly implement anything more sophisticated.

Cheers,
rjs



Re: reload vs restart

2021-02-27 Thread Rob Sargent

Chris,
Thank you, yet again.

On 2/26/21 9:31 PM, Christopher Schultz wrote:

Rob,

On 2/26/21 16:47, Rob Sargent wrote:
Given a single webapp, what's the difference between server restart 
and webapp reload in terms of current open sessions?


That depends upon a few things.

If you do not have session-persistence enabled, then you will lose all 
your sessions in either case.


If you do have session-persistence enabled, then reloading your 
application will allow requests arriving for that application during 
the restart to be accepted and wait for the application to become 
available. If, instead, you restart your server (which means 
stopping/starting the JVM, or at least stopping/starting all of the 
Connectors in an embedded scenario), then there will be a period of 
time where clients might receive any number of errors such as 
"connection refused", etc.


I have not, far as I know, enabled session-persistence yet "persistent 
sessions" are sought on starting the JVM so perhaps that's the default mode.
My worry is that I have some rather lengthy data transfers (streamed 
from client to TC) and losing one of those would be a week's worth of 
m5.4xlarge down the drain (unless and until I get the interim/fall-back 
file save working on s3).  So I'm wondering how circumspect I have to be 
on this front.  The only change to the running webapp would be a new db 
resource in the context.xml and a ref to it in the web.xml.   This harks 
back to my "wildly successful" scenario wherein a second customer shows 
up while the first is still running.  Worst comes, I can simply delay 
adding the new customer for a week. (Code changes to the webapp proper 
would be done "between jobs". They get there own database.)


If you are going embedded (which it sounds like you are from other 
recent posts), are you also using a load-balancer and some kind of 
clustering, management, etc? If so, you should be able to configure 
your reverse-proxy/lb to ensure that Tomcat is actually available 
before proxying requests to that node, or failing-over to another node.


If you want true high-availability, you will either want a shared 
session-store (e.g. db, memcached, etc.) or clustering (using Tomcat's 
clustering) in which case restart versus reload doesn't matter much.


No HA, no load balancing in play - not millions of hits, ever.  In it's 
previous incarnation the system used pg-bouncer for connection pooling 
but I think I can live with the TC built-in.


Cheers,
rjs



reload vs restart

2021-02-26 Thread Rob Sargent
Given a single webapp, what's the difference between server restart and 
webapp reload in terms of current open sessions?


Re: embedded: one-liner

2021-02-26 Thread Rob Sargent




On 2/26/21 12:05 PM, Mark Thomas wrote:

On 26/02/2021 18:36, Rob Sargent wrote:
In the absence of anything Catalina, but with true etc/>, is an embedded tomcat able to detect updates to web.xml 
(or context.xml) and reload the app or the resource definitions? 
Hasn't worked for me so far, but still hoping I doing it wrong (as 
usual).




You can configure embedded Tomcat for automatic deployment. Take a 
look at the TestHostConfigAutomaticDeployment test class for inspiration.


Mark



Fun read, thank you!
rjs

-
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



embedded: one-liner

2021-02-26 Thread Rob Sargent
In the absence of anything Catalina, but with etc/>, is an embedded tomcat able to detect updates to web.xml (or 
context.xml) and reload the app or the resource definitions? Hasn't 
worked for me so far, but still hoping I doing it wrong (as usual).


Re: Error = Caused by: java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)

2021-02-19 Thread Rob Sargent
Can you remove IntelliJ from local env?  Much magic in there. 

> On Feb 19, 2021, at 6:14 AM, Ricky Thomas  wrote:
> 
> Thanks.
> I already did that so there is no guava or any other google in tomcat’s lib
> which would collide.
> 
> also as we checked WEB-INF lib there were no dupes.
> 
> we enforced right version of guava, also excluded old dependencies
> 
>> On Fri, 19 Feb 2021, 13:00 Christopher Schultz, <
>> ch...@christopherschultz.net> wrote:
>> 
>> Ricky,
>> 
>>> On 2/19/21 07:55, Ricky Thomas wrote:
>>> Trying to connect our application from Tomcat to Big Query. Same war file
>>> works fine in Jetty.
>>> Tomcat version 9
>>> Grails version 4
>>> BQ driver SimbaJDBCDriverforGoogleBigQuery42_1.2.13.1016
>>> 
>>> Above error usually caused by older version of com.google.guava:guava
>> lib,
>>> so to make sure we have latest/higher we also added entry in build.gradle
>>> compile "com.google.guava:guava:30.1-jre"
>>> 
>>>  On local env (IntelliJ) application works fine and BQ jdbc makes
>>> connection without any issue. When we deploy war file on server we start
>>> getting above error on Big Query database connection.
>>> 
>>> Any ideas?
>> 
>> Check for duplicate JAR files in Tomcat's lib/ versus
>> webapps/yourapp/WEB-INF/lib directories.
>> 
>> Failing that, search your application's JAR files to find out if you
>> have multiple copies of that class hidden somewhere.
>> 
>> With build tools which handle dependencies, it's easy to accidentally
>> include the same thing twice, especially if the packaging of one or more
>> dependencies isn't right.
>> 
>> This can also happen with "fat JARs" where one project distributes a
>> library which includes all of its own dependencies without shading them.
>> Oops.
>> 
>> -chris
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 
> 
> -- 
> 
> 
> 
> 
> Avora Ltd is a company registered in England and Wales. Registered 
> number: 08922902. Registered office: Avora, 38 Chancery Lane, London WC2A 
> 1EN.
> 
> 
> 
> 
> 
> 
> 
> 

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



Re: embedded, not local

2021-02-16 Thread Rob Sargent
Other than the browsers not trusting my self-signed cert I think I'm now 
in the business of impersonation AWS ;)


Thanks to all I've bothered,
rjs

On 2/16/21 7:50 PM, Rob Sargent wrote:

Ah, yes, a stray Constuctor() left lying around.
Thank you!  I am now down to dealing with https mis-configurations, 
which puts me squarely back to the future.


Ever grateful,
rjs

On 2/16/21 3:27 PM, Mark Thomas wrote:
On February 16, 2021 10:00:01 PM UTC, Noelette Stout 
 wrote:

I'm kinda new to this, but it looks like you're trying to start http
and
https on the same port.

Feb 16, 2021 1:06:59 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-nio-16004"]
    Feb 16, 2021 1:06:59 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["https-jsse-nio-16004"]

In my (admittedly limited) experience, they need to be on separate
ports.

+1. That is clearly the problem given those log messages.

Mark

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








Re: embedded, not local

2021-02-16 Thread Rob Sargent

Ah, yes, a stray Constuctor() left lying around.
Thank you!  I am now down to dealing with https mis-configurations, 
which puts me squarely back to the future.


Ever grateful,
rjs

On 2/16/21 3:27 PM, Mark Thomas wrote:

On February 16, 2021 10:00:01 PM UTC, Noelette Stout  
wrote:

I'm kinda new to this, but it looks like you're trying to start http
and
https on the same port.

Feb 16, 2021 1:06:59 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-16004"]
Feb 16, 2021 1:06:59 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["https-jsse-nio-16004"]

In my (admittedly limited) experience, they need to be on separate
ports.

+1. That is clearly the problem given those log messages.

Mark

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





  1   2   >