Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud-galleon-pack causes that javaOpts port config isn't working for wildfly:run/dev #41

Open
martin-v opened this issue Feb 12, 2024 · 4 comments

Comments

@martin-v
Copy link

Hi,

the following POM doesn't respect the javaOpts port config for wildfly:run or wildfly:dev. In case I remove the cloud-galleon-pack it works as expected (e.g. Admin console listening on :9993).

<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>test</groupId>
	<artifactId>test</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-war-plugin</artifactId>
					<version>3.4.0</version>
					<configuration>
						<failOnMissingWebXml>false</failOnMissingWebXml>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.wildfly.plugins</groupId>
					<artifactId>wildfly-maven-plugin</artifactId>
					<!--<version>4.2.2.Final</version>-->
					<version>5.0.0.Beta3</version>
					<configuration>
						<version>31.0.0.Final</version>
						<feature-packs>
							<feature-pack>
								<location>org.wildfly:wildfly-galleon-pack:31.0.0.Final</location>
							</feature-pack>
							<feature-pack>
								<location>org.wildfly.cloud:wildfly-cloud-galleon-pack:6.0.0.Final</location>
							</feature-pack>
						</feature-packs>
						<javaOpts>
							<javaOpt>-Djboss.socket.binding.port-offset=3</javaOpt>
						</javaOpts>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>

(Ignore the "The server did not start within 60 seconds." this is caused by https://issues.redhat.com/browse/WFMP-244)

@jfdenise
Copy link
Contributor

@martin-v , when using the cloud feature-pack, the server configuration is updated differently than on bare-metal.
The environment variable PORT_OFFSET (https://github.com/wildfly/wildfly-cekit-modules/blob/main/jboss/container/wildfly/launch/port-offset/module.yaml) is to be used in order to set a port offset.
The server shutdown in a cloud environment retrieves the offset thanks to this env variable (https://github.com/wildfly/wildfly-cekit-modules/blob/main/jboss/container/wildfly/run/bash/artifacts/opt/jboss/container/wildfly/run/run-utils.sh#L36).

@martin-v
Copy link
Author

@jfdenise Thanks for the reply! Can you show me an example configuration with the correct configuration? Didn't find anything and my guess, didn't work.

  <env>
	  <PORT_OFFSET>3</PORT_OFFSET>
  </env>

Use case is I have different services and want to run/debug them in parallel.

@jfdenise
Copy link
Contributor

I don't think actually that you will manage to run the server with a PORT_OFFSET. The cloud server is dedicated to run inside WildFly runtime docker image.
The problem is that run goal calls bin/standalone.sh although to have the PORT_OFFSET to be taken into account, the launcher: bin/openshift-launch.sh needs to be called.
I suggest that you don't build a cloud server when launching the server using the run goal.

@jfdenise
Copy link
Contributor

jfdenise commented Feb 15, 2024

@martin-v , I think that we could make a small change in order to have the standalone.sh be usable with PORT_OFFSET. I will use this issue to track progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants