Hazelcast Hibernate Enum Serialization/Deserialization Exception - java

I am trying to integrate hazelcast with a Spring boot project for hibernate L2 cache.
Hazelcast - 3.9.4
hazelcast-hibernate4
Setting up Hibernate L2 cache in Cluster Mode and connecting like a Native client.
The setup works fine (both for L2+Query cache) and I can see data in my cluster .
But now a weird Exception is coming:-
SEVERE: [10.129.252.157]:5701 [dev] [3.9.4]
java.io.InvalidObjectException: enum constant DUMMY does not exist in class com.shared.api.bean.pg.PG
com.hazelcast.nio.serialization.HazelcastSerializationException: java.io.InvalidObjectException: enum constant DUMMY does not exist in class com.shared.api.bean.pg.PG
at com.hazelcast.internal.serialization.impl.SerializationUtil.handleException(SerializationUtil.java:63)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:279)
at com.hazelcast.internal.serialization.impl.ByteArrayObjectDataInput.readObject(ByteArrayObjectDataInput.java:574)
at com.hazelcast.hibernate.serialization.Value.readData(Value.java:76)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.readInternal(DataSerializableSerializer.java:158)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:105)
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.read(DataSerializableSerializer.java:50)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:191)
at com.hazelcast.query.impl.CachedQueryEntry.getValue(CachedQueryEntry.java:75)
at com.hazelcast.hibernate.distributed.LockEntryProcessor.process(LockEntryProcessor.java:49)
at com.hazelcast.hibernate.distributed.LockEntryProcessor.process(LockEntryProcessor.java:32)
at com.hazelcast.map.impl.operation.EntryOperator.process(EntryOperator.java:335)
at com.hazelcast.map.impl.operation.EntryOperator.operateOnKeyValueInternal(EntryOperator.java:194)
at com.hazelcast.map.impl.operation.EntryOperator.operateOnKey(EntryOperator.java:179)
at com.hazelcast.map.impl.operation.EntryOperation.runVanilla(EntryOperation.java:395)
at com.hazelcast.map.impl.operation.EntryOperation.run(EntryOperation.java:177)
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:194)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.run(OperationExecutorImpl.java:406)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.runOrExecute(OperationExecutorImpl.java:433)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvokeLocal(Invocation.java:569)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvoke(Invocation.java:554)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke0(Invocation.java:513)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke(Invocation.java:207)
at com.hazelcast.spi.impl.operationservice.impl.InvocationBuilderImpl.invoke(InvocationBuilderImpl.java:60)
at com.hazelcast.client.impl.protocol.task.AbstractPartitionMessageTask.processMessage(AbstractPartitionMessageTask.java:67)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.initializeAndProcessMessage(AbstractMessageTask.java:123)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.run(AbstractMessageTask.java:103)
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:154)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(OperationThread.java:125)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.run(OperationThread.java:100)
Caused by: java.io.InvalidObjectException: enum constant DUMMY does not exist in class com.shared.api.bean.pg.PG
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at java.util.HashMap.readObject(HashMap.java:1404)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1909)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:79)
at com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.read(JavaDefaultSerializers.java:72)
at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:48)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.readObject(AbstractSerializationService.java:273)
... 29 more
Caused by: java.lang.IllegalArgumentException: com.shared.api.bean.pg.PG is not an enum type
at java.lang.Class.enumConstantDirectory(Class.java:3344)
at java.lang.Enum.valueOf(Enum.java:232)
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1750)
... 44 more
I also tried to Java serialization/Deserialization and able to retreive the values from my Enum
What can be the issue with Hazelcast Serialization/Deserialization?
Hz Config:-
<map name="com.entity.*">
<in-memory-format>BINARY</in-memory-format>
<backup-count>0</backup-count>
<async-backup-count>0</async-backup-count>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
<eviction-policy>LRU</eviction-policy>
<max-size policy="PER_NODE">10000</max-size>
<eviction-percentage>20</eviction-percentage>
<merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy>
<read-backup-data>false</read-backup-data>
<cache-deserialized-values>INDEX-ONLY</cache-deserialized-values>
</map>

Related

Cannot serialize into L2 cache

