Application Server 3  4  5 and 6
  1. Application Server 3 4 5 and 6
  2. JBAS-7239

JBoss overwiting java.library.path when native libs available

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: JBossAS-5.1.0.GA
    • Fix Version/s: 6.0.0.M1
    • Component/s: None
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Environment:
      Windows x86/x64 (XP SP3), Linux x86/x64 (Ubuntu 9.04, Centos 5)
    • Workaround Description:
      Hide

      Make the required change described above to the run.sh file

      Show
      Make the required change described above to the run.sh file
    • Similar Issues:
      Show 10 results 

      Description

      When using JBM1.4 my java.library.path was as follows:

      /opt/jdk1.6.0_16/jre/lib/i386/server:/opt/jdk1.6.0_16/jre/lib/i386:/opt/jdk1.6.0_16/jre/../lib/i386:/opt/berkeleydb/lib:/usr/java/packages/lib/i386:/lib:/usr/lib

      But now that I've changed to HornetQ it is this:

      /opt/jboss/bin/META-INF/lib/linux2/x86

      So I can't load my berkeley database anymore. The bug is due to behaviour when there are native libraries available for JBoss to load.

      The problem lies in the run.sh script:

      JBOSS_NATIVE_DIR="$JBOSS_HOME/bin/META-INF/lib/$JBOSS_NATIVE_SYS/$JBOSS_NATIVE_CPU"
      if [ -d "$JBOSS_NATIVE_DIR" ]; then
      if $cygwin ; then
      export PATH="$JBOSS_NATIVE_DIR:$PATH"
      JBOSS_NATIVE_DIR=`cygpath --path --windows "$JBOSS_NATIVE_DIR"`
      else
      if [ "x$LD_LIBRARY_PATH" = "x" ]; then
      LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR"
      else
      LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR:$LD_LIBRARY_PATH"
      fi
      export LD_LIBRARY_PATH
      fi
      if [ "x$JAVA_OPTS" = "x" ]; then
      JAVA_OPTS="-Djava.library.path=$JBOSS_NATIVE_DIR"
      else
      JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$JBOSS_NATIVE_DIR"
      fi
      fi

      Where the JAVA_OPTS section should actually look like this:

      if [ "x$JAVA_OPTS" = "x" ]; then
      JAVA_OPTS="-Djava.library.path=$LD_LIBRARY_PATH"
      else
      JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$LD_LIBRARY_PATH"
      fi

        Issue Links

          Activity

          Hide
          Dimitris Andreadis
          added a comment -

          Assign to Mladen to fix. My only concern looking at the if statements is it might not work on cygwin?

          Show
          Dimitris Andreadis
          added a comment - Assign to Mladen to fix. My only concern looking at the if statements is it might not work on cygwin?
          Hide
          Mladen Turk
          added a comment -

          Fixed in the SVN for both trunk and JBAPP_5_0 branch.
          http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas?view=revision&revision=93446
          http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas?view=revision&revision=93447

          Explanation:
          Some platforms prefer java.library.path over the system LD_LIBRARY_PATH, so the patch makes sure
          they are both in sync.
          For cygwin it's irrelevant because on Windows PATH environment variable is used for loading
          the .dll's, so we can have shorter version of java.library.path

          Show
          Mladen Turk
          added a comment - Fixed in the SVN for both trunk and JBAPP_5_0 branch. http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas?view=revision&revision=93446 http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas?view=revision&revision=93447 Explanation: Some platforms prefer java.library.path over the system LD_LIBRARY_PATH, so the patch makes sure they are both in sync. For cygwin it's irrelevant because on Windows PATH environment variable is used for loading the .dll's, so we can have shorter version of java.library.path
          Hide
          Dimitris Andreadis
          added a comment -

          Re-open to apply some bureaucracy:

          a) The change is needed in Brach_5_x for AS 5.2.Beta, too. I had put that in the original fix version. Nevertheless, I see run.sh in that branch is a bit out-of-sync with trunk, or the other way round, so it's a good opportunity to sync them.

          b) It's good you've fixed it for EAP. In that case you need to create an EAP JIRA with the appropriate fix version (EAP 5.0 GA?) and link it to the current JIRA, so they have a record of the change for their release notes.

          Thanks

          Show
          Dimitris Andreadis
          added a comment - Re-open to apply some bureaucracy: a) The change is needed in Brach_5_x for AS 5.2.Beta, too. I had put that in the original fix version. Nevertheless, I see run.sh in that branch is a bit out-of-sync with trunk, or the other way round, so it's a good opportunity to sync them. b) It's good you've fixed it for EAP. In that case you need to create an EAP JIRA with the appropriate fix version (EAP 5.0 GA?) and link it to the current JIRA, so they have a record of the change for their release notes. Thanks
          Hide
          Jean-Frederic Clere
          added a comment -

          I have "merged" trunk and 5.x
          trunk doesn't work with jbossweb native 2.0.4-2.0.6 because the logic of META-INF/ isn't there, but I plan to release a 2.0.7 that works there.
          5.x should work for all comunity version of jbossweb native (I tested 2.0.6 and 2.0.7-dev).

          Show
          Jean-Frederic Clere
          added a comment - I have "merged" trunk and 5.x trunk doesn't work with jbossweb native 2.0.4-2.0.6 because the logic of META-INF/ isn't there, but I plan to release a 2.0.7 that works there. 5.x should work for all comunity version of jbossweb native (I tested 2.0.6 and 2.0.7-dev).
          Hide
          Mladen Turk
          added a comment -

          Issue resolved

          Show
          Mladen Turk
          added a comment - Issue resolved

            People

            • Assignee:
              Mladen Turk
              Reporter:
              Ross Nicholson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: