Re: Installing Jenkins (WAR) on Tomcat - Corrupts SMTP / Email for Java Apps

2022-04-01 Thread Konstantin Kolinko
чт, 31 мар. 2022 г. в 23:46, Decker, Richard :
>
> Tomcat Users,
>
> Sorry if this is a bit off base, but does anyone have experience with this 
> unusual problem? As soon as I uninstall Jenkins (& restart tomcat), I can 
> send java emails just fine through Tomcat. When I load the Jenkins war it 
> breaks emails being sent immediately, by our other installed (custom) java 
> apps in Tomcat. This server has been around for 6+ years, and the problem 
> just starting occurring on Jan 24th of this year, without me knowing what 
> changed. Looking at the smtp logs, it corrupts the mail before it leaves the 
> system, before it hits the mail server. Replacing the original message with 
> garbage like this example below:
>
>
> --=_Part_3_1832428443.1648744184783--
>

I do not understand your example. (If there was an image, images are
not allowed and are stripped by a mailing list server).

The above line is a valid delimiter for parts of a mime multipart
message. It ends with "--", so it is the final delimiter that ends the
message.


>
> Curiously when I deleted the 'work' dir under tomcat it temporarily solved 
> the problem, allowing emails to be sent properly/correctly, but email 
> eventually became corrupt again, just hours later, and deletion of the 'work' 
> dir does nothing now (tried many times). I removed every mail related plugin 
> in the .jenkins install dir, thinking the JVM was being corrupted with 
> multiple java mail files, with no success/luck on the email send. Searched 
> through the markmail archive, Jenkins forum, and google with nothing really 
> matching the described issue.
>
>
> Env: Oracle Linux 7.9
> Tomcat: 8.5.72  (tried with 8.5.65, when I know it was working)
> Java: jdk1.8.0_311  (tried with 281, when I know it was working)
> Apr: 1.7.0
> Apr-util: 1.6.1
> Openssl: 1.1.1l
> tomcat-native: 1.2.31-src
> Jenkins: 2.332.1 LTS (tried several / various previous versions that I know 
> worked)
> Postfix: 2.10.1-9.el7.x86_64
> Mail Jar: javax.mail-1.6.2.jar

Does every web application come with its own copy of
"javax.mail-1.6.2.jar", or the same library is shared by several web
applications? Sharing can result in side effects.

1. I think that when something weird happens but you can reproduce it,
the fastest way is to try remote debugging. If Tomcat has been started
with certain options you can attach a remote debugger. See

https://cwiki.apache.org/confluence/display/TOMCAT/Debugging
https://cwiki.apache.org/confluence/display/TOMCAT/Developing#Developing-Q1

Also do not forget to look for any strange errors in the log files.

2. When a library is shared by web applications, side effects are
related to the broken life cycle of that library. Essentially they are
likely to lead to a "Perm Gen memory leak".

If you are new to this, it may be hard to explain, but some info is at
https://cwiki.apache.org/confluence/display/TOMCAT/MemoryLeakProtection#MemoryLeakProtection-LogFactory
and there are some presentations at
https://tomcat.apache.org/presentations.html

3.  A web application may illegally call System.setProperty() and thus
affect global configuration. I saw some libraries doing so.

Best regards,
Konstantin Kolinko

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



Installing Jenkins (WAR) on Tomcat - Corrupts SMTP / Email for Java Apps

2022-03-31 Thread Decker, Richard
Tomcat Users,

Sorry if this is a bit off base, but does anyone have experience with this 
unusual problem? As soon as I uninstall Jenkins (& restart tomcat), I can send 
java emails just fine through Tomcat. When I load the Jenkins war it breaks 
emails being sent immediately, by our other installed (custom) java apps in 
Tomcat. This server has been around for 6+ years, and the problem just starting 
occurring on Jan 24th of this year, without me knowing what changed. Looking at 
the smtp logs, it corrupts the mail before it leaves the system, before it hits 
the mail server. Replacing the original message with garbage like this example 
below:


--=_Part_3_1832428443.1648744184783--


Curiously when I deleted the 'work' dir under tomcat it temporarily solved the 
problem, allowing emails to be sent properly/correctly, but email eventually 
became corrupt again, just hours later, and deletion of the 'work' dir does 
nothing now (tried many times). I removed every mail related plugin in the 
.jenkins install dir, thinking the JVM was being corrupted with multiple java 
mail files, with no success/luck on the email send. Searched through the 
markmail archive, Jenkins forum, and google with nothing really matching the 
described issue.


Env: Oracle Linux 7.9
Tomcat: 8.5.72  (tried with 8.5.65, when I know it was working)
Java: jdk1.8.0_311  (tried with 281, when I know it was working)
Apr: 1.7.0
Apr-util: 1.6.1
Openssl: 1.1.1l
tomcat-native: 1.2.31-src
Jenkins: 2.332.1 LTS (tried several / various previous versions that I know 
worked)
Postfix: 2.10.1-9.el7.x86_64
Mail Jar: javax.mail-1.6.2.jar


V/R,