I am using ZeroC Ice in my project. I have a problem with the following exception:
com.zeroc.Ice.NoValueFactoryException
reason = "no value factory found and compact format prevents slicing (the sender should use the sliced format instead)"
type = "::test::DataExt"
at com.zeroc.Ice.InputStream$EncapsDecoder11.skipSlice(InputStream.java:3120)
at com.zeroc.Ice.InputStream$EncapsDecoder11.readInstance(InputStream.java:3333)
at com.zeroc.Ice.InputStream$EncapsDecoder11.readValue(InputStream.java:2881)
at com.zeroc.Ice.InputStream.readValue(InputStream.java:1933)
at org.megacinol.test.DataListHelper.read(DataListHelper.java:48)
at org.megacinol.test.TestClass._iceD_testSth(TestClass.java:58)
at org.megacinol.test.TestClass._iceDispatch(TestClass.java:106)
at com.zeroc.IceInternal.Incoming.invoke(Incoming.java:221)
at com.zeroc.Ice.ConnectionI.invokeAll(ConnectionI.java:2706)
at com.zeroc.Ice.ConnectionI.dispatch(ConnectionI.java:1292)
at com.zeroc.Ice.ConnectionI.message(ConnectionI.java:1203)
at com.zeroc.IceInternal.ThreadPool.run(ThreadPool.java:412)
at com.zeroc.IceInternal.ThreadPool.access$500(ThreadPool.java:7)
at com.zeroc.IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:781)
at java.base/java.lang.Thread.run(Thread.java:830)
My slice file looks like this:
[["underscore"]]
[["java:package:org.megacinol"]]
module test
{
class Data
{
string name;
string profession;
}
["java:serializable:temp.Player"]
sequence<byte> Player;
class DataExt extends Data
{
Player player;
}
["java:type:java.util.ArrayList<Data>"] sequence<Data> DataList;
interface TestClass
{
void testSth(DataList data);
}
}
After some experiments and debugging, I've figured out, that removing
[["java:package:org.megacinol"]]
solves the problem.
I can replace this metadata with nested module declarations, but I would rather stick to the metadata approach.
Is there any other way to solve that problem?
You need to configure this with Ice.Package.
configuration property as explained in documentation
So for your sample you need to set the configuration property
Ice.Package.test=org.megacinol