Karaf
  1. Karaf
  2. KARAF-1695

startup fails on Windows with only JRE installed

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.8, 3.0.0
    • Fix Version/s: 2.3.0, 3.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows XP 32bit
      Oracle Java Runtime Environment 7u5

      Description

      It fails with the error:

      Error: missing `server' JVM at `C:\Program Files\Java\jre7\bin\server\jvm.dll'.
      Please install or use the JRE or JDK that contains these missing components.
      

      Possible workarounds:
      a) Install Oracle JDK
      b) modify the JAVA_OPTS:

      set JAVA_OPTS=-Xmx512M
      karaf.bat
      

      The startup-script should contain special handling for JRE on windows and fallback to "-client" of "-server" is not available.

      1. jre-windows-client.patch
        1 kB
        Christoph Gritschenberger

        Activity

        Christoph Gritschenberger created issue -
        Show
        Dan Tran added a comment - initial discussion is at http://karaf.922171.n3.nabble.com/Why-is-JDK-required-for-running-Karaf-td4025391.html
        Hide
        Dan Tran added a comment -

        a fix would be scan for the existing server or client dll and act upon it for windows script

        Show
        Dan Tran added a comment - a fix would be scan for the existing server or client dll and act upon it for windows script
        Hide
        Dan Tran added a comment -

        since all jre distribution from all platforms have server mode, except windows x62 32 bit. So it is safe to remove '-server' option from

        DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote" for both unix and windows karaf(.bat) scripts

        tested with my environment

        Show
        Dan Tran added a comment - since all jre distribution from all platforms have server mode, except windows x62 32 bit. So it is safe to remove '-server' option from DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote" for both unix and windows karaf(.bat) scripts tested with my environment
        Hide
        Christoph Gritschenberger added a comment -

        This patch make the startup-script fallback to client-mode if server-mode is not available.

        Tested under
        WinXP 32bit (German)
        and Win7 64bit (English)

        Show
        Christoph Gritschenberger added a comment - This patch make the startup-script fallback to client-mode if server-mode is not available. Tested under WinXP 32bit (German) and Win7 64bit (English)
        Christoph Gritschenberger made changes -
        Field Original Value New Value
        Attachment jre-windows-client.patch [ 12544454 ]
        Hide
        Dan Tran added a comment -

        Christoph, I thought of doing the same thing, but fall back to the simpler solution by just remove '-server' option from command line. karaf java service wrapper does the same thing

        Show
        Dan Tran added a comment - Christoph, I thought of doing the same thing, but fall back to the simpler solution by just remove '-server' option from command line. karaf java service wrapper does the same thing
        Andreas Pieber made changes -
        Assignee Andreas Pieber [ pieber ]
        Andreas Pieber made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Dan Tran added a comment -

        same issue for client.bat

        Show
        Dan Tran added a comment - same issue for client.bat
        Hide
        Andreas Pieber added a comment -

        @Dan: 3.x or 2.3.x? Just given the client.bat in 2.3.x a shot and it does't look as if there's any server param.

        Show
        Andreas Pieber added a comment - @Dan: 3.x or 2.3.x? Just given the client.bat in 2.3.x a shot and it does't look as if there's any server param.
        Hide
        Andreas Pieber added a comment -

        Committed r1388128
        M assemblies/features/framework/src/main/filtered-resources/resources/bin/karaf.bat
        r1388128 = 2a67c132dbaa9c1902e7e90151a51889a0219bda (refs/remotes/origin/trunk)

        Committed r1388129
        M assemblies/apache-karaf/src/main/distribution/windows-text/bin/karaf.bat
        r1388129 = dbbffa76024f5169b11edebe9f3d1f6ef3a76da5 (refs/remotes/origin/karaf-2.3.x)

        Show
        Andreas Pieber added a comment - Committed r1388128 M assemblies/features/framework/src/main/filtered-resources/resources/bin/karaf.bat r1388128 = 2a67c132dbaa9c1902e7e90151a51889a0219bda (refs/remotes/origin/trunk) Committed r1388129 M assemblies/apache-karaf/src/main/distribution/windows-text/bin/karaf.bat r1388129 = dbbffa76024f5169b11edebe9f3d1f6ef3a76da5 (refs/remotes/origin/karaf-2.3.x)
        Andreas Pieber made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 2.3.0 [ 12320554 ]
        Fix Version/s 3.0.0 [ 12316040 ]
        Resolution Fixed [ 1 ]
        Hide
        Andreas Pieber added a comment -

        I neither found it on the master --> I resolve it for now; feel free to reopen if there still consist any problems

        Show
        Andreas Pieber added a comment - I neither found it on the master --> I resolve it for now; feel free to reopen if there still consist any problems
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        43d 19h 18m 1 Andreas Pieber 13/Sep/12 09:35
        In Progress In Progress Resolved Resolved
        7d 9h 6m 1 Andreas Pieber 20/Sep/12 18:42

          People

          • Assignee:
            Andreas Pieber
            Reporter:
            Christoph Gritschenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development