Skip to content

Commit

Permalink
* 升级依赖包的版本:
Browse files Browse the repository at this point in the history
      spring                3.1.2   -> 3.2.4
      slf4j                 1.6.6   -> 1.7.5
      commons-fileupload    1.2.2   -> 1.3
      commons-io            2.3     -> 2.4
      commons-codec         1.6     -> 1.8
      fastjson              1.1.23  -> 1.1.36
      logback               1.0.6   -> 1.0.13   [provided]
      commons-logging       1.1.1   -> 1.1.3    [provided]
      servlet               3.0.1   -> 3.1.0    [provided]
      javamail              1.4.1   -> 1.4.7    [provided]
      activation            1.1     -> 1.1.1    [provided]
      freemarker            2.3.19  -> 2.3.20   [provided]
      groovy                1.8.6   -> 2.1.7    [runtime]
      httpunit              1.7     -> 1.7.2    [test]
      xerces                2.10.0  -> 2.11.0   [test]
      easymock              3.1     -> 3.2      [test]
      jasper                6.0.35  -> 6.0.37   [test]
      mock-javamail         1.7     -> 1.9      [test]
  • Loading branch information
Michael Zhou committed Sep 19, 2013
1 parent e4fa60b commit df033c0
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 44 deletions.
19 changes: 19 additions & 0 deletions CHANGES_SINCE_3.2.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,22 @@
<res-loaders:super-loader name="/webroot/common/templates/layout" />
</resource>
* Bugfix: 修正当request.startAsync以后,每个请求都会生成cglib类,从而导致permgen溢出的问题。
* 升级依赖包的版本:
spring 3.1.2 -> 3.2.4
slf4j 1.6.6 -> 1.7.5
commons-fileupload 1.2.2 -> 1.3
commons-io 2.3 -> 2.4
commons-codec 1.6 -> 1.8
fastjson 1.1.23 -> 1.1.36
logback 1.0.6 -> 1.0.13 [provided]
commons-logging 1.1.1 -> 1.1.3 [provided]
servlet 3.0.1 -> 3.1.0 [provided]
javamail 1.4.1 -> 1.4.7 [provided]
activation 1.1 -> 1.1.1 [provided]
freemarker 2.3.19 -> 2.3.20 [provided]
groovy 1.8.6 -> 2.1.7 [runtime]
httpunit 1.7 -> 1.7.2 [test]
xerces 2.10.0 -> 2.11.0 [test]
easymock 3.1 -> 3.2 [test]
jasper 6.0.35 -> 6.0.37 [test]
mock-javamail 1.7 -> 1.9 [test]
2 changes: 1 addition & 1 deletion common/logconfig/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<artifactId>hamcrest-library</artifactId>
</dependency>
<dependency>
<groupId>httpunit</groupId>
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion dist/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>httpunit</groupId>
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<scope>compile</scope>
</dependency>
Expand Down
52 changes: 28 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
<java.version>1.6</java.version>
<java.encoding>UTF-8</java.encoding>
<webx-version>3.2.1</webx-version>
<spring-version>3.1.2.RELEASE</spring-version>
<spring-version>3.2.4.RELEASE</spring-version>
<springext-plugin-version>1.2</springext-plugin-version>
<maven-util-version>1.1</maven-util-version>
<jetty-version>8.1.7.v20120910</jetty-version>
<maven-util-version>1.2</maven-util-version>
<jetty-version>8.1.13.v20130916</jetty-version>
<project.build.sourceEncoding>${java.encoding}</project.build.sourceEncoding>
<gpg.skip>true</gpg.skip>
</properties>
Expand Down Expand Up @@ -282,33 +282,33 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
<version>1.7.5</version>
</dependency>
<!-- 将现有的jakarta commons logging的调用转换成lsf4j的调用。 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.6.6</version>
<version>1.7.5</version>
</dependency>
<!-- Hack:确保commons-logging的jar包不被引入,否则将和jcl-over-slf4j冲突 -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<version>1.1.3</version>
<scope>provided</scope>
</dependency>
<!-- slf4j的实现:logback,用来取代log4j。更快、更强! -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.6</version>
<version>1.0.13</version>
<scope>runtime</scope>
</dependency>
<!-- log4j的实现:备而不用。 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
<version>1.7.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand All @@ -333,15 +333,19 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>httpunit</groupId>
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<version>1.7</version>
<version>1.7.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>jtidy</groupId>
<groupId>net.sf.jtidy</groupId>
<artifactId>jtidy</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
Expand All @@ -363,7 +367,7 @@
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -381,13 +385,13 @@
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymockclassextension</artifactId>
<version>3.1</version>
<version>3.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>jasper</artifactId>
<version>6.0.35</version>
<version>6.0.37</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -399,7 +403,7 @@
<dependency>
<groupId>org.jvnet.mock-javamail</groupId>
<artifactId>mock-javamail</artifactId>
<version>1.7</version>
<version>1.9</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -429,28 +433,28 @@
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.19</version>
<version>2.3.20</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
<version>1.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.3</version>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.6</version>
<version>2.1.7</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -486,13 +490,13 @@
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.1</version>
<version>1.4.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -503,7 +507,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.1.23</version>
<version>1.1.36</version>
</dependency>
<!-- ======================================== -->
<!-- Spring依赖 -->
Expand Down Expand Up @@ -576,7 +580,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,15 @@ public void render_error() throws Exception {
} catch (TemplateException e) {
assertThat(
e,
exception(InvalidReferenceException.class, "Error rendering FreeMarker template: /test_render.ftl",
"Expression world is undefined on line 6, column 10 in test_render.ftl"));
exception(InvalidReferenceException.class, "Error rendering FreeMarker template: /test_render.ftl"));
}

