1

I have Jboss server (EAP 6.4.X) working in domain mode.

In domain.xml I have custom-handler defined. Class specified in custom-handler definition is enclosed in Jboss module.

The definition is as follows:

<custom-handler name="SomeCustomHandlerName" class="com.abc.def.SomeCustomHandler" module="com.abc.def">
   <level name="ALL"/>
   <properties>
      ...
      <property name="somePropertyKey" value="${some.property.value}"/>
      ...
   </properties>
</custom-handler>

When I start the Jboss I get this error:

2018-12-04 18:33:30,564 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("add") failed - address: ([
    ("subsystem" => "logging"),
    ("custom-handler" => "SomeCustomHandlerName")
]) - failure description: "JBAS014802: Cannot resolve expression '${some.property.value}'"

As I see Jboss tries to resolve ${some.property.value} expression using system-properties. However this value should be resolved internally by com.abc.def.SomeCustomHandler class.

The question is how to tell Jboss not to interpret this value and pass it as raw property value to SomeCustomHandler class? Maybe there is a simple way to escape ${} like \$\{\} or something like that?

luke
  • 3,435
  • 33
  • 41
  • Did you solve somehow? Same error on 7.2 when executing: `/subsystem=jgroups/stack=tcp/protocol=JDBC_PING/property=initialize_sql:add(value="DELETE from public.jgroupsping WHERE cluster_name = '${jgroups.tcp.cluster_name}'; CREATE TABLE IF NOT EXISTS public.jgroupsping (own_addr varchar(200) NOT NULL, cluster_name varchar(200) NOT NULL,)ping_data bytea NULL, ip varchar(100) NOT NULL,)node_name varchar(100) NOT NULL, CONSTRAINT jgroupsping_pkey PRIMARY KEY (own_addr, cluster_name));")` – shortsteps Apr 04 '19 at 15:55
  • I was thinking that maybe when I pass for example` \$\{some.property.value\}` to jboss it will not be resolved and then jboss will automatically use raw value without escape characters, like this: `${some.property.value}`. But there is no such escape character. You can escape expression like this and it won't be evaluated, but then jboss will use `\$\{some.property.value\}` as property value. My solution was to put escaped property value in custom-handler definition, and then intercept it in code and manually convert it using regex from `\$\{some.property.value\}` to `${some.property.value}`. – luke Apr 08 '19 at 14:05
  • So you can escape expression like this to prevent resolving by jboss, but then you have to manually parse it in your application code. – luke Apr 08 '19 at 14:08
  • 1
    Thanks, my error was due to the simple fact that jgroups.tcp.cluster_name was not valued anywhere. I set it like system-property and the execution go straight. – shortsteps Apr 08 '19 at 18:48

0 Answers0