我在tomcat 7上的catalina.out日志中不断收到以下错误消息,我只是找不到源:
java.lang.ClassNotFoundException: play.db.jpa.JPABase
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:150)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
at my.task.task.model.RequestLogManager.add(RequestLogManager.java:44)
at my.task.task.control.RequestLogFilter.logRequest(RequestLogFilter.java:48)
at my.task.task.control.RequestLogFilter.doFilter(RequestLogFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at my.task.task.control.LoginFilter.doFilter(LoginFilter.java:26)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:269)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1773)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我在 Mysql 服务器上使用休眠3和JSF 2 。我从来没有使用过游戏框架。
该异常不会导致持久性问题,所有事务都在数据库中提交。所以它实际上比问题更烦人,但我无法忍受在不知道来源和清理日志的情况下出现错误消息。
导致错误的代码是:
public int add(RequestLogBean request) {
if (request.getUserName() == null || request.getUserName().isEmpty()) {
throw new IllegalArgumentException("Missing request user name");
}
int result = -1;
Session session = this.getFactory().openSession();
try {
session.beginTransaction();
result = (Integer) session.save(request);
session.getTransaction().commit();
} catch(HibernateException e) {
if(session.getTransaction() != null) {
session.getTransaction().rollback();
}
e.printStackTrace();
return -1;
} finally {
session.close();
}
return result;
}
在commit()
我调查过: 这篇文章
但我的情况不同,我使用的不是jBoss而是tomcat。我添加到我的 pom.xml
<dependency>
<groupId>com.google.code.maven-play-plugin.org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.10.Final-patched-play-1.2.5</version>
<scope>compile</scope>
</dependency>
我确定我的 Maven 依赖项已添加到我的类路径中。
类是做什么play.db.jpa.JPABase
用的?
我读到它是任何 jpa impl on play 框架的基类,但我什至没有将它安装在我的计算机上.....
任何帮助将不胜感激。