org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type class java.lang.String is neither a @NodeEntity nor a @RelationshipEntity

Spring JIRA | Victor Cvetanov | 5 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    When attempting .equals() on instance of @NodeEntity annotated class against instance of some non-@NodeEntity annotated class an exception is thrown. In my opinion it should just return false with no exceptions. @NodeEntity public class Person { ... } Person person = ....;// some loading from the Graph database person.equals("some string here"); //throws the exception Exception in thread "main" org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type class java.lang.String is neither a @NodeEntity nor a @RelationshipEntity at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.createPersistentEntity(Neo4jMappingContext.java:56) at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.createPersistentEntity(Neo4jMappingContext.java:46) at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:271) at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:61) at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:46) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:183) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:158) at org.springframework.data.neo4j.support.mapping.EntityStateHandler.getId(EntityStateHandler.java:82) at org.springframework.data.neo4j.support.mapping.EntityStateHandler.getPersistentState(EntityStateHandler.java:99) at org.springframework.data.neo4j.support.mapping.EntityStateHandler.equals(EntityStateHandler.java:260) at org.springframework.data.neo4j.aspects.support.node.Neo4jNodeBacking.ajc$interMethod$org_springframework_data_neo4j_aspects_support_node_Neo4jNodeBacking$org_springframework_data_neo4j_aspects_core_NodeBacked$equals(Neo4jNodeBacking.aj:235) ....

    Spring JIRA | 5 years ago | Victor Cvetanov
    org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type class java.lang.String is neither a @NodeEntity nor a @RelationshipEntity
  2. 0

    When attempting .equals() on instance of @NodeEntity annotated class against instance of some non-@NodeEntity annotated class an exception is thrown. In my opinion it should just return false with no exceptions. @NodeEntity public class Person { ... } Person person = ....;// some loading from the Graph database person.equals("some string here"); //throws the exception Exception in thread "main" org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type class java.lang.String is neither a @NodeEntity nor a @RelationshipEntity at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.createPersistentEntity(Neo4jMappingContext.java:56) at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.createPersistentEntity(Neo4jMappingContext.java:46) at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:271) at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:61) at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:46) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:183) at org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:158) at org.springframework.data.neo4j.support.mapping.EntityStateHandler.getId(EntityStateHandler.java:82) at org.springframework.data.neo4j.support.mapping.EntityStateHandler.getPersistentState(EntityStateHandler.java:99) at org.springframework.data.neo4j.support.mapping.EntityStateHandler.equals(EntityStateHandler.java:260) at org.springframework.data.neo4j.aspects.support.node.Neo4jNodeBacking.ajc$interMethod$org_springframework_data_neo4j_aspects_support_node_Neo4jNodeBacking$org_springframework_data_neo4j_aspects_core_NodeBacked$equals(Neo4jNodeBacking.aj:235) ....

    Spring JIRA | 5 years ago | Victor Cvetanov
    org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type class java.lang.String is neither a @NodeEntity nor a @RelationshipEntity
  3. 0

    Type class java.lang.RuntimeException is neither a @NodeEntity nor a @RelationshipEntity

    Stack Overflow | 4 years ago | user1971430
    org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type class java.lang.RuntimeException is neither a @NodeEntity nor a @RelationshipEntity
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SpringData/Neo4j: cannot persist relationship

    Stack Overflow | 5 years ago | Rolf
    org.springframework.data.neo4j.mapping.InvalidEntityTypeException: Type class org.springframework.data.neo4j.fieldaccess.GraphBackedEntityIterableWrapper is neither a @NodeEntity nor a @RelationshipEntity

    Root Cause Analysis

    1. org.springframework.data.neo4j.mapping.InvalidEntityTypeException

      Type class java.lang.String is neither a @NodeEntity nor a @RelationshipEntity

      at org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.createPersistentEntity()
    2. Spring Data Neo4j
      Neo4jMappingContext.createPersistentEntity
      1. org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.createPersistentEntity(Neo4jMappingContext.java:56)
      2. org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.createPersistentEntity(Neo4jMappingContext.java:46)
      2 frames
    3. Spring Data Core
      AbstractMappingContext.addPersistentEntity
      1. org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:271)
      1 frame
    4. Spring Data Neo4j
      Neo4jMappingContext.addPersistentEntity
      1. org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:61)
      2. org.springframework.data.neo4j.support.mapping.Neo4jMappingContext.addPersistentEntity(Neo4jMappingContext.java:46)
      2 frames
    5. Spring Data Core
      AbstractMappingContext.getPersistentEntity
      1. org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:183)
      2. org.springframework.data.mapping.context.AbstractMappingContext.getPersistentEntity(AbstractMappingContext.java:158)
      2 frames
    6. Spring Data Neo4j
      EntityStateHandler.equals
      1. org.springframework.data.neo4j.support.mapping.EntityStateHandler.getId(EntityStateHandler.java:82)
      2. org.springframework.data.neo4j.support.mapping.EntityStateHandler.getPersistentState(EntityStateHandler.java:99)
      3. org.springframework.data.neo4j.support.mapping.EntityStateHandler.equals(EntityStateHandler.java:260)
      3 frames
    7. Spring Data Neo4j - AspectJ Advanced Mapping
      Neo4jNodeBacking.ajc$interMethod$org_springframework_data_neo4j_aspects_support_node_Neo4jNodeBacking$org_springframework_data_neo4j_aspects_core_NodeBacked$equals
      1. org.springframework.data.neo4j.aspects.support.node.Neo4jNodeBacking.ajc$interMethod$org_springframework_data_neo4j_aspects_support_node_Neo4jNodeBacking$org_springframework_data_neo4j_aspects_core_NodeBacked$equals(Neo4jNodeBacking.aj:235)
      1 frame