【问题标题】:a.neo4j.mapping.Neo4jPersistentProperty: 73 - Owning ClassInfo is null for fielda.neo4j.mapping.Neo4jPersistentProperty: 73 - 拥有 ClassInfo 的字段为空
【发布时间】:2016-01-24 01:12:44
【问题描述】:

这个错误信息是什么意思?

2016-01-23 19:07:24,914  WARN ta.neo4j.mapping.Neo4jPersistentProperty:  73 - Owning ClassInfo is null for field: private java.lang.Long com.xenoterracide.rpf.AbstractPersistable.id and propertyDescriptor: org.springframework.beans.GenericTypeAwarePropertyDescriptor[name=id]

这是这个类

public abstract class AbstractPersistable implements Identified<Long> {

    private Long id;

    @Override
    public Long getId() {
        return this.id;
    }
}

【问题讨论】:

  • 请发布如何使用这个抽象类的完整代码。它是warning 而不是error。似乎 Spring 期望 ID 字段用 @GraphId 注释,但如果您的实体中有其他字段用 @GraphId 注释,那么您可以忽略此警告。
  • @Sumit 我没有用它注释的其他字段,我尝试添加它,并没有使警告消失。我在其他领域也收到同样的警告

标签: java neo4j spring-data spring-data-neo4j spring-data-neo4j-4


【解决方案1】:

我重组了我的包,我的配置中定义的 Neo4j 组件扫描不再正确。因此,如果您收到此错误,请确保该类位于 neo4j 会话的扫描路径中。

@Configuration
@Profile( Strings.Profiles.EMBEDDED )
class EmbeddedConfig extends Neo4jConfiguration {

    @Bean
    @Override
    @Scope( value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS )
    public Session getSession() throws Exception {
        return super.getSession();
    }

    @Bean
    @Override
    public Neo4jServer neo4jServer() {
        return new InProcessServer();
    }

    @Bean
    @Override
    public SessionFactory getSessionFactory() {
        return new SessionFactory( Strings.PackagePaths.getModelPackages() );
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-06
    • 1970-01-01
    • 2023-03-25
    • 2014-12-17
    • 1970-01-01
    相关资源
    最近更新 更多