http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

      Bootstrap
          |
       System
          |
       Common
       /     \
  Webapp1   Webapp2 ... 


클래스 로더 계층 구조이다.


lass Loader Definitions

As indicated in the diagram above, Tomcat 6 creates the following class loaders as it is initialized:

  • Bootstrap - This class loader contains the basic runtime classes provided by the Java Virtual Machine, plus any classes from JAR files present in the System Extensions directory ($JAVA_HOME/jre/lib/ext). NOTE - Some JVMs may implement this as more than one class loader, or it may not be visible (as a class loader) at all.
  • System - This class loader is normally initialized from the contents of theCLASSPATH environment variable. All such classes are visible to both Tomcat internal classes, and to web applications. However, the standard Tomcat 6 startup scripts ($CATALINA_HOME/bin/catalina.sh or%CATALINA_HOME%\bin\catalina.bat) totally ignore the contents of the CLASSPATHenvironment variable itself, and instead build the System class loader from the following repositories:
    • $CATALINA_HOME/bin/bootstrap.jar - Contains the main() method that is used to initialize the Tomcat 6 server, and the class loader implementation classes it depends on.
    • $CATALINA_HOME/bin/tomcat-juli.jar - Package renamed Commons logging API, and java.util.logging LogManager.
  • Common - This class loader contains additional classes that are made visible to both Tomcat internal classes and to all web applications. Normally, application classes should NOT be placed here. All unpacked classes and resources in $CATALINA_HOME/lib, as well as classes and resources in JAR files are made visible through this class loader. By default, that includes the following:
    • annotations-api.jar - JEE annotations classes.
    • catalina.jar - Implementation of the Catalina servlet container portion of Tomcat 6.
    • catalina-ant.jar - Tomcat Catalina Ant tasks.
    • catalina-ha.jar - High availability package.
    • catalina-tribes.jar - Group communication package.
    • el-api.jar - EL 2.1 API.
    • jasper.jar - Jasper 2 Compiler and Runtime.
    • jasper-el.jar - Jasper 2 EL implementation.
    • jasper-jdt.jar - Eclipse JDT 3.2 Java compiler.
    • jsp-api.jar - JSP 2.1 API.
    • servlet-api.jar - Servlet 2.5 API.
    • tomcat-coyote.jar - Tomcat connectors and utility classes.
    • tomcat-dbcp.jar - package renamed database connection pool based on Commons DBCP.
    • tomcat-i18n-**.jar - Optional JARs containing resource bundles for other languages. As default bundles are also included in each individual JAR, they can be safely removed if no internationalization of messages is needed.
  • WebappX - A class loader is created for each web application that is deployed in a single Tomcat 6 instance. All unpacked classes and resources in the /WEB-INF/classes directory of your web application archive, plus classes and resources in JAR files under the /WEB-INF/lib directory of your web application archive, are made visible to the containing web application, but to no others.

As mentioned above, the web application class loader diverges from the default Java 2 delegation model (in accordance with the recommendations in the Servlet Specification, version 2.3, section 9.7.2 Web Application Classloader). When a request to load a class from the web application's WebappX class loader is processed, this class loader will look in the local repositories first, instead of delegating before looking. There are exceptions. Classes which are part of the JRE base classes cannot be overriden. For some classes (such as the XML parser components in J2SE 1.4+), the J2SE 1.4 endorsed feature can be used. Last, any JAR containing servlet API classes will be ignored by the classloader. All other class loaders in Tomcat 6 follow the usual delegation pattern.

Therefore, from the perspective of a web application, class or resource loading looks in the following repositories, in this order:

  • Bootstrap classes of your JVM
  • System class loader classes (described above)
  • /WEB-INF/classes of your web application
  • /WEB-INF/lib/*.jar of your web application
  • $CATALINA_HOME/lib
  • $CATALINA_HOME/lib/*.jar



SRV.9.7.2 Web Application Class Loader

The class loader that a container uses to load a servlet in a WAR must allow the
developer to load any resources contained in library JARs within the WAR
following normal J2SE semantics using getResource. As described in the J2EE
license agreement, servlet containers that are not part of a J2EE product should not
allow the application to override J2SE platform classes, such as those in the java.*
and javax.* namespaces, that J2SE does not allow to be modified. Also, servlet
containers that are part of a J2EE product should not allow the application to
override J2SE or J2EE platform classes, such as those in java.* and javax.*
namespaces, that either J2SE or J2EE do not allow to be modified. The container
should not allow applications to override or access the container’s implementation
Replacing a Web Application classes. 
It is recommended also that the application class loader be implemented so
that classes and resources packaged within the WAR are loaded in preference to
classes and resources residing in container-wide library JARs.


'Web service' 카테고리의 다른 글

Tomcat 7 Released  (0) 2010.07.02
AB (apache load generator) usage  (0) 2010.06.13
[Tomcat] STRICT_SERVLET_COMPLIANCE 내용  (0) 2010.06.03
톰캣 Connector 프로토콜 설정  (0) 2010.05.31
Tomcat7 Valve를 Filter로 바뀔까나~  (0) 2010.05.13
Posted by '김용환'
,


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html

Servlet 스펙을 Strict 하게 준수하게 위해서 STRICT_SERVLET_COMPLIANCE 옵션을 사용한다.
사실 Servlet 스펙 관련된 내용은STRICT_SERVLET_COMPLIANCE 말고도 ACTIVITY_CHECK, ALLOW_EQUALS_IN_VALUE, ALWAYS_ADD_EXPIRES 이렇게 3개가 더 있다.


PropertyDescription
org.apache.catalina. STRICT_SERVLET_COMPLIANCE

If this is true the following actions will occur:

  • any wrapped request or response object passed to an application dispatcher will be checked to ensure that it has wrapped the original request or response. (SRV.8.2 / SRV.14.2.5.1)
  • a call to Response.getWriter() if no character encoding has been specified will result in subsequent calls toResponse.getCharacterEncoding() returning ISO-8859-1and the Content-Type response header will include acharset=ISO-8859-1 component. (SRV.15.2.22.1)
  • every request that is associated with a session will cause the session's last accessed time to be updated regardless of whether or not the request explicitly accesses the session. (SRV.7.6)
  • cookies will be parsed strictly, by default v0 cookies will not work with any invalid characters. 
    If set to false, any v0 cookie with invalid character will be switched to a v1 cookie and the value will be quoted.
  • ServletContext.getResource/getResourceAsStream must start with "/"
    if set to false, code like getResource("myfolder/myresource.txt") will work



SRV.8.2 Using a Request Dispatcher
To use a request dispatcher, a servlet calls either the include method or forward
method of the RequestDispatcher interface. The parameters to these methods can
be either the request and response arguments that were passed in via the service
method of the Servlet interface, or instances of subclasses of the request and
response wrapper classes that have been introduced for version 2.3 of the
specification. In the latter case, the wrapper instances must wrap the request or
response objects that the container passed into the service method.
The Container Provider must ensure that the dispatch of the request to a target
servlet occurs in the same thread of the same VM as the original request.

------------------------------------

SRV.14.2.5.1 Methods
forward(ServletRequest, ServletResponse)

public void forward(ServletRequest request,
ServletResponse response)
throws ServletException, IOException

include(ServletRequest, ServletResponse)
public void include(ServletRequest request,
ServletResponse response)
throws ServletException, IOException


----------------------------
두번째 내용은 스펙의 번호가 약간 잘못되지 않았나 싶다.

SRV.4.9 Request data encoding
Currently, many browsers do not send a char encoding qualifier with the Content-
Type header, leaving open the determination of the character encoding for reading
HTTP requests. The default encoding of a request the container uses to create the
request reader and parse POST data must be “ISO-8859-1” if none has been
specified by the client request. However, in order to indicate to the developer in this
case the failure of the client to send a character encoding, the container returns null
from the getCharacterEncoding method.
If the client hasn’t set character encoding and the request data is encoded with
a different encoding than the default as described above, breakage can occur. To
remedy this situation, a new method setCharacterEncoding(String enc) has
been added to the ServletRequest interface. Developers can override the
character encoding supplied by the container by calling this method. It must be
called prior to parsing any post data or reading any input from the request. Calling
this method once data has been read will not affect the encoding.

-> 이 내용은 브라우져 요청 데이터는  요청안에 content-type의 chatset이 빠져있으면, ISO-8859-1 로 디코딩이어야 한다는 것이다. IE가 한글 정보를 base64 인코딩하면서 '=' 문제가 커지는 부분이 발견되어서 톰캣 6.0.24부터 바뀐 얘기와 연관이 깊다.

--------------------------------------------

SRV.7.6 Last Accessed Times
The getLastAccessedTime method of the HttpSession interface allows a servlet to
determine the last time the session was accessed before the current request. The
session is considered to be accessed when a request that is part of the session is first
handled by the servlet container.


---------------------------------------------


'Web service' 카테고리의 다른 글

AB (apache load generator) usage  (0) 2010.06.13
[Tomcat] 클래스로딩 How-To  (0) 2010.06.03
톰캣 Connector 프로토콜 설정  (0) 2010.05.31
Tomcat7 Valve를 Filter로 바뀔까나~  (0) 2010.05.13
Tomcat 7 TestCase의 깔끔함  (0) 2010.05.13
Posted by '김용환'
,

<Connector protocol="org.apache.coyote.http11.Http11AprProtocol"  ..>

현재 톰캣은 아래의 6가지의 Connector protocol이 있다. 

org.apache.coyote.http11.Http11Protocol
org.apache.coyote.http11.Http11NioProtocol
org.apache.coyote.http11.Http11AprProtocol
org.apache.coyote.ajp.AjpProtocol
org.apache.coyote.ajp.AjpAprProtocol
org.apache.jk.server.JkCoyoteHandler (protocol보다는 jk handler인데, 광의차원에서 protocol로 넣어준다)


톰캐 5.5부터 자세한 내용을 본다..

톰캣 5.5 

connector 가 http일 때,
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
protocol : This attribute value must be HTTP/1.1 to use the HTTP handler, which is the default.


connector가 ajp일 때,
http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html
protocol : This attribute value must be AJP/1.3 to use the AJP handler.

톰캣 5.5에서는 
ajp/1.3은 org.apache.jk.server.JkCoyoteHandler를 의미하고, http 1.1 protocol에서는 org.apache.coyote.http11.Http11Protocol를 사용하였다.


Tomcat 6

connector 가 http일 때,
protocol
Sets the protocol to handle incoming traffic. The default value is HTTP/1.1 and configures the org.apache.coyote.http11.Http11Protocol. This is the blocking Java connector.
If the PATH(Windows) or LD_LIBRARY_PATH(on most unix system) environment variables contain the Tomcat native library, the APR connector will automatically be configured. Please be advised that the APR connector has different settings for HTTPS than the default Java connector.
Other values for this attribute are, but not limited to:
org.apache.coyote.http11.Http11Protocol - same as HTTP/1.1
org.apache.coyote.http11.Http11NioProtocol - non blocking Java connector
org.apache.coyote.http11.Http11AprProtocol - the APR connector.
Take a look at our Connector Comparison chart. The configuration for both Java connectors are identical, both for http and https. 
For more information on the APR connector and APR specific SSL settings please visit the APR documentation


connector가 ajp일 때,
protocol
Sets the protocol to handle incoming traffic. The default value is AJP/1.3 and configures org.apache.jk.server.JkCoyoteHandler the original blocking Java connector by default.
If the PATH (Windows) or LD_LIBRARY_PATH (on most unix systems) environment variables contain the Tomcat native library, the native/APR connector will automatically be configured instead.
To use an explicit protocol rather than rely on the auto-switching mechanism described above, the following values may be used:
org.apache.jk.server.JkCoyoteHandler - original blocking Java connector
org.apache.coyote.ajp.AjpProtocol - new blocking Java connector that supports an executor
org.apache.coyote.ajp.AjpAprProtocol - the APR/native connector.
Custom implementations may also be used.


내가 보통 쓰는 방법은 세가지였다..

1) 아파치와 연동하는 것
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" 
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3" URIEncoding="UTF-8"/>


2) 직접 요청을 받아서 처리하는 것
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>


3) comet을 이용하는 것
<connector connectiontimeout="20000" port="8000">
     protocol="org.apache.coyote.http11.Http11NioProtocol" useComet="true" redirectPort="8443"/>

공부를 하기 위한 좋은 내용이 있어서 소개한다.
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Connector Comparison

Connector Comparison

Below is a small chart that shows how the connectors differentiate.

                  Java Blocking Connector       Java Nio Blocking Connector       APR Connector
    Classname         Http11Protocol                  Http11NioProtocol         Http11AprProtocol
    Tomcat Version   3.x 4.x 5.x 6.x                       6.x                     5.5.x 6.x
    Support Polling         NO                             YES                        YES
    Polling Size           N/A                   Unlimited - Restricted by mem        Unlimited - Configurable
    Read HTTP Request     Blocking                     Non Blocking                   Blocking
    Read HTTP Body        Blocking                     Sim Blocking                   Blocking
    Write HTTP Response   Blocking                     Sim Blocking                   Blocking
    SSL Support           Java SSL                     Java SSL                       OpenSSL
    SSL Handshake         Blocking                     Non blocking                   Blocking
    Max Connections       maxThreads                   See polling size               See polling size       



Http 11NioProtocol 공부를 많이 해야겠다는 생각이 든다..
comet 공부 시작해보자~
Posted by '김용환'
,

Tomcat7부터는 Value가 사라지고 Filter로 이루어질지도 모른다...
Tomcat7의 주장 Mark Thomas는 Tomcat8부터 사라지지 않을까 생각하지만. 실제로는 Tomcat7에서는 실질적으로 사용을 안하려 할 것이라는 생각이 든다.


http://www.pubbs.net/201003/tomcat/69238-tomcat-7-and-securityfilter-or-a-love-letter-to-markt-.html

Posted by '김용환'
,

TestCase는 깔끔하고 쓰기 편해야 하는데.. 이 부분에 대한 희망이 Tomcat TestCase를 보면서 기분이 좋아졌다. 이런 테스트 케이스가 나올 수 있도록 프레임워크는 잘 짜여져야 할 것 같다.


참고
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java?view=markup&pathrev=937733


17 package org.apache.catalina.loader;
18
19 import java.io.IOException;
20 import java.util.Timer;
21 import java.util.TimerTask;
22
23 import javax.servlet.ServletException;
24 import javax.servlet.http.HttpServlet;
25 import javax.servlet.http.HttpServletRequest;
26 import javax.servlet.http.HttpServletResponse;
27
28 import org.apache.catalina.Context;
29 import org.apache.catalina.startup.Tomcat;
30 import org.apache.catalina.startup.TomcatBaseTest;
31
32 public class TestWebappClassLoaderMemoryLeak extends TomcatBaseTest {
33
34 public void testTimerThreadLeak() throws Exception {
35 Tomcat tomcat = getTomcatInstance();
36
37 // Must have a real docBase - just use temp
38 Context ctx =
39 tomcat.addContext("/", System.getProperty("java.io.tmpdir"));
40
41 Tomcat.addServlet(ctx, "taskServlet", new TaskServlet());
42 ctx.addServletMapping("/", "taskServlet");
43
44 tomcat.start();
45
46 // This will trigger the timer & thread creation
47 getUrl("http://localhost:" + getPort() + "/");
48
49 // Stop the context
50 ctx.stop();
51
52 // If the thread still exists, we have a thread/memory leak
53 try {
54 Thread.sleep(1000);
55 } catch(InterruptedException ie) {
56 // ignore
57 }
58 Thread[] threads = getThreads();
59 for (Thread thread : threads) {
60 if (thread != null &&
61 TaskServlet.TIMER_THREAD_NAME.equals(thread.getName())) {
62 fail("Timer thread still running");
63 }
64 }
65 }
66
67 /*
68 * Get the set of current threads as an array.
69 * Copied from WebappClassLoader
70 */
71 private Thread[] getThreads() {
72 // Get the current thread group
73 ThreadGroup tg = Thread.currentThread( ).getThreadGroup( );
74 // Find the root thread group
75 while (tg.getParent() != null) {
76 tg = tg.getParent();
77 }
78
79 int threadCountGuess = tg.activeCount() + 50;
80 Thread[] threads = new Thread[threadCountGuess];
81 int threadCountActual = tg.enumerate(threads);
82 // Make sure we don't miss any threads
83 while (threadCountActual == threadCountGuess) {
84 threadCountGuess *=2;
85 threads = new Thread[threadCountGuess];
86 // Note tg.enumerate(Thread[]) silently ignores any threads that
87 // can't fit into the array
88 threadCountActual = tg.enumerate(threads);
89 }
90
91 return threads;
92 }
93
94 private static final class TaskServlet extends HttpServlet {
95
96 private static final long serialVersionUID = 1L;
97 private static final String TIMER_THREAD_NAME = "leaked-thread";
98
99 @Override
100 protected void doGet(HttpServletRequest req, HttpServletResponse resp)
101 throws ServletException, IOException {
102 Timer timer = new Timer(TIMER_THREAD_NAME);
103 timer.schedule(new LocalTask(), 0, 10000);
104 }
105
106 }
107
108 private static final class LocalTask extends TimerTask {
109
110 @Override
111 public void run() {
112 // Doesn't actually need to do anything.
113 }
114
115 }
116 }

