Skip to main content

Kenyth Zeng's Library tagged tomcat   View Popular

02 Nov 09

Java 编程的动态性,第 1 部分:类和类装入 - K.Y.Z@CSDN - CSDN博客

  • 在编写应用程序以使用接口时,可以到运行时才指定其实际实现。这个用于组装应用程序的后联编方法广泛用于 Java 平台,servlet 就是一个常见示例。
  • 每个构造好的类在某种意义上是由装入它的类装入器所“拥有”。类装入器通常保留它们所装入类的映射,从而当再次请求某个类时,能通过名称找到该类。
  • 5 more annotations...

Apache Tomcat 6.0 - Class Loader HOW-TO

  • Some JVMs may
    implement this as more than one class loader, or it may not be visible
    (as a class loader) at all.
  • the standard Tomcat 6 startup scripts
    ($CATALINA_HOME/bin/catalina.sh or
    %CATALINA_HOME%\bin\catalina.bat) totally ignore the contents
    of the CLASSPATH environment variable itself
  • 6 more annotations...
22 May 09

Tomcat Tutorial: The Architecture of Tomcat - server.xml configuration

  • At the core of this rewrite is the Catalina servlet engine
  • Tomcat comes an entirely new architecture composed of a grouping of application containers, each with a specific role. The sum of all of these containers makes up an instance of a Catalina engine.
  • 3 more annotations...
21 May 09

Bug 44310 – Possible data packet corruption when sending data on the outputStream of a recycled response

  • By activating
    -Dorg.apache.catalina.connector.RECYCLE_FACADES=true
    on the command line, the problem of data corruption does not occur anymore
    (exception occurs in write and not flush).
  • I have no requirement to include it in 6.0.16 since I have a workaround (disable
    recycling facades),
20 May 09

InfoQ: Web请求异步处理降低应用依赖风险

    • 问题原因:



      1. Http请求处理的阻塞方式。
      2. 后端服务处理时间过长,服务质量不稳定。
      3. Web Container接受请求线程资源有限。
      4. 改阻塞方式为非阻塞方式来处理请求。
      5. 设置后端超时时间,主动断开连接,回收资源。
      6. 修改容器配置,增加线程池大小以及等待队列长度。
  • 15 more annotations...

Nabble - Tomcat - User - comet questions

  • private class ServerCometChannel {


            private static final int OUTPUT_BUFFER_SIZE = 512;


            private CometEvent cometEvent;


            private InputStream inputStream;


            private PrintWriter outputWriter;


            public ServerCometChannel(CometEvent cometEvent) throws

    IOException, ServletException {

                this.cometEvent = cometEvent;

                inputStream = cometEvent.getHttpServletRequest().getInputStream();

                OutputStream outputStream =

    cometEvent.getHttpServletResponse().getOutputStream();

                this.outputWriter = new PrintWriter(new BufferedWriter(new

    OutputStreamWriter(outputStream),

                        OUTPUT_BUFFER_SIZE));

            }


            private String receive() throws IOException {

                StringBuffer buffer = new StringBuffer();

                byte[] buf = new byte[512];

                while (inputStream.available() > 0) {

                    int n = inputStream.read(buf);

                    if (n > 0) {

                        buffer.append(new String(buf, 0, n));

                    }

                }

                return buffer.toString();

            }


            public void send(String msg) {

                synchronized (cometEvent.getHttpServletResponse()) {

                    outputWriter.print(msg);

                    outputWriter.flush();

                }

            }


            public void close() throws IOException {

                inputStream.close();

                outputWriter.close();

            }

        }
18 May 09

Comet Daily » Blog Archive » JavaScript Tutorial

  • i have a complex servlet implementing comet -now running from Tomcat with Nio protocol enabled - that pushes data towards clients.. my only problem is having a client able to interprete what i push and display it in an easy way with good performances

Apache Tomcat Configuration Reference - The HTTP 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.
  • The default value is to use the value that has been set for the
    connectionTimeout attribute.
  • 2 more annotations...

Apache Tomcat 6.0 - Connectors How To

  • When using a single server, the performance when using a native webserver in
    front of the Tomcat instance is most of the time significantly worse than a
    standalone Tomcat with its default HTTP connector, even if a large part of the web
    application is made of static files.
17 May 09

