[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

--- Comment #8 from Norimasa Yamamoto  ---
I made a new Windows 7 using Tomcat 7.0.96 x86/x64 service installer
and AdoptOpenJDK x86. It worked fine.

Next, I checked Tomcat7.exe arch.
I download from prunsrv.exe from Apache commons daemon
and to rename/replace them to installed Tomcat7.exe.
using x86 prunsrv.exe : OK
using x64 prunsrv.exe : NG (0xc005, like as this issue)

I think the NG machine was installed Tomcat7.exe x64 even if Java x86
installed directory was selected while Tomcat 7.0.96 installing.
But I don't know why it was occured.
I'll more test on next Monday on the NG machine.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Include failed TLS handshakes in the access log

2019-08-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new c692f6b  Include failed TLS handshakes in the access log
c692f6b is described below

commit c692f6b2646fbdad71c00694ff7a98ab19437376
Author: Mark Thomas 
AuthorDate: Wed Jul 31 16:49:35 2019 +0100

Include failed TLS handshakes in the access log

Failed TLS handshakes are logged with the following information:
- status 400
- start time close to the connection failure
- duration 0

All other fields apart from network related fields (e.g. IP address etc)
obtained from the SocketWrapper are empty.
---
 java/org/apache/coyote/AbstractProcessor.java   | 17 -
 java/org/apache/coyote/AbstractProcessorLight.java  | 17 -
 java/org/apache/coyote/http11/Http11Processor.java  | 10 --
 java/org/apache/coyote/http2/Http2UpgradeHandler.java   |  1 +
 java/org/apache/tomcat/util/net/AprEndpoint.java|  2 ++
 java/org/apache/tomcat/util/net/Nio2Endpoint.java   |  1 +
 java/org/apache/tomcat/util/net/NioEndpoint.java|  1 +
 java/org/apache/tomcat/util/net/SocketEvent.java| 11 ++-
 .../tomcat/websocket/server/WsHttpUpgradeHandler.java   |  1 +
 .../http11/upgrade/TestUpgradeInternalHandler.java  |  1 +
 webapps/docs/changelog.xml  |  4 
 11 files changed, 61 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index 9af075b..3e73254 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -162,7 +162,7 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
  * Set the socket wrapper being used.
  * @param socketWrapper The socket wrapper
  */
-protected final void setSocketWrapper(SocketWrapperBase socketWrapper) {
+protected void setSocketWrapper(SocketWrapperBase socketWrapper) {
 this.socketWrapper = socketWrapper;
 }
 
@@ -922,6 +922,7 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
  */
 protected abstract boolean flushBufferedWrite() throws IOException ;
 
+
 /**
  * Perform any necessary clean-up processing if the dispatch resulted in 
the
  * completion of processing for the current request.
@@ -933,4 +934,18 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
  * request
  */
 protected abstract SocketState dispatchEndRequest() throws IOException;
+
+
+@Override
+protected final void logAccess(SocketWrapperBase socketWrapper) throws 
IOException {
+// Set the socket wrapper so the access log can read the socket related
+// information (e.g. client IP)
+setSocketWrapper(socketWrapper);
+// Setup the minimal request information
+request.setStartTime(System.currentTimeMillis());
+// Setup the minimal response information
+response.setStatus(400);
+response.setError();
+getAdapter().log(request, response, 0);
+}
 }
diff --git a/java/org/apache/coyote/AbstractProcessorLight.java 
b/java/org/apache/coyote/AbstractProcessorLight.java
index 7a46c79..7d0b6e0 100644
--- a/java/org/apache/coyote/AbstractProcessorLight.java
+++ b/java/org/apache/coyote/AbstractProcessorLight.java
@@ -62,8 +62,10 @@ public abstract class AbstractProcessorLight implements 
Processor {
 } else if (status == SocketEvent.OPEN_WRITE) {
 // Extra write event likely after async, ignore
 state = SocketState.LONG;
-} else if (status == SocketEvent.OPEN_READ){
+} else if (status == SocketEvent.OPEN_READ) {
 state = service(socketWrapper);
+} else if (status == SocketEvent.CONNECT_FAIL) {
+logAccess(socketWrapper);
 } else {
 // Default to closing the socket if the SocketEvent passed in
 // is not consistent with the current state of the Processor
@@ -130,6 +132,19 @@ public abstract class AbstractProcessorLight implements 
Processor {
 
 
 /**
+ * Add an entry to the access log for a failed connection attempt.
+ *
+ * @param socketWrapper The connection to process
+ *
+ * @throws IOException If an I/O error occurs during the processing of the
+ * request
+ */
+protected void logAccess(SocketWrapperBase socketWrapper) throws 
IOException {
+// NO-OP by default
+}
+
+
+/**
  * Service a 'standard' HTTP request. This method is called for both new
  * requests and for requests that have partially read the HTTP request line
  * or HTTP 

[tomcat] branch master updated: Include failed TLS handshakes in the access log

2019-08-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new acf6076  Include failed TLS handshakes in the access log
acf6076 is described below

commit acf6076d7118571ebc881984b96792f861b72bb2
Author: Mark Thomas 
AuthorDate: Wed Jul 31 16:49:35 2019 +0100

Include failed TLS handshakes in the access log

Failed TLS handshakes are logged with the following information:
- status 400
- start time close to the connection failure
- duration 0

All other fields apart from network related fields (e.g. IP address etc)
obtained from the SocketWrapper are empty.
---
 java/org/apache/coyote/AbstractProcessor.java   | 17 -
 java/org/apache/coyote/AbstractProcessorLight.java  | 17 -
 java/org/apache/coyote/http11/Http11Processor.java  | 10 --
 java/org/apache/coyote/http2/Http2UpgradeHandler.java   |  1 +
 java/org/apache/tomcat/util/net/AprEndpoint.java|  2 ++
 java/org/apache/tomcat/util/net/Nio2Endpoint.java   |  1 +
 java/org/apache/tomcat/util/net/NioEndpoint.java|  1 +
 java/org/apache/tomcat/util/net/SocketEvent.java| 11 ++-
 .../tomcat/websocket/server/WsHttpUpgradeHandler.java   |  1 +
 .../http11/upgrade/TestUpgradeInternalHandler.java  |  1 +
 webapps/docs/changelog.xml  |  4 
 11 files changed, 61 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java 
b/java/org/apache/coyote/AbstractProcessor.java
index e7909ba..d94a8e4 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -149,7 +149,7 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
  * Set the socket wrapper being used.
  * @param socketWrapper The socket wrapper
  */
-protected final void setSocketWrapper(SocketWrapperBase socketWrapper) {
+protected void setSocketWrapper(SocketWrapperBase socketWrapper) {
 this.socketWrapper = socketWrapper;
 }
 
@@ -944,6 +944,7 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
  */
 protected abstract boolean flushBufferedWrite() throws IOException ;
 
+
 /**
  * Perform any necessary clean-up processing if the dispatch resulted in 
the
  * completion of processing for the current request.
@@ -955,4 +956,18 @@ public abstract class AbstractProcessor extends 
AbstractProcessorLight implement
  * request
  */
 protected abstract SocketState dispatchEndRequest() throws IOException;
+
+
+@Override
+protected final void logAccess(SocketWrapperBase socketWrapper) throws 
IOException {
+// Set the socket wrapper so the access log can read the socket related
+// information (e.g. client IP)
+setSocketWrapper(socketWrapper);
+// Setup the minimal request information
+request.setStartTime(System.currentTimeMillis());
+// Setup the minimal response information
+response.setStatus(400);
+response.setError();
+getAdapter().log(request, response, 0);
+}
 }
diff --git a/java/org/apache/coyote/AbstractProcessorLight.java 
b/java/org/apache/coyote/AbstractProcessorLight.java
index 7a46c79..7d0b6e0 100644
--- a/java/org/apache/coyote/AbstractProcessorLight.java
+++ b/java/org/apache/coyote/AbstractProcessorLight.java
@@ -62,8 +62,10 @@ public abstract class AbstractProcessorLight implements 
Processor {
 } else if (status == SocketEvent.OPEN_WRITE) {
 // Extra write event likely after async, ignore
 state = SocketState.LONG;
-} else if (status == SocketEvent.OPEN_READ){
+} else if (status == SocketEvent.OPEN_READ) {
 state = service(socketWrapper);
+} else if (status == SocketEvent.CONNECT_FAIL) {
+logAccess(socketWrapper);
 } else {
 // Default to closing the socket if the SocketEvent passed in
 // is not consistent with the current state of the Processor
@@ -130,6 +132,19 @@ public abstract class AbstractProcessorLight implements 
Processor {
 
 
 /**
+ * Add an entry to the access log for a failed connection attempt.
+ *
+ * @param socketWrapper The connection to process
+ *
+ * @throws IOException If an I/O error occurs during the processing of the
+ * request
+ */
+protected void logAccess(SocketWrapperBase socketWrapper) throws 
IOException {
+// NO-OP by default
+}
+
+
+/**
  * Service a 'standard' HTTP request. This method is called for both new
  * requests and for requests that have partially read the HTTP request line
  * or HTTP 

[GitHub] [tomcat] michael-o opened a new pull request #184: BZ 63627: Implement more fine-grained handling in RealmBase#authenticate(GSSContext, boolean)

2019-08-02 Thread GitBox
michael-o opened a new pull request #184: BZ 63627: Implement more fine-grained 
handling in RealmBase#authenticate(GSSContext, boolean)
URL: https://github.com/apache/tomcat/pull/184
 
 
   Tests are pending, but I don't expect any related failures here.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[tomcat] 01/01: BZ 63627: Implement more fine-grained handling in RealmBase#authenticate(GSSContext, boolean)

2019-08-02 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch BZ-63627/tomcat-9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit feabfd9554f115e3892aa179231039e0ca714079
Author: Michael Osipov 
AuthorDate: Fri Aug 2 14:09:02 2019 +0200

BZ 63627: Implement more fine-grained handling in 
RealmBase#authenticate(GSSContext, boolean)
---
 .../apache/catalina/realm/LocalStrings.properties  |  3 ++-
 java/org/apache/catalina/realm/RealmBase.java  | 31 +-
 webapps/docs/changelog.xml |  4 +++
 3 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/java/org/apache/catalina/realm/LocalStrings.properties 
b/java/org/apache/catalina/realm/LocalStrings.properties
index a390fb5..1cb2407 100644
--- a/java/org/apache/catalina/realm/LocalStrings.properties
+++ b/java/org/apache/catalina/realm/LocalStrings.properties
@@ -102,7 +102,8 @@ realmBase.cannotGetRoles=Cannot get roles from principal 
[{0}]
 realmBase.createUsernameRetriever.ClassCastException=Class [{0}] is not an 
X509UsernameRetriever.
 realmBase.createUsernameRetriever.newInstance=Cannot create object of type 
[{0}].
 realmBase.credentialHandler.customCredentialHandler=Unable to set the property 
[{0}] to value [{1}] as a custom CredentialHandler has been configured
-realmBase.delegatedCredentialFail=Unable to obtain delegated credentials for 
user [{0}]
+realmBase.delegatedCredentialFail=Unable to obtain delegated credential for 
user [{0}]
+realmBase.credentialNotDelegated=Credential for user [{0}] has not been 
delegated though storing was requested
 realmBase.digest=Error digesting user credentials
 realmBase.forbidden=Access to the requested resource has been denied
 realmBase.gotX509Username=Got user name from X509 certificate: [{0}]
diff --git a/java/org/apache/catalina/realm/RealmBase.java 
b/java/org/apache/catalina/realm/RealmBase.java
index 3fde57c..0a0792a 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -480,27 +480,32 @@ public abstract class RealmBase extends 
LifecycleMBeanBase implements Realm {
 }
 
 if (gssName!= null) {
+GSSCredential gssCredential = null;
+if (storeCreds) {
+if (gssContext.getCredDelegState()) {
+try {
+gssCredential = gssContext.getDelegCred();
+} catch (GSSException e) {
+log.warn(sm.getString(
+"realmBase.delegatedCredentialFail", 
gssName), e);
+}
+} else {
+if (log.isDebugEnabled()) {
+log.debug(sm.getString(
+"realmBase.credentialNotDelegated", 
gssName));
+}
+}
+}
+
 String name = gssName.toString();
 
 if (isStripRealmForGss()) {
 int i = name.indexOf('@');
 if (i > 0) {
-// Zero so we don;t leave a zero length name
+// Zero so we don't leave a zero length name
 name = name.substring(0, i);
 }
 }
-GSSCredential gssCredential = null;
-if (storeCreds && gssContext.getCredDelegState()) {
-try {
-gssCredential = gssContext.getDelegCred();
-} catch (GSSException e) {
-if (log.isDebugEnabled()) {
-log.debug(sm.getString(
-"realmBase.delegatedCredentialFail", name),
-e);
-}
-}
-}
 return getPrincipal(name, gssCredential);
 }
 } else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2393a89..6c58399 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -47,6 +47,10 @@
 
   
 
+  
+63627: Implement more fine-grained handling in
+RealmBase.authenticate(GSSContext, boolean). (michaelo)
+  
   
 62496: Add option to write auth information (remote 
user/auth type)
 to response headers. (michaelo)


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



[tomcat] branch BZ-63627/tomcat-9.0.x created (now feabfd9)

2019-08-02 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch BZ-63627/tomcat-9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


  at feabfd9  BZ 63627: Implement more fine-grained handling in 
RealmBase#authenticate(GSSContext, boolean)

This branch includes the following new commits:

 new feabfd9  BZ 63627: Implement more fine-grained handling in 
RealmBase#authenticate(GSSContext, boolean)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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



[Bug 63627] New: Implement more fine-grained handling in RealmBase#authenticate(GSSContext, boolean)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63627

Bug ID: 63627
   Summary: Implement more fine-grained handling in
RealmBase#authenticate(GSSContext, boolean)
   Product: Tomcat 8
   Version: 8.5.x-trunk
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: micha...@apache.org
  Target Milestone: 

We maintain a custom RealmBase#authenticate(GSSContext, boolean) implementation
because the given one as a few shortcomings I'd like to address this in a PR:

* Move stripping right before #getPrincipal() to log a fully qualified GSS name
* Issue a warning instead of a debug if #getDelegCred() has failed.
Justification: the context indicates that there is a credential and the
developer has configured to store them, but this failed. A debug will be
unnoticed in a production system. The admin should see this and take action.
* If storeCreds is requested, but the credentials arent't log this in debug for
traceability.

Custom impl:
http://tomcatspnegoad.sourceforge.net/xref/net/sf/michaelo/tomcat/realm/ActiveDirectoryRealm.html#L229

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #7 from Mark Thomas  ---
This works for me on a clean Windows 7 SP1 x64 install with AdoptOpenJDK
1.8u222-b10

You appear to be using a 32-bit JVM. Make sure you are using the 32-bit version
of tomcat7.exe

Also, make sure you have applied all currently available updates from Windows
update.

At this point it looks like an environmental issue rather than a Tomcat bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

--- Comment #6 from Norimasa Yamamoto  ---
Also Adopt OpenJDK hotspot 12.0.2 was crashed.

java -version
openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.2+10)
OpenJDK Client VM AdoptOpenJDK (build 12.0.2+10, mixed mode)

No more latest version were released at this moment.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

--- Comment #5 from Norimasa Yamamoto  ---
Also Adopt OpenJDK hotspot 11.0.4 was crashed.

java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK Client VM AdoptOpenJDK (build 11.0.4+11, mixed mode)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

--- Comment #4 from Norimasa Yamamoto  ---
Also latest Java 8u221 was crashed.

java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) Client VM (build 25.221-b11, mixed mode)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

--- Comment #3 from Michael Osipov  ---
(In reply to Norimasa Yamamoto from comment #2)
> Created attachment 36699 [details]
> appcrash_tomcat7.7z
> 
> - Windows
> Windows 7 Professional
> Microsoft Windows
> Version 6.1 (build 7601: Service Pack 1)
> 
> Microsoft Windows [Version 6.1.7601]
> 
> - java -version
> java version "1.8.0_151"
> Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
> Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode)
> 
> - Additional : WER
> attached "appcrash_tomcat7.7z"

You should try a newer Java version first...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

--- Comment #2 from Norimasa Yamamoto  ---
Created attachment 36699
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36699=edit
appcrash_tomcat7.7z

- Windows
Windows 7 Professional
Microsoft Windows
Version 6.1 (build 7601: Service Pack 1)

Microsoft Windows [Version 6.1.7601]

- java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode)

- Additional : WER
attached "appcrash_tomcat7.7z"

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/02: Align with 8.5.x.

2019-08-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 9bc20a26655809be0af2d93f840baacb6e4b2225
Author: Mark Thomas 
AuthorDate: Fri Aug 2 10:04:07 2019 +0100

Align with 8.5.x.
---
 test/org/apache/catalina/startup/TestListener.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestListener.java 
b/test/org/apache/catalina/startup/TestListener.java
index 3d873e3..cfd62b7 100644
--- a/test/org/apache/catalina/startup/TestListener.java
+++ b/test/org/apache/catalina/startup/TestListener.java
@@ -31,7 +31,7 @@ import org.apache.catalina.Context;
 
 public class TestListener extends TomcatBaseTest {
 
-/**
+/*
  * Check that a ServletContainerInitializer can install a
  * {@link ServletContextListener} and that it gets initialized.
  * @throws Exception
@@ -48,9 +48,9 @@ public class TestListener extends TomcatBaseTest {
 Assert.assertTrue(SCL.initialized);
 }
 
-/**
+/*
  * Check that a {@link ServletContextListener} cannot install a
- * {@link javax.servlet.ServletContainerInitializer}.
+ * {@link ServletContainerInitializer}.
  * @throws Exception
  */
 @Test


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



[tomcat] branch 7.0.x updated (8b191b5 -> 081614d)

2019-08-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 8b191b5  Only decode in standard mode.
 new 9bc20a2  Align with 8.5.x.
 new 081614d  Fix Javadcoc warning

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 test/org/apache/catalina/startup/TestListener.java   | 6 +++---
 test/org/apache/catalina/startup/TesterServletEncodeUrl.java | 8 
 2 files changed, 7 insertions(+), 7 deletions(-)


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



[tomcat] 02/02: Fix Javadcoc warning

2019-08-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 081614d12719a1eea01ce593c25978fe4e48ab14
Author: Mark Thomas 
AuthorDate: Fri Aug 2 10:04:21 2019 +0100

Fix Javadcoc warning
---
 test/org/apache/catalina/startup/TesterServletEncodeUrl.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/org/apache/catalina/startup/TesterServletEncodeUrl.java 
b/test/org/apache/catalina/startup/TesterServletEncodeUrl.java
index dd8429e..895e5bb 100644
--- a/test/org/apache/catalina/startup/TesterServletEncodeUrl.java
+++ b/test/org/apache/catalina/startup/TesterServletEncodeUrl.java
@@ -34,10 +34,10 @@ public class TesterServletEncodeUrl extends HttpServlet {
 
 /**
  * Almost minimal processing for a servlet.
- *
- * @param nextUrl The url the caller would like to go to next. If
- *supplied, put an encoded url into the returned
- *html page as a hyperlink.
+ * 
+ * The request parameter nextUrl specifies the url to which 
the
+ * caller would like to go next. If supplied, put an encoded url into the
+ * returned html page as a hyperlink.
  */
 @Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp)


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



[tomcat] branch 8.5.x updated: Simplify test. Correct comments.

2019-08-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new d176d48  Simplify test. Correct comments.
d176d48 is described below

commit d176d488c3c7e5653601dc25e846b50a836473f8
Author: Mark Thomas 
AuthorDate: Fri Aug 2 10:03:38 2019 +0100

Simplify test. Correct comments.
---
 test/org/apache/catalina/startup/TestListener.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestListener.java 
b/test/org/apache/catalina/startup/TestListener.java
index a7b1c38..cfd62b7 100644
--- a/test/org/apache/catalina/startup/TestListener.java
+++ b/test/org/apache/catalina/startup/TestListener.java
@@ -40,8 +40,8 @@ public class TestListener extends TomcatBaseTest {
 public void testServletContainerInitializer() throws Exception {
 Tomcat tomcat = getTomcatInstance();
 
-Context context = tomcat.addContext("",
-System.getProperty("java.io.tmpdir"));
+// No file system docBase required
+Context context = tomcat.addContext("", null);
 
 context.addServletContainerInitializer(new SCI(), null);
 tomcat.start();
@@ -57,15 +57,15 @@ public class TestListener extends TomcatBaseTest {
 public void testServletContextListener() throws Exception {
 Tomcat tomcat = getTomcatInstance();
 
-Context context = tomcat.addContext("",
-System.getProperty("java.io.tmpdir"));
+// No file system docBase required
+Context context = tomcat.addContext("", null);
 
 // SCL2 pretends to be in web.xml, and tries to install a
-// ServletContextInitializer.
+// ServletContainerInitializer.
 context.addApplicationListener(SCL2.class.getName());
 tomcat.start();
 
-//check that the ServletContextInitializer wasn't initialized.
+//check that the ServletContainerInitializer wasn't initialized.
 Assert.assertFalse(SCL3.initialized);
 }
 


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



[tomcat] branch master updated: Simplify test. Correct comments.

2019-08-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 22301d2  Simplify test. Correct comments.
22301d2 is described below

commit 22301d2a82dfe4acd872e56c27270ed06991f4e6
Author: Mark Thomas 
AuthorDate: Fri Aug 2 10:03:16 2019 +0100

Simplify test. Correct comments.
---
 test/org/apache/catalina/startup/TestListener.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/startup/TestListener.java 
b/test/org/apache/catalina/startup/TestListener.java
index 0d90d8e..c1c4d4f 100644
--- a/test/org/apache/catalina/startup/TestListener.java
+++ b/test/org/apache/catalina/startup/TestListener.java
@@ -40,8 +40,8 @@ public class TestListener extends TomcatBaseTest {
 public void testServletContainerInitializer() throws Exception {
 Tomcat tomcat = getTomcatInstance();
 
-Context context = tomcat.addContext("",
-System.getProperty("java.io.tmpdir"));
+// No file system docBase required
+Context context = tomcat.addContext("", null);
 
 context.addServletContainerInitializer(new SCI(), null);
 tomcat.start();
@@ -57,15 +57,15 @@ public class TestListener extends TomcatBaseTest {
 public void testServletContextListener() throws Exception {
 Tomcat tomcat = getTomcatInstance();
 
-Context context = tomcat.addContext("",
-System.getProperty("java.io.tmpdir"));
+// No file system docBase required
+Context context = tomcat.addContext("", null);
 
 // SCL2 pretends to be in web.xml, and tries to install a
-// ServletContextInitializer.
+// ServletContainerInitializer.
 context.addApplicationListener(SCL2.class.getName());
 tomcat.start();
 
-//check that the ServletContextInitializer wasn't initialized.
+//check that the ServletContainerInitializer wasn't initialized.
 Assert.assertFalse(SCL3.initialized);
 }
 


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



[GitHub] [tomcat] rmannibucau opened a new pull request #183: preload driver in connection pool

2019-08-02 Thread GitBox
rmannibucau opened a new pull request #183: preload driver in connection pool
URL: https://github.com/apache/tomcat/pull/183
 
 
   share it for all connections to not have mixed connections (multiple driver 
instances when fallbacking on TCCL)
   
   Side note: the setters of DataSource(Proxy) should likely recreate the pool 
when called, not sure it is not already the case but looks fishy so a follow up 
issue can be needed


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



Re: PooledConnection#connectUsingDriver, Thread.currentThread().getContextClassLoader() is null

2019-08-02 Thread Romain Manni-Bucau
Finally managed to reproduce it in a test:
https://github.com/apache/tomcat/pull/183

Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le mar. 30 juil. 2019 à 14:21, Romain Manni-Bucau  a
écrit :

> Yes, got caught by PooledConnection.class.getClassLoader() which tries to
> load the driver from tomcat/lib first (common.loader actually) so if you
> put your driver there it will work in your case. Stays the bug when the
> driver is only in the webapp.
>
>
> Romain Manni-Bucau
> @rmannibucau  |  Blog
>  | Old Blog
>  | Github
>  | LinkedIn
>  | Book
> 
>
>
> Le mar. 30 juil. 2019 à 13:30, Clemens Wyss DEV  a
> écrit :
>
>> > recent tomcat version
>>
>> 9.0.22 has the same class loading code as 8.5.35
>>
>>
>> https://jar-download.com/artifacts/org.apache.tomcat/tomcat-jdbc/9.0.22/source-code/org/apache/tomcat/jdbc/pool/PooledConnection.java
>>
>> driver = (java.sql.Driver)
>>
>> ClassLoaderUtil.*loadClass*(
>>
>> poolProperties.getDriverClassName(),
>>
>> PooledConnection.*class*.getClassLoader(),
>>
>> Thread.*currentThread*
>> ().getContextClassLoader()
>>
>> ).getConstructor().newInstance();
>>
>>
>>
>>
>>
>> *Von:* Romain Manni-Bucau 
>> *Gesendet:* Montag, 29. Juli 2019 09:35
>> *An:* Tomcat Developers List 
>> *Betreff:* Re: PooledConnection#connectUsingDriver,
>> Thread.currentThread().getContextClassLoader() is null
>>
>>
>>
>> Can you give a try on a more recent tomcat version? Seems it works with
>> master version since the tomcat-jdbc module classloader is tried first
>> before the tccl?
>>
>> Tested with:
>>
>>
>>
>> *public class *PooledConnectionTest {
>> @Test
>> *public void *avoidNPEWhenTcclIsNull() *throws *SQLException {
>> *final *PoolProperties poolProperties = *new *PoolProperties();
>> poolProperties.setDriverClassName(*"org.h2.Driver"*);
>> poolProperties.setUsername(*"sa"*);
>> poolProperties.setPassword(*""*);
>> 
>> poolProperties.setUrl(*"jdbc:h2:mem:PooledConnectionTest_avoidNPEWhenTcclIsNull"*);
>> poolProperties.setMaxIdle(1);
>> poolProperties.setMinIdle(1);
>> poolProperties.setInitialSize(1);
>> poolProperties.setMaxActive(1);
>>
>> ensureDataSourceIsValid(poolProperties);
>>
>> *final *Thread thread = Thread.*currentThread*();
>> *final *ClassLoader testLoader = thread.getContextClassLoader();
>> thread.setContextClassLoader(*null*);
>> *try *{
>> ensureDataSourceIsValid(poolProperties);
>> } *finally *{
>> thread.setContextClassLoader(testLoader);
>> }
>> }
>>
>> *private void *ensureDataSourceIsValid(*final *PoolProperties 
>> poolProperties) *throws *SQLException {
>> *final *DataSource dataSource = *new *DataSource(poolProperties);
>> *try *(*final *Connection connection = dataSource.getConnection()) {
>> *assertTrue*(connection.isValid(5));
>> } *finally *{
>> dataSource.close();
>> }
>> }
>> }
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau  |  Blog
>>  | Old Blog
>>  | Github
>>  | LinkedIn
>>  | Book
>> 
>>
>>
>>
>>
>>
>> Le lun. 29 juil. 2019 à 07:36, Clemens Wyss DEV  a
>> écrit :
>>
>> https://bz.apache.org/bugzilla/show_bug.cgi?id=63612
>>
>>
>> > with a small project reproducing it?
>>
>> Unfortunately not easily extractable/reproducible
>>
>> Maybe :
>>
>> th = new Thread() {
>> @Override
>>
>> public void run() {
>> « do something that requires a connection from the pool »
>>
>> }
>> } ;
>> th.set getContextClassLoader( null ) ;
>> th.run() ;
>>
>>
>>
>> *Von:* Romain Manni-Bucau 
>> *Gesendet:* Donnerstag, 25. Juli 2019 08:06
>> *An:* Tomcat Developers List 
>> *Betreff:* Re: PooledConnection#connectUsingDriver,
>> Thread.currentThread().getContextClassLoader() is null
>>
>>
>>
>>
>>
>> Le jeu. 25 juil. 2019 à 07:46, Clemens Wyss DEV  a
>> écrit :
>>
>> < mais c'était rapide  >
>> >+1
>> should/can I file a bug?
>>
>>
>>
>> Guess so, with a small project reproducing it?
>>
>>
>>
>>
>> > init at bootstrap the 

[GitHub] [tomcat] bkiselka commented on issue #139: service.bat handles changed Service at installation

2019-08-02 Thread GitBox
bkiselka commented on issue #139: service.bat handles changed Service at 
installation
URL: https://github.com/apache/tomcat/pull/139#issuecomment-517606070
 
 
   Sorry that I had no time to tackle your proposed changes from 9 Apr for the 
installation from zip file via batch file.
   All your proposed changes from 30 July sound reasonable and clear to me (no 
objections!) and are necessary to solve the issue.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[Bug 63625] Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

Mark Thomas  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from Mark Thomas  ---
Please provide full version information for:
- Windows (winver or systeminfo)
- Java (java -version)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63625] New: Unable to start Tomcat 7.0.96 (stop by 0xc0000005)

2019-08-02 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63625

Bug ID: 63625
   Summary: Unable to start Tomcat 7.0.96 (stop by 0xc005)
   Product: Tomcat 7
   Version: 7.0.96
  Hardware: PC
Status: NEW
  Severity: critical
  Priority: P2
 Component: Packaging
  Assignee: dev@tomcat.apache.org
  Reporter: nor...@sainet.or.jp
  Target Milestone: ---

Unable to start Tomcat 7.0.96 on Windows 7.
0xc005 Error by Tomcat7.exe.

Tomcat 7.0.96 changed Tomcat7.exe version 1.2.0.0.
When I replaced Tomcat7.exe to version 1.1.0.0 (used Tomcat 7.0.94),
Tomcat 7.0.96 works fine.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org