- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对 JBoss、EJB3、hibernate 和 MySQL 还很陌生。
我正在尝试编写一个示例代码来使用 JPA 和 hibernate 来持久化一个 bean。
我正在关注 http://docs.jboss.org/hibernate/entitymanager/3.6/reference/en/html/ , 第二章 http://docs.jboss.org/hibernate/entitymanager/3.6/reference/en/html/configuration.html#d0e215关于如何配置 hibernate 。
完成 hibernate、MySQL 和 JBoss 的配置指南后,我收到以下错误(当我设置 <property name="hibernate.hbm2ddl.auto" value="validate"/>
时),这表明它无法连接/找到架构和/或表。
12:08:31,486 INFO [DatabaseMetadata] 表未找到:用户
如果我删除上述属性,那么 JBoss 将不会在启动期间提示,但一旦我尝试在 bean 上调用 persist() 时它就会提示该表不存在。
根据我对指南的理解,我不需要 orm.xml 或 hibernate.cfg.xml,只要我在 persistence.xml 文件中指出所有必要的属性,这就是我所做的(试图保持简单和可管理)。但是,经过几天的故障排除后,我无法成功保留该 bean。
这是我的 persistence.xml 文件:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="ejb3-persistence-unit" transaction-type="JTA">
<jta-data-source>java:/DefaultDS</jta-data-source>
<class>com.sf.bean.UserBean</class>
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/HRIS"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value="root"/>
<!-- JDBC connection pool (use the built-in) -->
<property name="hibernate.connection.pool_size" value="1"/>
<!-- SQL dialect -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<!-- Enable Hibernate's automatic session context management -->
<property name="hibernate.current_session_context_class" value="thread"/>
<!-- Disable the second-level cache -->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
<!-- Echo all executed SQL to stdout -->
<property name="hibernate.use_sql_comments" value="true"/>
<property name="hibernate.show_sql" value="true"/>
<!-- validate the database schema on startup -->
<property name="hibernate.transaction.auto_close_session" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
</properties>
</persistence-unit>
</persistence>
这是 server.log 的输出
12:08:05,110 INFO [AbstractServer] Starting: JBossAS [6.0.0.Final "Neo"]
12:08:06,914 INFO [ServerInfo] Java version: 1.6.0_24,Apple Inc.
12:08:06,915 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
12:08:06,915 INFO [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 19.1-b02-334,Apple Inc.
12:08:06,915 INFO [ServerInfo] OS-System: Mac OS X 10.6.7,x86_64
12:08:06,916 INFO [ServerInfo] VM arguments: -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Xdebug -Xrunjdwp:transport=dt_socket,address=8989,suspend=n,server=y -Dhibernate.show_sql=true -Dprogram.name=run.sh -Djava.library.path=/Users/sfdeveloper/dev/jboss-6.0.0.Final/bin/native/lib64 -Djava.endorsed.dirs=/Users/sfdeveloper/dev/jboss-6.0.0.Final/lib/endorsed
12:08:06,978 INFO [JMXKernel] Legacy JMX core initialized
12:08:12,915 INFO [AbstractServerConfig] JBoss Web Services - Stack CXF Server 3.4.1.GA
.............
............. {lines deleted}
.............
12:08:26,628 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
12:08:26,866 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb
12:08:27,133 INFO [Version] Hibernate Commons Annotations 3.2.0.Final
12:08:27,145 INFO [Environment] Hibernate 3.6.0.Final
**12:08:27,148 INFO [Environment] hibernate.properties not found**
12:08:27,152 INFO [Environment] Bytecode provider name : javassist
12:08:27,158 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
12:08:27,309 INFO [Version] Hibernate EntityManager 3.6.0.Final
12:08:27,342 INFO [Ejb3Configuration] Processing PersistenceUnitInfo [
name: timerdb
...]
12:08:27,399 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly.PersistenceUnitInfo.getNewTempClassLoader() is null.
12:08:27,495 INFO [AnnotationBinder] Binding entity from annotated class: org.jboss.ejb3.timerservice.mk2.persistence.TimerEntity
12:08:27,608 INFO [EntityBinder] Bind entity org.jboss.ejb3.timerservice.mk2.persistence.TimerEntity on table timer
12:08:28,433 INFO [AnnotationBinder] Binding entity from annotated class: org.jboss.ejb3.timerservice.mk2.persistence.TimeoutMethod
12:08:28,442 INFO [EntityBinder] Bind entity org.jboss.ejb3.timerservice.mk2.persistence.TimeoutMethod on table timeout_method
12:08:28,511 INFO [AnnotationBinder] Binding entity from annotated class: org.jboss.ejb3.timerservice.mk2.persistence.CalendarTimerEntity
12:08:28,513 INFO [EntityBinder] Bind entity org.jboss.ejb3.timerservice.mk2.persistence.CalendarTimerEntity on table calendar_timer
12:08:28,590 INFO [Version] Hibernate Validator 3.1.0.GA
12:08:28,670 INFO [Version] Hibernate Validator 4.1.0.Final
12:08:28,693 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
12:08:28,936 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
12:08:28,942 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
12:08:28,950 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
12:08:28,963 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
12:08:28,968 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
12:08:28,973 INFO [SettingsFactory] Database ->
name : HSQL Database Engine
version : 1.8.0
major : 1
minor : 8
12:08:28,974 INFO [SettingsFactory] Driver ->
name : HSQL Database Engine Driver
version : 1.8.0
major : 1
minor : 8
12:08:29,048 INFO [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
12:08:29,077 INFO [JdbcSupportLoader] Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
12:08:29,105 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
12:08:29,111 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
12:08:29,114 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
12:08:29,114 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
12:08:29,114 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
12:08:29,114 INFO [SettingsFactory] JDBC batch size: 15
12:08:29,114 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
12:08:29,116 INFO [SettingsFactory] Scrollable result sets: enabled
12:08:29,116 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
12:08:29,116 INFO [SettingsFactory] Connection release mode: auto
12:08:29,118 INFO [SettingsFactory] Default batch fetch size: 1
12:08:29,118 INFO [SettingsFactory] Generate SQL with comments: disabled
12:08:29,118 INFO [SettingsFactory] Order SQL updates by primary key: disabled
12:08:29,118 INFO [SettingsFactory] Order SQL inserts for batching: disabled
12:08:29,119 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
12:08:29,123 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
12:08:29,123 INFO [SettingsFactory] Query language substitutions: {}
12:08:29,123 INFO [SettingsFactory] JPA-QL strict compliance: enabled
12:08:29,123 INFO [SettingsFactory] Second-level cache: enabled
12:08:29,124 INFO [SettingsFactory] Query cache: disabled
12:08:29,125 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
12:08:29,134 INFO [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
12:08:29,136 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
12:08:29,136 INFO [SettingsFactory] Cache region prefix: persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb
12:08:29,136 INFO [SettingsFactory] Structured second-level cache entries: disabled
12:08:29,149 INFO [SettingsFactory] Echoing all SQL to stdout
12:08:29,151 INFO [SettingsFactory] Statistics: disabled
12:08:29,151 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
12:08:29,151 INFO [SettingsFactory] Default entity-mode: pojo
12:08:29,151 INFO [SettingsFactory] Named query checking : enabled
12:08:29,151 INFO [SettingsFactory] Check Nullability in Core (should be disabled when Bean Validation is on): disabled
12:08:29,188 INFO [SessionFactoryImpl] building session factory
12:08:29,520 INFO [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb
12:08:29,523 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
12:08:29,527 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb
12:08:29,527 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
12:08:29,537 INFO [SchemaUpdate] Running hbm2ddl schema update
12:08:29,538 INFO [SchemaUpdate] fetching database metadata
12:08:29,540 INFO [SchemaUpdate] updating schema
12:08:29,544 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
12:08:29,584 INFO [TableMetadata] table found: PUBLIC.TIMEOUTMETHOD_METHODPARAMS
12:08:29,584 INFO [TableMetadata] columns: [methodparams, timeoutmethod_id]
12:08:29,585 INFO [TableMetadata] foreign keys: [fkf294c964b7de2d8a]
12:08:29,585 INFO [TableMetadata] indexes: [sys_idx_55]
12:08:29,610 INFO [TableMetadata] table found: PUBLIC.CALENDAR_TIMER
12:08:29,610 INFO [TableMetadata] columns: [scheduleexprtimezone, scheduleexprsecond, autotimer, scheduleexprstartdate, scheduleexprminute, scheduleexprhour, timeoutmethod_id, id, scheduleexprdayofmonth, scheduleexprenddate, scheduleexprmonth, scheduleexprdayofweek, scheduleexpryear]
12:08:29,611 INFO [TableMetadata] foreign keys: [fk2b697f04b7de2d8a, fk2b697f04e6e6ef93]
12:08:29,611 INFO [TableMetadata] indexes: [sys_idx_57, sys_idx_48, sys_idx_59]
12:08:29,627 INFO [TableMetadata] table found: PUBLIC.TIMEOUT_METHOD
12:08:29,628 INFO [TableMetadata] columns: [id, methodname, declaringclass]
12:08:29,628 INFO [TableMetadata] foreign keys: []
12:08:29,628 INFO [TableMetadata] indexes: [sys_idx_50]
12:08:29,647 INFO [TableMetadata] table found: PUBLIC.TIMER
12:08:29,647 INFO [TableMetadata] columns: [id, previousrun, initialdate, repeatinterval, timedobjectid, timerstate, nextdate, info]
12:08:29,647 INFO [TableMetadata] foreign keys: []
12:08:29,648 INFO [TableMetadata] indexes: [sys_idx_52]
12:08:29,650 INFO [SchemaUpdate] schema update complete
12:08:29,656 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
12:08:29,879 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
12:08:29,920 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MySQLDB' to JNDI name 'java:MySQLDB'
12:08:30,140 INFO [xnio] XNIO Version 2.1.0.CR2
12:08:30,149 INFO [nio] XNIO NIO Implementation Version 2.1.0.CR2
12:08:30,408 INFO [remoting] JBoss Remoting version 3.1.0.Beta2
12:08:30,569 INFO [TomcatDeployment] deploy, ctxPath=/
12:08:30,661 INFO [BeanInstantiatorDeployerBase] Installed org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator@7760116b into MC at org.jboss.ejb.bean.instantiator/Simple/Simple-server/UserServiceImpl
12:08:30,672 WARN [InterceptorInfoRepository] EJBTHREE-1852: InterceptorInfoRepository is deprecated
12:08:31,216 INFO [JBossASKernel] Created KernelDeployment for: Simple-server.jar
12:08:31,220 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3
12:08:31,221 INFO [JBossASKernel] with dependencies:
12:08:31,221 INFO [JBossASKernel] and demands:
12:08:31,221 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService; Required: Described
12:08:31,221 INFO [JBossASKernel] jboss-injector:topLevelUnit=Simple.ear,unit=Simple-server.jar,bean=UserServiceImpl; Required: Described
12:08:31,222 INFO [JBossASKernel] jboss-switchboard:appName=Simple,module=Simple-server,name=UserServiceImpl; Required: Create
12:08:31,222 INFO [JBossASKernel] persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit; Required: Described
12:08:31,222 INFO [JBossASKernel] and supplies:
12:08:31,222 INFO [JBossASKernel] jndi:Simple/UserServiceImpl/local-com.sf.service.user.UserService
12:08:31,222 INFO [JBossASKernel] jndi:UserServiceImpl
12:08:31,222 INFO [JBossASKernel] jndi:Simple/UserServiceImpl/local
12:08:31,222 INFO [JBossASKernel] Class:com.sf.service.user.UserService
12:08:31,227 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3) to KernelDeployment of: Simple-server.jar
12:08:31,366 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit
12:08:31,368 INFO [Ejb3Configuration] Processing PersistenceUnitInfo [
name: ejb3-persistence-unit
...]
12:08:31,369 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly.PersistenceUnitInfo.getNewTempClassLoader() is null.
12:08:31,370 INFO [AnnotationBinder] Binding entity from annotated class: com.sf.bean.UserBean
12:08:31,370 INFO [EntityBinder] Bind entity com.sf.bean.UserBean on table users
12:08:31,379 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
12:08:31,386 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
12:08:31,389 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
12:08:31,405 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
12:08:31,407 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
12:08:31,407 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
12:08:31,439 INFO [SettingsFactory] Database ->
name : HSQL Database Engine
version : 1.8.0
major : 1
minor : 8
12:08:31,440 INFO [SettingsFactory] Driver ->
name : HSQL Database Engine Driver
version : 1.8.0
major : 1
minor : 8
12:08:31,442 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
12:08:31,443 INFO [JdbcSupportLoader] Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
12:08:31,444 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
12:08:31,444 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
12:08:31,445 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
12:08:31,445 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
12:08:31,445 INFO [SettingsFactory] Automatic session close at end of transaction: enabled
12:08:31,445 INFO [SettingsFactory] JDBC batch size: 15
12:08:31,445 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
12:08:31,446 INFO [SettingsFactory] Scrollable result sets: enabled
12:08:31,446 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
12:08:31,446 INFO [SettingsFactory] Connection release mode: auto
12:08:31,446 INFO [SettingsFactory] Maximum outer join fetch depth: 2
12:08:31,446 INFO [SettingsFactory] Default batch fetch size: 1
12:08:31,447 INFO [SettingsFactory] Generate SQL with comments: enabled
12:08:31,447 INFO [SettingsFactory] Order SQL updates by primary key: disabled
12:08:31,447 INFO [SettingsFactory] Order SQL inserts for batching: disabled
12:08:31,447 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
12:08:31,448 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
12:08:31,448 INFO [SettingsFactory] Query language substitutions: {}
12:08:31,448 INFO [SettingsFactory] JPA-QL strict compliance: enabled
12:08:31,448 INFO [SettingsFactory] Second-level cache: enabled
12:08:31,449 INFO [SettingsFactory] Query cache: disabled
12:08:31,449 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
12:08:31,449 INFO [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.NoCacheProvider
12:08:31,452 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
12:08:31,453 INFO [SettingsFactory] Cache region prefix: persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit
12:08:31,453 INFO [SettingsFactory] Structured second-level cache entries: disabled
12:08:31,453 INFO [SettingsFactory] Echoing all SQL to stdout
12:08:31,453 INFO [SettingsFactory] Statistics: disabled
12:08:31,454 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
12:08:31,454 INFO [SettingsFactory] Default entity-mode: pojo
12:08:31,454 INFO [SettingsFactory] Named query checking : enabled
12:08:31,454 INFO [SettingsFactory] Check Nullability in Core (should be disabled when Bean Validation is on): disabled
12:08:31,461 INFO [SessionFactoryImpl] building session factory
12:08:31,472 INFO [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit
12:08:31,472 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
12:08:31,475 INFO [NamingHelper] Creating subcontext: persistence.unit:unitName=Simple.ear
12:08:31,476 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit
12:08:31,476 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
12:08:31,480 INFO [SchemaValidator] Running schema validator
12:08:31,480 INFO [SchemaValidator] fetching database metadata
12:08:31,482 INFO [DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
**12:08:31,486 INFO [DatabaseMetadata] table not found: users
12:08:31,488 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit state=Create: javax.persistence.PersistenceException: [PersistenceUnit: ejb3-persistence-unit] Unable to build EntityManagerFactory**
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:911) [:3.6.0.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) [:3.6.0.Final]
at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:47) [:1.0.2-alpha-3]
at org.jboss.as.jpa.scanner.HackCEMFBuilder.build(HackCEMFBuilder.java:49) [:6.0.0.Final]
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275) [:1.0.2-alpha-3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
………..
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]
Caused by: org.hibernate.HibernateException: Missing table: users
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1310) [:3.6.0.Final]
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139) [:3.6.0.Final]
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:376) [:3.6.0.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842) [:3.6.0.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902) [:3.6.0.Final]
... 79 more
12:08:31,541 INFO [service] Removing bootstrap log handlers
12:08:31,645 ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss-switchboard:appName=Simple,module=Simple-web" is missing the following dependencies:
Dependency "jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3" (should be in state "Installed", but is actually in state "PreInstall")
Deployment "jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3" is missing the following dependencies:
Dependency "<UNKNOWN jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit' **")
Deployment "jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3" (should be in state "Installed", but is actually in state "PreInstall")
Deployment "jboss.web.deployment:war=/ejb3" is missing the following dependencies:
Dependency "jboss-switchboard:appName=Simple,module=Simple-web" (should be in state "Installed", but is actually in state "Deploy")
DEPLOYMENTS IN ERROR:
Deployment "persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit" is in error due to the following reason(s): org.hibernate.HibernateException: Missing table: users
Deployment "<UNKNOWN jboss.j2ee:ear=Simple.ear,jar=Simple-server.jar,name=UserServiceImpl,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=Simple.ear/Simple-server.jar#ejb3-persistence-unit' **
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]
12:08:31,669 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
12:08:31,672 INFO [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
12:08:31,672 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 26s:559ms
这是显示架构和表格的工作台屏幕截图:
非常感谢任何帮助,- 旧金山的开发者。
最佳答案
hibernate.hbm2ddl.auto=validate
这意味着该异常是合乎逻辑的——hibernate 会尝试查找您的实体是否有它们对应的表,如果没有找到,则报告一个问题
要修复它,您有两种选择:
hibernate.hbm2ddl.auto=update
。这将创建(和更新)数据库架构以匹配实体。关于mysql - 找不到表 : users during JBoss 6 startup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5532165/
目前我正在构建相当大的网络系统,我需要强大的 SQL 数据库解决方案。我选择 Mysql 而不是 Postgres,因为一些任务需要只读(MyISAM 引擎)而其他任务需要大量写入(InnoDB)。
我在 mysql 中使用如下命令。当它显示表格数据时,它被格式化为一个非常干净的表格,间距均匀且 |作为列分隔符。 SELECT * FROM TABLE_NAME; 当我从 CLI 运行命令时,如下
我知道这个问题之前已经被问过好几次了,我已经解决了很多问题,但到目前为止没有任何效果。 MySQL 试图将自身安装到的目录 (usr/local/mysql) 肯定有问题。关于我的错误的奇怪之处在于我
以下是我的 SQL 数据结构,我正在尝试如下两个查询: Select Wrk_ID, Wrk_LastName, Skill_Desc from Worker, Skill where
我们有一个本地 mysql 服务器(不在公共(public)域上),并希望将该服务器复制到我们拥有的 google 云 sql 实例。我的问题是:1.这可能吗?2.我们的本地服务器只能在本地网络上访问
我有一个表(test_table),其中一些字段值(例如字段 A、B 和 C)是从外部应用程序插入的,还有一个字段(字段 D),我想从现有表(store_table)插入其值,但在插入前者(A、B 和
我想创建一个 AWS RDS 实例,然后使用 terraform 管理数据库用户。因此,首先,我创建了一个 RDS 实例,然后使用创建的 RDS 实例初始化 mysql 提供程序,以进一步将其用于用户
当用户在我的网站上注册时,他们会在我的一个数据库中创建自己的表格。该表存储用户发布的所有帖子。我还想做的是也为他们生成自己的 MySql 用户——该用户仅有权从他们的表中读取、写入和删除。 创建它应该
我有一个关于 ColdFusion 和 Mysql 的问题。我有两个表:PRODUCT 和 PRODUCT_CAT。我想列出包含一些标记为:IS_EXTRANET=1 的特殊产品的类别。所以我写了这个
我想获取 recipes_id 列的值,以获取包含 ingredient_id 的 2,17 和 26 条目的值。 假设 ingredient_id 2 丢失则不获取记录。 我已经尝试过 IN 运算符
在 Ubuntu 中,我通常安装两者,但 MySQL 的客户端和服务器之间有什么区别。 作为奖励,当一个新语句提到它需要 MySQL 5.x 时,它是指客户端、服务器还是两者兼而有之。例如这个链接ht
我重新访问了我的数据库并注意到我有一些 INT 类型的主键。 这还不够独特,所以我想我会有一个指导。 我来自微软 sql 背景,在 ssms 中你可以 选择类型为“uniqeidentifier”并自
我的系统上有 MySQL,我正在尝试确定它是 Oracle MySQL 还是 MySQL。 Oracle MySQL 有区别吗: http://www.oracle.com/us/products/m
我是在生产 MySQL 中运行的应用程序的新维护者。之前的维护者已经离开,留下的文档很少,而且联系不上了。 我面临的问题是执行以下请求大约需要 10 秒: SELECT COUNT(*) FROM `
我有两个位于不同机器上的 MySQL 数据库。我想自动将数据从一台服务器传输到另一台服务器。比方说,我希望每天早上 4:00 进行数据传输。 可以吗?是否有任何 MySQL 内置功能可以让我们做到这一
有什么方法可以使用 jdbc 查询位于 mysql 根目录之外的目录中的 mysql 表,还是必须将它们移动到 mysql 根目录内的数据库文件夹中?我在 Google 上搜索时没有找到任何东西。 最
我在 mysql 数据库中有两个表。成员和 ClassNumbers。两个表都有一个付费年份字段,都有一个代码字段。我想用代码数字表中的值更新成员表中的付费年份,其中成员中的代码与 ClassNumb
情况:我有 2 台服务器,其中一台当前托管一个实时 WordPress 站点,我希望能够将该站点转移到另一台服务器,以防第一台服务器出现故障。传输源文件很容易;传输数据库是我需要弄清楚如何做的。两台服
Phpmyadmin 有一个功能是“复制数据库到”..有没有mysql查询来写这个函数?类似于将 db A 复制到新的 db B。 最佳答案 首先创建复制数据库: CREATE DATABASE du
我有一个使用 mySQL 作为后端的库存软件。我已经在我的计算机上对其进行了测试,并且运行良好。 当我在计算机上安装我的软件时,我必须执行以下步骤: 安装 mySQL 服务器 将用户名指定为“root
我是一名优秀的程序员,十分优秀!