Geronimo
  1. Geronimo
  2. GERONIMO-5142

runtime errors if JAVA_HOME or JRE_HOME is not specified

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.4, 2.2
    • Fix Version/s: Wish List
    • Component/s: None
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      setjavaenv.sh used to require JAVA_HOME or JRE_HOME to be specified. Looks like it was updated to look for a java runtime in the PATH, and use that, if the environment variables weren't specified.

      On Mac OS, at least, this doesn't work. JAVA_HOME/JRE_HOME are used to set other variables. Namely EXT_DIRS and ENDORSED_DIRS. They aren't set properly, if JAVA_HOME/JRE_HOME aren't set. This causes runtime errors:

      Module 19/70 org.apache.geronimo.configs/openejb/2.1.4/car
      2010-02-11 09:48:23,404 ERROR [SimpleEncryption] Unable to decrypt
      java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES
      at javax.crypto.Cipher.getInstance(DashoA13*..)
      at org.apache.geronimo.crypto.AbstractEncryption.decrypt(AbstractEncryption.java:74)
      at org.apache.geronimo.crypto.EncryptionManager.decrypt(EncryptionManager.java:109)
      ...

      1. setjavaenv.sh
        5 kB
        Ivan
      2. geronimo.sh
        15 kB
        Ivan

        Issue Links

          Activity

          Hide
          Rex Wang added a comment -

          add to wish list

          Show
          Rex Wang added a comment - add to wish list
          Hide
          Ivan added a comment -

          About recursivly finding the target file location from a symbolic link, after googled, I found there is a quick command "readlink", but not sure all the OS have this command.

          Show
          Ivan added a comment - About recursivly finding the target file location from a symbolic link, after googled, I found there is a quick command "readlink", but not sure all the OS have this command.
          Hide
          Ivan added a comment -

          Hi, Kevan:
          I ported some changes from Tomcat and Maven, so that the script would guess the jre_home if it is not set on OSX. But I do not have a OSX on hand, could you please help to review it ?
          Thanks !

          Show
          Ivan added a comment - Hi, Kevan: I ported some changes from Tomcat and Maven, so that the script would guess the jre_home if it is not set on OSX. But I do not have a OSX on hand, could you please help to review it ? Thanks !
          Hide
          Kevan Miller added a comment -

          Right. Almost any *nix system is going to have a symbolic link in PATH to the actual java executable. So the shell script would need to follow symbolic links until it found the actual executable. This is certainly possible to do. I also seem to recall the mvn script having some platform specific code for finding JAVA_HOME.

          I'd prefer we were a 1) consistent between Windoze .bat and reasonable OS .sh environments (e.g. require or not require JAVA/JRE_HOME) and 2) allowed JAVA/JRE_HOME to default, if not explicitly set.

          FYI, just checked Tomcat. Looks like their setclasspath.sh would be a reasonable guide.

          Show
          Kevan Miller added a comment - Right. Almost any *nix system is going to have a symbolic link in PATH to the actual java executable. So the shell script would need to follow symbolic links until it found the actual executable. This is certainly possible to do. I also seem to recall the mvn script having some platform specific code for finding JAVA_HOME. I'd prefer we were a 1) consistent between Windoze .bat and reasonable OS .sh environments (e.g. require or not require JAVA/JRE_HOME) and 2) allowed JAVA/JRE_HOME to default, if not explicitly set. FYI, just checked Tomcat. Looks like their setclasspath.sh would be a reasonable guide.
          Hide
          Jack Cai added a comment -

          So maybe let's just remove the support for locating java from PATH, which is the current behavior on Windows platforms.

          Show
          Jack Cai added a comment - So maybe let's just remove the support for locating java from PATH, which is the current behavior on Windows platforms.

            People

            • Assignee:
              Unassigned
              Reporter:
              Kevan Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development