I'm stuck with some misconfiguration of some kind using datanucleus & JDO within an stand-alone Java web app (which uses Jetty, Servlets [yes the architecture is kinda old] and spring).
We are currently working on a new version; the original project didn't had any dependency update in the past 3 years; so we wanted to have those nice security, performance & functionallity upgrades, but as it was expected, the upgrade wasn't that easy.
Most of the problems we had have been already fixed, but one that is becoming really tedious has not:
When the server starts, it checks if there is a default user in the database; which is mongo. If there is no user, the default one is created. In any case, the server starts up.
We are using datanucleus + JDO to acces the underlying database; mainly because it was already there and beacause most of the system is really tied to it. So far, we can confirm that datanucleus can read the database (the debugger shows a non-null result coming from the database which correcty represents the default user; and some other dummy results from active endpoints). But when datanucleus tries to cache the results, it just goes into a dead end.
The error stack is the following:
GRAVE: exception catched
javax.jdo.JDOException: Failed to set object CachedPC : cls=mobi.allshoppings.model.User version=null loadedFlags=[YYYYYYYYYYYYYYYYY] with id com.inodes.datanucleus.model.Key:User("admin") into Redis cache
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:680)
at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1747)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:144)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:108)
at mobi.allshoppings.bdb.tools.BasicDataBuilder.warmUp(BasicDataBuilder.java:49)
at mobi.allshoppings.bdb.tools.InitAppServlet.init(InitAppServlet.java:21)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:616)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:396)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at mobi.allshoppings.jetty.JettyServer.startup(JettyServer.java:62)
at mobi.allshoppings.cli.StartServer.main(StartServer.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at mobi.allshoppings.cli.CLI.main(CLI.java:100)
NestedThrowablesStackTrace:
Failed to set object CachedPC : cls=mobi.allshoppings.model.User version=null loadedFlags=[YYYYYYYYYYYYYYYYY] with id com.inodes.datanucleus.model.Key:User("admin") into Redis cache
org.datanucleus.exceptions.NucleusException: Failed to set object CachedPC : cls=mobi.allshoppings.model.User version=null loadedFlags=[YYYYYYYYYYYYYYYYY] with id com.inodes.datanucleus.model.Key:User("admin") into Redis cache
at org.datanucleus.cache.redis.RedisLevel2Cache.put(RedisLevel2Cache.java:280)
at org.datanucleus.ExecutionContextImpl.putObjectIntoLevel2CacheInternal(ExecutionContextImpl.java:4914)
at org.datanucleus.ExecutionContextImpl.putObjectIntoLevel2Cache(ExecutionContextImpl.java:4741)
at org.datanucleus.ExecutionContextImpl.findObject(ExecutionContextImpl.java:3579)
at org.datanucleus.ExecutionContextImpl.findObject(ExecutionContextImpl.java:3016)
at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1742)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:144)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:108)
at mobi.allshoppings.bdb.tools.BasicDataBuilder.warmUp(BasicDataBuilder.java:49)
at mobi.allshoppings.bdb.tools.InitAppServlet.init(InitAppServlet.java:21)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:616)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:396)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at mobi.allshoppings.jetty.JettyServer.startup(JettyServer.java:62)
at mobi.allshoppings.cli.StartServer.main(StartServer.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at mobi.allshoppings.cli.CLI.main(CLI.java:100)
As the stack shows, the exception is fired during the serialization process. I'm aware that any class that will be stored using datanucleus must extend Serializable and must use some special annotations, like #PersistenceCapable, #NotPersistant or #EmbebedOnly
The thing is that, the current in-production version has the very same configuration, the only changes made that could broken any datanucleus configuration was the upgrade itself and the declaration of two new classes, which: have been already annotated (as in the documentation and as in other working classes) and those classes are not involved at all in the statup process, so even if their configuration is bad, the server should start just fine; but it refuses to. The persitence.xml and package-mongodb.orm seem just fine (again, as in the documentation and as in other working classes).
The datanucleus enhanchement process and dependency addition into classpath are; as far we know, correct.
The Non-Serializable exception that gets reaised during the serialization process is caused due a (malformed?) CachePC object (builded by datanucleus to wrap the actual User object), which has a field that is an instance of StateManagerImpl and appearently does not implements Serializable, hece causing the exception.
Note: the stacktrace above matches the current configuration of the project and it does not shows directly a NoSerializableException, but while debbuging I confirmed this is the first exception raised. It gets raised when ObjectOutputStream determines that StateManagerImpl isn't a valid object to serialize. The current version uses XMemcached, if we switch this version to Memcached, we can clearly see a "Non-Serializable Exception". (we want to switch to Redis because the original server was designed to be a distributed system; but you would get surprise of how manny bottle necks it has)
So; we don't know why it tries to serialize StateManagerImpl; we thought it was a bug on the last datanucleus version, so we switched to version 5.1.0-release with no success. The app, the Jetty server & the servlets start just fine, we can confirm that datanucleus parses the datanucleus.configuration file sucessfully and we can obtain PersistanceManager instances and read mongo database. But when it comes into writting in the cache (which is done automatically); Redis or XMemcached, we always get a Non-Serializable exception because datanucleus builds a CachedPC with a non-serializable StateManagerImpl.
Where should we re-start? What could be wrong? Should we switch datanucleus for a more supported data access layer?
Thanks in advaice.
UPDATE
The following is the stack trace produced when using Memcached instead of Redis (the behaviour is the same, it breaks when serializing into L2 Cache again)
GRAVE: exception catched
javax.jdo.JDOException: Exception thrown in persistence to xmemcached
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:676)
at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1747)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:144)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:108)
at mobi.allshoppings.bdb.tools.BasicDataBuilder.warmUp(BasicDataBuilder.java:49)
at mobi.allshoppings.bdb.tools.InitAppServlet.init(InitAppServlet.java:21)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:616)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:396)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at mobi.allshoppings.jetty.JettyServer.startup(JettyServer.java:62)
at mobi.allshoppings.cli.StartServer.main(StartServer.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at mobi.allshoppings.cli.CLI.main(CLI.java:100)
NestedThrowablesStackTrace:
java.lang.IllegalArgumentException: Non-serializable object
at net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder.serialize(BaseSerializingTranscoder.java:99)
at net.rubyeye.xmemcached.transcoders.SerializingTranscoder.encode(SerializingTranscoder.java:211)
at net.rubyeye.xmemcached.command.text.TextStoreCommand.encodeValue(TextStoreCommand.java:199)
at net.rubyeye.xmemcached.command.text.TextStoreCommand.encode(TextStoreCommand.java:155)
at net.rubyeye.xmemcached.impl.MemcachedTCPSession.wrapMessage(MemcachedTCPSession.java:189)
at com.google.code.yanf4j.core.impl.AbstractSession.write(AbstractSession.java:383)
at net.rubyeye.xmemcached.impl.MemcachedConnector.send(MemcachedConnector.java:556)
at net.rubyeye.xmemcached.XMemcachedClient.sendCommand(XMemcachedClient.java:322)
at net.rubyeye.xmemcached.XMemcachedClient.sendStoreCommand(XMemcachedClient.java:2537)
at net.rubyeye.xmemcached.XMemcachedClient.set(XMemcachedClient.java:1369)
at net.rubyeye.xmemcached.XMemcachedClient.set(XMemcachedClient.java:1428)
at net.rubyeye.xmemcached.XMemcachedClient.set(XMemcachedClient.java:1415)
at org.datanucleus.cache.xmemcached.XmemcachedLevel2Cache.put(XmemcachedLevel2Cache.java:177)
at org.datanucleus.ExecutionContextImpl.putObjectIntoLevel2CacheInternal(ExecutionContextImpl.java:4914)
at org.datanucleus.ExecutionContextImpl.putObjectIntoLevel2Cache(ExecutionContextImpl.java:4741)
at org.datanucleus.ExecutionContextImpl.findObject(ExecutionContextImpl.java:3579)
at org.datanucleus.ExecutionContextImpl.findObject(ExecutionContextImpl.java:3016)
at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1742)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:144)
at mobi.allshoppings.dao.spi.GenericDAOJDO.get(GenericDAOJDO.java:108)
at mobi.allshoppings.bdb.tools.BasicDataBuilder.warmUp(BasicDataBuilder.java:49)
at mobi.allshoppings.bdb.tools.InitAppServlet.init(InitAppServlet.java:21)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:616)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:396)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:298)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at mobi.allshoppings.jetty.JettyServer.startup(JettyServer.java:62)
at mobi.allshoppings.cli.StartServer.main(StartServer.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at mobi.allshoppings.cli.CLI.main(CLI.java:100)
Caused by: java.io.NotSerializableException: org.datanucleus.state.StateManagerImpl
- field (class "org.datanucleus.identity.IdentityReference", name: "client", type: "class java.lang.Object")
- object (class "org.datanucleus.identity.IdentityReference", org.datanucleus.identity.IdentityReference#44fd7ba4)
- field (class "org.datanucleus.cache.CachedPC", name: "id", type: "class java.lang.Object")
- object (class "org.datanucleus.cache.CachedPC", CachedPC : cls=mobi.allshoppings.model.Address version=null loadedFlags=[YYYYYYYYY])
- custom writeObject data (class "java.util.HashMap")
- object (class "java.util.HashMap", {0=1, 1=CachedPC : cls=mobi.allshoppings.model.Address version=null loadedFlags=[YYYYYYYYY], 2=null, 3=null, 4=CachedPC : cls=mobi.allshoppings.model.ContactInfo version=null loadedFlags=[YYYYYYYYYYYY], 5=Sun Oct 29 04:57:34 CST 2017, 6=null, 7=true, 8=User("admin"), 9=null, 10=Sun Oct 29 05:03:40 CST 2017, 11=0, 12=true, 13=CachedPC : cls=mobi.allshoppings.model.UserSecurity version=null loadedFlags=[YYYYYYYYYYYYYYYYY], 14=null, 15=00000000880E0D76, 16=CachedPC : cls=mobi.allshoppings.model.tools.ViewLocation version=null loadedFlags=[Y]})
- field (class "org.datanucleus.cache.CachedPC", name: "fieldValues", type: "interface java.util.Map")
- root object (class "org.datanucleus.cache.CachedPC", CachedPC : cls=mobi.allshoppings.model.User version=null loadedFlags=[YYYYYYYYYYYYYYYYY])
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1182)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at java.util.HashMap.internalWriteEntries(HashMap.java:1790)
at java.util.HashMap.writeObject(HashMap.java:1363)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1128)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder.serialize(BaseSerializingTranscoder.java:94)
... 48 more
Also, the following are state of the ObjectOutputStream's debugInfoStack before the actual exception throw from the serialization process:
This is the state just before the exception creation:
- object (class "java.lang.StackTraceElement", java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1182))
- element of array (index: 0)
- array (class "[Ljava.lang.StackTraceElement;", size: 74)
- field (class "java.lang.Throwable", name: "stackTrace", type: "class [Ljava.lang.StackTraceElement;")
- custom writeObject data (class "java.lang.Throwable")
- root object (class "java.io.NotSerializableException", java.io.NotSerializableException: org.datanucleus.state.StateManagerImpl
- field (class "org.datanucleus.identity.IdentityReference", name: "client", type: "class java.lang.Object")
- object (class "org.datanucleus.identity.IdentityReference", org.datanucleus.identity.IdentityReference#44fd7ba4)
- field (class "org.datanucleus.cache.CachedPC", name: "id", type: "class java.lang.Object")
- object (class "org.datanucleus.cache.CachedPC", CachedPC : cls=mobi.allshoppings.model.Address version=null loadedFlags=[YYYYYYYYY])
- custom writeObject data (class "java.util.HashMap")
- object (class "java.util.HashMap", {0=1, 1=CachedPC : cls=mobi.allshoppings.model.Address version=null loadedFlags=[YYYYYYYYY], 2=null, 3=null, 4=CachedPC : cls=mobi.allshoppings.model.ContactInfo version=null loadedFlags=[YYYYYYYYYYYY], 5=Sun Oct 29 04:57:34 CST 2017, 6=null, 7=true, 8=User("admin"), 9=null, 10=Sun Oct 29 05:03:40 CST 2017, 11=0, 12=true, 13=CachedPC : cls=mobi.allshoppings.model.UserSecurity version=null loadedFlags=[YYYYYYYYYYYYYYYYY], 14=null, 15=00000000880E0D76, 16=CachedPC : cls=mobi.allshoppings.model.tools.ViewLocation version=null loadedFlags=[Y]})
- field (class "org.datanucleus.cache.CachedPC", name: "fieldValues", type: "interface java.util.Map")
- root object (class "org.datanucleus.cache.CachedPC", CachedPC : cls=mobi.allshoppings.model.User version=null loadedFlags=[YYYYYYYYYYYYYYYYY]))
This state displays a suppressedException I hadn't noticed before (and one of the last states before firing the exception):
- object (class "java.util.ArrayList", [])
- field (class "java.util.Collections$UnmodifiableCollection", name: "c", type: "interface java.util.Collection")
- object (class "java.util.Collections$UnmodifiableList", [])
- field (class "java.lang.Throwable", name: "suppressedExceptions", type: "interface java.util.List")
- custom writeObject data (class "java.lang.Throwable")
- root object (class "java.io.NotSerializableException", java.io.NotSerializableException: org.datanucleus.state.StateManagerImpl
- field (class "org.datanucleus.identity.IdentityReference", name: "client", type: "class java.lang.Object")
- object (class "org.datanucleus.identity.IdentityReference", org.datanucleus.identity.IdentityReference#44fd7ba4)
- field (class "org.datanucleus.cache.CachedPC", name: "id", type: "class java.lang.Object")
- object (class "org.datanucleus.cache.CachedPC", CachedPC : cls=mobi.allshoppings.model.Address version=null loadedFlags=[YYYYYYYYY])
- custom writeObject data (class "java.util.HashMap")
- object (class "java.util.HashMap", {0=1, 1=CachedPC : cls=mobi.allshoppings.model.Address version=null loadedFlags=[YYYYYYYYY], 2=null, 3=null, 4=CachedPC : cls=mobi.allshoppings.model.ContactInfo version=null loadedFlags=[YYYYYYYYYYYY], 5=Sun Oct 29 04:57:34 CST 2017, 6=null, 7=true, 8=User("admin"), 9=null, 10=Sun Oct 29 05:03:40 CST 2017, 11=0, 12=true, 13=CachedPC : cls=mobi.allshoppings.model.UserSecurity version=null loadedFlags=[YYYYYYYYYYYYYYYYY], 14=null, 15=00000000880E0D76, 16=CachedPC : cls=mobi.allshoppings.model.tools.ViewLocation version=null loadedFlags=[Y]})
- field (class "org.datanucleus.cache.CachedPC", name: "fieldValues", type: "interface java.util.Map")
- root object (class "org.datanucleus.cache.CachedPC", CachedPC : cls=mobi.allshoppings.model.User version=null loadedFlags=[YYYYYYYYYYYYYYYYY]))
The only class holding Lists as attributes, is an attribute of the User class, which has the following declaration:
#PersistenceCapable(detachable="true")
#EmbeddedOnly
public class UserSecurity implements Serializable {
And I don't see it being called during the caching process, only during the mongodb reading. Again: lectures to mongodb work well, but as datanucleus tryies to cache the just readed object; it fails. So, I don't know from where that unmodificable list is coming.
So, maybe I was being a little too salty; but it turns out that actually our problem was caused by a Datanucleus bug: https://github.com/datanucleus/datanucleus-core/issues/283
The docs says that embedded objects shouldn't have an ID, since they are directly liked to the container object which has an ID (under the "same table" scheme) http://www.datanucleus.org/products/datanucleus/jdo/mapping.html#embedded_pc
But our embedded objects were given a IdentityReference which shouldn't be there.
I noticed that the StateManagerImpl was the cause of the exception when serializing the embedded objects, but I didn't put much attention on the IdentityReference object which lead to the serialization of the StateManagerImpl; causing the errors on cache L2 writting. This is what the bug is all about.
So, the solution was to clone the datanucleus-core project, build and install the latest version locally and re-build our project changing the datanuclues-core dependency to a local file. Its working just great.
After diving deep on the documentation of datanucleus and its code itself, I'm more convinced that datanucleus is actually a very nice datastore abstraction, and we'll keep it on our project (but I still believe that support and error messages are vague)

java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing with microservices

I am new to the microservices + Spring Boot combinations and getting the below error while running the code from the link: https://github.com/sqshq/PiggyMetrics . Please guide me what is the nissue ?
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:110) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89) ~[spring-cloud-context-1.1.0.RELEASE.jar:1.1.0.RELEASE]
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:640) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:343) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at com.piggymetrics.statistics.StatisticsApplication.main(StatisticsApplication.java:34) [classes/:na]
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://config:8888/statistics-service/default": config; nested exception is java.net.UnknownHostException: config
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:607) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:130) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:81) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
... 7 common frames omitted
Caused by: java.net.UnknownHostException: config
at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_144]
at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_144]
at sun.net.NetworkClient.doConnect(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.http.HttpClient.<init>(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[na:1.8.0_144]
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) ~[na:1.8.0_144]
at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:80) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:93) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$BasicAuthorizationInterceptor.intercept(ConfigServicePropertySourceLocator.java:179) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:85) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:69) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:596) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 11 common frames omitted
2017-09-09 19:19:34.861 INFO 4968 --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/C:/Learnings/micro-services/PiggyMetrics/statistics-service/target/classes/, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-security/1.3.5.RELEASE/spring-boot-starter-security-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.5.RELEASE/spring-boot-starter-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot/1.3.5.RELEASE/spring-boot-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.5.RELEASE/spring-boot-autoconfigure-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-aop/4.2.6.RELEASE/spring-aop-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-config/4.0.4.RELEASE/spring-security-config-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-web/4.0.4.RELEASE/spring-security-web-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-expression/4.2.6.RELEASE/spring-expression-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-config/1.1.0.RELEASE/spring-cloud-starter-config-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter/1.1.0.RELEASE/spring-cloud-starter-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-context/1.1.0.RELEASE/spring-cloud-context-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-rsa/1.0.1.RELEASE/spring-security-rsa-1.0.1.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.47/bcpkix-jdk15on-1.47.jar, file:/C:/Users/pashtikar/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.47/bcprov-jdk15on-1.47.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-config-client/1.1.0.RELEASE/spring-cloud-config-client-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.6/jackson-annotations-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.6/jackson-databind-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.6/jackson-core-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/oauth/spring-security-oauth2/2.0.9.RELEASE/spring-security-oauth2-2.0.9.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-beans/4.2.6.RELEASE/spring-beans-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-context/4.2.6.RELEASE/spring-context-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-webmvc/4.2.6.RELEASE/spring-webmvc-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-core/4.0.4.RELEASE/spring-security-core-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.5.RELEASE/spring-boot-starter-web-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.5.RELEASE/spring-boot-starter-tomcat-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.33/tomcat-embed-core-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.33/tomcat-embed-el-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.33/tomcat-embed-logging-juli-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.33/tomcat-embed-websocket-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.5.RELEASE/spring-boot-starter-validation-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar, file:/C:/Users/pashtikar/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/C:/Users/pashtikar/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/classmate/1.1.0/classmate-1.1.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-web/4.2.6.RELEASE/spring-web-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-feign/1.1.0.RELEASE/spring-cloud-starter-feign-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-core/1.1.0.RELEASE/spring-cloud-netflix-core-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-commons/1.1.0.RELEASE/spring-cloud-commons-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-crypto/4.0.4.RELEASE/spring-security-crypto-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-core/8.16.2/feign-core-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/jvnet/animal-sniffer-annotation/1.0/animal-sniffer-annotation-1.0.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-slf4j/8.16.2/feign-slf4j-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-hystrix/8.16.2/feign-hystrix-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-ribbon/1.1.0.RELEASE/spring-cloud-starter-ribbon-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon/2.1.5/ribbon-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-transport/2.1.5/ribbon-transport-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-codec-http/4.0.27.Final/netty-codec-http-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-codec/4.0.27.Final/netty-codec-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-handler/4.0.27.Final/netty-handler-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-transport-native-epoll/4.0.27.Final/netty-transport-native-epoll-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-common/4.0.27.Final/netty-common-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-buffer/4.0.27.Final/netty-buffer-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-transport/4.0.27.Final/netty-transport-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-core/2.1.5/ribbon-core-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-httpclient/2.1.5/ribbon-httpclient-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-commons-util/0.1.1/netflix-commons-util-0.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-loadbalancer/2.1.5/ribbon-loadbalancer-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxjava/1.1.5/rxjava-1.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-archaius/1.1.0.RELEASE/spring-cloud-starter-archaius-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/archaius/archaius-core/0.7.4/archaius-core-0.7.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar, file:/C:/Users/pashtikar/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar, file:/C:/Users/pashtikar/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-eureka/1.1.0.RELEASE/spring-cloud-starter-eureka-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/1.1.0.RELEASE/spring-cloud-netflix-eureka-client-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/eureka/eureka-client/1.4.6/eureka-client-1.4.6.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/C:/Users/pashtikar/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/C:/Users/pashtikar/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/servo/servo-core/0.10.1/servo-core-0.10.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/servo/servo-internal/0.10.1/servo-internal-0.10.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/inject/guice/4.0/guice-4.0.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator-api/1.12.10/governator-api-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/eureka/eureka-core/1.4.6/eureka-core-1.4.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-core/1.10.30/aws-java-sdk-core-1.10.30.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-ec2/1.10.30/aws-java-sdk-ec2-1.10.30.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-autoscaling/1.9.3/aws-java-sdk-autoscaling-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-sts/1.9.3/aws-java-sdk-sts-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-route53/1.9.3/aws-java-sdk-route53-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator/1.12.10/governator-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator-core/1.12.10/governator-core-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar, file:/C:/Users/pashtikar/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-eureka/2.1.5/ribbon-eureka-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/thoughtworks/xstream/xstream/1.4.2/xstream-1.4.2.jar, file:/C:/Users/pashtikar/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/C:/Users/pashtikar/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-data-mongodb/1.3.5.RELEASE/spring-boot-starter-data-mongodb-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/mongodb/mongo-java-driver/2.13.3/mongo-java-driver-2.13.3.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/data/spring-data-mongodb/1.8.4.RELEASE/spring-data-mongodb-1.8.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-tx/4.2.6.RELEASE/spring-tx-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/data/spring-data-commons/1.11.4.RELEASE/spring-data-commons-1.11.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.21/jcl-over-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.3.5.RELEASE/spring-boot-starter-actuator-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-actuator/1.3.5.RELEASE/spring-boot-actuator-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-bus-amqp/1.1.0.RELEASE/spring-cloud-starter-bus-amqp-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-stream-rabbit/1.0.0.RELEASE/spring-cloud-starter-stream-rabbit-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream-binder-rabbit/1.0.0.RELEASE/spring-cloud-stream-binder-rabbit-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream-codec/1.0.0.RELEASE/spring-cloud-stream-codec-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-amqp/1.3.5.RELEASE/spring-boot-starter-amqp-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/amqp/spring-rabbit/1.5.6.RELEASE/spring-rabbit-1.5.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/amqp/spring-amqp/1.5.6.RELEASE/spring-amqp-1.5.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/rabbitmq/http-client/1.0.0.RELEASE/http-client-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/rabbitmq/amqp-client/3.5.7/amqp-client-3.5.7.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-amqp/4.2.5.RELEASE/spring-integration-amqp-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-jmx/4.2.5.RELEASE/spring-integration-jmx-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.1.0.RELEASE/spring-cloud-bus-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-core/4.2.5.RELEASE/spring-integration-core-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-hystrix-stream/1.1.0.RELEASE/spring-cloud-netflix-hystrix-stream-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.5.RELEASE/spring-boot-starter-logging-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/ch/qos/logback/logback-core/1.1.7/logback-core-1.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/jul-to-slf4j/1.7.21/jul-to-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.21/log4j-over-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream/1.0.0.RELEASE/spring-cloud-stream-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-messaging/4.2.6.RELEASE/spring-messaging-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-tuple/1.0.0.RELEASE/spring-tuple-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/esotericsoftware/kryo-shaded/3.0.3/kryo-shaded-3.0.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/esotericsoftware/minlog/1.3.0/minlog-1.3.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-tuple/1.0.0.RELEASE/spring-integration-tuple-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/retry/spring-retry/1.1.2.RELEASE/spring-retry-1.1.2.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/hystrix/hystrix-core/1.5.2/hystrix-core-1.5.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.7/HdrHistogram-2.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar]
Anatoly above sums it pretty clearly and nicely as to what you need to do.
If you are looking for a quick and dirty test try changing the hostnames from
http://config:8888 to http://localhost:8888
in the bootstrap.yml files, for the service you are trying to run.
If you build and run project modules manually (e.g. from IDE) you should rename all "config" hostnames in bootstrap.yml files to "localhost".
The issue is, this project uses Docker Compose to run things
Development mode
If you'd like to build images yourself (with some changes in the code, for example), you have to clone all repository and build artifacts with maven. Then, run docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
docker-compose.dev.yml inherits docker-compose.yml with additional possibility to build images locally and expose all containers ports for convenient development.
and Docker Compose allows you to use service name as hostname.
Setting failsafe to false will just not throw the exception , this is something I would not recommend since this means even if you are not connected to your config server and unable to fetch the configuration your application will run which leads to an uncertain behavior (since you do not know where your properties are loaded), always better to fail fast.
The original cause of the problem is an exception or failing during fetching the remote environment from your config server, probably a timeout issue.
Your configuration is not setup properly. It thinks the hostname is 'config'.
For me it was because the Jhipster Registry was not running
I met this issue as the same, i resolved it by updated configuration below:
cloud:
config:
fail-fast: false
After changing Active profiles to local in "Edit configuration" it started working.
1)
2)
For Jhipster...
The focus is on http://localhost:8761/config, and then I saw that there is a bootstrap-prod.yml based on the production environment in the project. The reason is that the configuration in the production environment is the same as the dev, which leads to an error.
So replace the produced localhost with the domain name/IP of the project registration center
I got something similar, an 500 internal error from a micro service! No cause given.
I looked at the config server, for the service my application was attempting to contact. It had given a parse error when attempting to read a yml file at start up, with the result the entire process was hanging.
So if you get an error, look in the logging data from your config server, there might be some extra information there.

xPage managedBean ODA application error

Navigating from one page to other constantly get following error.
Error not related with any of my code at least from stack trace.
From debug prints seems that it happen after page is loaded.
Any thoughts?
com.ibm.xsp.FacesExceptionEx: java.io.NotSerializableException: org.openntf.domino.impl.Document
com.ibm.xsp.application.AbstractStateManager.saveSerializedView(AbstractStateManager.java:121)
com.ibm.xsp.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:152)
com.ibm.xsp.application.ViewHandlerExImpl._saveViewState(ViewHandlerExImpl.java:455)
com.ibm.xsp.application.ViewHandlerExImpl.saveViewState(ViewHandlerExImpl.java:449)
com.ibm.xsp.application.ViewHandlerExImpl._renderView(ViewHandlerExImpl.java:324)
com.ibm.xsp.application.ViewHandlerExImpl.renderView(ViewHandlerExImpl.java:336)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:103)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:270)
com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:261)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:588)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:865)
com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:808)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:577)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)
com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
java.io.NotSerializableException: org.openntf.domino.impl.Document
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1185)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
java.util.TreeMap.writeObject(TreeMap.java:5740)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
java.lang.reflect.Method.invoke(Method.java:611)
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1059)
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1502)
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179)
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1555)
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1516)
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179)
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1555)
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1516)
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
java.util.HashMap.writeObject(HashMap.java:942)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
java.lang.reflect.Method.invoke(Method.java:611)
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1059)
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1502)
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179)
java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:413)
com.ibm.xsp.application.AbstractSerializingStateManager$FastObjectOutputStream.writeObjectEx(AbstractSerializingStateManager.java:438)
com.ibm.xsp.application.AbstractSerializingStateManager$FastObjectOutputStream.writeObjectEx(AbstractSerializingStateManager.java:417)
com.ibm.xsp.application.AbstractSerializingStateManager$FastObjectOutputStream.writeObjectEx(AbstractSerializingStateManager.java:417)
com.ibm.xsp.application.AbstractSerializingStateManager$FastObjectOutputStream.writeObjectEx(AbstractSerializingStateManager.java:417)
com.ibm.xsp.application.AbstractSerializingStateManager$FastObjectOutputStream.writeObjectEx(AbstractSerializingStateManager.java:417)
com.ibm.xsp.application.AbstractSerializingStateManager.saveSerializedView(AbstractSerializingStateManager.java:294)
com.ibm.xsp.application.AbstractSerializingStateManager.doSaveSerializedView(AbstractSerializingStateManager.java:269)
com.ibm.xsp.application.FileStateManager.doSaveSerializedView(FileStateManager.java:290)
com.ibm.xsp.application.FileStateManager.doSaveSerializedView(FileStateManager.java:270)
com.ibm.xsp.application.AbstractStateManager.saveSerializedView(AbstractStateManager.java:114)
com.ibm.xsp.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:152)
com.ibm.xsp.application.ViewHandlerExImpl._saveViewState(ViewHandlerExImpl.java:455)
com.ibm.xsp.application.ViewHandlerExImpl.saveViewState(ViewHandlerExImpl.java:449)
com.ibm.xsp.application.ViewHandlerExImpl._renderView(ViewHandlerExImpl.java:324)
com.ibm.xsp.application.ViewHandlerExImpl.renderView(ViewHandlerExImpl.java:336)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:103)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:120)
com.ibm.xsp.controller.FacesControllerImpl.render(FacesControllerImpl.java:270)
com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:261)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:588)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:865)
com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:808)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:577)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)
com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
You cannot store any Domino object in a managed bean. As the method says, it's not serializable. ODA cannot work around that issue.
My recommendation would be to store either the DominoDocument object (if you need the front-end document, so updating it during the life of the bean but not saving each time) or the UNID (if you just need the backend document). Database.getDocumentByUNID() is extremely fast, so you should not be concerned about the performance impacts of getting the document.
If you want to avoid getting the document multiple times in the XPages lifecycle, put the resulting Document object in requestScope and check there before retrieving from the database. Alternatively (I'm not sure how best practice this is or if it is properly cleaned up) it may be an option to set the variable to transient, so it will not be serialized at the end of each request, but will be held in the bean for the duration of each partial refresh.

CXF Webservice issue in weblogic server

I am trying to call a webservice from my webapplication which works fine with servers like Apache Tomcat or JBoss, but fails with below exception in Weblogic server.
Any solution for this ?
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:379)
at org.apache.geronimo.osgi.locator.ProviderLocator.getService(ProviderLocator.java:234)
at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:176)
at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:220)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:160)
at javax.xml.ws.spi.Provider.provider(Provider.java:43)
at javax.xml.ws.Service.<init>(Service.java:35)
at com.my.Tpackage.imageSign.FIUsbWebServiceService.<init>(FIUsbWebServiceService.java:40)
at com.my.Tpackage.imageSign.SignatureWebServiceClient.getWebServiceResponse(SignatureWebServiceClient.java:32)
at com.my.Tpackage.imageSign.MyAction.getMySignatureImage(MyAction.java:47)
at com.my.Tpackage.imageSign.MyAction.execute(MyAction.java:28)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at com.montran.security.SecureRequestProcessor.processActionPerform(SecureRequestProcessor.java:707)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at com.montran.main.action.InheritanceActionServet.process(InheritanceActionServet.java:332)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.my.security.ActivityLoggingFilter.doFilter(ActivityLoggingFilter.java:88)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.my.security.AuthenticationFilter.doFilter(AuthenticationFilter.java:179)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.my.security.InjectionFilter.filter(InjectionFilter.java:453)
at com.my.security.InjectionFilter.doFilter(InjectionFilter.java:360)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:237)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:232)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:232)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:95)
... 44 more
Caused by: javax.xml.bind.JAXBException
- with linked exception:
[com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
org.w3c.dom.Element is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.w3c.dom.Element
at public java.util.List com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements.elements
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:263)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:235)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:432)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:235)
... 48 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
org.w3c.dom.Element is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.w3c.dom.Element
at public java.util.List com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements.elements
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:466)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:298)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:141)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1163)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:248)
... 53 more
In your weblogic-application.xml you must define your JAXB-provider to be the one from cxf not the sun reference implementation (com.sun.xml...).
Add the following to the mentioned file
<prefer-web-inf-classes>true</prefer-web-inf-classes>
This leads to reversing the classloading process. So the classes you provide with your war are loaded before the ones from weblogic.
EDIT:
The Documentation for Provider says:
The algorithm used to locate the provider subclass to use consists of
the following steps:
If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then its first
line, if present, is used as the UTF-8 encoded name of the
implementation class.
If the $java.home/lib/jaxws.properties file exists and it is readable by the java.util.Properties.load(InputStream) method and it
contains an entry whose key is javax.xml.ws.spi.Provider, then the
value of that entry is used as the name of the implementation class.
If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used as the name of the implementation
class.
Finally, a default implementation class name is used.
so, if the changing the classloading is not enough add the following
<prefer-application-resources>
<resource-name>META-INF/services/javax.xml.ws.spi.Provider</resource-name>
</prefer-application-resources>
to weblogic-application.xml

