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

[WFCORE-6843] Logging a WARN if a deployment's runtime name doesn't have an extension #6340

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

khermano
Copy link
Contributor

Copy link
Collaborator

@yersan yersan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khermano Check the "Check non-i18n logging" failure, you have to use the proper log classes and add the message using @message, see for example DomainControllerLogger, otherwise your warning messages won't be i18n

@khermano
Copy link
Contributor Author

Thank you for your very quick response and sorry for the late response, I overlooked that. I will look at it now. Thanks for the information. :)

@khermano khermano force-pushed the WFCORE-6843_from_main branch from 2f2cb16 to ac61cc4 Compare February 17, 2025 11:18
Comment on lines 118 to 123
/**
* A logger with the category of {@code org.jboss.as.server.deployment.warning}.
* <strong>Usage:</strong> Use this in code related to deployment's warnings
*/
ServerLogger DEPLOYMENT_WARN_LOGGER = Logger.getMessageLogger(MethodHandles.lookup(), ServerLogger.class, "org.jboss.as.server.deployment.warning");

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not create specific root loggers for specific levels. We create root loggers and then we configure the levels from outside, for example in a logger configuration file.

In this file there is already a logger for deployment, use it instead.

Comment on lines 59 to 64
/**
* A logger with the category of {@code org.jboss.as.domain.controller.operations.deployment.warning}.
* <strong>Usage:</strong> Use this in code related to deployment's warnings
*/
DomainControllerLogger DEPLOYMENT_WARN_LOGGER = Logger.getMessageLogger(MethodHandles.lookup(), DomainControllerLogger.class, "org.jboss.as.domain.controller.operations.deployment.warning");

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not create specific root loggers for specific levels. We create root loggers and then we configure the levels from outside, for example in a logger configuration file.

Copy link
Contributor Author

@khermano khermano Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, I just wasn't sure how to implement this correctly since the description of the issue was talking about using distinct logger for this. So, can I just use the ROOT_LOGGER for the domain and DEPLOYMENT_LOGGER for the standalone @yersan ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wasn't sure how to implement this correctly since the description of the issue was talking about using distinct logger for this

... and I did not properly read the Jira description :(

Got it, it was requested to use a different logger so users can turn off the logger under demand.

In such a case, I would suggest using the following (for sure open to any other idea for the name):

"org.jboss.as.server.deployment.runtime.namecheck"
"org.jboss.as.domain.controller.operations.deployment.runtime.namecheck"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great to me, thank you.
First I thought, that this logger could have name so it could be reused for other deployment warnings in the future, but now I realized that it could be tricky to decide when to turn off the warning I am implementing now if the logger would be associated with another warnings with different meaning.
So, I will change also the name DEPLOYMENT_WARN_LOGGER to maybe DEPLOYMENT_NAMECHECK_LOGGER? I am also open to ideas.

Copy link
Collaborator

@yersan yersan Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEPLOYMENT_NAMECHECK_LOGGER is ok, variable name is not an issue, if you read it and identify its meaning, that's ok

@@ -94,6 +95,9 @@ static void validateRuntimeNames(String deploymentName, OperationContext context
Resource root = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS);
ModelNode domainDeployment = root.getChild(PathElement.pathElement(DEPLOYMENT, deploymentName)).getModel();
String runtimeName = getRuntimeName(deploymentName, deployment, domainDeployment);
if (!runtimeName.contains(".")) {
DEPLOYMENT_WARN_LOGGER.deploymentsRuntimeNameWithoutExtension(deploymentName, runtimeName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use DomainControllerLogger.ROOT_LOGGER here instead.

@wildfly-ci
Copy link

Core -> WildFly Preview Integration Build 14381 outcome was FAILURE using a merge of ac61cc4
Summary: Tests failed: 1 (1 new), passed: 5416, ignored: 83 Build time: 03:02:07

Failed tests

org.jboss.as.test.clustering.cluster.web.FineWebFailoverTestCase.testNonPrimaryOwner: java.lang.AssertionError: POST expected:<2> but was:<1>
	at org.jboss.as.test.clustering.cluster.web.AbstractWebFailoverTestCase.testNonPrimaryOwner(AbstractWebFailoverTestCase.java:354)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
------- Stdout: -------
node-3 2025-02-17 12:20:56,016 INFO  [org.jboss.as.repository] (management-handler-thread - 2) WFLYDR0001: Content added at location /opt/buildAgent/work/e8e0dd9c7c4ba60/full/testsuite/integration/clustering/target/wildfly-3/standalone/data/content/fc/2e4022218f85ca28968db4d5361fd5d2fb917a/content
node-3 2025-02-17 12:20:56,026 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "FineWebFailoverTestCase.war" (runtime-name: "FineWebFailoverTestCase.war")
node-3 2025-02-17 12:20:56,086 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) WFLYSRV0018: Deployment "deployment.FineWebFailoverTestCase.war" is using a private module ("org.infinispan.core") which may be changed or removed in future versions without notice.
node-3 2025-02-17 12:20:56,091 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment FineWebFailoverTestCase.war
node-3 2025-02-17 12:20:56,125 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-4) WFLYEJB0473: JNDI bindings for session bean named 'TopologyChangeListenerBean' in deployment unit 'deployment "FineWebFailoverTestCase.war"' are as follows:

	java:global/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:app/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:module/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:jboss/exported/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	ejb:/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:global/FineWebFailoverTestCase/TopologyChangeListenerBean
	java:app/FineWebFailoverTestCase/TopologyChangeListenerBean
	java:module/TopologyChangeListenerBean

node-3 2025-02-17 12:20:56,239 INFO  [org.infinispan.CONTAINER] (ServerService Thread Pool -- 88) ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
node-3 2025-02-17 12:20:56,247 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 89) WFLYCLINF0002: Started default-server cache from web container
node-3 2025-02-17 12:20:56,248 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 88) WFLYCLINF0002: Started FineWebFailoverTestCase.war cache from web container
node-3 2025-02-17 12:20:56,436 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 89) WFLYUT0021: Registered web context: '/FineWebFailoverTestCase' for server 'default-server'
node-3 2025-02-17 12:20:56,451 INFO  [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "FineWebFailoverTestCase.war" (runtime-name : "FineWebFailoverTestCase.war")
node-2 2025-02-17 12:20:56,521 INFO  [org.jboss.as.repository] (management-handler-thread - 2) WFLYDR0001: Content added at location /opt/buildAgent/work/e8e0dd9c7c4ba60/full/testsuite/integration/clustering/target/wildfly-2/standalone/data/content/fc/2e4022218f85ca28968db4d5361fd5d2fb917a/content
node-2 2025-02-17 12:20:56,523 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "FineWebFailoverTestCase.war" (runtime-name: "FineWebFailoverTestCase.war")
node-2 2025-02-17 12:20:56,612 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-5) WFLYSRV0018: Deployment "deployment.FineWebFailoverTestCase.war" is using a private module ("org.infinispan.core") which may be changed or removed in future versions without notice.
node-2 2025-02-17 12:20:56,619 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) WFLYWELD0003: Processing weld deployment FineWebFailoverTestCase.war
node-2 2025-02-17 12:20:56,647 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-7) WFLYEJB0473: JNDI bindings for session bean named 'TopologyChangeListenerBean' in deployment unit 'deployment "FineWebFailoverTestCase.war"' are as follows:

	java:global/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:app/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:module/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:jboss/exported/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	ejb:/FineWebFailoverTestCase/TopologyChangeListenerBean!org.jboss.as.test.clustering.TopologyChangeListener
	java:global/FineWebFailoverTestCase/TopologyChangeListenerBean
	java:app/FineWebFailoverTestCase/TopologyChangeListenerBean
	java:module/TopologyChangeListenerBean