// 语法错
try {
templateService.getText("test_render_error.ftl", ctx);
fail();
} catch (TemplateException e) {
assertThat(e, exception(ParseException.class, "Error rendering FreeMarker template: "
+ "/test_render_error.ftl"));
assertThat(e, exception(ParseException.class, "Error rendering FreeMarker template: /test_render_error.ftl"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.EmptyStackException;
import java.util.LinkedList;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.citrus.service.requestcontext.RequestContext;
Expand Down Expand Up @@ -499,6 +500,15 @@ public void close() throws IOException {
bytes.flush();
bytes.close();
}

@Override
public boolean isReady() {
return true;
}

@Override
public void setWriteListener(WriteListener writeListener) {
}
}

/** 代表一个将内容保存在内存中的<code>PrintWriter</code>。 */
Expand Down Expand Up @@ -558,5 +568,14 @@ public void flush() throws IOException {
public void close() throws IOException {
this.flush();
}

@Override
public boolean isReady() {
return true;
}

@Override
public void setWriteListener(WriteListener writeListener) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.io.IOException;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;

class CommittingAwareServletOutputStream extends ServletOutputStream {
private final HeaderCommitter committer;
Expand Down Expand Up @@ -148,6 +149,16 @@ public void close() throws IOException {
originalStream.close();
}

@Override
public boolean isReady() {
return originalStream.isReady();
}

@Override
public void setWriteListener(WriteListener writeListener) {
originalStream.setWriteListener(writeListener);
}

@Override
public String toString() {
return originalStream.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.concurrent.TimeUnit;
import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand Down Expand Up @@ -67,8 +68,18 @@ public void init() throws Exception {

expect(response.getWriter()).andReturn(new PrintWriter(System.out)).anyTimes();
expect(response.getOutputStream()).andReturn(new ServletOutputStream() {
@Override
public void write(int b) throws IOException {
}

@Override
public boolean isReady() {
return true;
}

@Override
public void setWriteListener(WriteListener writeListener) {
}
}).anyTimes();

replay(servletContext, request, response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ public void setFileNameKey(String[] fileNameKey) {
}

@Override
public List<?/* FileItem */> parseRequest(HttpServletRequest request) throws FileUploadException {
public List<FileItem> parseRequest(HttpServletRequest request) throws FileUploadException {
return parseRequest(new ServletRequestContext(request));
}

@Override
public List<?/* FileItem */> parseRequest(RequestContext ctx) throws FileUploadException {
@SuppressWarnings("unchecked")
public List<FileItem> parseRequest(RequestContext ctx) throws FileUploadException {
List<FileItem> items = super.parseRequest(ctx);
String charset = ctx.getCharacterEncoding();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void link_URIBroker() {
assertEquals("http://www.alibaba.com/", uri.setServerName("www.alibaba.com").render());
assertEquals("http://localhost:8080/", uri.setServerPort(8080).render());
assertEquals("http://localhost/", uri.setServerPort(80).render());
assertEquals("https://localhost/", uri.setServerScheme("https").render());
assertEquals("https://localhost:80/", uri.setServerScheme("https").render());
assertEquals("http://localhost/aa/bb", uri.addPath("aa").addPath("bb").render());

// fork
Expand Down
2 changes: 1 addition & 1 deletion test/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>httpunit</groupId>
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<scope>compile</scope>
</dependency>
Expand Down
Loading

0 comments on commit df033c0

Please sign in to comment.