我正在尝试将一个应用程序从WLP迁移到Tomcat,在尝试部署war时,我得到了以下异常
org.apache.openjpa.persistence.ArgumentException:此配置不允许运行时优化,但以下列出的类型在构建时或类加载时没有使用javaagent进行增强:
我尝试添加javaagent以启用运行时加载JAVA_OPTS=%JAVA_OPTS% JAVA_OPTS=%JAVA_OPTS%
正如在这里中提到的,但没有成功。
任何建议或观点。
发布于 2017-01-23 16:21:03
我总是建议使用编译时优化。JPA实现是为JPA增强的类文件自动生成jpa函数的任务。
请参阅build.xml in 吉顿的ScopedEntityManager公用事业项目。
<?xml version="1.0" encoding="UTF-8"?>
<project name="jpaexample" default="build" basedir=".">
...clip...
<target name="compile" depends="clean" description="Compile classes">
<mkdir dir="${classes}"/>
<javac srcdir="${src}" destdir="${classes}" target="1.7" source="1.7" encoding="ISO-8859-1"
debug="true" debuglevel="lines,source" includeantruntime="false"
excludes="" >
<classpath refid="libs" />
</javac>
<antcall target="jpaenhance" />
</target>
<target name="jpaenhance" description="Preprocess entity classes, enhance for JPA use">
<path id="jpa.enhancement.classpath">
<pathelement location="${classes}" />
<fileset dir="./webapp/WEB-INF/lib">
<include name="*.jar" />
<exclude name="${name}.jar" />
</fileset>
</path>
<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
<classpath refid="jpa.enhancement.classpath" />
</taskdef>
<openjpac>
<classpath refid="jpa.enhancement.classpath" />
<config propertiesFile="./webapp/WEB-INF/classes/META-INF/persistence.xml" />
</openjpac>
</target>
...clip...
</project>https://stackoverflow.com/questions/37590785
复制相似问题