Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-1671

Fuse/A-MQ does not fully respect KARAF_ETC environment variable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • jboss-fuse-6.2
    • jboss-fuse-6.1
    • None
    • None
    • % %
    • Hide

      1. Install jboss-fuse-6.1.0-redhat-379
      2. Rename 'etc' to 'etc.old'
      3. Start fuse as follows:
      KARAF_ETC=/full/path/to/etc.orig ./bin/fuse
      4. Note the error message in the log about users.properties

      Show
      1. Install jboss-fuse-6.1.0-redhat-379 2. Rename 'etc' to 'etc.old' 3. Start fuse as follows: KARAF_ETC=/full/path/to/etc.orig ./bin/fuse 4. Note the error message in the log about users.properties

    Description

      Fuse 6.1 and JBoss A-MQ 6.1 (and perhaps earlier versions) do not fully respect the KARAF_ETC environment variable. This variable should allow it to be possible to put the Fuse configuration directory in some place other than ./etc. Fuse does correctly detect an attempt to set KARAF_ETC to a non-existent directory and, if it is set validly, Fuse does start up. However, it fails to read user credentials from KARAF_ETC/users.properties, and a message to that effect can be seen in the log.

      9:22:25,205 | WARN | FelixStartLevel | BootstrapConfiguration | 53 - io.fabric8.fabric-zookeeper - 1.0.0.redhat-379 | Failed to load users from etc/users.properties. No users will be imported.
      java.io.FileNotFoundException: /home/kevin/lib/jboss-fuse-6.1.0.redhat-379/etc/users.properties (No such file or directory)
      at java.io.FileInputStream.open(Native Method)[:1.7.0_25]
      at java.io.FileInputStream.<init>(FileInputStream.java:138)[:1.7.0_25]
      at org.apache.felix.utils.properties.Properties.load(Properties.java:106)
      at io.fabric8.zookeeper.bootstrap.BootstrapConfiguration.activate(BootstrapConfiguration.java:133)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_25]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_25]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_25]

      The problem appears to be in the class io.fabric8.zookeeper.bootstrap.BootstrapConfiguration.java, which is hard-coded to look for users.properties in ./etc.

      @Activate
      void activate(ComponentContext componentContext, Map<String, ?> configuration) throws Exception {
      this.componentContext = componentContext;
      configurer.configure(configuration, this);

      org.apache.felix.utils.properties.Properties userProps = new org.apache.felix.utils.properties.Properties();
      // [TODO] abstract access to karaf users.properties
      try

      { userProps.load(new File(new File(home) , "etc" + File.separator + "users.properties")); }

      catch (IOException e)

      { LOGGER.warn("Failed to load users from etc/users.properties. No users will be imported.", e); }

      Attachments

        Activity

          People

            pantinor@redhat.com Paolo Antinori
            rhn-support-kboone Kevin Boone
            Tomas Rohovsky Tomas Rohovsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: