【发布时间】:2014-08-28 12:14:15
【问题描述】:
我是第一次使用 EclipseLink 构建一个新应用程序。
在我添加一个使用 JSR310 Instant 作为时间戳列的实体之前,一切正常。
所以我创建了一个转换器类并将其映射到相关字段,如下所示:
@Convert(converter = JSR310InstantTypeConverter.class)
private Instant pwdChangeCodeExpiresOn = null;
但是,自从我添加了该转换器后,应用程序开始抛出以下异常:
SEVERE: Servlet.service() for servlet [APIJerseyServlet] in context with path [/Sclera] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.ExceptionInInitializerError] with root cause
Local Exception Stack:
Exception [EclipseLink-7351] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The converter class [com.sclera.utils.JSR310InstantTypeConverter] specified on the mapping attribute [pwdChangeCodeExpiresOn] from the class [com.sclera.entity.Admin] was not found. Please ensure the converter class name is correct and exists with the persistence unit definition.
at org.eclipse.persistence.exceptions.ValidationException.converterClassNotFound(ValidationException.java:2317)
at org.eclipse.persistence.internal.jpa.metadata.converters.ConvertMetadata.process(ConvertMetadata.java:248)
这将在代码更改后开始发生(当 Eclipse 重新启动服务器时)。我必须手动停止和启动(和/或重新启动)服务器几次,直到它最终再次开始工作。然后它会正常工作,直到一两次代码更改后它会再次开始抛出异常。
这是一个巨大的痛苦。有人知道原因和解决方法吗?
【问题讨论】:
标签: eclipse jpa eclipselink