]
Brian Stansberry commented on WFCORE-149:
-----------------------------------------
My theory about the logging happening because a cause was attached is incorrect. It's
logged because it happens at Stage.RUNTIME. RUNTIME OFEs are logged as there is the
potential they have disrupted the server.
Solution is to not throw the OFE but rather to use context.getFailureDescription() to
report the failure to the client.
Failues in 'resolve-expression" op appear in server log
-------------------------------------------------------
Key: WFCORE-149
URL:
https://issues.jboss.org/browse/WFCORE-149
Project: WildFly Core
Issue Type: Bug
Components: Domain Management
Reporter: Brian Stansberry
Priority: Minor
I happened to notice this in a server log:
11:53:48,854 ERROR [org.jboss.as.controller.management-operation]
(management-handler-thread - 3) WFLYCTL0013: Operation ("resolve-expression")
failed - address: ([]) - failure description: "WFLYCTL0211: Cannot resolve expression
'expression \"${unresolvable}\"' -- java.lang.IllegalStateException:
Failed to resolve expression: ${unresolvable}"
That failure shouldn't end up in the server log; it's just a client mistake
unrelated to server operation.
A guess is that it's logged because the OFE has the ISE attached as a cause, in which
case a simple fix is to not attach the ISE, which adds no value.
Note the handler has a catch block above the one that throws this OFE that handles a
SecurityException case. In that case it *may* be appropriate for something to appear in
the logs, assuming tracing how the SE can happen indicates it could be triggered by a user
fishing for an exploit. In that case a direct WARN in the log from the
ResolveExpressionHandler instead of attaching the SE to the OFE and letting the
OperationContext log an ERROR may be more appropriate.