Using resource lookup to replace system property in EJB on JBoss EAP 7.x

Solution Unverified - Updated -

Issue

When defining a property in @Resource(lookup = "${some.defined.property}") an exception is triggered:

Caused by: javax.naming.NameNotFoundException: ${some.defined.property} -- service jboss.naming.context.java."${catalyst.changelog.datasource.database}"
        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
        at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:237)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at org.jboss.as.weld.services.bootstrap.WeldResourceInjectionServices.resolveResource(WeldResourceInjectionServices.java:237)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content