Browse Source

New upstream version 9.0.40

tags/upstream/9.0.40^0
Emmanuel Bourg 11 months ago
parent
commit
3bb6485b0e
100 changed files with 1683 additions and 289 deletions
  1. +3
    -2
      RUNNING.txt
  2. +22
    -15
      build.properties.default
  3. +3
    -0
      java/javax/el/ExpressionFactory.java
  4. +54
    -1
      java/javax/servlet/AsyncContext.java
  5. +1
    -1
      java/javax/servlet/GenericFilter.java
  6. +5
    -0
      java/javax/servlet/http/HttpFilter.java
  7. +3
    -0
      java/javax/websocket/ContainerProvider.java
  8. +8
    -0
      java/javax/websocket/Decoder.java
  9. +8
    -0
      java/javax/websocket/Encoder.java
  10. +3
    -0
      java/javax/websocket/server/ServerEndpointConfig.java
  11. +0
    -2
      java/javax/xml/ws/WebServiceRef.java
  12. +0
    -2
      java/javax/xml/ws/WebServiceRefs.java
  13. +2
    -0
      java/org/apache/catalina/authenticator/jaspic/LocalStrings_fr.properties
  14. +2
    -0
      java/org/apache/catalina/authenticator/jaspic/LocalStrings_ko.properties
  15. +2
    -0
      java/org/apache/catalina/authenticator/jaspic/LocalStrings_ru.properties
  16. +1
    -1
      java/org/apache/catalina/authenticator/jaspic/LocalStrings_zh_CN.properties
  17. +1
    -1
      java/org/apache/catalina/connector/Request.java
  18. +7
    -0
      java/org/apache/catalina/core/LocalStrings_ru.properties
  19. +1
    -1
      java/org/apache/catalina/ha/backend/TcpSender.java
  20. +16
    -0
      java/org/apache/catalina/ha/tcp/LocalStrings_ru.properties
  21. +1
    -0
      java/org/apache/catalina/loader/LocalStrings_fr.properties
  22. +1
    -0
      java/org/apache/catalina/loader/LocalStrings_ko.properties
  23. +1
    -0
      java/org/apache/catalina/loader/LocalStrings_ru.properties
  24. +1
    -1
      java/org/apache/catalina/loader/LocalStrings_zh_CN.properties
  25. +1
    -1
      java/org/apache/catalina/manager/JMXProxyServlet.java
  26. +1
    -1
      java/org/apache/catalina/manager/LocalStrings_zh_CN.properties
  27. +1
    -1
      java/org/apache/catalina/manager/host/HostManagerServlet.java
  28. +85
    -5
      java/org/apache/catalina/realm/JNDIRealm.java
  29. +1
    -0
      java/org/apache/catalina/realm/LocalStrings_ru.properties
  30. +1
    -1
      java/org/apache/catalina/realm/LocalStrings_zh_CN.properties
  31. +92
    -24
      java/org/apache/catalina/realm/UserDatabaseRealm.java
  32. +4
    -0
      java/org/apache/catalina/realm/mbeans-descriptors.xml
  33. +1
    -1
      java/org/apache/catalina/servlets/DefaultServlet.java
  34. +453
    -0
      java/org/apache/catalina/session/DataSourceStore.java
  35. +3
    -0
      java/org/apache/catalina/session/JDBCStore.java
  36. +1
    -0
      java/org/apache/catalina/session/LocalStrings.properties
  37. +1
    -0
      java/org/apache/catalina/session/LocalStrings_fr.properties
  38. +1
    -0
      java/org/apache/catalina/session/LocalStrings_ko.properties
  39. +16
    -0
      java/org/apache/catalina/session/LocalStrings_ru.properties
  40. +4
    -6
      java/org/apache/catalina/startup/LocalStrings_de.properties
  41. +14
    -5
      java/org/apache/catalina/startup/LocalStrings_es.properties
  42. +14
    -13
      java/org/apache/catalina/startup/LocalStrings_fr.properties
  43. +14
    -13
      java/org/apache/catalina/startup/LocalStrings_ko.properties
  44. +7
    -0
      java/org/apache/catalina/startup/LocalStrings_ru.properties
  45. +8
    -8
      java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
  46. +2
    -0
      java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ru.properties
  47. +4
    -4
      java/org/apache/catalina/tribes/membership/McastServiceImpl.java
  48. +2
    -0
      java/org/apache/catalina/util/LocalStrings_ru.properties
  49. +2
    -6
      java/org/apache/catalina/valves/HealthCheckValve.java
  50. +111
    -0
      java/org/apache/catalina/valves/JsonErrorReportValve.java
  51. +2
    -0
      java/org/apache/catalina/valves/LocalStrings_ko.properties
  52. +1
    -0
      java/org/apache/catalina/valves/LocalStrings_ru.properties
  53. +18
    -1
      java/org/apache/catalina/webresources/AbstractFileResourceSet.java
  54. +2
    -0
      java/org/apache/catalina/webresources/LocalStrings.properties
  55. +3
    -0
      java/org/apache/coyote/AbstractProcessor.java
  56. +28
    -17
      java/org/apache/coyote/AbstractProtocol.java
  57. +1
    -0
      java/org/apache/coyote/LocalStrings.properties
  58. +2
    -0
      java/org/apache/coyote/LocalStrings_ko.properties
  59. +26
    -1
      java/org/apache/coyote/UpgradeProtocol.java
  60. +7
    -2
      java/org/apache/coyote/UpgradeToken.java
  61. +92
    -4
      java/org/apache/coyote/http11/AbstractHttp11Protocol.java
  62. +1
    -1
      java/org/apache/coyote/http11/Http11Processor.java
  63. +2
    -0
      java/org/apache/coyote/http11/LocalStrings.properties
  64. +1
    -0
      java/org/apache/coyote/http11/LocalStrings_ru.properties
  65. +16
    -0
      java/org/apache/coyote/http11/filters/LocalStrings_ru.properties
  66. +4
    -0
      java/org/apache/coyote/http11/upgrade/InternalHttpUpgradeHandler.java
  67. +120
    -0
      java/org/apache/coyote/http11/upgrade/UpgradeGroupInfo.java
  68. +96
    -0
      java/org/apache/coyote/http11/upgrade/UpgradeInfo.java
  69. +9
    -5
      java/org/apache/coyote/http11/upgrade/UpgradeProcessorExternal.java
  70. +10
    -2
      java/org/apache/coyote/http11/upgrade/UpgradeProcessorInternal.java
  71. +14
    -3
      java/org/apache/coyote/http11/upgrade/UpgradeServletInputStream.java
  72. +5
    -2
      java/org/apache/coyote/http11/upgrade/UpgradeServletOutputStream.java
  73. +3
    -3
      java/org/apache/coyote/http2/ConnectionSettingsBase.java
  74. +4
    -8
      java/org/apache/coyote/http2/HpackDecoder.java
  75. +3
    -2
      java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
  76. +41
    -4
      java/org/apache/coyote/http2/Http2Protocol.java
  77. +5
    -6
      java/org/apache/coyote/http2/Http2UpgradeHandler.java
  78. +2
    -0
      java/org/apache/coyote/http2/LocalStrings.properties
  79. +1
    -0
      java/org/apache/coyote/http2/LocalStrings_fr.properties
  80. +3
    -0
      java/org/apache/coyote/http2/LocalStrings_ko.properties
  81. +10
    -0
      java/org/apache/coyote/http2/StreamProcessor.java
  82. +30
    -0
      java/org/apache/coyote/mbeans-descriptors.xml
  83. +1
    -7
      java/org/apache/el/ExpressionFactoryImpl.java
  84. +13
    -0
      java/org/apache/jasper/JspC.java
  85. +11
    -0
      java/org/apache/jasper/Options.java
  86. +4
    -2
      java/org/apache/jasper/compiler/Generator.java
  87. +54
    -93
      java/org/apache/jasper/compiler/JDTCompiler.java
  88. +5
    -0
      java/org/apache/jasper/resources/LocalStrings_ru.properties
  89. +3
    -2
      java/org/apache/jasper/security/SecurityClassLoad.java
  90. +1
    -1
      java/org/apache/tomcat/buildutil/translate/Utils.java
  91. +1
    -0
      java/org/apache/tomcat/util/LocalStrings_ru.properties
  92. +1
    -1
      java/org/apache/tomcat/util/LocalStrings_zh_CN.properties
  93. +3
    -1
      java/org/apache/tomcat/util/buf/UDecoder.java
  94. +16
    -0
      java/org/apache/tomcat/util/digester/LocalStrings_ru.properties
  95. +1
    -2
      java/org/apache/tomcat/util/digester/SetPropertiesRule.java
  96. +2
    -1
      java/org/apache/tomcat/util/http/parser/EntityTag.java
  97. +4
    -2
      java/org/apache/tomcat/util/net/Acceptor.java
  98. +7
    -0
      java/org/apache/tomcat/util/net/LocalStrings.properties
  99. +1
    -0
      java/org/apache/tomcat/util/net/LocalStrings_ko.properties
  100. +3
    -0
      java/org/apache/tomcat/util/net/LocalStrings_ru.properties

+ 3
- 2
RUNNING.txt View File

@@ -297,8 +297,8 @@ CATALINA_BASE can be referenced in the XML configuration files processed
by Tomcat as ${catalina.home} and ${catalina.base} respectively.

For example, the standard manager web application can be kept in
CATALINA_HOME/webapps/manager and loaded into CATALINA_BASE by using
the following trick:
CATALINA_HOME/webapps/manager and loaded into CATALINA_BASE by copying
its deployment descriptor into the desired virtual host:

* Copy the CATALINA_HOME/webapps/manager/META-INF/context.xml
file as CATALINA_BASE/conf/Catalina/localhost/manager.xml
@@ -312,6 +312,7 @@ The file will look like the following:
antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.0\.0\.1" />
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>

See Deployer chapter in User Guide and Context and Host chapters in the


+ 22
- 15
build.properties.default View File

@@ -25,7 +25,7 @@
# ----- Version Control Flags -----
version.major=9
version.minor=0
version.build=39
version.build=40
version.patch=0
version.suffix=

@@ -129,15 +129,15 @@ wsdl4j-lib.loc=${base-maven.loc}/wsdl4j/wsdl4j/${wsdl4j-lib.version}/wsdl4j-${ws
# ----- Eclipse JDT, version 4.7 or later -----#
# See https://cwiki.apache.org/confluence/display/TOMCAT/Managing+Tomcat%27s+Dependency+on+the+Eclipse+JDT+Core+Batch+Compiler
#
# Checksum is from "SHA512 Checksums for 4.15" link at
# http://download.eclipse.org/eclipse/downloads/drops4/R-4.15-202003050155/
# http://download.eclipse.org/eclipse/downloads/drops4/R-4.15-202003050155/checksum/eclipse-4.15-SUMSSHA512
# Checksum is from "SHA512 Checksums for 4.17" link at
# http://download.eclipse.org/eclipse/downloads/drops4/R-4.17-202009021800/
# http://download.eclipse.org/eclipse/downloads/drops4/R-4.17-202009021800/checksum/eclipse-4.17-SUMSSHA512
#
jdt.version=4.15
jdt.release=R-4.15-202003050155/
jdt.version=4.17
jdt.release=R-4.17-202009021800
jdt.checksum.enabled=true
jdt.checksum.algorithm=SHA-512
jdt.checksum.value=41311832a593d13ea84eebea087baa3bab16df381c70bd4c0f425caeb69eac1b41be2af27e40735ae16c039df4861fa93c3cfc4c21f84bad1c5eb1cb0e7ad351
jdt.checksum.value=5e63e06eccd76a61249c7c6bd97e5b77dc37335bfdf316d941b00a16bae4f152d4306bac4e45c8422976187b0d77fe30cf7e6f6d4425f7732a3cb0cfa954385b
jdt.home=${base.path}/ecj-${jdt.version}
jdt.jar=${jdt.home}/ecj-${jdt.version}.jar
# The download will be moved to the archive area eventually. We are taking care of that in advance.
@@ -286,24 +286,31 @@ saaj-api.home=${base.path}/saaj-api-${saaj-api.version}
saaj-api.jar=${saaj-api.home}/saaj-api-${saaj-api.version}.jar
saaj-api.loc=${base-maven.loc}/javax/xml/soap/saaj-api/${saaj-api.version}/saaj-api-${saaj-api.version}.jar

# ----- bnd, version 5.1.1 or later -----
# ----- bnd, version 5.3.0 or later -----
# ----- provides OSGI metadata for JARs -----
bnd.version=5.1.1

# checksums for biz.aQute.bnd-5.1.1.jar
bnd.checksum.enabled=true
# *** Using SNAPSHOT *** Using SNAPSHOT *** Using SNAPSHOT ***
# The specific version used for release builds will be archived at
# https://home.apache.org/~markt/dev/deps/bnd-5.3.0-SNAPHOT/
# *** Using SNAPSHOT *** Using SNAPSHOT *** Using SNAPSHOT ***
bnd.version=5.3.0-SNAPSHOT

# checksums for biz.aQute.bnd-5.2.0.jar
# *** Disabled while we depend on SNAPSHOT JARs ***
bnd.checksum.enabled=false
bnd.checksum.algorithm=MD5|SHA-1
bnd.checksum.value=0dc5ff0af222ef075b5b0dd488f6aeac|0e542cf0f928107c17ce65f3c68dd2875724fecc
bnd.checksum.value=3254df4b94104002f79005ae54ec1dbb|1d69d0a5862133ac1f54555c9cd59011d79bbb86

bnd.home=${base.path}/bnd-${bnd.version}
bnd.jar=${bnd.home}/biz.aQute.bnd-${bnd.version}.jar
bnd.loc=${base-maven.loc}/biz/aQute/bnd/biz.aQute.bnd/${bnd.version}/biz.aQute.bnd-${bnd.version}.jar
# *** Temporary change to use the SNAPSHOT repository ***
# bnd.loc=${base-maven.loc}/biz/aQute/bnd/biz.aQute.bnd/${bnd.version}/biz.aQute.bnd-${bnd.version}.jar
bnd.loc=https://bndtools.jfrog.io/bndtools/update-snapshot/biz/aQute/bnd/biz.aQute.bnd/${bnd.version}/biz.aQute.bnd-${bnd.version}.jar

# ----- OSGi annotations bundle, version 1.0.0 or later -----
# ----- required to avoid Javadoc error when using bnd annotations -----
osgi-annotations.version=1.0.0

# checksums for biz.aQute.bnd-5.1.1.jar
# checksums for biz.aQute.bnd-5.2.0.jar
osgi-annotations.checksum.enabled=true
osgi-annotations.checksum.algorithm=MD5|SHA-1
osgi-annotations.checksum.value=153054f987534244f95a399539b11375|b6e802bceba0682353466abf8fadbbd662b2f7f8


+ 3
- 0
java/javax/el/ExpressionFactory.java View File

@@ -36,10 +36,13 @@ import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

import aQute.bnd.annotation.spi.ServiceConsumer;

/**
*
* @since 2.1
*/
@ServiceConsumer(value=ExpressionFactory.class)
public abstract class ExpressionFactory {

private static final boolean IS_SECURITY_ENABLED =


+ 54
- 1
java/javax/servlet/AsyncContext.java View File

@@ -17,20 +17,45 @@
package javax.servlet;

/**
* TODO SERVLET3 - Add comments
* Provides the context for asynchronous request handling
*
* @since Servlet 3.0
*/
public interface AsyncContext {

/**
* The attribute name for the URI of the async request
*/
public static final String ASYNC_REQUEST_URI =
"javax.servlet.async.request_uri";

/**
* The attribute name for the Context Path of the async request
*/
public static final String ASYNC_CONTEXT_PATH =
"javax.servlet.async.context_path";

/**
* The attribute name for the Mapping of the async request
*/
public static final String ASYNC_MAPPING =
"javax.servlet.async.mapping";

/**
* The attribute name for the Path Info of the async request
*/
public static final String ASYNC_PATH_INFO =
"javax.servlet.async.path_info";

/**
* The attribute name for the Servlet Path of the async request
*/
public static final String ASYNC_SERVLET_PATH =
"javax.servlet.async.servlet_path";

/**
* The attribute name for the Query String of the async request
*/
public static final String ASYNC_QUERY_STRING =
"javax.servlet.async.query_string";

@@ -79,15 +104,43 @@ public interface AsyncContext {
*/
void dispatch(ServletContext context, String path);

/**
* Completes the async request processing and closes the response stream
*/
void complete();

/**
* Starts a new thread to process the asynchronous request
*
* @param run a Runnable that the new thread will run
*/
void start(Runnable run);

/**
* Adds an event listener that will be called for different AsyncEvents fire
*
* @param listener an AsyncListener that will be called with AsyncEvent objects
*/
void addListener(AsyncListener listener);

/**
* Adds an event listener that will be called when different AsyncEvents fire
*
* @param listener an AsyncListener that will be called with AsyncEvent objects
* @param request the ServletRequest that will be passed with the AsyncEvent
* @param response the ServletResponse that will be passed with the AsyncEvent
*/
void addListener(AsyncListener listener, ServletRequest request,
ServletResponse response);

/**
* Creates and returns an AsyncListener object
*
* @param <T> The type to create that extends AsyncListener
* @param clazz The class to instantiate to create the listener
* @return the newly created AsyncListener object
* @throws ServletException if the listener cannot be created
*/
<T extends AsyncListener> T createListener(Class<T> clazz)
throws ServletException;



+ 1
- 1
java/javax/servlet/GenericFilter.java View File

@@ -20,7 +20,7 @@ import java.io.Serializable;
import java.util.Enumeration;

/**
* Provides a base class the implements the Filter and FilterConfig interfaces
* Provides a base class that implements the Filter and FilterConfig interfaces
* to reduce boilerplate when writing new filters.
*
* @see javax.servlet.Filter


+ 5
- 0
java/javax/servlet/http/HttpFilter.java View File

@@ -24,6 +24,11 @@ import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
* Provides a base class that implements the Filter interface and ensures
* that the Request and Response are of type HttpServletRequest and
* HttpServletResponse respectively.
*/
public abstract class HttpFilter extends GenericFilter {

private static final long serialVersionUID = 1L;


+ 3
- 0
java/javax/websocket/ContainerProvider.java View File

@@ -19,10 +19,13 @@ package javax.websocket;
import java.util.Iterator;
import java.util.ServiceLoader;

import aQute.bnd.annotation.spi.ServiceConsumer;

/**
* Use the {@link ServiceLoader} mechanism to provide instances of the WebSocket
* client container.
*/
@ServiceConsumer(value=ContainerProvider.class)
public abstract class ContainerProvider {

private static final String DEFAULT_PROVIDER_CLASS_NAME =


+ 8
- 0
java/javax/websocket/Decoder.java View File

@@ -23,8 +23,16 @@ import java.nio.ByteBuffer;

public interface Decoder {

/**
* Initialise the decoder.
*
* @param endpointConfig The end-point configuration
*/
abstract void init(EndpointConfig endpointConfig);

/**
* Destroy the decoder.
*/
abstract void destroy();

interface Binary<T> extends Decoder {


+ 8
- 0
java/javax/websocket/Encoder.java View File

@@ -23,8 +23,16 @@ import java.nio.ByteBuffer;

public interface Encoder {

/**
* Initialise the encoder.
*
* @param endpointConfig The end-point configuration
*/
abstract void init(EndpointConfig endpointConfig);

/**
* Destroy the decoder.
*/
abstract void destroy();

interface Text<T> extends Encoder {


+ 3
- 0
java/javax/websocket/server/ServerEndpointConfig.java View File

@@ -29,6 +29,8 @@ import javax.websocket.EndpointConfig;
import javax.websocket.Extension;
import javax.websocket.HandshakeResponse;

import aQute.bnd.annotation.spi.ServiceConsumer;

/**
* Provides configuration information for WebSocket endpoints published to a
* server. Applications may provide their own implementation or use
@@ -139,6 +141,7 @@ public interface ServerEndpointConfig extends EndpointConfig {
}


@ServiceConsumer(value=Configurator.class)
public class Configurator {

private static volatile Configurator defaultImpl = null;


+ 0
- 2
java/javax/xml/ws/WebServiceRef.java View File

@@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/


package javax.xml.ws;

import java.lang.annotation.ElementType;


+ 0
- 2
java/javax/xml/ws/WebServiceRefs.java View File

@@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/


package javax.xml.ws;

import java.lang.annotation.ElementType;


+ 2
- 0
java/org/apache/catalina/authenticator/jaspic/LocalStrings_fr.properties View File

@@ -19,7 +19,9 @@ authConfigFactoryImpl.registerInstance=Enregistrement de l''instance de type [{0
authConfigFactoryImpl.zeroLengthAppContext=Un nom de contexte vide n'est pas valide
authConfigFactoryImpl.zeroLengthMessageLayer=Un message vide de nom de couche est invalide

callbackHandlerImpl.containerMissing=Le rappel (callback) JASPIC de type [{0}] a un conteneur manquant et a été ignoré
callbackHandlerImpl.jaspicCallbackMissing=Le rappel (callback) JASPIC de type [{0}] reçu n''est pas supporté et a été ignoré
callbackHandlerImpl.realmMissing=Le rappel (callback) JASPIC de type [{0}] reçu n''a pas de royaume (realm) et a été ignoré

jaspicAuthenticator.authenticate=Authentification de la requête pour [{0}] avec JASPIC



+ 2
- 0
java/org/apache/catalina/authenticator/jaspic/LocalStrings_ko.properties View File

@@ -19,7 +19,9 @@ authConfigFactoryImpl.registerInstance=레이어 [{1}]와(과) 애플리케이
authConfigFactoryImpl.zeroLengthAppContext=애플리케이션 컨텍스트 이름의 길이가 0으로, 이는 유효하지 않습니다.
authConfigFactoryImpl.zeroLengthMessageLayer=길이가 0인 메시지 레이어 이름은 유효하지 않습니다.

callbackHandlerImpl.containerMissing=타입이 [{0}]인 JASPIC 콜백을 위한 컨테이너가 존재하지 않아 무시됩니다.
callbackHandlerImpl.jaspicCallbackMissing=타입이 [{0}]인 지원되지 않는 JASPIC 콜백을 받았는데, 이는 무시됩니다.
callbackHandlerImpl.realmMissing=컨테이너 [{1}]에 타입이 [{0}]인 JASPIC 콜백을 위한 Realm이 존재하지 않아 무시됩니다.

jaspicAuthenticator.authenticate=[{0}]을(를) 위한 요청을 JASPIC를 통하여 인증합니다.



+ 2
- 0
java/org/apache/catalina/authenticator/jaspic/LocalStrings_ru.properties View File

@@ -13,4 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

authConfigFactoryImpl.zeroLengthAppContext=Название контекста приложения нулевой длины является недействительным

persistentProviderRegistrations.existsDeleteFail=Временный файл [{0}] уже существует и не может быть удалён

+ 1
- 1
java/org/apache/catalina/authenticator/jaspic/LocalStrings_zh_CN.properties View File

@@ -16,7 +16,7 @@
authConfigFactoryImpl.load=从[{0}]加载持久化提供者注册信息
authConfigFactoryImpl.registerClass=正在为层[{1}]和应用程序上下文[{2}]注册类[{0}]
authConfigFactoryImpl.registerInstance=正在为层[{1}]和应用程序上下文[{2}]注册类型为[{0}]的实例
authConfigFactoryImpl.zeroLengthAppContext=:)应用上下文名称的长度为0是无效的
authConfigFactoryImpl.zeroLengthAppContext=应用上下文名称的长度为0是无效的
authConfigFactoryImpl.zeroLengthMessageLayer=零长度的消息层名称是无效的

callbackHandlerImpl.jaspicCallbackMissing=接收到不支持的类型为{0}的JASPIC回调,该回调被忽略


+ 1
- 1
java/org/apache/catalina/connector/Request.java View File

@@ -2049,7 +2049,7 @@ public class Request implements HttpServletRequest {
throw new ServletException(e);
}
UpgradeToken upgradeToken = new UpgradeToken(handler,
getContext(), instanceManager);
getContext(), instanceManager, response.getHeader("upgrade"));

coyoteRequest.action(ActionCode.UPGRADE, upgradeToken);



+ 7
- 0
java/org/apache/catalina/core/LocalStrings_ru.properties View File

@@ -15,8 +15,15 @@

applicationContext.addJspFile.iae=Файл JSP [{0}] содержит ошибки
applicationContext.addListener.iae.cnfe=Невозможно создать экземпляр типа [{0}]
applicationContext.addListener.iae.wrongType=Указанный тип[{0}] не является одним из ожидаемых типов слушателей
applicationContext.setAttribute.namenull=Имя не может быть пустым

aprListener.initializingFIPS=Инициализируется режим FIPS...

filterChain.filter=При выполнении фильтра выброшено исключение

standardContext.securityConstraint.mixHttpMethod=Запрещено смешивать <http-method> и <http-method-omission> в одной и той же коллекции веб-ресурсов

standardWrapper.allocate=Ошибка при выделении экземпляра сервлета
standardWrapper.allocateException=Ошибка выделения для сервлета [{0}]
standardWrapper.deallocateException=Ошибка освобождения для сервлета [{0}]


+ 1
- 1
java/org/apache/catalina/ha/backend/TcpSender.java View File

@@ -151,7 +151,7 @@ public class TcpSender
// read all the headers.
String header = connectionReaders[i].readLine();
int contentLength = 0;
while (!header.isEmpty()) {
while (header != null && !header.isEmpty()) {
int colon = header.indexOf(':');
String headerName = header.substring(0, colon).trim();
String headerValue = header.substring(colon + 1).trim();


+ 16
- 0
java/org/apache/catalina/ha/tcp/LocalStrings_ru.properties View File

@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ReplicationValve.filter.failure=Не возможно скомпилировать фильтрr=[{0}]

+ 1
- 0
java/org/apache/catalina/loader/LocalStrings_fr.properties View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

webappClassLoader.addExportsJavaIo=Lorsque Java 9 ou ultérieur est utilisé, "--add-opens=java.base/java.io={0}" doit être ajouté aux arguments de la ligne de commande de la JVM pour activer la protection contre les fuites de mémoire du cache de ObjectStream; cet avertissement peut aussi être supprimé en désactivant cette protection
webappClassLoader.addExportsRmi=Quand Java 9 est utilisé, il faut utiliser "--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED" sur la ligne de commande de la JVM pour activer la détection de fuites de mémoire des cibles RMI ; sinon cet avertissement peut être supprimé en désactivant cette détection
webappClassLoader.addExportsThreadLocal=Quand Java 9 est utilisé, il faut utiliser "--add-opens=java.base/java.lang=ALL-UNNAMED" sur la ligne de commande de la JVM pour activer la détection de fuites de mémoire des ThreadLocal ; sinon cet avertissement peut être supprimé en désactivant cette détection
webappClassLoader.addPermissionNoCanonicalFile=Impossible d’obtenir le chemin de fichier canonique pour l''URL [{0}]


+ 1
- 0
java/org/apache/catalina/loader/LocalStrings_ko.properties View File

@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

webappClassLoader.addExportsJavaIo=Java 9 또는 이후 버전을 사용할 때에는, "--add-opens=java.base/java.io={0}" 을(를) JVM 명령행 아규먼트들에 추가해서, ObjectStream 캐시 메모리 릭 방지 옵션을 활성화할 필요가 있습니다. 또는 원하시는 경우, ObjectStream 클래스 캐시 메모리 릭 방지 옵션을 비활성화해서 이 경고 메시지를 없앨 수도 있습니다.
webappClassLoader.addExportsRmi=Java 9에서 실행하면서 RMI Target 메모리 누수 탐지를 사용 가능하게 하려면, "--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"를 JVM 명령 행 아규먼트에 추가해야 합니다. 또는, RMI Target 메모리 누수 탐지를 사용불능 상태로 설정함으로써, 이 경고를 없앨 수도 있습니다.
webappClassLoader.addExportsThreadLocal=Java 9 환경에서 실행할 때에는, ThreadLocal 메모리 누수 탐지를 위하여, "--add-opens=java.base/java.lang=ALL-UNNAMED"를 JVM 명령 행 아규먼트들에 추가해야 합니다. 또는, ThreadLocal 메모리 누수 탐지를 사용불능 상태로 설정함으로써, 이 경고 메시지를 없앨 수도 있습니다.
webappClassLoader.addPermissionNoCanonicalFile=URL [{0}](으)로부터 canonical 파일 경로를 얻을 수 없습니다.


+ 1
- 0
java/org/apache/catalina/loader/LocalStrings_ru.properties View File

@@ -14,3 +14,4 @@
# limitations under the License.

webappClassLoader.checkThreadLocalsForLeaks.unknown=Неизвестно
webappClassLoader.readError=Ошибка чтения ресурса: Не возможно загрузить [{0}].

+ 1
- 1
java/org/apache/catalina/loader/LocalStrings_zh_CN.properties View File

@@ -23,7 +23,7 @@ webappClassLoader.addTransformer.illegalArgument=Web应用程序[{0}]试图添
webappClassLoader.checkThreadLocalsForLeaks=web应用程序[{0}]创建了一个ThreadLocal,其键类型为[{1}](值为[{2}]),值类型为[{3}](值为[{4}),但在停止web应用程序时未能将其删除。线程将随着时间的推移而更新,以尝试避免可能的内存泄漏
webappClassLoader.checkThreadLocalsForLeaks.badKey=无法确定类型为[{0}]的键的字符串表示形式
webappClassLoader.checkThreadLocalsForLeaks.badValue=无法确定类型为 [{0}] 的值的字符串表示形式
webappClassLoader.checkThreadLocalsForLeaks.unknown=:)未知
webappClassLoader.checkThreadLocalsForLeaks.unknown=未知
webappClassLoader.checkThreadLocalsForLeaksFail=检查ThreadLocal引用失败,web应用程序:[{0}]
webappClassLoader.checkThreadLocalsForLeaksNone=web应用程序 [{0}] 创建了1个ThreadLocal变量(键:[{2}] (类型[{1}]) ,值:[{4}](类型[{3}]) )。键仅被ThreadLocal Map弱引用,所以不是内存泄露。
webappClassLoader.checkThreadLocalsForLeaksNull=web应用程序[{0}]创建了一个ThreadLocal,其键类型为[{1}](值为[{2}])。ThreadLocal已正确设置为null,GC将删除该键


+ 1
- 1
java/org/apache/catalina/manager/JMXProxyServlet.java View File

@@ -37,8 +37,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.catalina.mbeans.MBeanDumper;
import org.apache.catalina.tribes.util.StringManager;
import org.apache.tomcat.util.modeler.Registry;
import org.apache.tomcat.util.res.StringManager;

/**
* This servlet will dump JMX attributes in a simple format and implement proxy


+ 1
- 1
java/org/apache/catalina/manager/LocalStrings_zh_CN.properties View File

@@ -48,7 +48,7 @@ htmlManagerServlet.connectorStateTableTitleTime=时间
htmlManagerServlet.connectorStateTableTitleVHost=虚拟主机
htmlManagerServlet.connectorStateThreadBusy=当前线程繁忙:
htmlManagerServlet.connectorStateThreadCount=当前线程数:
htmlManagerServlet.deployButton=:)部署
htmlManagerServlet.deployButton=部署
htmlManagerServlet.deployConfig=XML配置文件路径:
htmlManagerServlet.deployPath=Context路径:
htmlManagerServlet.deployServer=服务器上.部署的目录或WAR文件


+ 1
- 1
java/org/apache/catalina/manager/host/HostManagerServlet.java View File

@@ -394,7 +394,7 @@ public class HostManagerServlet
"hostManagerServlet.configBaseCreateFail", name));
return;
}
try (InputStream is = getServletContext().getResourceAsStream("/manager.xml")) {
try (InputStream is = getServletContext().getResourceAsStream("/WEB-INF/manager.xml")) {
Path dest = (new File(configBaseFile, "manager.xml")).toPath();
Files.copy(is, dest);
} catch (IOException e) {


+ 85
- 5
java/org/apache/catalina/realm/JNDIRealm.java View File

@@ -490,6 +490,14 @@ public class JNDIRealm extends RealmBase {
protected int connectionPoolSize = 1;


/**
* Whether to use context ClassLoader or default ClassLoader.
* True means use context ClassLoader, and True is the default
* value.
*/
protected boolean useContextClassLoader = true;


// ------------------------------------------------------------- Properties

public boolean getForceDnHexEscape() {
@@ -1246,6 +1254,26 @@ public class JNDIRealm extends RealmBase {
return clazz.getConstructor().newInstance();
}

/**
* Sets whether to use the context or default ClassLoader.
* True means use context ClassLoader.
*
* @param useContext True means use context ClassLoader
*/
public void setUseContextClassLoader(boolean useContext) {
useContextClassLoader = useContext;
}

/**
* Returns whether to use the context or default ClassLoader.
* True means to use the context ClassLoader.
*
* @return The value of useContextClassLoader
*/
public boolean isUseContextClassLoader() {
return useContextClassLoader;
}

// ---------------------------------------------------------- Realm Methods

/**
@@ -1301,6 +1329,7 @@ public class JNDIRealm extends RealmBase {

// close the connection so we know it will be reopened.
close(connection);
closePooledConnections();

// open a new directory context.
connection = get();
@@ -2190,6 +2219,20 @@ public class JNDIRealm extends RealmBase {

}

/**
* Close all pooled connections.
*/
protected void closePooledConnections() {
if (connectionPool != null) {
// Close any pooled connections as they might be bad as well
synchronized (connectionPool) {
JNDIConnection connection = null;
while ((connection = connectionPool.pop()) != null) {
close(connection);
}
}
}
}

/**
* Get the password for the specified user.
@@ -2203,8 +2246,36 @@ public class JNDIRealm extends RealmBase {
return null;
}

JNDIConnection connection = null;
User user = null;
try {
User user = getUser(get(), username, null);

// Ensure that we have a directory context available
connection = get();

// Occasionally the directory context will timeout. Try one more
// time before giving up.
try {
user = getUser(connection, username, null);
} catch (NullPointerException | NamingException e) {
// log the exception so we know it's there.
containerLog.info(sm.getString("jndiRealm.exception.retry"), e);

// close the connection so we know it will be reopened.
close(connection);
closePooledConnections();

// open a new directory context.
connection = get();

// Try the authentication again.
user = getUser(connection, username, null);
}


// Release this context
release(connection);

if (user == null) {
// User should be found...
return null;
@@ -2212,7 +2283,10 @@ public class JNDIRealm extends RealmBase {
// ... and have a password
return user.getPassword();
}

} catch (NamingException e) {
// Log the problem for posterity
containerLog.error(sm.getString("jndiRealm.exception"), e);
return null;
}

@@ -2270,6 +2344,7 @@ public class JNDIRealm extends RealmBase {

// close the connection so we know it will be reopened.
close(connection);
closePooledConnections();

// open a new directory context.
connection = get();
@@ -2440,7 +2515,12 @@ public class JNDIRealm extends RealmBase {
* @throws NamingException if a directory server error occurs
*/
protected void open(JNDIConnection connection) throws NamingException {
ClassLoader ocl = null;
try {
if (!isUseContextClassLoader()) {
ocl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
}
// Ensure that we have a directory context available
connection.context = createDirContext(getDirectoryContextEnvironment());
} catch (Exception e) {
@@ -2457,6 +2537,9 @@ public class JNDIRealm extends RealmBase {
// reset it in case the connection times out.
// the primary may come back.
connectionAttempt = 0;
if (!isUseContextClassLoader()) {
Thread.currentThread().setContextClassLoader(ocl);
}
}
}

@@ -2668,10 +2751,7 @@ public class JNDIRealm extends RealmBase {
singleConnectionLock.lock();
close(singleConnection);
} else {
JNDIConnection connection = null;
while ((connection = connectionPool.pop()) != null) {
close(connection);
}
closePooledConnections();
connectionPool = null;
}
}


+ 1
- 0
java/org/apache/catalina/realm/LocalStrings_ru.properties View File

@@ -15,4 +15,5 @@

lockOutRealm.authLockedUser=Заблокированный пользователь [{0}] совершил попытку авторизоваться

realmBase.createUsernameRetriever.ClassCastException=Класс [{0}] не является X509UsernameRetriever.
realmBase.forbidden=Доступ к запрашиваемому ресурсу был заблокирован

+ 1
- 1
java/org/apache/catalina/realm/LocalStrings_zh_CN.properties View File

@@ -29,7 +29,7 @@ dataSourceRealm.authenticateSuccess=用户名[{0}]已成功通过身份验证。
dataSourceRealm.close=关闭数据库连接时发生异常
dataSourceRealm.exception=认证异常
dataSourceRealm.getPassword.exception=获取用户名[{0}]对应的密码失败。
dataSourceRealm.getRoles.exception=:)检索角色[{0}]异常
dataSourceRealm.getRoles.exception=检索角色[{0}]异常

jaasCallback.username=返回用户名 [{0}]



+ 92
- 24
java/org/apache/catalina/realm/UserDatabaseRealm.java View File

@@ -29,13 +29,14 @@ import org.apache.catalina.Role;
import org.apache.catalina.User;
import org.apache.catalina.UserDatabase;
import org.apache.catalina.Wrapper;
import org.apache.naming.ContextBindings;
import org.apache.tomcat.util.ExceptionUtils;

/**
* Implementation of {@link org.apache.catalina.Realm} that is based on an
* implementation of {@link UserDatabase} made available through the global JNDI
* implementation of {@link UserDatabase} made available through the JNDI
* resources configured for this instance of Catalina. Set the
* <code>resourceName</code> parameter to the global JNDI resources name for the
* <code>resourceName</code> parameter to the JNDI resources name for the
* configured instance of <code>UserDatabase</code> that we should consult.
*
* @author Craig R. McClanahan
@@ -49,7 +50,8 @@ public class UserDatabaseRealm extends RealmBase {
* The <code>UserDatabase</code> we will use to authenticate users and
* identify associated roles.
*/
protected UserDatabase database = null;
protected volatile UserDatabase database = null;
private final Object databaseLock = new Object();

/**
* The global JNDI name of the <code>UserDatabase</code> resource we will be
@@ -57,6 +59,11 @@ public class UserDatabaseRealm extends RealmBase {
*/
protected String resourceName = "UserDatabase";

/**
* Obtain the UserDatabase from the context (rather than global) JNDI.
*/
private boolean localJndiResource = false;


// ------------------------------------------------------------- Properties

@@ -80,6 +87,31 @@ public class UserDatabaseRealm extends RealmBase {
}


/**
* Determines whether this Realm is configured to obtain the associated
* {@link UserDatabase} from the global JNDI context or a local (web
* application) JNDI context.
*
* @return {@code true} if a local JNDI context will be used, {@code false}
* if the the global JNDI context will be used
*/
public boolean getLocalJndiResource() {
return localJndiResource;
}


/**
* Configure whether this Realm obtains the associated {@link UserDatabase}
* from the global JNDI context or a local (web application) JNDI context.
*
* @param localJndiResource {@code true} to use a local JNDI context,
* {@code false} to use the global JNDI context
*/
public void setLocalJndiResource(boolean localJndiResource) {
this.localJndiResource = localJndiResource;
}


// --------------------------------------------------------- Public Methods

/**
@@ -94,6 +126,12 @@ public class UserDatabaseRealm extends RealmBase {
*/
@Override
public boolean hasRole(Wrapper wrapper, Principal principal, String role) {

UserDatabase database = getUserDatabase();
if (database == null) {
return false;
}

// Check for a role alias defined in a <security-role-ref> element
if (wrapper != null) {
String realRole = wrapper.findSecurityReference(role);
@@ -140,7 +178,10 @@ public class UserDatabaseRealm extends RealmBase {

@Override
public void backgroundProcess() {
database.backgroundProcess();
UserDatabase database = getUserDatabase();
if (database != null) {
database.backgroundProcess();
}
}


@@ -149,6 +190,11 @@ public class UserDatabaseRealm extends RealmBase {
*/
@Override
protected String getPassword(String username) {
UserDatabase database = getUserDatabase();
if (database == null) {
return null;
}

User user = database.findUser(username);

if (user == null) {
@@ -164,6 +210,10 @@ public class UserDatabaseRealm extends RealmBase {
*/
@Override
protected Principal getPrincipal(String username) {
UserDatabase database = getUserDatabase();
if (database == null) {
return null;
}

User user = database.findUser(username);
if (user == null) {
@@ -189,30 +239,48 @@ public class UserDatabaseRealm extends RealmBase {
}


/*
* Can't do this in startInternal() with local JNDI as the local JNDI
* context won't be initialised at this point.
*/
private UserDatabase getUserDatabase() {
// DCL so database MUST be volatile
if (database == null) {
synchronized (databaseLock) {
if (database == null) {
try {
Context context = null;
if (localJndiResource) {
context = ContextBindings.getClassLoader();
context = (Context) context.lookup("comp/env");
} else {
context = getServer().getGlobalNamingContext();
}
database = (UserDatabase) context.lookup(resourceName);
} catch (Throwable e) {
ExceptionUtils.handleThrowable(e);
containerLog.error(sm.getString("userDatabaseRealm.lookup", resourceName), e);
database = null;
}
}
}
}
return database;
}


// ------------------------------------------------------ Lifecycle Methods

/**
* Prepare for the beginning of active use of the public methods of this
* component and implement the requirements of
* {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
*/
@Override
protected void startInternal() throws LifecycleException {

try {
Context context = getServer().getGlobalNamingContext();
database = (UserDatabase) context.lookup(resourceName);
} catch (Throwable e) {
ExceptionUtils.handleThrowable(e);
containerLog.error(sm.getString("userDatabaseRealm.lookup", resourceName), e);
database = null;
}
if (database == null) {
throw new LifecycleException(
sm.getString("userDatabaseRealm.noDatabase", resourceName));
// If the JNDI resource is global, check it here and fail the context
// start if it is not valid. Local JNDI resources can't be validated
// this way because the JNDI context isn't available at Realm start.
if (!localJndiResource) {
UserDatabase database = getUserDatabase();
if (database == null) {
throw new LifecycleException(sm.getString("userDatabaseRealm.noDatabase", resourceName));
}
}

super.startInternal();


+ 4
- 0
java/org/apache/catalina/realm/mbeans-descriptors.xml View File

@@ -400,6 +400,10 @@
description="The global JNDI name of the UserDatabase resource to use"
type="java.lang.String"/>

<attribute name="localJndiResource"
description="Configures if the UserDatabase JNDI definition is local to the webapp"
type="boolean"/>

<attribute name="realmPath"
description="The realm path"
type="java.lang.String"/>


+ 1
- 1
java/org/apache/catalina/servlets/DefaultServlet.java View File

@@ -1492,7 +1492,7 @@ public class DefaultServlet extends HttpServlet {
// If the timestamp of the entity the client got differs from
// the last modification date of the entity, the entire entity
// is returned.
if (Math.abs(lastModified -headerValueTime) > 1000) {
if (Math.abs(lastModified - headerValueTime) > 1000) {
return FULL;
}
}


+ 453
- 0
java/org/apache/catalina/session/DataSourceStore.java View File

@@ -0,0 +1,453 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.catalina.session;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

import org.apache.catalina.Globals;
import org.apache.catalina.Session;
import org.apache.juli.logging.Log;

/**
* Implementation of the {@link org.apache.catalina.Store Store}
* interface that stores serialized session objects in a database.
* Sessions that are saved are still subject to being expired
* based on inactivity.
*
* @author Bip Thelin
*/
@SuppressWarnings("deprecation")
public class DataSourceStore extends JDBCStore {

// --------------------------------------------------------- Public Methods

@Override
public String[] expiredKeys() throws IOException {
return keys(true);
}

@Override
public String[] keys() throws IOException {
return keys(false);
}

/**
* Return an array containing the session identifiers of all Sessions
* currently saved in this Store. If there are no such Sessions, a
* zero-length array is returned.
*
* @param expiredOnly flag, whether only keys of expired sessions should
* be returned
* @return array containing the list of session IDs
*
* @exception IOException if an input/output error occurred
*/
private String[] keys(boolean expiredOnly) throws IOException {
String keys[] = null;
int numberOfTries = 2;
while (numberOfTries > 0) {

Connection _conn = getConnection();
if (_conn == null) {
return new String[0];
}
try {

String keysSql = "SELECT " + sessionIdCol + " FROM "
+ sessionTable + " WHERE " + sessionAppCol + " = ?";
if (expiredOnly) {
keysSql += " AND (" + sessionLastAccessedCol + " + "
+ sessionMaxInactiveCol + " * 1000 < ?)";
}
try (PreparedStatement preparedKeysSql = _conn.prepareStatement(keysSql)) {
preparedKeysSql.setString(1, getName());
if (expiredOnly) {
preparedKeysSql.setLong(2, System.currentTimeMillis());
}
try (ResultSet rst = preparedKeysSql.executeQuery()) {
List<String> tmpkeys = new ArrayList<>();
if (rst != null) {
while (rst.next()) {
tmpkeys.add(rst.getString(1));
}
}
keys = tmpkeys.toArray(new String[0]);
// Break out after the finally block
numberOfTries = 0;
}
}
} catch (SQLException e) {
manager.getContext().getLogger().error(sm.getString(getStoreName() + ".SQLException", e));
keys = new String[0];
// Close the connection so that it gets reopened next time
} finally {
release(_conn);
}
numberOfTries--;
}
return keys;
}

/**
* Return an integer containing a count of all Sessions
* currently saved in this Store. If there are no Sessions,
* <code>0</code> is returned.
*
* @return the count of all sessions currently saved in this Store
*
* @exception IOException if an input/output error occurred
*/
@Override
public int getSize() throws IOException {
int size = 0;
String sizeSql = "SELECT COUNT(" + sessionIdCol
+ ") FROM " + sessionTable + " WHERE "
+ sessionAppCol + " = ?";

int numberOfTries = 2;
while (numberOfTries > 0) {
Connection _conn = getConnection();

if (_conn == null) {
return size;
}

try (PreparedStatement preparedSizeSql = _conn.prepareStatement(sizeSql)){
preparedSizeSql.setString(1, getName());
try (ResultSet rst = preparedSizeSql.executeQuery()) {
if (rst.next()) {
size = rst.getInt(1);
}
// Break out after the finally block
numberOfTries = 0;
}
} catch (SQLException e) {
manager.getContext().getLogger().error(sm.getString(getStoreName() + ".SQLException", e));
} finally {
release(_conn);
}
numberOfTries--;
}
return size;
}

/**
* Load the Session associated with the id <code>id</code>.
* If no such session is found <code>null</code> is returned.
*
* @param id a value of type <code>String</code>
* @return the stored <code>Session</code>
* @exception ClassNotFoundException if an error occurs
* @exception IOException if an input/output error occurred
*/
@Override
public Session load(String id) throws ClassNotFoundException, IOException {
StandardSession _session = null;
org.apache.catalina.Context context = getManager().getContext();
Log contextLog = context.getLogger();

int numberOfTries = 2;
String loadSql = "SELECT " + sessionIdCol + ", "
+ sessionDataCol + " FROM " + sessionTable
+ " WHERE " + sessionIdCol + " = ? AND "
+ sessionAppCol + " = ?";
while (numberOfTries > 0) {
Connection _conn = getConnection();
if (_conn == null) {
return null;
}

ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);

try (PreparedStatement preparedLoadSql = _conn.prepareStatement(loadSql)){
preparedLoadSql.setString(1, id);
preparedLoadSql.setString(2, getName());
try (ResultSet rst = preparedLoadSql.executeQuery()) {
if (rst.next()) {
try (ObjectInputStream ois =
getObjectInputStream(rst.getBinaryStream(2))) {
if (contextLog.isDebugEnabled()) {
contextLog.debug(sm.getString(
getStoreName() + ".loading", id, sessionTable));
}

_session = (StandardSession) manager.createEmptySession();
_session.readObjectData(ois);
_session.setManager(manager);
}
} else if (context.getLogger().isDebugEnabled()) {
contextLog.debug(getStoreName() + ": No persisted data object found");
}
// Break out after the finally block
numberOfTries = 0;
}
} catch (SQLException e) {
contextLog.error(sm.getString(getStoreName() + ".SQLException", e));
} finally {
context.unbind(Globals.IS_SECURITY_ENABLED, oldThreadContextCL);
release(_conn);
}
numberOfTries--;
}
return _session;
}

/**
* Remove the Session with the specified session identifier from
* this Store, if present. If no such Session is present, this method
* takes no action.
*
* @param id Session identifier of the Session to be removed
*
* @exception IOException if an input/output error occurs
*/
@Override
public void remove(String id) throws IOException {

int numberOfTries = 2;
while (numberOfTries > 0) {
Connection _conn = getConnection();

if (_conn == null) {
return;
}

try {
remove(id, _conn);
// Break out after the finally block
numberOfTries = 0;
} catch (SQLException e) {
manager.getContext().getLogger().error(sm.getString(getStoreName() + ".SQLException", e));
} finally {
release(_conn);
}
numberOfTries--;
}

if (manager.getContext().getLogger().isDebugEnabled()) {
manager.getContext().getLogger().debug(sm.getString(getStoreName() + ".removing", id, sessionTable));
}
}

/**
* Remove the Session with the specified session identifier from
* this Store, if present. If no such Session is present, this method
* takes no action.
*
* @param id Session identifier of the Session to be removed
* @param _conn open connection to be used
* @throws SQLException if an error occurs while talking to the database
*/
private void remove(String id, Connection _conn) throws SQLException {
String removeSql = "DELETE FROM " + sessionTable
+ " WHERE " + sessionIdCol + " = ? AND "
+ sessionAppCol + " = ?";
try (PreparedStatement preparedRemoveSql = _conn.prepareStatement(removeSql)) {
preparedRemoveSql.setString(1, id);
preparedRemoveSql.setString(2, getName());
preparedRemoveSql.execute();
}
}

/**
* Remove all of the Sessions in this Store.
*
* @exception IOException if an input/output error occurs
*/
@Override
public void clear() throws IOException {
String clearSql = "DELETE FROM " + sessionTable
+ " WHERE " + sessionAppCol + " = ?";

int numberOfTries = 2;
while (numberOfTries > 0) {
Connection _conn = getConnection();
if (_conn == null) {
return;
}

try (PreparedStatement preparedClearSql = _conn.prepareStatement(clearSql)){
preparedClearSql.setString(1, getName());
preparedClearSql.execute();
// Break out after the finally block
numberOfTries = 0;
} catch (SQLException e) {
manager.getContext().getLogger().error(sm.getString(getStoreName() + ".SQLException", e));
} finally {
release(_conn);
}
numberOfTries--;
}
}

/**
* Save a session to the Store.
*
* @param session the session to be stored
* @exception IOException if an input/output error occurs
*/
@Override
public void save(Session session) throws IOException {
ByteArrayOutputStream bos = null;
String saveSql = "INSERT INTO " + sessionTable + " ("
+ sessionIdCol + ", " + sessionAppCol + ", "
+ sessionDataCol + ", " + sessionValidCol
+ ", " + sessionMaxInactiveCol + ", "
+ sessionLastAccessedCol
+ ") VALUES (?, ?, ?, ?, ?, ?)";

synchronized (session) {
int numberOfTries = 2;
while (numberOfTries > 0) {
Connection _conn = getConnection();
if (_conn == null) {
return;
}

try {
// If sessions already exist in DB, remove and insert again.
// TODO:
// * Check if ID exists in database and if so use UPDATE.
remove(session.getIdInternal(), _conn);

bos = new ByteArrayOutputStream();
try (ObjectOutputStream oos =
new ObjectOutputStream(new BufferedOutputStream(bos))) {
((StandardSession) session).writeObjectData(oos);
}
byte[] obs = bos.toByteArray();
int size = obs.length;
try (ByteArrayInputStream bis = new ByteArrayInputStream(obs, 0, size);
InputStream in = new BufferedInputStream(bis, size);
PreparedStatement preparedSaveSql = _conn.prepareStatement(saveSql)) {
preparedSaveSql.setString(1, session.getIdInternal());
preparedSaveSql.setString(2, getName());
preparedSaveSql.setBinaryStream(3, in, size);
preparedSaveSql.setString(4, session.isValid() ? "1" : "0");
preparedSaveSql.setInt(5, session.getMaxInactiveInterval());
preparedSaveSql.setLong(6, session.getLastAccessedTime());
preparedSaveSql.execute();
// Break out after the finally block
numberOfTries = 0;
}
} catch (SQLException e) {
manager.getContext().getLogger().error(sm.getString(getStoreName() + ".SQLException", e));
} catch (IOException e) {
// Ignore
} finally {
release(_conn);
}
numberOfTries--;
}
}

if (manager.getContext().getLogger().isDebugEnabled()) {
manager.getContext().getLogger().debug(sm.getString(getStoreName() + ".saving",
session.getIdInternal(), sessionTable));
}
}


// --------------------------------------------------------- Protected Methods

/**
* Open (if necessary) and return a database connection for use by
* this Store.
*
* @return database connection ready to use
*
* @exception SQLException if a database error occurs
*/
protected Connection open() throws SQLException {
if (dataSourceName != null && dataSource == null) {
org.apache.catalina.Context context = getManager().getContext();
ClassLoader oldThreadContextCL = null;
if (getLocalDataSource()) {
oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null);
}

Context initCtx;
try {
initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
this.dataSource = (DataSource) envCtx.lookup(this.dataSourceName);
} catch (NamingException e) {
context.getLogger().error(
sm.getString(getStoreName() + ".wrongDataSource",
this.dataSourceName), e);
} finally {
if (getLocalDataSource()) {
context.unbind(Globals.IS_SECURITY_ENABLED, oldThreadContextCL);
}
}
}

if (dataSource != null) {
return dataSource.getConnection();
} else {
throw new IllegalStateException(sm.getString(getStoreName() + ".missingDataSource"));
}
}

/**
* Close the specified database connection.
*
* @param dbConnection The connection to be closed
*/
protected void close(Connection dbConnection) {

// Do nothing if the database connection is already closed
if (dbConnection == null)
return;

// Commit if autoCommit is false
try {
if (!dbConnection.getAutoCommit()) {
dbConnection.commit();
}
} catch (SQLException e) {
manager.getContext().getLogger().error(sm.getString(getStoreName() + ".commitSQLException"), e);
}

// Close this database connection, and log any errors
try {
dbConnection.close();
} catch (SQLException e) {
manager.getContext().getLogger().error(sm.getString(getStoreName() + ".close", e.toString())); // Just log it here
}
}

}

+ 3
- 0
java/org/apache/catalina/session/JDBCStore.java View File

@@ -53,7 +53,10 @@ import org.apache.tomcat.util.ExceptionUtils;
* based on inactivity.
*
* @author Bip Thelin
* @deprecated Removed in Tomcat 10 and replaced by DataSourceStore
* with removal of legacy JDBC code
*/
@Deprecated
public class JDBCStore extends StoreBase {

/**


+ 1
- 0
java/org/apache/catalina/session/LocalStrings.properties View File

@@ -22,6 +22,7 @@ JDBCStore.close=Exception closing database connection [{0}]
JDBCStore.commitSQLException=SQLException committing connection before closing
JDBCStore.connectError=Cannot connect to database [{0}]
JDBCStore.loading=Loading Session [{0}] from database [{1}]
JDBCStore.missingDataSource=No data source available
JDBCStore.missingDataSourceName=No valid JNDI name was given.
JDBCStore.removing=Removing Session [{0}] at database [{1}]
JDBCStore.saving=Saving Session [{0}] to database [{1}]


+ 1
- 0
java/org/apache/catalina/session/LocalStrings_fr.properties View File

@@ -20,6 +20,7 @@ JDBCStore.checkConnectionDBReOpenFail=La tentative de réouverture de la base de
JDBCStore.checkConnectionSQLException=Une exception SQL s''est produite [{0}]
JDBCStore.close=Exception lors de la fermeture de la connection vers la base de donnée [{0}]
JDBCStore.commitSQLException=Une SQLException a été retournée lors du commit de la connection avant sa fermeture
JDBCStore.connectError=Impossible de se connecter à la base de données [{0}]
JDBCStore.loading=Chargement de la Session [{0}] depuis la base de données [{1}]
JDBCStore.missingDataSourceName=Aucun nom JNDI valide n'a été donné.
JDBCStore.removing=Retrait de la Session [{0}] de la base de données [{1}]


+ 1
- 0
java/org/apache/catalina/session/LocalStrings_ko.properties View File

@@ -20,6 +20,7 @@ JDBCStore.checkConnectionDBReOpenFail=데이터베이스에 대해 다시 연결
JDBCStore.checkConnectionSQLException=SQL 예외 발생 [{0}]
JDBCStore.close=데이터베이스 연결 [{0}]을(를) 닫는 동안 예외 발생
JDBCStore.commitSQLException=데이터베이스 연결을 닫기 전, 커밋을 시도하는 중 SQLException 발생
JDBCStore.connectError=데이터베이스 [{0}]에 연결할 수 없습니다.
JDBCStore.loading=데이터베이스 [{1}](으)로부터 세션 [{0}]을(를) 로드합니다.
JDBCStore.missingDataSourceName=유효한 JNDI 이름이 주어지지 않았습니다.
JDBCStore.removing=데이터베이스 [{1}]에서 세션 [{0}]을(를) 제거합니다.


+ 16
- 0
java/org/apache/catalina/session/LocalStrings_ru.properties View File

@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

JDBCStore.connectError=Не возможно подключиться к базе данных [{0}]

+ 4
- 6
java/org/apache/catalina/startup/LocalStrings_de.properties View File

@@ -41,10 +41,8 @@ userConfig.database=Fehler beim Laden der Benutzer Datenbank.
userConfig.error=Fehler beim deployen einer Web-Applikation für den Benutzer [{0}]
userConfig.start=UserConfig: Verarbeite START

versionLoggerListener.catalina.base=\n\
\ CATALINA_BASE: {0}
versionLoggerListener.catalina.base=CATALINA_BASE: {0}
versionLoggerListener.catalina.home=CATALINA_HOME: {0}
versionLoggerListener.os.arch=Architektur: {0}
versionLoggerListener.serverInfo.server.version=\n\
\ Server Version: {0}
versionLoggerListener.vm.vendor=JVM Hersteller: {0}
versionLoggerListener.os.arch=Architektur: {0}
versionLoggerListener.serverInfo.server.version=Server Version: {0}
versionLoggerListener.vm.vendor=JVM Hersteller: {0}

+ 14
- 5
java/org/apache/catalina/startup/LocalStrings_es.properties View File

@@ -100,10 +100,19 @@ userConfig.error=Error durante el despliegue de la aplicación web para el usari
userConfig.start="UserConfig": Procesando "START"
userConfig.stop="UserConfig": Tratamiento del "STOP"

versionLoggerListener.os.arch=Arquitectura: {0}\n
versionLoggerListener.os.version=Versión de Systema Operativo: {0}\n
versionLoggerListener.serverInfo.server.number=Número de versión de servidor: {0}
versionLoggerListener.serverInfo.server.version=Nombre de la versión del servidor: {0}\n
versionLoggerListener.vm.vendor=Vededor JVM: {0}
versionLoggerListener.arg=Command line argument: {0}
versionLoggerListener.catalina.base=CATALINA_BASE: {0}
versionLoggerListener.catalina.home=CATALINA_HOME: {0}
versionLoggerListener.env=Environment variable: {0} = {1}
versionLoggerListener.java.home=Java Home: {0}
versionLoggerListener.os.arch=Arquitectura: {0}
versionLoggerListener.os.name=OS Name: {0}
versionLoggerListener.os.version=Versión de Systema Operativo: {0}
versionLoggerListener.prop=System property: {0} = {1}
versionLoggerListener.serverInfo.server.built=Server built: {0}
versionLoggerListener.serverInfo.server.number=Número de versión de servidor: {0}
versionLoggerListener.serverInfo.server.version=Nombre de la versión del servidor: {0}
versionLoggerListener.vm.vendor=Vededor JVM: {0}
versionLoggerListener.vm.version=JVM Version: {0}

webAnnotationSet.invalidInjection=El método de inyección de anotación no es un recurso válido

+ 14
- 13
java/org/apache/catalina/startup/LocalStrings_fr.properties View File

@@ -70,6 +70,7 @@ contextConfig.jspFile.warning=WARNING : Le fichier JSP [{0}] doit commencer par
contextConfig.missingRealm=Aucun royaume (realm) n'a été configuré pour réaliser l'authentification
contextConfig.noAntiLocking=La valeur [{0}] configurée pour java.io.tmpdir ne correspond pas à un répertoire valide, le paramètre antiResourceLocking configuré pour l''application [{1}] sera ignoré
contextConfig.processAnnotationsDir.debug=Balayage du répertoire pour trouver des fichiers de classe avec annotations [{0}]
contextConfig.processAnnotationsInParallelFailure=L'exécution en parallèle a échoué
contextConfig.processAnnotationsJar.debug=Analyse du fichier jars pour des classes annotées avec [{0}]
contextConfig.processAnnotationsWebDir.debug=Balayage du répertoire d''applications web, pour fichiers de classe avec annotations [{0}]
contextConfig.resourceJarFail=Echec du traitement du JAR trouvé à l''URL [{0}] pour les ressources statiques qui devront être incluses dans le contexte avec le nom [{1}]
@@ -165,18 +166,18 @@ userConfig.start="UserConfig" : Traitement du "START"
userConfig.stop="UserConfig" : Traitement du "STOP"

versionLoggerListener.arg=Argument de la ligne de commande : {0}
versionLoggerListener.catalina.base=CATALINA_BASE : {0}
versionLoggerListener.catalina.home=CATALINA_HOME : {0}
versionLoggerListener.env=Variable d’environnement : {0} = {1}
versionLoggerListener.java.home=Java Home : {0}
versionLoggerListener.os.arch=Architecture : {0}
versionLoggerListener.os.name=Nom de l''OS : {0}
versionLoggerListener.os.version=Version OS : {0}
versionLoggerListener.prop=Propriété système : {0} = {1}
versionLoggerListener.serverInfo.server.built=Serveur compilé : {0}
versionLoggerListener.serverInfo.server.number=Version du serveur : {0}
versionLoggerListener.serverInfo.server.version=Nom version serveur : {0}
versionLoggerListener.vm.vendor=Fournisseur de la JVM : {0}
versionLoggerListener.vm.version=Version JVM : {0}
versionLoggerListener.catalina.base=CATALINA_BASE : {0}
versionLoggerListener.catalina.home=CATALINA_HOME : {0}
versionLoggerListener.env=Variable d''environnement : {0} = {1}
versionLoggerListener.java.home=Java Home : {0}
versionLoggerListener.os.arch=Architecture : {0}
versionLoggerListener.os.name=Nom de l''OS : {0}
versionLoggerListener.os.version=Version OS : {0}
versionLoggerListener.prop=Propriété système : {0} = {1}
versionLoggerListener.serverInfo.server.built=Serveur compilé : {0}
versionLoggerListener.serverInfo.server.number=Version du serveur : {0}
versionLoggerListener.serverInfo.server.version=Nom version serveur : {0}
versionLoggerListener.vm.vendor=Fournisseur de la JVM : {0}
versionLoggerListener.vm.version=Version JVM : {0}

webAnnotationSet.invalidInjection=L'annotation d'injection de ressource de la méthode est invalide

+ 14
- 13
java/org/apache/catalina/startup/LocalStrings_ko.properties View File

@@ -70,6 +70,7 @@ contextConfig.jspFile.warning=경고: Servlet 2.4에서 JSP 파일 [{0}]은(는)
contextConfig.missingRealm=인증 처리 시 사용할 Realm이 설정되지 않았습니다.
contextConfig.noAntiLocking=java.io.tmpdir 프로퍼티 값 [{0}]이(가) 유효한 디렉토리 경로가 아닙니다. 해당 웹 애플리케이션 [{1}]을(를) 위한 antiResourceLocking 설정은 무시됩니다.
contextConfig.processAnnotationsDir.debug=Annotation들을 가진 클래스 파일들을 찾기 위해 디렉토리 [{0}]을(를) 스캔합니다.
contextConfig.processAnnotationsInParallelFailure=병렬 처리 실패
contextConfig.processAnnotationsJar.debug=Annotation들, [{0}]을(를) 가진 클래스 파일들을 찾기 위해, JAR 파일을 스캔합니다.
contextConfig.processAnnotationsWebDir.debug=Annotation들인 [{0}]을(를) 가진 클래스 파일들을 찾기 위해, 웹 애플리케이션 디렉토리를 스캔합니다.
contextConfig.resourceJarFail=정적 리소스들이, [{1}](이)라는 이름의 컨텍스트에 포함되게 하기 위하여, URL [{0}]에서 발견된 JAR를 처리하지 못했습니다.
@@ -164,19 +165,19 @@ userConfig.error=사용자 [{0}]을(를) 위한 웹 애플리케이션을 배치
userConfig.start=UserConfig: START 처리 중
userConfig.stop=UserConfig: STOP 처리 중

versionLoggerListener.arg=명령 행 아규먼트: {0}
versionLoggerListener.catalina.base=CATALINA_BASE: {0}
versionLoggerListener.catalina.home=CATALINA_HOME: {0}
versionLoggerListener.env=환경 변수: {0} = {1}
versionLoggerListener.java.home=자바 홈: {0}
versionLoggerListener.arg=명령 행 아규먼트: {0}
versionLoggerListener.catalina.base=CATALINA_BASE: {0}
versionLoggerListener.catalina.home=CATALINA_HOME: {0}
versionLoggerListener.env=환경 변수: {0} = {1}
versionLoggerListener.java.home=자바 홈: {0}
versionLoggerListener.os.arch=아키텍처: {0}
versionLoggerListener.os.name=운영체제 이름: {0}
versionLoggerListener.os.version=운영체제 버전: {0}
versionLoggerListener.prop=시스템 프로퍼티: {0} = {1}
versionLoggerListener.serverInfo.server.built=Server 빌드 시각: {0}
versionLoggerListener.serverInfo.server.number=Server 버전 번호: {0}
versionLoggerListener.serverInfo.server.version=서버 버전 이름: {0}
versionLoggerListener.vm.vendor=JVM 벤더: {0}
versionLoggerListener.vm.version=JVM 버전: {0}
versionLoggerListener.os.name=운영체제 이름: {0}
versionLoggerListener.os.version=운영체제 버전: {0}
versionLoggerListener.prop=시스템 프로퍼티: {0} = {1}
versionLoggerListener.serverInfo.server.built=Server 빌드 시각: {0}
versionLoggerListener.serverInfo.server.number=Server 버전 번호: {0}
versionLoggerListener.serverInfo.server.version=서버 버전 이름: {0}
versionLoggerListener.vm.vendor=JVM 벤더: {0}
versionLoggerListener.vm.version=JVM 버전: {0}

webAnnotationSet.invalidInjection=유효하지 않은 메소드 리소스 injection annotation입니다.

+ 7
- 0
java/org/apache/catalina/startup/LocalStrings_ru.properties View File

@@ -15,8 +15,15 @@

catalina.serverStartFail=Томкат не смог запуститься из-за того что обязательный компонент не смог запуститься

contextConfig.applicationUrl=Не возможно определить URL для web.xml приложения
contextConfig.defaultPosition=Произошло в строке [{0}] столбце [{1}]

hostConfig.deployDir=Установка веб приложения в папку [{0}]

userConfig.database=Ошибка при загрузке базы данных пользователей

versionLoggerListener.catalina.base=CATALINA_BASE: {0}
versionLoggerListener.catalina.home=CATALINA_HOME: {0}
versionLoggerListener.os.arch=Архитектура: {0}
versionLoggerListener.os.version=Версия ОС: {0}
versionLoggerListener.vm.version=Версия JVM: {0}

+ 8
- 8
java/org/apache/catalina/startup/LocalStrings_zh_CN.properties View File

@@ -82,7 +82,7 @@ contextConfig.tomcatWebXmlError=处理 /WEB-INF/tomcat-web.xml 发生错误
contextConfig.unavailable=由于之前的错误,标记当前应用程序不可用
contextConfig.unknownUrlProtocol=注解解析过程中,URL协议[{0}]未识别。忽略URL[{1}]。
contextConfig.urlPatternValue=类文件[{1}]的urlPatterns和值属性上同时设置了注解[{0}]
contextConfig.xmlSettings=上下文[{0}]将解析web.xml和web-fragment.xml文件,验证为:[{1}],命名空间感知为(:[{2}]
contextConfig.xmlSettings=上下文[{0}]将解析web.xml和web-fragment.xml文件,验证为:[{1}],命名空间感知为:[{2}]

engineConfig.cce=生命周期事件数据对象[{0}]不是一个引擎(Engine)
engineConfig.start=EngineConfig:处理开始。
@@ -107,12 +107,12 @@ hostConfig.context.restart=上下文[{0}]重新启动时出错。
hostConfig.createDirs=无法为部署创建目录:[{0}]
hostConfig.deploy.error=部署web应用程序目录[{0}]时发生异常
hostConfig.deployDescriptor=正在部署部署描述符[{0}]。
hostConfig.deployDescriptor.blocked=(:未部署上下文路径为[{0}]的Web应用程序,因为它包含一个部署描述符[{1}],该描述符可能包含安全部署应用程序所需的配置,但此主机的DeployXML设置阻止了部署描述符的处理。应该在[{2}]创建适当的描述符来部署此应用程序。
hostConfig.deployDescriptor.blocked=未部署上下文路径为[{0}]的Web应用程序,因为它包含一个部署描述符[{1}],该描述符可能包含安全部署应用程序所需的配置,但此主机的DeployXML设置阻止了部署描述符的处理。应该在[{2}]创建适当的描述符来部署此应用程序。
hostConfig.deployDescriptor.error=部署描述符[{0}]时出错
hostConfig.deployDescriptor.finished=部署描述符[{0}]的部署已在[{1}]ms内完成
hostConfig.deployDescriptor.hiddenDir=使用外部docBase部署部署描述符[{0}]意味着appBase中的目录[{1}]将被忽略
hostConfig.deployDescriptor.hiddenWar=使用外部docBase部署部署描述符[{0}]意味着appBase中的WAR[{1}]将被忽略
hostConfig.deployDescriptor.localDocBaseSpecified=(:在主机appBase 中指定了docBase [{0}],将被忽略
hostConfig.deployDescriptor.localDocBaseSpecified=在主机appBase 中指定了docBase [{0}],将被忽略
hostConfig.deployDescriptor.path=部署描述符[{1}]中值为[{0}]的路径属性已被忽略
hostConfig.deployDescriptor.threaded.error=等待部署描述符的多线程部署完成时出错
hostConfig.deployDir=把web 应用程序部署到目录 [{0}]
@@ -135,7 +135,7 @@ hostConfig.jmx.unregister=移除注册上下文[{0}]失败
hostConfig.reload=重新加载上下文[{0}]
hostConfig.resourceNotAbsolute=无法从上下文[{0}]中删除资源,因为[{1}]不是绝对路径
hostConfig.start=HostConfig: 开始处理
hostConfig.stop=:)Host配置:停止处理
hostConfig.stop=Host配置:停止处理
hostConfig.undeploy=正在取消部署上下文[{0}]
hostConfig.undeployVersion=正在取消部署没有活动会话的旧版本上下文[{0}]

@@ -161,17 +161,17 @@ userConfig.error=为用户 [{0}]部署web应用发生错误
userConfig.start=用户配置:处理开始
userConfig.stop=UserConfig:处理停止

versionLoggerListener.arg=命令行参数:{0}
versionLoggerListener.arg=命令行参数: {0}
versionLoggerListener.catalina.base=CATALINA_BASE: {0}
versionLoggerListener.catalina.home=CATALINA_HOME: {0}
versionLoggerListener.env=环境变量:[{0}] = [{1}]
versionLoggerListener.env=环境变量: {0} = {1}
versionLoggerListener.java.home=Java 环境变量: {0}
versionLoggerListener.os.arch=架构: {0}
versionLoggerListener.os.name=操作系统名称: {0}
versionLoggerListener.os.version=OS.版本: {0}
versionLoggerListener.prop=系统属性: {0} = {1}
versionLoggerListener.prop=系统属性: {0} = {1}
versionLoggerListener.serverInfo.server.built=服务器构建: {0}
versionLoggerListener.serverInfo.server.number=服务器版本号(: {0}
versionLoggerListener.serverInfo.server.number=服务器版本号: {0}
versionLoggerListener.serverInfo.server.version=Server.服务器版本: {0}
versionLoggerListener.vm.vendor=JVM.供应商: {0}
versionLoggerListener.vm.version=Java虚拟机版本: {0}


+ 2
- 0
java/org/apache/catalina/tribes/group/interceptors/LocalStrings_ru.properties View File

@@ -20,3 +20,5 @@ nonBlockingCoordinator.memberAlive.failed=Невозможно проверит
staticMembershipInterceptor.sendShutdown.failed=Не удалось сообщить об отключении.

tcpFailureDetector.still.alive=Проверка завершена. Участник ещё жив [{0}]

tcpPingInterceptor.ping.failed=Не возможно послать TCP пинг.

+ 4
- 4
java/org/apache/catalina/tribes/membership/McastServiceImpl.java View File

@@ -373,7 +373,7 @@ public class McastServiceImpl extends MembershipProviderBase {
public void run() {
String name = Thread.currentThread().getName();
try {
Thread.currentThread().setName("Membership-MemberDisappeared.");
Thread.currentThread().setName("Membership-MemberDisappeared");
service.memberDisappeared(m);
}finally {
Thread.currentThread().setName(name);
@@ -387,7 +387,7 @@ public class McastServiceImpl extends MembershipProviderBase {
public void run() {
String name = Thread.currentThread().getName();
try {
Thread.currentThread().setName("Membership-MemberAdded.");
Thread.currentThread().setName("Membership-MemberAdded");
service.memberAdded(m);
}finally {
Thread.currentThread().setName(name);
@@ -418,7 +418,7 @@ public class McastServiceImpl extends MembershipProviderBase {
public void run() {
String name = Thread.currentThread().getName();
try {
Thread.currentThread().setName("Membership-MemberAdded.");
Thread.currentThread().setName("Membership-MemberAdded");
for (ChannelData datum : data) {
try {
if (datum != null && !member.equals(datum.getAddress())) {
@@ -456,7 +456,7 @@ public class McastServiceImpl extends MembershipProviderBase {
public void run() {
String name = Thread.currentThread().getName();
try {
Thread.currentThread().setName("Membership-MemberExpired.");
Thread.currentThread().setName("Membership-MemberExpired");
service.memberDisappeared(member);
} finally {
Thread.currentThread().setName(name);


+ 2
- 0
java/org/apache/catalina/util/LocalStrings_ru.properties View File

@@ -13,4 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

extensionValidator.extension-not-found-error=ExtensionValidator[{0}][{1}]: требуемое расширение [{2}] не найдено.

introspection.classLoadFailed=Не возможно закрузить класс [{0}]

+ 2
- 6
java/org/apache/catalina/valves/HealthCheckValve.java View File

@@ -82,11 +82,7 @@ public class HealthCheckValve extends ValveBase {
@Override
protected synchronized void startInternal() throws LifecycleException {
super.startInternal();
if (getContainer() instanceof Context) {
context = true;
} else {
context = false;
}
context = (getContainer() instanceof Context);
}

@Override
@@ -96,7 +92,7 @@ public class HealthCheckValve extends ValveBase {
context ? request.getRequestPathMB() : request.getDecodedRequestURIMB();
if (urlMB.equals(path)) {
response.setContentType("application/json");
if (!checkContainersAvailable || (checkContainersAvailable && isAvailable(getContainer()))) {
if (!checkContainersAvailable || isAvailable(getContainer())) {
response.getOutputStream().print(UP);
} else {
response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);


+ 111
- 0
java/org/apache/catalina/valves/JsonErrorReportValve.java View File

@@ -0,0 +1,111 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.catalina.valves;

import java.io.IOException;
import java.io.Writer;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.coyote.ActionCode;
import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.res.StringManager;

/**
* <p>Implementation of a Valve that outputs error jsons.</p>
*
* <p>This Valve should be attached at the Host level, although it will work
* if attached to a Context.</p>
*
*/
public class JsonErrorReportValve extends ErrorReportValve {

public JsonErrorReportValve() {
super();
}

@Override
protected void report(Request request, Response response, Throwable throwable) {

int statusCode = response.getStatus();

// Do nothing on a 1xx, 2xx and 3xx status
// Do nothing if anything has been written already
// Do nothing if the response hasn't been explicitly marked as in error
// and that error has not been reported.
if (statusCode < 400 || response.getContentWritten() > 0 || !response.setErrorReported()) {
return;
}

// If an error has occurred that prevents further I/O, don't waste time
// producing an error report that will never be read
AtomicBoolean result = new AtomicBoolean(false);
response.getCoyoteResponse().action(ActionCode.IS_IO_ALLOWED, result);
if (!result.get()) {
return;
}

StringManager smClient = StringManager.getManager(Constants.Package, request.getLocales());
response.setLocale(smClient.getLocale());
String type = null;
if (throwable != null) {
type = smClient.getString("errorReportValve.exceptionReport");
} else {
type = smClient.getString("errorReportValve.statusReport");
}
String message = response.getMessage();
if (message == null && throwable != null) {
message = throwable.getMessage();
}
String description = null;
description = smClient.getString("http." + statusCode + ".desc");
if (description == null) {
if (message == null || message.isEmpty()) {
return;
} else {
description = smClient.getString("errorReportValve.noDescription");
}
}
String jsonReport = "{\n" +
" \"type\": \"" + type + "\",\n" +
" \"message\": \"" + message + "\"\n" +
" \"description\": \"" + description + "\"\n" +
"}";
try {
try {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
if (container.getLogger().isDebugEnabled()) {
container.getLogger().debug("status.setContentType", t);
}
}
Writer writer = response.getReporter();
if (writer != null) {
writer.write(jsonReport);
response.finishResponse();
return;
}
} catch (IOException e) {
// Ignore
} catch (IllegalStateException e) {
// Ignore
}
}
}

+ 2
- 0
java/org/apache/catalina/valves/LocalStrings_ko.properties View File

@@ -127,6 +127,8 @@ http.511.reason=네트워크 인증이 필요함
jdbcAccessLogValve.close=데이터베이스를 닫지 못했습니다.
jdbcAccessLogValve.exception=접근 엔트리를 추가하는 중 예외 발생

persistentValve.filter.failure=필터를 컴파일할 수 없습니다: [{0}]

remoteCidrValve.invalid=[{0}]을(를) 위해 유효하지 않은 설정이 제공되었습니다. 상세 정보를 보시려면 이전 메시지들을 확인하십시오.
remoteCidrValve.noRemoteIp=클라이언트가 IP 주소를 가지고 있지 않습니다.