Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10306

wildfly-config.xml should support expressions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.1.0.DR18
    • 7.1.0.DR16
    • Remoting
    • None

      wildfly-config.xml should support expressions for most values (where appropriate). For example, when defining a connection URI for EJB client.

      <jboss-ejb-client xmlns="urn:jboss:wildly-client-ejb:3.0">
                <connections>
                   <connection uri="${remote.ejb.url}"/> 
                </connections>
      </jboss-ejb-client>
      

      When running a client with this config, it fails with

      Exception in thread "main" java.lang.ExceptionInInitializerError
      	at org.jboss.ejb.client.EJBClientContext.<clinit>(EJBClientContext.java:106)
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:145)
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:96)
      	at com.sun.proxy.$Proxy0.hello(Unknown Source)
      	at client.Client.main(Client.java:21)
      Caused by: java.lang.IllegalStateException: org.wildfly.client.config.ConfigXMLParseException: CONF0019: Failed to parse URI value of attribute "uri"
      	at file:/home/jmartisk/Workspace/mock-artifacts/ejbclient/eap71-with-ssl-elytron/client/target/classes/META-INF/wildfly-config.xml:37:50
      	at org.jboss.ejb.client.ConfigurationBasedEJBClientContextSelector.loadConfiguration(ConfigurationBasedEJBClientContextSelector.java:66)
      	at org.jboss.ejb.client.ConfigurationBasedEJBClientContextSelector.<clinit>(ConfigurationBasedEJBClientContextSelector.java:53)
      	... 5 more
      Caused by: org.wildfly.client.config.ConfigXMLParseException: CONF0019: Failed to parse URI value of attribute "uri"
      	at file:/home/jmartisk/Workspace/mock-artifacts/ejbclient/eap71-with-ssl-elytron/client/target/classes/META-INF/wildfly-config.xml:37:50
      	at org.wildfly.client.config.ConfigurationXMLStreamReader.getURIAttributeValue(ConfigurationXMLStreamReader.java:477)
      	at org.jboss.ejb.client.ConfigurationBasedEJBClientContextSelector.parseConnectionType(ConfigurationBasedEJBClientContextSelector.java:224)
      	at org.jboss.ejb.client.ConfigurationBasedEJBClientContextSelector.parseConnectionsType(ConfigurationBasedEJBClientContextSelector.java:205)
      	at org.jboss.ejb.client.ConfigurationBasedEJBClientContextSelector.parseEJBClientType(ConfigurationBasedEJBClientContextSelector.java:108)
      	at org.jboss.ejb.client.ConfigurationBasedEJBClientContextSelector.parseEJBClientConfiguration(ConfigurationBasedEJBClientContextSelector.java:83)
      	at org.jboss.ejb.client.ConfigurationBasedEJBClientContextSelector.loadConfiguration(ConfigurationBasedEJBClientContextSelector.java:63)
      	... 6 more
      Caused by: java.net.URISyntaxException: Illegal character in path at index 1: ${remote.ejb.url}
      	at java.net.URI$Parser.fail(URI.java:2848)
      	at java.net.URI$Parser.checkChars(URI.java:3021)
      	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
      	at java.net.URI$Parser.parse(URI.java:3063)
      	at java.net.URI.<init>(URI.java:588)
      	at org.wildfly.client.config.ConfigurationXMLStreamReader.getURIAttributeValue(ConfigurationXMLStreamReader.java:475)
      	... 11 more
      

      Without expression resolution, this file loses much of its usability.

              dlloyd@redhat.com David Lloyd
              jmartisk@redhat.com Jan Martiska
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: