我正在使用版本2.5.1中的GWT开发应用程序.
几天前我们在日志中发现有大量的异常(每秒几个!!!),如下所示:
Nov 5, 2014 6:00:45 PM com.google.gwt.logging.server.RemoteLoggingServiceUtil logOnServer
SEVERE: (NS_ERROR_NOT_INITIALIZED) :
com.google.gwt.core.client.impl.SerializableThrowable$ThrowableWithClassName: (NS_ERROR_NOT_INITIALIZED) :
at Unknown.ZHe(StackTraceCreator.java:174)
at Unknown.WFe(StackTraceCreator.java:508)
at Unknown.IHf(Exceptions.java:29)
at Unknown.pIb(XMLHttpRequest.java:164)
at Unknown.OMe(RequestBuilder.java:411)
at Unknown.anonymous(XMLHttpRequest.java:351)
at Unknown.gHe(Impl.java:189)
at Unknown.jHe(Impl.java:243)
at Unknown.anonymous(Impl.java:70)
Run Code Online (Sandbox Code Playgroud)
至少在两种情况下,从Mozilla Firefox Web浏览器使用应用程序时发生问题.要阻止它,仅关闭浏览器是不够的,还要从任务管理器中终止进程.但我不确定它是否也不会被其他浏览器触发.
我还在com.google.gwt.http.client.Request类中找到了这条评论,方法为cancel():
/*
* There is a strange race condition that occurs on Mozilla when you cancel
* a request while the response is coming in. It appears that in some cases
* the onreadystatechange handler is still called after the handler function
* has …Run Code Online (Sandbox Code Playgroud) 如何覆盖grails域类中one-to-many关系字段的getter和setter?我知道如何覆盖作为单个对象的字段的getter和setter,但是我对Collections有问题.这是我的情况:
我有Entity域类,它有很多标题.现在我想覆盖标题的getter,只获得标志为isActive equals true的标题.我尝试过类似的东西,但它不起作用:
class Entity {
static hasMany = [
titles: Title
]
public Set<Title> getTitles() {
if(titles == null)
return null
return titles.findAll { r -> r.isActive == true }
}
public void setTitles(Set<Title> s) {
titles = s
}
}
class Title {
Boolean isActive
static belongsTo = [entity:Entity]
static mapping = {
isActive column: 'is_active'
isActive type: 'yes_no'
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助.
我有以下 JSON:
{
"id" : "1",
"birthday" : 401280850089
}
Run Code Online (Sandbox Code Playgroud)
和 POJO 类:
public class FbProfile {
long id;
@JsonDeserialize(using = LocalDateDeserializer.class)
LocalDate birthday;
}
Run Code Online (Sandbox Code Playgroud)
我正在使用 Jackson 进行反序列化:
public FbProfile loadFbProfile(File file) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper mapper = new ObjectMapper();
FbProfile profile = mapper.readValue(file, FbProfile.class);
return profile;
}
Run Code Online (Sandbox Code Playgroud)
但它抛出一个异常:
com.fasterxml.jackson.databind.JsonMappingException:意外的令牌(VALUE_NUMBER_INT),预期的 VALUE_STRING:预期的数组或字符串。
我怎样才能反序列化纪元LocalDate?我想补充一点,如果我将数据类型从更改LocalDate为java.util.Date它,它工作得很好。因此,也许最好反序列化java.util.Date并创建 getter 和 setter 来进行 to/from 的转换LocalDate。
使用JdbcTemplate,我想调用MERGE SQL语句,该语句将向表中插入新记录,或者如果已经存在具有特定键的行,则更新该语句。关键部分是该列之一是Oracle BLOB类型。
这是我到目前为止尝试过的:
尝试1。
SQL语句:
String sql = ""
+ "MERGE INTO file_thumbnails "
+ " USING (SELECT ? as file_c_id, ? as thumbnail_type, ? as thumbnail_image FROM DUAL) tmp "
+ " ON (file_thumbnails.file_c_id = tmp.file_c_id AND "
+ " file_thumbnails.thumbnail_type = tmp.thumbnail_type) "
+ " WHEN MATCHED THEN "
+ " UPDATE "
+ " SET thumbnail_image = tmp.thumbnail_image "
+ " ,thumbnail_date = SYSDATE "
+ " WHEN NOT MATCHED THEN "
+ " INSERT (c_id, …Run Code Online (Sandbox Code Playgroud)