[tomcat] branch main updated: Add UserDatabase documentation

2021-08-27 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 0c1915d  Add UserDatabase documentation
0c1915d is described below

commit 0c1915dd188bc0180cbc918cdc3cba8d40fa7e6d
Author: remm 
AuthorDate: Fri Aug 27 09:56:32 2021 +0200

Add UserDatabase documentation
---
 webapps/docs/jndi-resources-howto.xml | 204 +-
 1 file changed, 202 insertions(+), 2 deletions(-)

diff --git a/webapps/docs/jndi-resources-howto.xml 
b/webapps/docs/jndi-resources-howto.xml
index 3888eaa..c3574c7 100644
--- a/webapps/docs/jndi-resources-howto.xml
+++ b/webapps/docs/jndi-resources-howto.xml
@@ -427,14 +427,14 @@ public class MyBean2 {
   
 
 
-  
+  
 
 0.  Introduction
 
 UserDatabase resources are typically configured as global resources for
 use by a UserDatabase realm. Tomcat includes a UserDatabaseFactory that
 creates UserDatabase resources backed by an XML file - usually
-tomcat-users.xml
+tomcat-users.xml.
 
 The steps required to set up a global UserDatabase resource are 
described
 below.
@@ -495,6 +495,206 @@ public class MyBean2 {
   
 
 
+  
+
+0.  Introduction
+
+Tomcat also include a UserDatabase that uses a
+DataSource resource as the backend. The backend resource
+must be declared in the same JNDI context as the user database that will 
use
+it.
+
+The steps required to set up a global UserDatabase resource are 
described
+below.
+
+1. Database schema
+
+The database shema for the user database is flexible. It can be the same
+as the schema used for the DataSourceRealm, with only a table
+for users (user name, password), and another one listing the roles
+associated with each user. To support the full UserDatabase
+features, it must include additional tables for groups, and is
+compatible with referential integrity between users, groups and roles.
+
+The full featured schema with groups and referential integrity
+could be:
+
+
+
+The minimal schema without the ability to use groups will be
+(it is the same as for the DataSourceRealm):
+
+
+
+2.  Declare Your Resource
+
+Next, modify $CATALINA_BASE/conf/server.xml to create the
+UserDatabase resource based on your DataSource and its schema.
+It should look something like this:
+
+
+
+The dataSourceName attribute is the JNDI name of the
+DataSource that will be the backend for the
+UserDatabase. It must be declared in the same JNDI
+Context as the UserDatabase. Please refer to the
+DataSource resources
+documentation for further instructions.
+
+The readonly attribute is optional and defaults to
+true if not supplied. If the database is writeable then 
changes
+made through the Tomcat management to the UserDatabase can
+be persisted to the database using the save operation.
+
+Alternately, changes can also be made directly to the backend database.
+
+
+3.  Resource configuration
+
+
+
+  
+The name of the JNDI JDBC DataSource for this UserDatabase.
+  
+
+  
+Name of the column, in the "groups", "group roles" and "user groups"
+tables, that contains the group's name.
+  
+
+  
+Name of the "group roles" table, which must contain columns
+named by the groupNameCol and roleNameCol
+attributes.
+  
+
+  
+Name of the "groups" table, which must contain columns named
+by the groupNameCol attribute.
+  
+
+  
+If this is set to true, then changes to the
+UserDatabase can be persisted to the
+DataSource by using the save method.
+The default value is false.
+  
+
+  
+Name of the column, in the "roles" and "groups" tables, that 
contains
+the description for the roles and groups.
+  
+
+  
+Name of the column, in the "roles", "user roles" and "group roles"
+tables, which contains a role name assigned to the corresponding
+user.
+  
+
+  
+Name of the "roles" table, which must contain columns named
+by the roleNameCol attribute.
+  
+
+  
+Name of the column, in the "users" table, which contains
+the user's credentials (i.e. password).  If a
+CredentialHandler is specified, this component
+will assume that the passwords have been encoded with the
+specified algorithm.  Otherwise, they will be assumed to be
+in clear text.
+  
+
+  
+Name of the "user groups" table, which must contain columns
+named by the userNameCol and groupNameCol
+attributes.
+  
+
+  
+Name of the column, in the "users", "user groups" and "user roles"
+tables, that contains the user's user

[Bug 65525] New: Exception in thread "http-nio-8080-ClientPoller" java.lang.NullPointerException

2021-08-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65525

Bug ID: 65525
   Summary: Exception in thread "http-nio-8080-ClientPoller"
java.lang.NullPointerException
   Product: Tomcat 9
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: critical
  Priority: P2
 Component: WebSocket
  Assignee: dev@tomcat.apache.org
  Reporter: juhigupta...@gmail.com
  Target Milestone: -

I have a JAVA application running on spring boot 2.3.2 following is the
defination defined in pom



  org.springframework.boot
  spring-boot-starter-parent
  2.3.2.RELEASE
   


from the following link
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat/2.3.2.RELEASE
I can see it uses 9.0.x Tomcat


I have started to notice that the application has started to throw following 
exception:

Exception in thread "http-nio-8080-ClientPoller" java.lang.NullPointerException
at
org.apache.tomcat.util.net.NioEndpoint$Poller.events(NioEndpoint.java:613)
at
org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:729)
at java.base/java.lang.Thread.run(Thread.java:832)


and after this exception all the rest calls get stuck and breaks the
application.
Not sure what is causing it and how to mitigate it. 

Getting this error in prod and not sure how to resolve it, any hep is
appreciated.

-- 
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 65525] Exception in thread "http-nio-8080-ClientPoller" java.lang.NullPointerException

2021-08-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65525

Juhi Gupta  changed:

   What|Removed |Added

 OS|Linux   |All

-- 
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 64083] JDBC pool keeps closed connection as available

2021-08-27 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=64083

--- Comment #2 from Christopher Schultz  ---
(In reply to ToolGuy1 from comment #1)
> We have faced this issue in our shop as well with MS SQL Server on version
> 9.2.x driver for Java 11. Wondering if a configurable option could be added
> to the code to allow exceptions thrown from clearWarnings() calls to cause
> the pool to discard connections during return to the pool. Seems like if the
> underlying DB vendor supports clearWarnings commands that hit the db server
> ( suspect most do ), that this failing with an Exception should be a decent
> indicator that the underlying connection is not in good health.

SQL WARNINGs are not an indication of a broken connection. In fact, they are
specifically an indication of a GOOD connection: the database is in fact
communicating.

-1 on the suggestion in comment #1, though the original report seems
reasonable. to me.

-- 
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