Unable to reconnect with Hornet, Wildfly, JMS

I am trying to use JMS with wildfly but getting this error in wildfly server log. Can anyone tell me whats wrong I am doing?
2015-05-27 17:10:09,292 ERROR [org.hornetq.ra] (default-threads - 4) HQ154003: Unable to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter#19213379 connectionFactoryLookup=null destination=queue/freightdesk.xmlintmanager.inbound destinationType=javax.jms.Queue selector=MESSAGETYPE = 'ORHFA' ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.jboss.classfilewriter.ClassFile.define(ClassFile.java:282)
at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:164)
at org.jboss.invocation.proxy.AbstractClassFactory.newInstance(AbstractClassFactory.java:225)
at org.jboss.invocation.proxy.ProxyFactory.newInstance(ProxyFactory.java:270)
at org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:70)
at org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:62)
at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:198) [hornetq-ra-2.4.5.Final.jar:]
at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:340) [hornetq-ra-2.4.5.Final.jar:]
at org.hornetq.ra.inflow.HornetQActivation.handleFailure(HornetQActivation.java:768) [hornetq-ra-2.4.5.Final.jar:]
at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:823) [hornetq-ra-2.4.5.Final.jar:]
at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:219)
at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) [:1.8.0_40]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_40]
at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_40]
at org.jboss.classfilewriter.ClassFile.define(ClassFile.java:277)
... 16 more
Caused by: java.lang.VerifyError: class com.freightdesk.fdfoliox.organization.mdb.XMLOrgFindAddListener$$$endpoint11 overrides final method onMessage.(Ljavax/jms/Message;)V
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_40]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) [rt.jar:1.8.0_40]
... 20 more
Check the default constructor of your service implementation classes. Make sure it's public.
The stack trace shows that it tried to perform a new MyServiceImpl() using reflection (i.e. MyServiceImpl.class.newInstance()). Given the fact that it failed, it could be because there was no public constructor.
class MyServiceImpl extends MyService
{
public MyServiceImpl(){}
}

Categories

Resources