'Web service' 카테고리의 다른 글

톰캣 Connector 프로토콜 설정  (0) 2010.05.31
Tomcat7 Valve를 Filter로 바뀔까나~  (0) 2010.05.13
[Tomcat 7] 로딩되는 Jsp 개수를 지정할 수 있도록 한다  (0) 2010.05.13
아파치 문서 보기 #1  (0) 2010.04.28
Tomcat 7  (0) 2010.04.16
Posted by '김용환'
,

톰캣 7에서는  로딩되는 Jsp 개수를 지정할 수 있을 수 있도록 코드 수정을 하였다.
Mark Tomas는 tight한 memory를 쓰는 곳에 유용할 것이라고 하였다..

https://issues.apache.org/bugzilla/show_bug.cgi?id=48358

적당한 크기를 넘치면, jsp 하나 꺼내서 uload하고 destory 한다.
수정된 코드는 다음과 같다.
http://svn.apache.org/viewvc?view=revision&revision=937787

    tomcat/trunk/java/org/apache/jasper/util/Entry.java   (with props)

    tomcat/trunk/java/org/apache/jasper/util/JspQueue.java   (with props)

Modified:

    tomcat/trunk/conf/web.xml

    tomcat/trunk/java/org/apache/jasper/EmbeddedServletOptions.java

    tomcat/trunk/java/org/apache/jasper/JspC.java

    tomcat/trunk/java/org/apache/jasper/Options.java

    tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java

    tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties

    tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java

    tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java

    tomcat/trunk/webapps/docs/changelog.xml

    tomcat/trunk/webapps/docs/jasper-howto.xml

