将 glassfish JEE8 网络应用程序迁移到 Wildfly 10 (Jboss) - eclipseLink 不创建数据库表
migrate glassfish JEE8 weapp to Wildfly10 (Jboss) - eclipseLink dont create database tables
我正在 wildfly 10 中的 jee8 安全示例上安装一个开源项目,因为它只能在 glassfish 中运行。
我的项目源在那里:
https://github.com/robyp1/javaee8sec/
您可以在 src/jboss:
中找到配置文件和模块
https://github.com/robyp1/javaee8sec/tree/master/src/main/jboss
我使用 cargo maven 2 插件下载一个 wildfly10 实例安装在我的
cargo/target 目录。
我将 hsqldb 和 eclipselink 安装为模块。
Wildfly 使用 EclipseLink jap 持久性提供程序而不是 ibernate 默认提供程序正确启动,但我的 persistence.xml 似乎没有进行更改。
为什么?
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="soteria" transaction-type="JTA">
<jta-data-source>java:jboss/jdbc/soteria</jta-data-source>
<!-- only for jboss -->
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<!-- TODO: parameterize this -->
<properties>
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
<property name="eclipselink.logging.timestamp" value="true"/>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
<property name="eclipselink.ddl-generation.output-mode" value="database"/>
</properties>
</persistence-unit>
</persistence>
我将 wildfly 日志设置为 DEBUG:
[INFO] [talledLocalContainer] 14:56:16,869 INFO [org.jboss.as.jpa] (MSC service thread 1-6) WFLYJPA0002: Read persistence.xml for soteria
[INFO] [talledLocalContainer] 14:56:16,884 DEBUG [io.undertow.session] (ServerService Thread Pool -- 65) Setting default session timeout to 1800
[INFO] [talledLocalContainer] 14:56:16,894 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) persistence unit search for unitName=null referenced from class=id.swhp.javaee.soteria.business.account.boundary.AccountStore (annotation=@PersistenceContext)
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) persistence unit search for unitName=null referenced from class=id.swhp.javaee.soteria.business.security.boundary.TokenScheduler (annotation=@PersistenceContext)
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) persistence unit search for unitName=null referenced from class=id.swhp.javaee.soteria.business.security.boundary.TokenStore (annotation=@PersistenceContext)
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added javax.persistence.api:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.jboss.as.jpa:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.jboss.as.jpa.spi:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.javassist:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.eclipse.persistence:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) soteria is configured to use persistence provider 'org.eclipse.persistence.jpa.PersistenceProvider', adding an optional dependency on module 'org.eclipse.persistence'
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.account.boundary.AccountStore
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.servlet.jsp.jstl.tlv.ScriptFreeTLV
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.control.PbkdfGenerator
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.faces.webapp.FacetTag
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component org.omnifaces.ApplicationListener
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.control.SHAGenerator
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.faces.webapp.FacesServlet
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.application.servlet.AuthenticationFilter
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component com.sun.faces.config.ConfigureListener
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.boundary.TokenStore
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.boundary.TokenScheduler
[INFO] [talledLocalContainer] 14:56:16,904 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Creating module: deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,904 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,906 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/classes" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,906 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/lib/hsqldb-2.4.0.jar" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,910 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/lib/javax.security.enterprise-1.0.jar" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,919 DEBUG [io.undertow.request] (default I/O-3) Matched default handler path /cargocpc/index.html
[INFO] [talledLocalContainer] 14:56:16,927 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/lib/javax.security.enterprise-api-1.1-b01-20170827.084736-2.jar" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,938 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource
和
[INFO] [talledLocalContainer] 14:56:17,820 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The access type for the persistent class [class id.swhp.javaee.soteria.business.security.entity.Token] is set to [FIELD].
[INFO] [talledLocalContainer] 14:56:17,843 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The target entity (reference) class for the many to one mapping element [field account] is being defaulted to: class id.swhp.javaee.soteria.business.account.entity.Account.
[INFO] [talledLocalContainer] 14:56:17,843 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The access type for the persistent class [class id.swhp.javaee.soteria.business.account.entity.Account] is set to [FIELD].
[INFO] [talledLocalContainer] 14:56:17,849 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The target entity (reference) class for the one to many mapping element [field tokens] is being defaulted to: class id.swhp.javaee.soteria.business.security.entity.Token.
[INFO] [talledLocalContainer] 14:56:17,850 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The alias name for the entity class [class id.swhp.javaee.soteria.business.security.entity.Token] is being defaulted to: Token.
[INFO] [talledLocalContainer] 14:56:17,860 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [created] is being defaulted to: CREATED.
[INFO] [talledLocalContainer] 14:56:17,861 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [description] is being defaulted to: DESCRIPTION.
[INFO] [talledLocalContainer] 14:56:17,861 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [expiration] is being defaulted to: EXPIRATION.
[INFO] [talledLocalContainer] 14:56:17,861 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [id] is being defaulted to: ID.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The alias name for the entity class [class id.swhp.javaee.soteria.business.account.entity.Account] is being defaulted to: Account.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [password] is being defaulted to: PASSWORD.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [id] is being defaulted to: ID.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [email] is being defaulted to: EMAIL.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [username] is being defaulted to: USERNAME.
[INFO] [talledLocalContainer] 14:56:17,876 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The primary key column name for the mapping element [field account] is being defaulted to: ID.
[INFO] [talledLocalContainer] 14:56:18,069 DEBUG [org.jboss.as.ejb3] (MSC service thread 1-3) Installing timer service for component TokenScheduler
[INFO] [talledLocalContainer] 14:56:18,086 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0003: Processing weld deployment javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:18,125 DEBUG [org.jboss.weld.deployer] (MSC service thread 1-3) Discovered EXPLICIT BeanDeploymentArchive (javaee-soteria.war/WEB-INF/lib/omnifaces-2.6.4.jar)
[INFO] [talledLocalContainer] 14:56:18,126 DEBUG [org.jboss.weld.deployer] (MSC service thread 1-3) Discovered EXPLICIT BeanDeploymentArchive (javaee-soteria.war/WEB-INF/classes)
[INFO] [talledLocalContainer] 14:56:18,181 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-3) HV000001: Hibernate Validator 5.2.4.Final
[INFO] [talledLocalContainer] 14:56:18,205 DEBUG [org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver] (MSC service thread 1-3) Found javax.persistence.Persistence on classpath containing 'getPersistenceUtil'. Assuming JPA 2 environment. Trying to instantiate JPA aware TraversableResolver
[INFO] [talledLocalContainer] 14:56:18,206 DEBUG [org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver] (MSC service thread 1-3) Instantiated JPA aware TraversableResolver of type org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.
您可以在这里找到所有的日志服务器:
https://github.com/robyp1/javaee8sec/blob/master/server_20180202.log
或更易读的格式:
https://raw.githubusercontent.com/robyp1/javaee8sec/master/server_20180202.log
怎么了?
非常感谢
罗伯托
WildFly 使用 Hiberate 作为 JPA 提供程序而不是 EclipseLink!
所以你必须像这样属性设置休眠。hbm2ddl.auto
<property name="hibernate.hbm2ddl.auto" value="update"/>
或者您可以使用 JPA 标准 属性 javax.persistence.schema-generation.database.action
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
这将是可移植的并且独立于 JPA 实现。
您可以在 Hibernate 文档中找到所有选项:
可以在 Wildfly 上使用 EclipseLink,这在参考指南中有记录。简单来说,您需要添加 eclipse.jar 作为模块,然后设置 属性 以便以下条目出现在 standalone.xml 中:
<property name="eclipselink.archive.factory" value="org.jipijapa.eclipselink.JBossArchiveFactoryImpl"/>
我正在 wildfly 10 中的 jee8 安全示例上安装一个开源项目,因为它只能在 glassfish 中运行。 我的项目源在那里:
https://github.com/robyp1/javaee8sec/
您可以在 src/jboss:
中找到配置文件和模块https://github.com/robyp1/javaee8sec/tree/master/src/main/jboss
我使用 cargo maven 2 插件下载一个 wildfly10 实例安装在我的 cargo/target 目录。 我将 hsqldb 和 eclipselink 安装为模块。 Wildfly 使用 EclipseLink jap 持久性提供程序而不是 ibernate 默认提供程序正确启动,但我的 persistence.xml 似乎没有进行更改。
为什么?
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="soteria" transaction-type="JTA">
<jta-data-source>java:jboss/jdbc/soteria</jta-data-source>
<!-- only for jboss -->
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<!-- TODO: parameterize this -->
<properties>
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
<property name="eclipselink.logging.timestamp" value="true"/>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
<property name="eclipselink.ddl-generation.output-mode" value="database"/>
</properties>
</persistence-unit>
</persistence>
我将 wildfly 日志设置为 DEBUG:
[INFO] [talledLocalContainer] 14:56:16,869 INFO [org.jboss.as.jpa] (MSC service thread 1-6) WFLYJPA0002: Read persistence.xml for soteria
[INFO] [talledLocalContainer] 14:56:16,884 DEBUG [io.undertow.session] (ServerService Thread Pool -- 65) Setting default session timeout to 1800
[INFO] [talledLocalContainer] 14:56:16,894 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) persistence unit search for unitName=null referenced from class=id.swhp.javaee.soteria.business.account.boundary.AccountStore (annotation=@PersistenceContext)
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) persistence unit search for unitName=null referenced from class=id.swhp.javaee.soteria.business.security.boundary.TokenScheduler (annotation=@PersistenceContext)
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) persistence unit search for unitName=null referenced from class=id.swhp.javaee.soteria.business.security.boundary.TokenStore (annotation=@PersistenceContext)
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added javax.persistence.api:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.jboss.as.jpa:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.jboss.as.jpa.spi:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,901 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.javassist:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) added org.eclipse.persistence:main dependency to javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) soteria is configured to use persistence provider 'org.eclipse.persistence.jpa.PersistenceProvider', adding an optional dependency on module 'org.eclipse.persistence'
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.account.boundary.AccountStore
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.servlet.jsp.jstl.tlv.ScriptFreeTLV
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.control.PbkdfGenerator
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.faces.webapp.FacetTag
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component org.omnifaces.ApplicationListener
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.control.SHAGenerator
[INFO] [talledLocalContainer] 14:56:16,902 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component javax.faces.webapp.FacesServlet
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.application.servlet.AuthenticationFilter
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component com.sun.faces.config.ConfigureListener
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.boundary.TokenStore
[INFO] [talledLocalContainer] 14:56:16,903 DEBUG [org.jboss.as.jpa] (MSC service thread 1-6) Adding dependency on PU service service jboss.persistenceunit."javaee-soteria.war#soteria" for component id.swhp.javaee.soteria.business.security.boundary.TokenScheduler
[INFO] [talledLocalContainer] 14:56:16,904 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Creating module: deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,904 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,906 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/classes" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,906 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/lib/hsqldb-2.4.0.jar" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,910 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/lib/javax.security.enterprise-1.0.jar" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,919 DEBUG [io.undertow.request] (default I/O-3) Matched default handler path /cargocpc/index.html
[INFO] [talledLocalContainer] 14:56:16,927 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource "/C:/Progetti/altri/javaee-soteria-master/target/cargo/configurations/wildfly10x/content/javaee-soteria.war/WEB-INF/lib/javax.security.enterprise-api-1.1-b01-20170827.084736-2.jar" to module deployment.javaee-soteria.war:main
[INFO] [talledLocalContainer] 14:56:16,938 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-6) Adding resource
和
[INFO] [talledLocalContainer] 14:56:17,820 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The access type for the persistent class [class id.swhp.javaee.soteria.business.security.entity.Token] is set to [FIELD].
[INFO] [talledLocalContainer] 14:56:17,843 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The target entity (reference) class for the many to one mapping element [field account] is being defaulted to: class id.swhp.javaee.soteria.business.account.entity.Account.
[INFO] [talledLocalContainer] 14:56:17,843 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The access type for the persistent class [class id.swhp.javaee.soteria.business.account.entity.Account] is set to [FIELD].
[INFO] [talledLocalContainer] 14:56:17,849 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The target entity (reference) class for the one to many mapping element [field tokens] is being defaulted to: class id.swhp.javaee.soteria.business.security.entity.Token.
[INFO] [talledLocalContainer] 14:56:17,850 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The alias name for the entity class [class id.swhp.javaee.soteria.business.security.entity.Token] is being defaulted to: Token.
[INFO] [talledLocalContainer] 14:56:17,860 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [created] is being defaulted to: CREATED.
[INFO] [talledLocalContainer] 14:56:17,861 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [description] is being defaulted to: DESCRIPTION.
[INFO] [talledLocalContainer] 14:56:17,861 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [expiration] is being defaulted to: EXPIRATION.
[INFO] [talledLocalContainer] 14:56:17,861 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [id] is being defaulted to: ID.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The alias name for the entity class [class id.swhp.javaee.soteria.business.account.entity.Account] is being defaulted to: Account.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [password] is being defaulted to: PASSWORD.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [id] is being defaulted to: ID.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [email] is being defaulted to: EMAIL.
[INFO] [talledLocalContainer] 14:56:17,865 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The column name for element [username] is being defaulted to: USERNAME.
[INFO] [talledLocalContainer] 14:56:17,876 INFO [org.eclipse.persistence.metadata] (ServerService Thread Pool -- 65) The primary key column name for the mapping element [field account] is being defaulted to: ID.
[INFO] [talledLocalContainer] 14:56:18,069 DEBUG [org.jboss.as.ejb3] (MSC service thread 1-3) Installing timer service for component TokenScheduler
[INFO] [talledLocalContainer] 14:56:18,086 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0003: Processing weld deployment javaee-soteria.war
[INFO] [talledLocalContainer] 14:56:18,125 DEBUG [org.jboss.weld.deployer] (MSC service thread 1-3) Discovered EXPLICIT BeanDeploymentArchive (javaee-soteria.war/WEB-INF/lib/omnifaces-2.6.4.jar)
[INFO] [talledLocalContainer] 14:56:18,126 DEBUG [org.jboss.weld.deployer] (MSC service thread 1-3) Discovered EXPLICIT BeanDeploymentArchive (javaee-soteria.war/WEB-INF/classes)
[INFO] [talledLocalContainer] 14:56:18,181 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-3) HV000001: Hibernate Validator 5.2.4.Final
[INFO] [talledLocalContainer] 14:56:18,205 DEBUG [org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver] (MSC service thread 1-3) Found javax.persistence.Persistence on classpath containing 'getPersistenceUtil'. Assuming JPA 2 environment. Trying to instantiate JPA aware TraversableResolver
[INFO] [talledLocalContainer] 14:56:18,206 DEBUG [org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver] (MSC service thread 1-3) Instantiated JPA aware TraversableResolver of type org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.
您可以在这里找到所有的日志服务器: https://github.com/robyp1/javaee8sec/blob/master/server_20180202.log 或更易读的格式: https://raw.githubusercontent.com/robyp1/javaee8sec/master/server_20180202.log
怎么了?
非常感谢
罗伯托
WildFly 使用 Hiberate 作为 JPA 提供程序而不是 EclipseLink!
所以你必须像这样属性设置休眠。hbm2ddl.auto
<property name="hibernate.hbm2ddl.auto" value="update"/>
或者您可以使用 JPA 标准 属性 javax.persistence.schema-generation.database.action
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
这将是可移植的并且独立于 JPA 实现。
您可以在 Hibernate 文档中找到所有选项:
可以在 Wildfly 上使用 EclipseLink,这在参考指南中有记录。简单来说,您需要添加 eclipse.jar 作为模块,然后设置 属性 以便以下条目出现在 standalone.xml 中:
<property name="eclipselink.archive.factory" value="org.jipijapa.eclipselink.JBossArchiveFactoryImpl"/>