Jboss remote access

本文介绍了一种解决无法远程访问JBoss应用程序的问题的方法。通过调整配置文件中的端口绑定设置,可以有效避免因错误配置远程IP导致的服务器运行异常。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<Connector port="8080" address="${0.0.0.0}"   

This code can help to fix the problem of that unable to access the remote jboss app, instead of bunding the remote ip use -b in configuration which may cause the server always running error.

jboss-4.2.1.GA\server\default\deploy\jboss-web.deployer\server.xml

您可以按照以下步骤来配置 Redis 以用于 JBoss 的 Session 共享: 1. 下载 Jedis jar 包并将其添加到 JBoss 的 classpath 中。 2. 在 JBoss 的配置文件 `standalone.xml` 中添加以下配置: ``` <cache-container name="web" default-cache="passivation"> <transport lock-timeout="60000"/> <distributed-cache name="session-cache" mode="SYNC" statistics-enabled="true"> <persistence passivation="false"/> <partition-handling when-split="DENY_ACCESS" merge-policy="REMOVE_ALL"/> <file-store/> <!-- 如果您想使用持久化存储 --> <remote-store/> <!-- 如果您想使用远程存储 --> <locking isolation="REPEATABLE_READ"/> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="1800000"/> <state-transfer timeout="600000" await-initial-transfer="true" mode="ASYNC" /> </distributed-cache> </cache-container> ``` 3. 配置 JBoss 的 web subsystem,添加以下设置: ``` <subsystem xmlns="urn:jboss:domain:web:3.0" default-virtual-server="default-host" native="false"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> <!-- 添加以下设置 --> <distributable/> <session-management jvmRoute="jvmRoute" session-cookie="false" session-store="infinispan"> <infinispan> <cache-container>web</cache-container> </infinispan> </session-management> <!-- 结束 --> </virtual-server> </subsystem> ``` 4. 修改 `jboss-web.xml` 文件,添加以下配置: ``` <jboss-web xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_7_1.xsd"> <context-root>your-context-root</context-root> <session-config> <session-store>distributed-cache</session-store> <cookie-config> <http-only>true</http-only> </cookie-config> </session-config> </jboss-web> ``` 5. 配置 Redis 主机和端口。您可以在 `standalone.xml` 文件中添加以下配置: ``` <subsystem xmlns="urn:jboss:domain:infinispan:12.0" default-cache-container="clustered"> <cache-container name="clustered" default-cache="default"> <transport lock-timeout="60000"/> <distributed-cache name="default" mode="SYNC" statistics-enabled="true"> <persistence passivation="false"/> <partition-handling when-split="DENY_ACCESS" merge-policy="REMOVE_ALL"/> <remote-store> <connection-pool max-connections-per-node="2"/> <shared> <redis-server host="your-redis-host" port="your-redis-port"/> <!-- Redis 主机和端口 --> <serialization> <!-- 数据序列化 --> <marshaller class="org.infinispan.commons.marshall.JavaSerializationMarshaller"/> </serialization> </shared> </remote-store> <locking isolation="REPEATABLE_READ"/> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="1800000"/> <state-transfer timeout="600000" await-initial-transfer="true" mode="ASYNC" /> </distributed-cache> </cache-container> </subsystem> ``` 完成以上所有步骤后,您的 Redis 就可以用于 JBoss 的 Session 共享了。希望能对您有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值