- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 JBoss (wildfly-10.1.0.Final) 中运行我的 .ear
应用程序。之前它在 Glassfish 4.1 上运行没有任何问题。在 JBoss 上,我成功部署了它,但它抛出了大量异常。
例如:
2017-05-17 13:42:00,911 ERROR [org.jboss.as.ejb3.invocation] (default task-18) WFLYEJB0034: EJB Invocation failed on component VersionDao for method public abstract java.util.List com.valor.anthillprodashboard.db.dao.VersionDaoLocal.getAllVersions(): javax.ejb.EJBTransactionRolledbackException: NamedQuery of name: Version.findAll not found.
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:159)
2017-05-17 13:40:03,504 ERROR [org.jboss.as.ejb3.invocation] (default task-110) WFLYEJB0034: EJB Invocation failed on component DataAccessFacade for method public abstract java.util.List com.valor.anthillprodashboard.bl.da.DataAccessFacadeLocal.getAllVersions(): javax.ejb.EJBTransactionRolledbackException: NamedQuery of name: Version.findAll not found.
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:159)
在这两种情况下,我都使用eclipselink和MySQL。
我尝试使用与 Glassfish 中相同的参数来配置 JBoss。
Glassfish 配置:
JBoss 配置(来自standalone.xml):
<datasources>
<datasource jta="true" jndi-name="java:/jdbc/anthillprodashboard" pool-name="mysql_anthillprodashboard_rootPool" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/anthillprodashboard?zeroDateTimeBehavior=convertToNull</connection-url>
<driver>mysql</driver>
<security>
<user-name>****</user-name>
<password>****</password>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql"/>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
我的 Persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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="AnthillProDashboard-ejbPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/anthillprodashboard</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>NONE</shared-cache-mode>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
</properties>
</persistence-unit>
</persistence>
这些异常(exception)没有任何意义,因为相同的方法在 glassfish 上效果很好。这些异常的原因可能是什么?
最佳答案
出于某种原因,JBoss 无法识别实体,我必须在 persistence.xml 中指定它们:
<?xml version="1.0" encoding="UTF-8"?>
<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="AnthillProDashboard-ejbPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/anthillprodashboard</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>NONE</shared-cache-mode>
<class>com.valor.anthillprodashboard.db.entity.Build</class>
<class>com.valor.anthillprodashboard.db.entity.Commit</class>
<class>com.valor.anthillprodashboard.db.entity.Project</class>
<class>com.valor.anthillprodashboard.db.entity.ProjectVersion</class>
<class>com.valor.anthillprodashboard.db.entity.ProjectVersionPK</class>
<class>com.valor.anthillprodashboard.db.entity.Status</class>
<class>com.valor.anthillprodashboard.db.entity.TestSet</class>
<class>com.valor.anthillprodashboard.db.entity.TestSetUpdate</class>
<class>com.valor.anthillprodashboard.db.entity.TestStatus</class>
<class>com.valor.anthillprodashboard.db.entity.Version</class>
<class>com.valor.anthillprodashboard.db.entity.Workflow</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
</properties>
</persistence-unit>
</persistence>
关于java - 从 Glassfish 迁移到 Wildfly/JBoss,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44023894/
我是 JBoss 的新手,发现了很多不同的术语 - JBoss EAP、JBoss Server、Wildfly、Jboss Web,以及很多不是最新的或针对旧版本的文档。 我从哪里开始了解 JBos
JBoss ESB 服务器之间有什么区别(可在此处获得:http://jbossesb.jboss.org/downloads/) 和 JBoss fuse ( http://www.jboss.or
我在我的 PC 上安装了 JBoss 4 到目录 C:\JBoss4 并将环境变量 JBOSS_HOME 设置为此目录: JBOSS_HOME=C:\JBoss4 我需要在同一台 PC 上安装 JB
我有一个 JBoss 服务器正在运行并且想要部署一个服务。 该服务连接到在以下 xml 文件中配置的数据库 jdbc:postgresql://localhost:543
jboss 中的超时是如何工作的?网络应用程序如何知道何时重定向到登录页面? 只是为了澄清! -我知道如何在 jboss 上配置超时。我的问题是,Jboss 如何知道 session 已超时以及何时超
使用JBoss Forge启动新项目时,默认情况下该项目是使用Maven构建系统创建的。我如何利用Forge 2. *的Gradle插件使用Gradle而不是Maven创建项目? % forge Us
当前配置: 正在运行的16个Pod,基于JBoss TCP的集群以及google ping发现。容器作为状态集部署在Kubernetes集群上。 没有负载的初始群集按预期运行,没有任何单个问题,但是当
我以为这将是一个 JBoss 常见问题解答,但我找不到它。 我想同时运行 JBoss 4 和 JBoss 5。我通过将端口的前导数字更改为 9 手动更改了 JBoss 5 服务器/默认实例上的所有端口
我们在 JBoss AS 6 上实现了一些服务作为我们希望迁移到 JBoss AS 7 的单例服务。 这些服务在 jboss-service.xml 文件中声明,该文件位于 EJB 包中,类似于以下代
例如,如何确定我的简单 JBoss 4.2.3 服务器正在监听端口 8080? 这是我最接近的一次,但这不起作用: MBeanServerConnection server = (MBeanServe
我正在尝试找到从语法上确定我的程序是在 Jboss 5 还是 Jboss 7 (eap-6.1) 上运行的最佳方法。到目前为止,我找到的方法是特定于 jboss 5 或 jboss 7 的,这不起作用
我在域模式下使用 JBoss 6.4.8 版本。我想通过 CLI 添加这 4 个系统属性: 1- /host=myserver/server-config=node/system-property=j
在 JBoss 4 中,您可以在文件中设置对象的部署顺序( .jar 、 .war 、 .sar 等...): conf/xmdesc/org.jboss.deployment.MainDeploye
概括地说,JBoss 5 的关闭有什么作用?如果我只是杀死 java 进程而不是优雅地关闭 JBoss,可能会出现什么问题? 对于我的应用程序来说,正常的 JBoss 5 关闭大约需要 6 分钟,这个
我最近在 CentOS 6.7 服务器上安装了 JBoss AS 7。 jboss as 工作正常。为了测试,我部署了一个 .war 文件并对其进行了测试,效果很好!但现在我尝试从我的台式电脑访问相同
我有 jboss 应用程序。并想自动测试部署。并希望将此任务作为项目添加到 Hudson 我的愿景基于以下阶段: 将我的应用程序放到 JBoss(复制耳朵、配置、库等) 运行 JBoss 我有一台 L
我对 JBoss 很陌生。目前我有一个需求,我需要在 JBoss 上部署应用程序(已经在 Tomcat 上运行)。我下载了 JBoss,但是版本 7 中的目录结构不同。 我正在运行 bin\stand
我是 JBoss AS 7 的新手。我尝试在 JBoss AS 7 上部署我的 war 文件,这似乎工作正常。我的问题是在哪里可以看到部署的内容。 我希望它像 Tomcat 一样,它应该有一个探索的
我使用多播方法在两个不同的 JBoss 服务器之间配置了集群。 当我启动两个 JBoss 服务器时,两个服务器都将连接。 一天后,我收到以下消息 server.log 中的群集开始显示错误 05:28
为了打开/关闭我们产品的跟踪-“类别”或“记录器”标签,我们应该在jboss-log4j.xml中使用什么? 默认情况下,JBoss在jboss-log4j.xml中使用“类别”。 但据我所知,不赞成
我是一名优秀的程序员,十分优秀!