3 Replies Latest reply: Apr 12, 2013 10:15 AM by user738616 RSS

    Error with Coherence basic cluster

    1001748
      Hello,
      I'm trying to run a basic cluster with Coherence 3.7.1 using the example that is given in the documentation (2.4.1) but after following the steps I get this error:

      java version "1.7.0_15"
      OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.10.1)
      OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

      Exception in thread "main" (Wrapped: Failed to load cache configuration: java_opts=-Xms%memory%) java.io.IOException: The cache configuration is missing: "java_opts=-Xms%memory%", loader=null
           at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
           at com.tangosol.run.xml.XmlHelper.loadResourceInternal(XmlHelper.java:341)
           at com.tangosol.run.xml.XmlHelper.loadFileOrResource(XmlHelper.java:283)
           at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:186)
      Caused by: java.io.IOException: The cache configuration is missing: "java_opts=-Xms%memory%", loader=null
           at com.tangosol.run.xml.XmlHelper.loadResourceInternal(XmlHelper.java:318)
           ... 2 more
      2013-04-08 18:09:02.566/0.502 Oracle Coherence 3.7.1.0 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/opt/coherence/lib/coherence.jar!/tangosol-coherence.xml"
      2013-04-08 18:09:02.658/0.594 Oracle Coherence 3.7.1.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/opt/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
      2013-04-08 18:09:02.659/0.595 Oracle Coherence 3.7.1.0 <D5> (thread=main, member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
      2013-04-08 18:09:02.664/0.600 Oracle Coherence 3.7.1.0 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

      Oracle Coherence Version 3.7.1.0 Build 27797
      Grid Edition: Development mode
      Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
        • 1. Re: Error with Coherence basic cluster
          Jonathan.Knight
          Hi,

          What OS are you running on - I assume from the output it is Ubuntu Linux?

          I assume you have done the first few steps to edit the required scripts - on Linux this would be the .sh files.

          Post the edited version of cache-server.sh so we can see if it is correct.

          JK
          • 2. Re: Error with Coherence basic cluster
            1001748
            Hello,

            Yes, my OS is Ubuntu 12.10.

            I have only modified the cache-server.sh in the way I think I saw in the documentation.
            This is the way it looks like:

            #!/bin/sh

            # This will start a cache server

            # specify the Coherence installation directory
            SCRIPT_PATH="${BASH_SOURCE[0]}";
            if([ -h "${SCRIPT_PATH}" ]) then
            while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
            fi
            pushd . > /dev/null
            cd `dirname ${SCRIPT_PATH}` > /dev/null
            SCRIPT_PATH=`pwd`
            COHERENCE_HOME=`dirname $SCRIPT_PATH`;
            popd > /dev/null

            # specify the JVM heap size
            MEMORY=512m

            if [ ! -f ${COHERENCE_HOME}/bin/cache-server.sh ]; then
            echo "coherence.sh: must be run from the Coherence installation directory."
            exit
            fi

            if [ -f $JAVA_HOME/bin/java ]; then
            JAVAEXEC=$JAVA_HOME/bin/java
            else
            JAVAEXEC=java
            fi

            if [[ $1 == '-jmx' ]]; then
            JMXPROPERTIES="-Dcom.sun.management.jmxremote -Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true"
            shift
            fi

            #JAVA_OPTS="-Xms$MEMORY -Xmx$MEMORY $JMXPROPERTIES"
            set java_opts="-Xms%memory% -Xmx%memory% -Dtangosol.coherence.cluster=clusterCacheServer -Dtangosol.coherence.clusterport=6666"

            $JAVAEXEC -server -showversion $JAVA_OPTS -cp "$COHERENCE_HOME/lib/coherence.jar" com.tangosol.net.DefaultCacheServer $1

            Thanks
            • 3. Re: Error with Coherence basic cluster
              user738616
              Hi,

              The problem is with the way you are using %memory% (windows) in .sh script and should be replaced with $memory (Linux).

              HTH

              Cheers,
              _NJ