page 1 > Asynchronous HTTP and Comet architectures - JavaWorld

  • In this article I introduce asynchronous, non-blocking HTTP programming and explain how
    it works.
  • Asynchronous message handling also enables HTTP pipelining, which you can use to send multiple HTTP requests without waiting for the server response to former requests. The response
    messages will be returned by the server in the same order as they were sent. Pipelining requires that the underlying HTTP
    connection is in persistent mode, which is the standard mode with HTTP/1.1.
  • 1 more annotations...
15 May 09

Apache Tomcat 6.0 - Advanced IO and Tomcat

  • process IO aynchronously
  • Servlets which implement the org.apache.catalina.CometProcessor
    interface will have their event method invoked rather than the usual service
    method
  • 7 more annotations...
14 May 09

Nabble - Tomcat - User - Setting up Comet on Tomcat 6

  • implements CometProcessor
  •       <Connector port="8080"

    protocol="org.apache.coyote.http11.Http11NioProtocol"

    connectionTimeout="10000"

            tomcatAuthentication="false" keepaliveTimeout="5000"

            backlog="50" maxThreads="300" />
19 Apr 09

Apache Tomcat 6.0 - Class Loader HOW-TO

  • Like many server applications, Tomcat 6 installs a variety of class loaders
    (that is, classes that implement java.lang.ClassLoader) to allow
    different portions of the container, and the web applications running on the
    container, to have access to different repositories of available classes and
    resources.
  • the standard Tomcat 6 startup scripts
    ($CATALINA_HOME/bin/catalina.sh or
    %CATALINA_HOME%\bin\catalina.bat) totally ignore the contents
    of the CLASSPATH environment variable itself
  • 6 more annotations...
20 Feb 09

Java How To ...: 6 Common Errors in Setting Java Heap Size

  • How to set java heap size in Tomcat?
    Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin/catalina.sh or catalina.bat for how this variable is used. For example,
    set CATALINA_OPTS="-Xms512m -Xmx512m"  (Windows)
    export CATALINA_OPTS="-Xms512m -Xmx512m" (ksh/bash)
    setenv CATALINA_OPTS "-Xms512m -Xmx512m" (tcsh/csh)
  • How to set java heap size in Apache Ant?
    Set environment variable ANT_OPTS. Look at the file $ANT_HOME/bin/ant or %ANT_HOME%\bin\ant.bat, for how this variable is used by Ant runtime.
    set ANT_OPTS="-Xms512m -Xmx512m"  (Windows)
    export ANT_OPTS="-Xms512m -Xmx512m" (ksh/bash)
    setenv ANT_OPTS "-Xms512m -Xmx512m" (tcsh/csh)
17 Feb 09

Blog of Adam Warski » Blog Archive » UTF-8 in JBoss/Tomcat + MySQL + Hibernate + JavaMail

    • you also have to tell hibernate that in your connection to MySQL, you will be using the UTF-8 encoding. To do this:


      • if you are using a data source, to the connection URL add the parameters as in this example: <connection-url>jdbc:mysql://localhost:3306/

        <my_database>?useUnicode=true&characterEncoding=UTF-8

        </connection-url>
      • if you are using EJB3/JPA, add to persistence.xml the following properties (in the appropriate <persistence-unit>):



        <property name=”hibernate.connection.useUnicode”

        value=”true” />

        <property name=”hibernate.connection.characterEncoding”

        value=”UTF-8″ />
      • in case of “plain” hibernate, just specify the above properties in your configuration file (hibernate.properties or hibernate.cfg.xml)
28 Nov 08

用 GlassFish v2 替换 Tomcat 5.x - Tomcat - Java - JavaEye论坛

  • Tomcat主要的缺点就是较弱的热部署

    (hot deploy)能力. 修改一个Java类, 保存后, Tomcat会重新加载这个类, 但不久就要重

    新启动Tomcat才能继续开发. 在企业关键应用的场景下, 若发生急迫的程序缺陷更正, 让众多的用户停止手头的工作, 等待服务器重新启动, 显然十分不便.
  • GlassFish v2 的热部署能力就是其主要的一个受大家欢迎的

    特性. 这也是我们要用 GlassFish v2 替换 Tomcat 5.x 的主要理由.
  • 1 more annotations...

用 GlassFish v2 替换 Tomcat 5.x - Tomcat - Java - JavaEye论坛

  • Tomcat reload导致OOM的问题,在Jetty上也是一样,把JDK换成了JRockit之后就正常了,我测试过,使用SUN JDK的时候,reload 4次Jetty就OOM了,但是用JRockit一直reload 25次了还没问题
1 - 20 of 67 Next › Last »
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo