在启动时,我们需要获取正在运行的应用程序的服务器地址和http端口.到现在为止我们这样做了:
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
ObjectName socketBindingMBean = new ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=http");
String host = (String) mBeanServer.getAttribute(socketBindingMBean, "boundAddress"),
Integer port = (Integer) mBeanServer.getAttribute(socketBindingMBean, "boundPort"));
Run Code Online (Sandbox Code Playgroud)
一切都很好但是从jBoss 7.1.1.Final迁移到7.1.3.Final后我们遇到了MBean未在服务器启动时定义的问题.这意味着如果我在已经运行的 jboss服务器上部署应用程序,一切都很好,但如果我启动服务器并且在服务器启动期间加载了应用程序MBean不在那里.
我不知道为什么,但我觉得jBoss确保在大多数MBean之前启动/加载应用程序.我看了一眼,发现在申请后加载了Mbeans:
所以,
有没有人有使用CLI在Wildfly中设置消息传递子系统的示例脚本?
完美的示例是使服务器运行standalone.xml所需的CLI,并且在运行CLI脚本之后,它具有standalone-full.xml中定义的消息传递子系统.
到目前为止我发现的例子都是从消息子系统已经到位的假设开始的.
我们有一个EJB模块,我们正在部署到JBoss 7.1.1,它依赖于Infinispan和Infinispan Treecache.
我创建了一个模块并将其部署在jboss的模块部分中.
但是,正确拾取它似乎存在问题.这是作为Arquillian测试运行的.部署是:
@Deployment
public static Archive<?> createDeployment() {
Archive<?> archive = ShrinkWrap.create(JavaArchive.class)
.addPackages(true, "<package>")
.addAsManifestResource("META-INF/MANIFEST.MF", "MANIFEST.MF")
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
Run Code Online (Sandbox Code Playgroud)
MANIFEST.MF如下
Manifest-Version: 1.0
Dependencies: org.infinispan.infinispan-tree, org.infinispan
Run Code Online (Sandbox Code Playgroud)
infinispan-tree是手动添加到jboss的模块.
为了测试它不是模块配置,这两个模块在standalone.xml中是全局的,并且看起来一切正常.
甚至只将org.infinispan(包含在JBoss 7.x中)更改为非全局并尝试从MANIFEST.MF引用它不起作用.
缺什么?
如何修改WildFly 8日志记录级别,特别是server.log.目前我怀疑他们默认为INFO,并希望将其更改为Debug或Error.
作为参考,我一直在探索这些文章
https://docs.jboss.org/author/display/WFLY8/Logging+Configuration
https://docs.jboss.org/author/display/WFLY8/How+To
并怀疑这是正确的;
<subsystem xmlns="urn:jboss:domain:logging:2.0">
<console-handler name="CONSOLE">
<level name="DEBUG"/>
<formatter>
<named-formatter name="COLOR-PATTERN"/>
Run Code Online (Sandbox Code Playgroud) 我在IntelliJ 14中运行WildFly 8.1.服务器启动并可在以下位置访问localhost:8080
.部署了人工制品并且可以打开网站.
但
我一重新部署,就得到:
服务器未连接.部署不可用
没有任何内容写入server.log
想法?
是否可以在 JBoss ClI 中回显系统变量?
jboss.server.config.dir
jboss.home.dir
Run Code Online (Sandbox Code Playgroud)
来自https://docs.jboss.org/author/display/WFLY8/Command+line+parameters标题“独立”下的表格。
我试图在配置mysql依赖项后运行我的JBOSS,但是遇到了这个错误
09:49:00,138 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "TripTicketDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]"
]}
09:49:00,149 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "TripTicketDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]",
"jboss.data-source.java:jboss/datasources/TripTicketDS is …
Run Code Online (Sandbox Code Playgroud) 我的项目是战争部署。
XXX.战争
对于我的项目,jboss 中安装了一个数据源 (ds)。
还XXX.war
具有对 a 的 Maven 依赖xxx-domain.jar
,它处理休眠/持久性配置。
这是我的persistence.xml
<persistence version="2.0"
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">
<persistence-unit name="primary" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/xxxDS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.session_factory_name" value="XXXSessionFactory"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
</properties>
</persistence-unit>
</persistence>
Run Code Online (Sandbox Code Playgroud)
这是hibernate.cfg.xml
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="java:jboss/XXXSessionFactory">
<property name="connection.datasource">java:xxxDS</property>
<property name="show_sql">false</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="current_session_context_class">thread</property>
<mapping resource="com/xxx/model/XXXModel.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Run Code Online (Sandbox Code Playgroud)
这 2 个配置存在于 xxx-domain.jar
. …
你知道是否有一种标准方法来配置JBoss EAP 7发送给客户端的Http Headers?我主要对能够配置以下内容感兴趣:
我在互联网上找到了这个链接
https://blog.akquinet.de/2017/08/03/wildfly-8-10-and-jboss-eap-7-verbose-http-headers/
但我不确定我是否可以将它用于我感兴趣的标题.
谢谢!
我正在尝试在 JBoss EAP 7.1 服务器上部署 Spring Boot (2.0.2) 应用程序。
导致问题的代码是:
import javax.validation.constraints.NotBlank;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
@Component
@Validated
public class AppProperties {
@NotBlank
private String name;
Run Code Online (Sandbox Code Playgroud)
当应用程序部署在 JBoss 上时,我收到以下异常:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
16:44:25,861 ERROR [org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter] (ServerService Thread Pool -- 6 7)
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'app' to com.example.security.config.AppProperties:
Property: app.contextpath
Value: /api
Origin: class path resource [application.yml]:5:18
Reason: HV000030: No validator …
Run Code Online (Sandbox Code Playgroud) jboss ×4
wildfly ×4
java ×3
jboss-eap-7 ×3
jboss-cli ×2
jboss7.x ×2
deployment ×1
hibernate ×1
http ×1
http-headers ×1
jakarta-ee ×1
java-ee ×1
jta ×1
mbeans ×1
persistence ×1
security ×1
spring-boot ×1
wildfly-8 ×1
wildfly-9 ×1