小编Dav*_*ide的帖子

Java Spring Web应用程序在调试模式下启动缓慢

我有一个java Web应用程序,使用Spring,Jersey(jax-rs)和Hibernate.

它运行得很好而且速度很快,但有些时候只需要花费大量时间在调试模式下进行初始化,并且启动时非常慢......

我正在使用Eclipse 3.6,Apache Tomcat 6和java 1.6.0_29用于MAC OS X.

写入此日志行后,应用程序开始记录缓慢:

INFO: Initializing Spring root WebApplicationContext
Run Code Online (Sandbox Code Playgroud)

在此日志行之前:

30-dic-2011 10.51.25 com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
    com.example.project.web.rest
Run Code Online (Sandbox Code Playgroud)

我该如何调查?有什么建议?

不幸的是我真的不知道我做了什么来降低性能..

非常感谢您的帮助!达维德.

java debugging spring tomcat jersey

16
推荐指数
1
解决办法
6035
查看次数

JAX-RS JSON java.util.Date Unmarshall

我正在使用Jersey(jax-rs)来构建一个REST丰富的应用程序.

一切都很好,但我真的不明白如何为日期和数字配置JSON编组/解组选项.

我有一个User类:

@XmlRootElement
public class User {
    private String username;
    private String password;
    private java.util.Date createdOn;

    // ... getters and setters
}
Run Code Online (Sandbox Code Playgroud)

createdOn序列化属性时,我得到一个这样的字符串:'2010-05-12T00:00:00 + 02:00',但是我需要使用特定的日期模式来编组和解组日期.

有人知道怎么做吗?

json jax-rs marshalling unmarshalling

7
推荐指数
2
解决办法
8375
查看次数

标签 统计

debugging ×1

java ×1

jax-rs ×1

jersey ×1

json ×1

marshalling ×1

spring ×1

tomcat ×1

unmarshalling ×1