node-2 2025-02-17 12:20:56,737 INFO  [org.infinispan.CONTAINER] (ServerService Thread Pool -- 39) ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread


@khermano khermano force-pushed the WFCORE-6843_from_main branch from ac61cc4 to dac24f1 Compare February 18, 2025 11:51
@wildfly-ci
Copy link

Core -> Full Integration Build 14591 outcome was FAILURE using a merge of dac24f1
Summary: Tests failed: 1 (1 new), passed: 8140, ignored: 109 Build time: 04:17:40

Failed tests

org.wildfly.test.integration.microprofile.jwt.propagation.JWTIdentityPropagationTestCase(standalone-enabled-expansion-test).testInvokeEJBWithinSingleDeploymentOutflowNotConfigured: java.lang.AssertionError: expectedMessage:[targetCallerPrincipal: anonymous, targetIsCallerAdmin: false] returned msg:[hello testUser  hasJWT: true  targetCallerPrincipal: testUser, targetIsCallerAdmin: false  ctx: org.jboss.resteasy.plugins.server.servlet.ServletSecurityContext@46618d06  targetBean context: org.jboss.as.ejb3.context.SessionContextImpl@148d8808]
	at org.wildfly.test.integration.microprofile.jwt.propagation.JWTIdentityPropagationTestCase.testInvokeEJB(JWTIdentityPropagationTestCase.java:323)
	at org.wildfly.test.integration.microprofile.jwt.propagation.JWTIdentityPropagationTestCase.testInvokeEJBWithinSingleDeploymentOutflowNotConfigured(JWTIdentityPropagationTestCase.java:257)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at jdk.internal.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at jdk.internal.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
------- Stdout: -------
 [31m15:23:55,377 ERROR [stderr] (default task-1) java.lang.Throwable: hello testUser  hasJWT: true  targetCallerPrincipal: testUser, targetIsCallerAdmin: false  ctx: org.jboss.resteasy.plugins.server.servlet.ServletSecurityContext@46618d06  targetBean context: org.jboss.as.ejb3.context.SessionContextImpl@148d8808
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at deployment.no-outflow-config.ear.no-outflow-config-web.war//org.wildfly.test.integration.microprofile.jwt.propagation.BeanEndPoint.helloRolesAllowed(BeanEndPoint.java:50)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:35)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:62)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:72)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:85)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:46)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
 [0m [31m15:23:55,378 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:26)
 [0m [31m15:23:55,379 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
 [0m [31m15:23:55,379 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:30)
 [0m [31m15:23:55,379 ERROR [stderr] (default task-1) 	at [email protected]//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)


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

Successfully merging this pull request may close these issues.

3 participants