추가된 설명을 보면.. 다음과 같다.



+<li><strong>maxLoadedJsps</strong> - The maximum number of JSPs that

+will be loaded for a web application. If more than this number of JSPs

+are loaded, the least recently used JSPs will be unloaded so that the

+number of JSPs loaded at any one time does not exceed this limit. A

+value of zero or less indicates no limit. Default <code>-1</code></li>

+

 <li><strong>modificationTestInterval</strong> - Causes a JSP (and its dependent

 files) to not be checked for modification during the specified time interval  (in seconds) from the last time the JSP was checked for modification. A value of

'Web service' 카테고리의 다른 글

Tomcat7 Valve를 Filter로 바뀔까나~  (0) 2010.05.13
Tomcat 7 TestCase의 깔끔함  (0) 2010.05.13
아파치 문서 보기 #1  (0) 2010.04.28
Tomcat 7  (0) 2010.04.16
Tomcat Major 패치 (5.5.29, 6.0.27) - 파일 다운로드 관련  (0) 2010.04.12
Posted by '김용환'
,

만약 IfModule 이라는 태그를 언제 사용할 수 있는지 봅니다.

아래 설명을 찾았습니다.



출처 : http://httpd.apache.org/docs/2.0/mod/core.html

<IfModule> Directive

Description: Encloses directives that are processed conditional on the presence or absence of a specific module
Syntax: <IfModule [!]module-name> ... </IfModule>
Context: server config, virtual host, directory, .htaccess
Override: All
Status: Core
Module: core

The <IfModule test>...</IfModule> section is used to mark directives that are conditional on the presence of a specific module. The directives within an <IfModule> section are only processed if the test is true. If test is false, everything between the start and end markers is ignored.

The test in the <IfModule> section directive can be one of two forms:

  • module name
  • !module name

In the former case, the directives between the start and end markers are only processed if the module named module name is included in Apache -- either compiled in or dynamically loaded using LoadModule. The second format reverses the test, and only processes the directives if module name is not included.

The module name argument is the file name of the module, at the time it was compiled. For example, mod_rewrite.c. If a module consists of several source files, use the name of the file containing the string STANDARD20_MODULE_STUFF.

<IfModule> sections are nest-able, which can be used to implement simple multiple-module tests.

This section should only be used if you need to have one configuration file that works whether or not a specific module is available. In normal operation, directives need not be placed in <IfModule> sections.




위의 문구중 아래를 확인한다.
Context: server config, virtual host, directory, .htaccess

http://httpd.apache.org/docs/2.0/mod/directive-dict.html#Context

사용장소 (Context)

서버의 설정파일중 어느곳에서 지시어를 사용할 수 있는지 알려준다. 다음 값들을 쉼표로 구분한 목록이다:

주서버설정 (server config)
지시어를 서버 설정파일에서 (예를 들어, httpd.conf) 사용할 수 있으나, <VirtualHost><Directory>에서 사용할 수 없음을 뜻한다. 이 지시어는 .htaccess 파일에서도 사용할 수 없다.
가상호스트 (virtual host)
지시어를 서버 설정파일의 <VirtualHost> 안에서 사용할 수 있음을 뜻한다.
디렉토리 (directory)
지시어가 어떻게 Directory, Location, Files 섹션이 동작하나에 설명한 제약을 따르며, 서버 설정파일의 <Directory>, <Location>, <Files>에서 사용할 수 있음을 뜻한다.
.htaccess
지시어를 디렉토리 .htaccess 파일에서 사용할 수 있음을 뜻한다. 이 지시어는 현재 사용하는 overrides 값에 따라 무시될 수 있다.

지시어는 지정된 장소에서 사용할 수 있다. 다른 곳에서 사용하면 설정오류가 발생하고 서버는 부분에 대한 요청을 올바로 처리하지 못하거나 작동이, 예를 들어 시작조차도, 안될 수 있다.

지시어를 사용할 수 있는 장소는 열거한 장소를 모두 불린(boolean) OR한 결과이다. 즉, "server config, .htaccess"에서 가능하다는 지시어는 httpd.conf 파일과 .htaccess 파일에서는 사용할 수 있지만, <Directory><VirtualHost>에서는 사용할 수 없다.


directory는  <Directory>, <Location>, <Files> 를 의미한다.

 

IfModule은 <directory>, <location>, <files> 태그 안에서 사용된다.

 

 

 

Posted by '김용환'
,

Tomcat 7

Web service 2010. 4. 16. 11:05


올해 상반기 안으로 Tomcat 7이 나오지 않을까  싶습니다.

 

Tomcat 7은 Servlet 3.0과 JSP 2.1(or 2.2), JDK 1.6 이상을 지원하도록 발표하였습니다.
 

Tomcat 7 Dev Leader Mark Thomas가 발표한 중요 바뀐 부분은 다음과 같습니다. Servlet 3.0 SPEC을 많이 봐야 할 것 같습니다.

•Servlet 3.0 support

•Cluster communication via UDP

•Significantly improved JMX support - GSOC

•Replace Valves with Filters - GSOC

•Bayeux

•Numerous smaller improvements

•Code clean up

–Remove unused stuff

–Resolve inconsistencies

 

 

재미있는 것은 web.xml에 더 이상 strtus, webwork 설정을 넣을 필요가 없다고 하는군요. 알아서 읽는 구조라고 하네요.

, @ annotation만으로도 서블릿과 필터를 추가 확장시킬 수 있도록 되어 있습니다.

JMX기능이 확장되었네요. 이 부분에 대한 Control이 더 좋아 질 것으로 보입니다.

GSOC(Google Summer of Code - Google Code)에 나온 좋은 것들을 Tomcat7에 넣어서 모니터링/control이 아주 잘 될 것으로 보입니다.

