我在启动和运行实体管理器工厂方面遇到了更多问题。不幸的是,错误信息非常模糊。我不太清楚为什么它不是更具描述性,但它就是它:
Hibernate启动日志消息(跟踪级别),没有为简洁而配置的实体(除了创建此关系的所有启动消息之外,都是相同的错误消息):
2010-02-12 20:48:52,501 INFO - main - org.hibernate.cfg.annotations.Version <clinit> - Hibernate Annotations 3.4.0.GA
2010-02-12 20:48:52,510 INFO - main - org.hibernate.cfg.Environment <clinit> - Hibernate 3.3.0.SP1
2010-02-12 20:48:52,513 INFO - main - org.hibernate.cfg.Environment <clinit> - hibernate.properties not found
2010-02-12 20:48:52,516 INFO - main - org.hibernate.cfg.Environment buildBytecodeProvider - Bytecode provider name : javassist
2010-02-12 20:48:52,520 INFO - main - org.hibernate.cfg.Environment <clinit> - using JDK 1.4 java.sql.Timestamp handling
2010-02-12 20:48:52,563 INFO - main - org.hibernate.annotations.common.Version <clinit> - Hibernate Commons Annotations 3.1.0.GA
2010-02-12 20:48:52,567 INFO - main - org.hibernate.ejb.Version <clinit> - Hibernate EntityManager 3.4.0.GA
2010-02-12 20:48:52,582 DEBUG - main - org.hibernate.ejb.Ejb3Configuration configure - Look up for persistence unit: development
2010-02-12 20:48:52,583 TRACE - main - org.hibernate.ejb.Ejb3Configuration configure - Analysing persistence.xml: file:/mnt/projects/workspaces/development/trunk/web/WalterJWhite.com/WalterJWhite-web/target/work/webapp/WEB-INF/classes/META-INF/persistence.xml
2010-02-12 20:48:52,617 DEBUG - main - org.hibernate.util.DTDEntityResolver resolveEntity - trying to resolve system-id [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd]
2010-02-12 20:48:52,617 DEBUG - main - org.hibernate.cfg.EJB3DTDEntityResolver resolveEntity - recognized EJB3 ORM namespace; attempting to resolve on classpath under org/hibernate/ejb
2010-02-12 20:48:52,618 DEBUG - main - org.hibernate.cfg.EJB3DTDEntityResolver resolveEntity - located [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd] in classpath
2010-02-12 20:48:52,650 TRACE - main - org.hibernate.ejb.packaging.PersistenceXmlLoader parsePersistenceUnit - Persistent Unit name from persistence.xml: development
2010-02-12 20:48:52,654 TRACE - main - org.hibernate.ejb.Ejb3Configuration configure - PersistenceMetadata [
name: development
jtaDataSource: null
nonJtaDataSource: jdbc/development
transactionType: RESOURCE_LOCAL
provider: org.hibernate.ejb.HibernatePersistence
classes[
]
packages[
]
mappingFiles[
]
jarFiles[
]
hbmfiles: 0
properties[
hibernate.search.default.directory_provider: org.hibernate.search.store.FSDirectoryProvider
hibernate.search.default.indexBase: /mnt/projects/workspaces/development/trunk/web/WalterJWhite.com/WalterJWhite-web/target/WalterJWhite-web-1.8.0-SNAPSHOT-development/lucene/indexes
hibernate.jdbc.batch_versioned_data: true
hibernate.ejb.event.post-insert: org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener
hibernate.connection.autocommit: true
hibernate.ejb.event.post-collection-recreate: org.hibernate.envers.event.AuditEventListener
hibernate.show_sql: false
hibernate.ejb.event.pre-collection-update: org.hibernate.envers.event.AuditEventListener
format_sql: false
hibernate.ejb.event.post-update: org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener
hibernate.hbm2ddl.auto: create-drop
hibernate.cache.use_query_cache: true
hibernate.connection.release_mode: after_transaction
hibernate.jndi.java.naming.factory.url.pkgs: org.mortbay.naming
use_sql_comments: false
hibernate.jndi.java.naming.factory.initial: org.mortbay.naming.InitialContextFactory
hibernate.cache.provider_class: org.hibernate.cache.EHCacheProvider
hibernate.ejb.event.post-delete: org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener
hibernate.cache.provider_configuration_file_resource_path: /ehcache.xml
hibernate.dialect: org.hibernate.dialect.MySQLInnoDBDialect
hibernate.ejb.event.pre-collection-remove: org.hibernate.envers.event.AuditEventListener
]]
2010-02-12 20:48:52,655 TRACE - main - org.hibernate.ejb.packaging.JarVisitorFactory getJarURLFromURLEntry - JAR URL from URL Entry: file:/mnt/projects/workspaces/development/trunk/web/WalterJWhite.com/WalterJWhite-web/target/work/webapp/WEB-INF/classes/META-INF/persistence.xml >> file:/mnt/projects/workspaces/development/trunk/web/WalterJWhite.com/WalterJWhite-web/target/work/webapp/WEB-INF/classes/
2010-02-12 20:48:52,659 DEBUG - main - org.hibernate.ejb.packaging.AbstractJarVisitor unqualify - Searching mapped entities in jar/par: file:/mnt/projects/workspaces/development/trunk/web/WalterJWhite.com/WalterJWhite-web/target/work/webapp/WEB-INF/classes/
2010-02-12 20:48:52,663 DEBUG - main - org.hibernate.ejb.packaging.AbstractJarVisitor addElement - File Filter matched for META-INF/orm.xml
2010-02-12 20:48:52,667 DEBUG - main - org.hibernate.ejb.Ejb3Configuration getDetectedArtifacts - Detect class: true; detect hbm: true
2010-02-12 20:48:52,669 DEBUG - main - org.hibernate.ejb.Ejb3Configuration configure - Creating Factory: development
2010-02-12 20:48:52,674 DEBUG - main - org.hibernate.util.DTDEntityResolver resolveEntity - trying to resolve system-id [file:///mnt/projects/workspaces/development/trunk/web/WalterJWhite.com/WalterJWhite-web/orm_1_0.xsd]
2010-02-12 20:48:52,674 DEBUG - main - org.hibernate.cfg.EJB3DTDEntityResolver resolveEntity - recognized EJB3 ORM namespace; attempting to resolve on classpath under org/hibernate/ejb
2010-02-12 20:48:52,675 DEBUG - main - org.hibernate.cfg.EJB3DTDEntityResolver resolveEntity - located [file:///mnt/projects/workspaces/development/trunk/web/WalterJWhite.com/WalterJWhite-web/orm_1_0.xsd] in classpath
2010-02-12 20:48:52,722 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration secondPassCompile - Execute first pass mapping processing
2010-02-12 20:48:52,763 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration processArtifactsOfType - Process hbm files
2010-02-12 20:48:52,764 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration processArtifactsOfType - Process annotated classes
2010-02-12 20:48:52,764 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration processFkSecondPassInOrder - processing fk mappings (*ToOne and JoinedSubclass)
2010-02-12 20:48:52,765 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing extends queue
2010-02-12 20:48:52,765 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing collection mappings
2010-02-12 20:48:52,765 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing native query and ResultSetMapping mappings
2010-02-12 20:48:52,765 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing association property references
2010-02-12 20:48:52,766 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing foreign key constraints
2010-02-12 20:48:52,779 DEBUG - main - org.hibernate.ejb.util.NamingHelper bind - No JNDI name configured for binding Ejb3Configuration
2010-02-12 20:48:52,789 DEBUG - main - org.hibernate.cfg.Configuration buildSessionFactory - Preparing to build session factory with filters : {}
2010-02-12 20:48:52,790 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration secondPassCompile - Execute first pass mapping processing
2010-02-12 20:48:52,790 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration processArtifactsOfType - Process hbm files
2010-02-12 20:48:52,790 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration processArtifactsOfType - Process annotated classes
2010-02-12 20:48:52,790 DEBUG - main - org.hibernate.cfg.AnnotationConfiguration processFkSecondPassInOrder - processing fk mappings (*ToOne and JoinedSubclass)
2010-02-12 20:48:52,791 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing extends queue
2010-02-12 20:48:52,791 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing collection mappings
2010-02-12 20:48:52,791 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing native query and ResultSetMapping mappings
2010-02-12 20:48:52,792 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing association property references
2010-02-12 20:48:52,792 DEBUG - main - org.hibernate.cfg.Configuration secondPassCompile - processing foreign key constraints
2010-02-12 20:48:52,797 INFO - main - org.hibernate.util.NamingHelper getInitialContext - JNDI InitialContext properties:{java.naming.factory.initial=org.mortbay.naming.InitialContextFactory, java.naming.factory.url.pkgs=org.mortbay.naming}
2010-02-12 20:48:52,804 INFO - main - org.hibernate.connection.DatasourceConnectionProvider configure - Using datasource: jdbc/development
2010-02-12 20:48:53,230 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - RDBMS: MySQL, version: 5.1.37-1ubuntu5.1
2010-02-12 20:48:53,231 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
2010-02-12 20:48:53,244 INFO - main - org.hibernate.dialect.Dialect <init> - Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
2010-02-12 20:48:53,271 INFO - main - org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
2010-02-12 20:48:53,273 INFO - main - org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2010-02-12 20:48:53,273 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Automatic flush during beforeCompletion(): disabled
2010-02-12 20:48:53,273 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Automatic session close at end of transaction: disabled
2010-02-12 20:48:53,274 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - JDBC batch size: 15
2010-02-12 20:48:53,274 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - JDBC batch updates for versioned data: enabled
2010-02-12 20:48:53,275 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Scrollable result sets: enabled
2010-02-12 20:48:53,275 DEBUG - main - org.hibernate.cfg.SettingsFactory buildSettings - Wrap result sets: disabled
2010-02-12 20:48:53,275 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - JDBC3 getGeneratedKeys(): enabled
2010-02-12 20:48:53,275 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Connection release mode: after_transaction
2010-02-12 20:48:53,276 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Maximum outer join fetch depth: 2
2010-02-12 20:48:53,277 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Default batch fetch size: 1
2010-02-12 20:48:53,277 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Generate SQL with comments: disabled
2010-02-12 20:48:53,277 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Order SQL updates by primary key: disabled
2010-02-12 20:48:53,277 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Order SQL inserts for batching: disabled
2010-02-12 20:48:53,278 INFO - main - org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2010-02-12 20:48:53,279 INFO - main - org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> - Using ASTQueryTranslatorFactory
2010-02-12 20:48:53,280 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Query language substitutions: {}
2010-02-12 20:48:53,280 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - JPA-QL strict compliance: enabled
2010-02-12 20:48:53,280 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Second-level cache: enabled
2010-02-12 20:48:53,282 INFO - main - org.hibernate.cfg.SettingsFactory buildSettings - Query cache: enabled
2010-02-12 20:48:53,285 INFO - main - org.hibernate.cfg.SettingsFactory createRegionFactory - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
2010-02-12 20:48:53,285 INFO - main - org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge <init> - Cache provider: org.hibernate.cache.EHCacheProvider
它总是在EHCacheProvider死掉。我过去遇到的问题是我将项目分成50个子项目(30个模型项目,监听项目,过滤项目,ui项目,网络行动项目等)。我的一个项目很可能没有使用最新版本(尽管不太可能)导致这种类型的错误。
这是我的log4j配置。我正在尝试将日志中的内容分开,以便我可以更轻松地识别问题的来源,并查看解决问题所需的内容。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!--
| For more configuration infromation and examples see the Jakarta Log4j
| owebsite: http://jakarta.apache.org/log4j
-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="${logging.pattern}"/>
</layout>
</appender>
<appender name="HIBERNATE_FILE" class="org.apache.log4j.FileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${log.directory}hibernate.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="${logging.pattern}"/>
</layout>
</appender>
<appender name="C3P0_FILE" class="org.apache.log4j.FileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${log.directory}c3p0.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="${logging.pattern}"/>
</layout>
</appender>
<appender name="SEAM_FILE" class="org.apache.log4j.FileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${log.directory}seam.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="${logging.pattern}"/>
</layout>
</appender>
<appender name="FILE" class="org.apache.log4j.FileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${log.directory}${pom.artifactId}.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="${logging.pattern}"/>
</layout>
</appender>
<appender name="DATABASE_DEPLOYMENT_FILE" class="org.apache.log4j.FileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${log.directory}${pom.artifactId}.database.deployment.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="${logging.pattern}"/>
</layout>
</appender>
<logger name="org">
<level value="${components.logLevel}"/>
</logger>
<logger name="net">
<level value="${components.logLevel}"/>
</logger>
<logger name="com">
<level value="${components.logLevel}"/>
</logger>
<logger name="javax">
<level value="${components.logLevel}"/>
</logger>
<logger name="org.jboss.seam" additivity="false">
<level value="${seam.logLevel}"/>
<appender-ref ref="SEAM_FILE"/>
</logger>
<!-- Only put hibernate stuff in the hibernate file, be sure to not include it in the application logs -->
<logger name="org.hibernate" additivity="false">
<level value="TRACE"/>
<appender-ref ref="HIBERNATE_FILE"/>
</logger>
<logger name="com.mchange" additivity="false">
<level value="${components.logLevel}" />
<appender-ref ref="C3P0_FILE"/>
</logger>
<logger name="com.walterjwhite" additivity="false">
<level value="${walterjwhite.logLevel}"/>
<appender-ref ref="FILE"/>
</logger>
<!-- Log the database import script to a separate file to keep information clean and simple -->
<logger name="com.walterjwhite.service.databaseImporter" additivity="false">
<level value="TRACE"/>
<appender-ref ref="DATABASE_DEPLOYMENT_FILE"/>
</logger>
<root>
<priority value="${components.logLevel}"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</log4j:configuration>
答案 0 :(得分:0)
你的休眠日志没有显示错误。为什么你认为有什么不对?以后是否有实际的错误消息?
答案 1 :(得分:0)
我发现了问题。我必须将一个调试器附加到启动过程,以查看根本原因是找不到类的异常。原因本身是null,这就是为什么异常被记录的原因。
我在这里混合和匹配的版本显然为我正在使用的缓存提供程序更改了一个类名,这导致了整个混乱。
沃尔特