Chronicle-Engine demo run fail

69 views
Skip to first unread message

Liu Leo

unread,
Aug 26, 2016, 5:47:55 AM8/26/16
to Chronicle
Got this exception when run the demo

Exception in thread "main" java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to net.openhft.chronicle.engine.cfg.Installable
 at net.openhft.chronicle.engine.cfg.EngineCfg.readMarshallable(EngineCfg.java:69)
 at net.openhft.chronicle.engine.cfg.EngineCfg.lambda$readMarshallable$353(EngineCfg.java:71)
 at net.openhft.chronicle.wire.SerializationStrategies$1.readUsing(SerializationStrategies.java:23)
 at net.openhft.chronicle.wire.TextWire$TextValueIn.marshallable(TextWire.java:2301)
 at net.openhft.chronicle.wire.ValueIn.marshallable(ValueIn.java:325)
 at net.openhft.chronicle.engine.cfg.EngineCfg.readMarshallable(EngineCfg.java:71)
 at net.openhft.chronicle.engine.cfg.EngineCfg.readMarshallable(EngineCfg.java:57)
 at net.openhft.chronicle.wire.SerializationStrategies$1.readUsing(SerializationStrategies.java:23)
 at net.openhft.chronicle.wire.TextWire$TextValueIn.marshallable(TextWire.java:2301)
 at net.openhft.chronicle.wire.ValueIn.object(ValueIn.java:443)
 at net.openhft.chronicle.wire.ValueIn.object(ValueIn.java:412)
 at net.openhft.chronicle.wire.TextWire.readTypedObject(TextWire.java:741)
 at net.openhft.chronicle.wire.TextWire.readObject(TextWire.java:730)
 at net.openhft.chronicle.wire.TextWire.readObject(TextWire.java:710)
 at net.openhft.chronicle.engine.EngineMain.main(EngineMain.java:55)
 at net.openhft.engine.chronicle.demo.RunEngineMain.main(RunEngineMain.java:21)

Liu Leo

unread,
Aug 29, 2016, 9:10:23 PM8/29/16
to Chronicle
I am testing in windows 7 64bit.

Currently using chronicle queue to store trade data. and want to use chronicle engine to share over network.
with subscribe and publish serivice.

Peter Lawrey

unread,
Aug 29, 2016, 9:12:10 PM8/29/16
to java-ch...@googlegroups.com

This suggests you have an error in your configuration file. Can you send us a copy of it?


--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicle+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Lawrey

unread,
Aug 29, 2016, 9:13:43 PM8/29/16
to java-ch...@googlegroups.com

The configuration file is actually deserialized. This means your configuration blocks need to be typed. In this case it needs to be typed as a class which implements Installable.


On 26 Aug 2016 19:47, "Liu Leo" <liuta...@gmail.com> wrote:
--

Liu Leo

unread,
Aug 29, 2016, 9:43:29 PM8/29/16
to Chronicle
The config file is download from the Chronicle-Engine Demo "engine.yaml"

--- !EngineCfg {
#
# Configuration files are being placed in /etc following the Unix convention, but could be anywhere
#
etc: {
  #
  # Configures JMX supports
  #
  jmx: !JmxCfg {
    enabled: true
    }
  #
  # Configure remote access for Java and C#
  #
  server: !ServerCfg {
    wireType: BINARY,
    port: 8088,
    logTCPMessages: DEBUG_ONLY, # only show when in debug mode on the server
    heartbeatIntervalMs: 1_000, # must be lees than the timeout.
    heartbeatIntervalTimeout: 100_000
    }
  #
  # Allow access via NFS to this engine.
  #
  nfs: !NfsCfg {
    enabled: true,
    debug: false, # log every NFS request.
    exports: {
     # export everything.
      "/": "*(rw,noacl,anonuid=1000,anongid=1000)",
      "/data": "*(rw,noacl,anonuid=1000,anongid=1000)"
      "/stocks": "*(rw,noacl,anonuid=1000,anongid=1000)"
    }
  }
  monitoring: !MonitorCfg {
      subscriptionMonitoringEnabled: true
      userMonitoringEnabled: true
  }
  #
  # Configure a group of node which form a local cluster.
  #
  # Configure a cluster of one for now.
  clusters: !ClustersCfg {
    cluster: {
      host1: {
         hostId: 1,
         tcpBufferSize: 65536,
         connectUri: localhost:8088,
         timeoutMs: 1000,
      }
#      host2: {
#         hostId: 2,
#         tcpBufferSize: 65536,
#         connectUri: server2:8088,
#         timeoutMs: 1000,
#      },
#       host3: {
#           hostId: 3,
#           tcpBufferSize: 65536,
#           connectUri: server3:8088,
#           timeoutMs: 1000,
#        }
      }
    }
  }
#
# User space data resources, could be named anything
#
data: {
    # a map with wraps a directory
    disk: !FilePerKeyMapCfg {
      keyType: !type String,
      valueType: !type String,
      compression: none,
      putReturnsNull: false,
      removeReturnsNull: false,
      diskPath: demo-data
    },
    chronicle: !ChronicleMapCfg {
          diskPath: /tmp/data,
          keyType: !type String,
          valueType: !type String,
          compression: none,
          putReturnsNull: false,
          removeReturnsNull: false,
          entries: 2000,
          averageSize: 1000
        },
    # a map which wraps ConcurrentHashMap
    map: !InMemoryMapCfg {
      keyType: !type String,
      valueType: !type String,
      compression: none,
      putReturnsNull: false,
      removeReturnsNull: false,
    },
    # a map which wraps ConcurrentHashMap
    map2:  !InMemoryMapCfg {
      keyType: !type String,
      valueType: !type String,
      compression: none,
      putReturnsNull: true,
      removeReturnsNull: true,
    }
  }
stocks: {
  ftse: !InMemoryMapCfg {
    keyType: !type String,
    valueType: !type EndOfDayShort,
    compression: none,
    putReturnsNull: true,
    removeReturnsNull: true,
    import: ftse350.csv
    }
  nyse: !InMemoryMapCfg {
    keyType: !type String,
    valueType: !type EndOfDay,
    compression: none,
    putReturnsNull: true,
    removeReturnsNull: true,
    import: nyse.csv
    }
  }
}
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages