jboss-developer / jboss-jdg-quickstarts

Quickstarts (or examples, or samples) for Infinispan.
Apache License 2.0
67 stars 99 forks source link

Forecast example error on infinispan-server startup #151

Open angelorlcosta opened 7 years ago

angelorlcosta commented 7 years ago

Hello all,

I have been working on the remote-query example and was trying to change from local cache to a distributed-cache so i changed the configuration to:

                <distributed-cache name="addressbook_indexed" owners="2" mode="ASYNC" segments="20" start="EAGER" remote-timeout="300000">

                    <!-- Define the locking isolation of this cache -->
                    <locking isolation="READ_UNCOMMITTED" striping="false" acquire-timeout="15000" concurrency-level="10000" />

                    <!-- Enable indexing using the RAM Lucene directory provider -->
                    <indexing index="ALL">
                        <property name="default.indexBase">${jboss.server.name}/index</property>
                        <property name="default.indexmanager">near-real-time</property>
                        <property name="default.directory_provider">ram</property>
                    </indexing>

                    <!-- Define the JdbcBinaryCacheStores to point to the ExampleDS previously defined -->
                    <string-keyed-jdbc-store datasource="java:jboss/datasources/DSMysql" passivation="false" preload="true" purge="false">

                        <!-- specifies information about database table/column names and data types -->
                        <string-keyed-table prefix="JDG">
                            <id-column name="id" type="VARCHAR(100)"/>
                            <data-column name="datum" type="BLOB"/>
                            <timestamp-column name="version" type="BIGINT"/>
                        </string-keyed-table>
                    </string-keyed-jdbc-store>
                </distributed-cache>
                <!-- End of 'addressbook_indexed' cache definition -->

Right now i am able to run the demo with: mvn exec:java -PSnowForecast

and then add one forecast successfully and i see that forecast stored in the database. In my case it's a mysql database.

If i stop the infinispan-server and startup it again, i get an error:

Caused by: java.lang.IllegalArgumentException: Message descriptor not found : quickstart.Forecast at org.infinispan.protostream.impl.SerializationContextImpl.getMessageDescriptor(SerializationContextImpl.java:180) at org.infinispan.query.remote.impl.indexing.WrappedMessageTagHandler.onTag(WrappedMessageTagHandler.java:66) at org.infinispan.protostream.ProtobufParser.parseMessage(ProtobufParser.java:76)

How can i solve this?

Thanks in advance, Ângelo Costa

anistor commented 7 years ago

Hi, please make sure global state persistence is enabled for the cache container. This will make the protobuf metadata cache persistent too and will solve your issue.

To do that add a element under the cache-container element.

Adrian

angelorlcosta commented 7 years ago

Hello,

I have added the bellow xml configuration but the error still shows up.

Is this the correct configuration or any other configuration i should we aware of?

Of a sample example?

Thanks in advance, Ângelo Costa

angelorlcosta commented 7 years ago

Also noticed that there is also another error which could help: Caused by: java.lang.NullPointerException at org.infinispan.remoting.rpc.RpcManagerImpl.setTopologyId(RpcManagerImpl.java:282) at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotelyAsync(RpcManagerImpl.java:136) at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:185) at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.releaseLocksOnFailureBeforePrepare(PessimisticLockingInterceptor.java:268)

may be another configuration missing?