我有一个使用 Eclipselink 2.5 的应用程序,在运行 Junit 测试用例时,我总是收到以下警告:
[EL Warning]: metadata: 2013-08-19 01:14:05.142--ServerSession(14351551)--
Reverting the lazy setting on the OneToOne or ManyToOne attribute [currentTransit]
for the entity class [class ......persistent.entity.BPExecutionEntity] since
weaving was not enabled or did not occur.
所以,我在我的 Ant 构建文件上写了一个“编织”任务,如下所示:
<target name="define.task" description="New task definition for EclipseLink static weaving">
<taskdef name="weave" classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask"/>
</target>
<target name="weaving" description="perform weaving" depends="define.task">
<weave source="D:\...\dist\${ant.project.name}.jar"
target="D:\...\dist\woven-${ant.project.name}.jar"
persistenceinfo="D:\...\lib\persistence.jar">
<classpath>
</classpath>
</weave>
</target>
好的,一切正常,当我编译代码时,它会生成一个已编译 jar 一半大小的编织文件。但是,当我运行项目的测试时,我仍然收到相同的警告blah blah blah... since weaving was not enabled or did not occur.
有人知道如何从我的测试中删除此警告吗?