阿喀琉斯抛出“ IllegalStateException:当前类型未知:java.util.Collection <org.example.aninterface>”

时间:2018-10-05 19:02:30

标签: java cassandra

我将Achilles用作Cassandra的对象映射器,并且通常运行良好,但是当运行注释处理器时,Achilles现在抛出IllegalStateException。

//in ../../actions/pages.js  
import { UPDATE } from 'react-admin';

export const UPDATE_PAGE = 'UPDATE_PAGE';
export const updatePage = (id, data) => ({
    type: UPDATE_PAGE,
    payload: { id, data: { ...data, is_updated: true } },
    meta: { fetch: UPDATE, resource: 'pages' },
});

在堆栈跟踪中,AnInterface是具有名为AnInterfaceImpl的实现的接口,该实现在类级别用@UDT和@Table进行注释。似乎引起此问题的字段用@Column注释,并且具有字段签名Error:java: Error while parsing: java.lang.IllegalStateException: Unknown current type : java.util.Collection<org.example.AnInterface> at info.archinnov.achilles.internals.parser.AnnotationTree.buildTree_Javac(AnnotationTree.java:370) at info.archinnov.achilles.internals.parser.AnnotationTree.buildFrom(AnnotationTree.java:304) at info.archinnov.achilles.internals.parser.FieldParser.parse(FieldParser.java:62) at info.archinnov.achilles.internals.parser.AbstractBeanParser.lambda$parseFields$315(AbstractBeanParser.java:65) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at info.archinnov.achilles.internals.parser.AbstractBeanParser.parseFields(AbstractBeanParser.java:66) at info.archinnov.achilles.internals.parser.EntityParser.parseEntity(EntityParser.java:45) at info.archinnov.achilles.internals.apt.processors.meta.AchillesProcessor.lambda$discoverAndValidateTablesAndViews$651(AchillesProcessor.java:259) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)

有人知道我如何解决此问题吗?

1 个答案:

答案 0 :(得分:0)

我不是Achilles方面的专家,但我认为Collection太笼统了,可能有SetList,...映射到基础卡桑德拉类型。请使用与Cassandra表类型匹配的特定类型,例如List<AnInterface>