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

System property wildfly.config.url doesn't resolve correctly relative paths

XMLWordPrintable

    • Hide

      Use reproducer from JBEAP-8585

      jcacek@jcacek:~/projects/wildfly-security/elytron-anonymous-jms-client$ ls
      custom-config.xml  demo.cli  LICENSE  pom.xml  README.md  src  target
      
      jcacek@jcacek:~/projects/wildfly-security/elytron-anonymous-jms-client$ pwd
      /home/jcacek/projects/wildfly-security/elytron-anonymous-jms-client
      
      jcacek@jcacek:~/projects/wildfly-security/elytron-anonymous-jms-client$ java -Dwildfly.config.url=custom-config.xml -jar target/elytron-anonymous-jms-client.jar 
      Led 31, 2017 1:35:27 ODP. org.wildfly.naming.client.Version <clinit>
      INFO: WildFly Naming version 1.0.0.Beta6
      Led 31, 2017 1:35:27 ODP. org.wildfly.security.elytron.demo.JmsClient main
      INFO: Attempting to acquire connection factory
      Led 31, 2017 1:35:27 ODP. org.jboss.remoting3.EndpointImpl <clinit>
      INFO: JBoss Remoting version 5.0.0.Beta12
      Led 31, 2017 1:35:27 ODP. org.xnio.Xnio <clinit>
      INFO: XNIO version 3.4.3.Final
      Led 31, 2017 1:35:27 ODP. org.xnio.nio.NioXnio <clinit>
      INFO: XNIO NIO Implementation Version 3.4.3.Final
      Led 31, 2017 1:35:27 ODP. org.wildfly.security.Version <clinit>
      INFO: ELY00001: WildFly Elytron version 1.1.0.Beta21
      Exception in thread "main" java.lang.ExceptionInInitializerError
      	at org.wildfly.security.auth.client.AuthenticationContext.lambda$static$0(AuthenticationContext.java:49)
      	at org.wildfly.common.context.ContextManager.getPrivileged(ContextManager.java:205)
      	at org.wildfly.security.auth.client.AuthenticationContext.captureCurrent(AuthenticationContext.java:81)
      	at org.jboss.remoting3.EndpointImpl.construct(EndpointImpl.java:223)
      	at org.jboss.remoting3.EndpointBuilder.build(EndpointBuilder.java:117)
      	at org.jboss.remoting3.ConfigurationEndpointSupplier.lambda$static$0(ConfigurationEndpointSupplier.java:68)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.jboss.remoting3.ConfigurationEndpointSupplier.<clinit>(ConfigurationEndpointSupplier.java:48)
      	at org.wildfly.common.context.ContextManager.setGlobalDefaultSupplierIfNotSet(ContextManager.java:108)
      	at org.jboss.remoting3.Endpoint.lambda$static$0(Endpoint.java:58)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.jboss.remoting3.Endpoint.<clinit>(Endpoint.java:56)
      	at org.wildfly.naming.client.remote.RemoteNamingProviderFactory.supportsUriScheme(RemoteNamingProviderFactory.java:70)
      	at org.wildfly.naming.client.WildFlyRootContext.getProviderContext(WildFlyRootContext.java:318)
      	at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:123)
      	at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:113)
      	at javax.naming.InitialContext.lookup(InitialContext.java:417)
      	at org.wildfly.security.elytron.demo.JmsClient.main(JmsClient.java:37)
      Caused by: org.wildfly.security.auth.client.InvalidAuthenticationConfigurationException: org.wildfly.client.config.ConfigXMLParseException: CONF0012: Failed to read from input source
      	at file:/home/jcacek/projects/wildfly-security/custom-config.xml
      	at org.wildfly.security.auth.client.DefaultAuthenticationContextProvider.lambda$static$0(DefaultAuthenticationContextProvider.java:44)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.wildfly.security.auth.client.DefaultAuthenticationContextProvider.<clinit>(DefaultAuthenticationContextProvider.java:36)
      	... 18 more
      Caused by: org.wildfly.client.config.ConfigXMLParseException: CONF0012: Failed to read from input source
      	at file:/home/jcacek/projects/wildfly-security/custom-config.xml
      	at org.wildfly.client.config.ConfigurationXMLStreamReader.openUri(ConfigurationXMLStreamReader.java:64)
      	at org.wildfly.client.config.ClientConfiguration.readConfiguration(ClientConfiguration.java:72)
      	at org.wildfly.security.auth.client.ElytronXmlParser.parseAuthenticationClientConfiguration(ElytronXmlParser.java:131)
      	at org.wildfly.security.auth.client.DefaultAuthenticationContextProvider.lambda$static$0(DefaultAuthenticationContextProvider.java:42)
      	... 20 more
      Caused by: java.io.FileNotFoundException: /home/jcacek/projects/wildfly-security/custom-config.xml (Adresář nebo soubor neexistuje)
      	at java.io.FileInputStream.open0(Native Method)
      	at java.io.FileInputStream.open(FileInputStream.java:195)
      	at java.io.FileInputStream.<init>(FileInputStream.java:138)
      	at java.io.FileInputStream.<init>(FileInputStream.java:93)
      	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
      	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
      	at org.wildfly.client.config.ConfigurationXMLStreamReader.openUri(ConfigurationXMLStreamReader.java:50)
      	... 23 more
      
      Show
      Use reproducer from JBEAP-8585 jcacek@jcacek:~/projects/wildfly-security/elytron-anonymous-jms-client$ ls custom-config.xml demo.cli LICENSE pom.xml README.md src target jcacek@jcacek:~/projects/wildfly-security/elytron-anonymous-jms-client$ pwd /home/jcacek/projects/wildfly-security/elytron-anonymous-jms-client jcacek@jcacek:~/projects/wildfly-security/elytron-anonymous-jms-client$ java -Dwildfly.config.url=custom-config.xml -jar target/elytron-anonymous-jms-client.jar Led 31, 2017 1:35:27 ODP. org.wildfly.naming.client.Version <clinit> INFO: WildFly Naming version 1.0.0.Beta6 Led 31, 2017 1:35:27 ODP. org.wildfly.security.elytron.demo.JmsClient main INFO: Attempting to acquire connection factory Led 31, 2017 1:35:27 ODP. org.jboss.remoting3.EndpointImpl <clinit> INFO: JBoss Remoting version 5.0.0.Beta12 Led 31, 2017 1:35:27 ODP. org.xnio.Xnio <clinit> INFO: XNIO version 3.4.3.Final Led 31, 2017 1:35:27 ODP. org.xnio.nio.NioXnio <clinit> INFO: XNIO NIO Implementation Version 3.4.3.Final Led 31, 2017 1:35:27 ODP. org.wildfly.security.Version <clinit> INFO: ELY00001: WildFly Elytron version 1.1.0.Beta21 Exception in thread "main" java.lang.ExceptionInInitializerError at org.wildfly.security.auth.client.AuthenticationContext.lambda$ static $0(AuthenticationContext.java:49) at org.wildfly.common.context.ContextManager.getPrivileged(ContextManager.java:205) at org.wildfly.security.auth.client.AuthenticationContext.captureCurrent(AuthenticationContext.java:81) at org.jboss.remoting3.EndpointImpl.construct(EndpointImpl.java:223) at org.jboss.remoting3.EndpointBuilder.build(EndpointBuilder.java:117) at org.jboss.remoting3.ConfigurationEndpointSupplier.lambda$ static $0(ConfigurationEndpointSupplier.java:68) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.remoting3.ConfigurationEndpointSupplier.<clinit>(ConfigurationEndpointSupplier.java:48) at org.wildfly.common.context.ContextManager.setGlobalDefaultSupplierIfNotSet(ContextManager.java:108) at org.jboss.remoting3.Endpoint.lambda$ static $0(Endpoint.java:58) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.remoting3.Endpoint.<clinit>(Endpoint.java:56) at org.wildfly.naming.client.remote.RemoteNamingProviderFactory.supportsUriScheme(RemoteNamingProviderFactory.java:70) at org.wildfly.naming.client.WildFlyRootContext.getProviderContext(WildFlyRootContext.java:318) at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:123) at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:113) at javax.naming.InitialContext.lookup(InitialContext.java:417) at org.wildfly.security.elytron.demo.JmsClient.main(JmsClient.java:37) Caused by: org.wildfly.security.auth.client.InvalidAuthenticationConfigurationException: org.wildfly.client.config.ConfigXMLParseException: CONF0012: Failed to read from input source at file:/home/jcacek/projects/wildfly-security/custom-config.xml at org.wildfly.security.auth.client.DefaultAuthenticationContextProvider.lambda$ static $0(DefaultAuthenticationContextProvider.java:44) at java.security.AccessController.doPrivileged(Native Method) at org.wildfly.security.auth.client.DefaultAuthenticationContextProvider.<clinit>(DefaultAuthenticationContextProvider.java:36) ... 18 more Caused by: org.wildfly.client.config.ConfigXMLParseException: CONF0012: Failed to read from input source at file:/home/jcacek/projects/wildfly-security/custom-config.xml at org.wildfly.client.config.ConfigurationXMLStreamReader.openUri(ConfigurationXMLStreamReader.java:64) at org.wildfly.client.config.ClientConfiguration.readConfiguration(ClientConfiguration.java:72) at org.wildfly.security.auth.client.ElytronXmlParser.parseAuthenticationClientConfiguration(ElytronXmlParser.java:131) at org.wildfly.security.auth.client.DefaultAuthenticationContextProvider.lambda$ static $0(DefaultAuthenticationContextProvider.java:42) ... 20 more Caused by: java.io.FileNotFoundException: /home/jcacek/projects/wildfly-security/custom-config.xml (Adresář nebo soubor neexistuje) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at java.io.FileInputStream.<init>(FileInputStream.java:93) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) at org.wildfly.client.config.ConfigurationXMLStreamReader.openUri(ConfigurationXMLStreamReader.java:50) ... 23 more

      When an AS client runs with custom Elytron configuration specified and system property wildfly.config.url is used to provide the configuration (as a relative path), then the resolved URI is not correct.

              darran.lofthouse@redhat.com Darran Lofthouse
              josef.cacek@gmail.com Josef Cacek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: