我刚刚在我的tomcat服务器目录中部署了一个app.war文件。 当服务器启动时,上下文初始化失败,出现以下exception:
[ERROR] 2015-10-08 04:01:56,946 org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDAO' defined in ServletContext resource [/WEB-INF/hibernate-persistance.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [cz.techsys.web.server.services.hibernatepersistance.HibernateDAO]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: Syntax error, annotations are only available if source level is 1.5 or greater
我绝对已经安装了最新的Java:
XXXX@debianvirtualbox:~/$ java -version java version "1.7.0_79" OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-1~deb8u1) OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
但我注意到这在hibernate开始的日志(我从日志中删除时间戳):
信息:部署Web应用程序目录/ var / lib / tomcat8 / webapps / app [INFO] org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.5.6-Final [INFO] org.hibernate.cfg.Environment - Hibernate 3.5.6-Final [INFO] org.hibernate.cfg.Environment - 找不到hibernate.properties [INFO] org.hibernate.cfg.Environment - 字节码提供者名称:javassist [INFO] org.hibernate.cfg.Environment - 使用JDK 1.4 java.sql.Timestamp处理
是hibernate.properties缺less有关我的问题? 还是有另外一个原因hibernate使用JDK 1.4 ?