스펙에 대해서는 철저하게 적용되어 쿠키 나 보안문제를 처리할 수 있는 보안 정책을 지정할 수 있다고 합니다.

그리고, 전에 말씀 드렸던 메모리릭도 해결해 줄 수 있다고 발표하였습니다.

 

 

Tomcat 7 한글 자료

http://openframework.or.kr/Wiki.jsp?page=Apache_tomcat7_introduction

원본 : http://java.dzone.com/articles/mark-thomas-apache-tomcat-7

 

 

 

Tomcat 7 Dev Leader Mark Thomas 발표 자료

http://people.apache.org/~markt/presentations/2009-04-01-Tomcat7Servlet3.pdf

 

 

Tomcat 7 SVN 위치 및 테스트

http://www.codeweblog.com/tomcat-7-run-servlet-3/

 

 

 

 

Posted by '김용환'
,


Tomcat 5, 6 중요 패치가 있었습니다. (아직 나오지 않은 Tomcat 5.5.29, 6.0.27에 추가될 예정입니다.)

 

1.    이슈

톰캣으로부터 1.8MB 파일을 다운받을 때, Bad file number IOException이 뜨는 것에 대해서 버그 요청을 하였습니다.

Caching을 쓰지 않으면 문제가 없다고 합니다.

https://issues.apache.org/bugzilla/show_bug.cgi?id=48760

 

 

Tomcat Context 설정 안에 아래와 설정이 가능합니다.

http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

cacheMaxSize

Maximum size of the static resource cache in kilobytes. If not specified, the default value is 10240 (10 megabytes).

cacheObjectMaxSize

Maximum size of the static resource that will be placed in the cache. If not specified, the default value is 512 (512 kilobytes). If this value is greater than cacheMaxSize/20 it will be reduced to cacheMaxSize/20.

 

하지만, 동시 접속 시 문제가 생길 수 있었습니다.

 

2.    패치 코드

http://svn.apache.org/viewvc?view=revision&revision=920858

public InputStream streamContent()

             throws IOException {

             if (binaryContent == null) {

-                inputStream = new FileInputStream(file);

+                FileInputStream fis = new FileInputStream(file);

+                inputStream = fis;

+                return fis;

             }

             return super.streamContent();

         }

 

빨간 색 라인의 inputStream을 클래스 변수로 서로 공유했기 때문에 multiple thread 상에서 문제가 생길 수 있는 코드입니다. 톰캣 개발쪽에서도 이렇게 중요한 코드를 놓치기도 합니다..

Instance를 하나 만들어서 return하는 구조로 패치되었습니다.

 

 

 

'Web service' 카테고리의 다른 글

아파치 문서 보기 #1  (0) 2010.04.28
Tomcat 7  (0) 2010.04.16
톰캣 7 개발 도구  (0) 2010.04.12
Tomcat 버그 패치 (Race Condition)  (0) 2010.04.06
AJP 연결 테스트 (AJP command line client)  (0) 2010.04.05
Posted by '김용환'
,

톰캣 7 개발 도구

Web service 2010. 4. 12. 11:59


톰캣 7을 무슨 툴을 이용하여 개발하냐고 물어본 질문에 대해서 톰캣 7의 핵심개발자 Mark Thomas는 이렇게 대답했습니다.

 

-       톰캣 로그는 Ecplise를 통해서 봅니다. (JPDA를 말하는 것 같음)

-       Tortoise SVN : 윈도우 svn client

-       Eclipse

-       Firefox

-       LiveHttpHeaders : Firefox Pluging : Fiddler와 비슷한 툴

-       Wireshark : Socket Stream 파싱툴, TCP,IP/HTTP Protocol을 정확히 분석가능함

-       YourKit : Profiler tool (돈주고 사야하는 상용 툴임)

'Web service' 카테고리의 다른 글

Tomcat 7  (0) 2010.04.16
Tomcat Major 패치 (5.5.29, 6.0.27) - 파일 다운로드 관련  (0) 2010.04.12
Tomcat 버그 패치 (Race Condition)  (0) 2010.04.06
AJP 연결 테스트 (AJP command line client)  (0) 2010.04.05
Reverse Proxy  (0) 2010.04.05
Posted by '김용환'
,