hazelcast / hazelcast-tomcat-sessionmanager

Tomcat Based Web Session Replication
Other
33 stars 37 forks source link

YAML configuration is parsed as XML (com.hazelcast.session.P2PLifecycleListener) #93

Closed emillundstrm closed 4 years ago

emillundstrm commented 4 years ago

The project README has a sample hazelcast.yaml file, which gives the impression that yaml is supported when using hazelcast 4. However, P2PLifecycleListener uses com.hazelcast.internal.config.ConfigLoader, which seems to always parse the config file as XML, giving this error on startup:

INFO [main] com.hazelcast.config.UrlXmlConfig.null Configuring Hazelcast from 'file:/usr/local/tomcat/lib/hazelcast.yaml'.
[Fatal Error] :1:1: Content is not allowed in prolog.
SEVERE [main] com.hazelcast.config.XmlConfigBuilder.null Failed to parse the inputstream
Exception: Content is not allowed in prolog.
Hazelcast startup interrupted.
alparslanavci commented 4 years ago

@emillundstrm, thanks for reporting this issue. It looks YAML configuration is missed when getting the configuration in both P2PLifecycleListener and ClientServerLifecycleListener. As a workaround, you can use hazelcastInstanceName attribute in Manager element in context.xml. It specifies an existing Hazelcast instance to use for session replication which you can configure using YAML.