java.lang.StackOverflowError

DataStax JIRA | Roman Kondrashov | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Hi folks, I tried to persisit a tree structure using UDT and mapper, but got a StackOverflowError. The problem is the endless recursion on UDT mapper creation for the circular referenced class member. h4. Cassandra-KS: {code:title=tree.cql|borderStyle=solid} CREATE KEYSPACE tree_test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; CREATE TYPE tree_test.node ( name text, ); ALTER TYPE tree_test.node ADD children frozen<list<tree_test.node>>; CREATE TABLE tree_test.tree ( id uuid PRIMARY KEY, children frozen<list<tree_test.node>> ); {code} h4.Node UDT: {code:title=Node.java|borderStyle=solid} @UDT(keyspace = "tree_test", name = "node") public class Node { private String name; private List<Node> childeren; // getters and setters omitted } {code} h4.Tree table {code:title=Tree.java|borderStyle=solid} @Table(keyspace = "tree_test", name = "tree") public class Tree { @PartitionKey private UUID id; @FrozenValue List<Node> children; // getters and setters omitted } {code} h4.Test class {code:title=TreeTest.java|borderStyle=solid} public class TreeTest { @Test public void testMapper() { Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build(); Session session = cluster.connect(); MappingManager manager = new ExtendedMappingManager(session); UDTMapper<Node> mapper = manager.udtMapper(Node.class); assertNotNull(mapper); } } {code} h4.Stacktrace {code} java.lang.StackOverflowError at java.lang.Character.toUpperCaseEx(Character.java:7138) at java.lang.String.toUpperCase(String.java:2729) at java.beans.NameGenerator.capitalize(NameGenerator.java:82) at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:71) at com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:209) at com.datastax.driver.mapping.ExtendedMappingManager.convert(ExtendedMappingManager.java:107) at com.datastax.driver.mapping.ExtendedMappingManager.parseUDT(ExtendedMappingManager.java:98) at com.datastax.driver.mapping.ExtendedMappingManager.getUDTMapper(ExtendedMappingManager.java:40) at com.datastax.driver.mapping.MappingManager.udtMapper(MappingManager.java:123) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:84) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:65) at com.datastax.driver.mapping.InferredCQLType.from(InferredCQLType.java:43) at com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:221) at com.datastax.driver.mapping.ExtendedMappingManager.convert(ExtendedMappingManager.java:107) at com.datastax.driver.mapping.ExtendedMappingManager.parseUDT(ExtendedMappingManager.java:98) at com.datastax.driver.mapping.ExtendedMappingManager.getUDTMapper(ExtendedMappingManager.java:40) at com.datastax.driver.mapping.MappingManager.udtMapper(MappingManager.java:123) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:84) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:65) at com.datastax.driver.mapping.InferredCQLType.from(InferredCQLType.java:43) .................... {code}

    DataStax JIRA | 2 years ago | Roman Kondrashov
    java.lang.StackOverflowError
  2. 0

    Hi folks, I tried to persisit a tree structure using UDT and mapper, but got a StackOverflowError. The problem is the endless recursion on UDT mapper creation for the circular referenced class member. h4. Cassandra-KS: {code:title=tree.cql|borderStyle=solid} CREATE KEYSPACE tree_test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; CREATE TYPE tree_test.node ( name text, ); ALTER TYPE tree_test.node ADD children frozen<list<tree_test.node>>; CREATE TABLE tree_test.tree ( id uuid PRIMARY KEY, children frozen<list<tree_test.node>> ); {code} h4.Node UDT: {code:title=Node.java|borderStyle=solid} @UDT(keyspace = "tree_test", name = "node") public class Node { private String name; private List<Node> childeren; // getters and setters omitted } {code} h4.Tree table {code:title=Tree.java|borderStyle=solid} @Table(keyspace = "tree_test", name = "tree") public class Tree { @PartitionKey private UUID id; @FrozenValue List<Node> children; // getters and setters omitted } {code} h4.Test class {code:title=TreeTest.java|borderStyle=solid} public class TreeTest { @Test public void testMapper() { Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build(); Session session = cluster.connect(); MappingManager manager = new ExtendedMappingManager(session); UDTMapper<Node> mapper = manager.udtMapper(Node.class); assertNotNull(mapper); } } {code} h4.Stacktrace {code} java.lang.StackOverflowError at java.lang.Character.toUpperCaseEx(Character.java:7138) at java.lang.String.toUpperCase(String.java:2729) at java.beans.NameGenerator.capitalize(NameGenerator.java:82) at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:71) at com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:209) at com.datastax.driver.mapping.ExtendedMappingManager.convert(ExtendedMappingManager.java:107) at com.datastax.driver.mapping.ExtendedMappingManager.parseUDT(ExtendedMappingManager.java:98) at com.datastax.driver.mapping.ExtendedMappingManager.getUDTMapper(ExtendedMappingManager.java:40) at com.datastax.driver.mapping.MappingManager.udtMapper(MappingManager.java:123) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:84) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:65) at com.datastax.driver.mapping.InferredCQLType.from(InferredCQLType.java:43) at com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:221) at com.datastax.driver.mapping.ExtendedMappingManager.convert(ExtendedMappingManager.java:107) at com.datastax.driver.mapping.ExtendedMappingManager.parseUDT(ExtendedMappingManager.java:98) at com.datastax.driver.mapping.ExtendedMappingManager.getUDTMapper(ExtendedMappingManager.java:40) at com.datastax.driver.mapping.MappingManager.udtMapper(MappingManager.java:123) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:84) at com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:65) at com.datastax.driver.mapping.InferredCQLType.from(InferredCQLType.java:43) .................... {code}

    DataStax JIRA | 2 years ago | Roman Kondrashov
    java.lang.StackOverflowError

    Root Cause Analysis

    1. java.lang.StackOverflowError

      No message provided

      at java.lang.Character.toUpperCaseEx()
    2. Java RT
      PropertyDescriptor.<init>
      1. java.lang.Character.toUpperCaseEx(Character.java:7138)
      2. java.lang.String.toUpperCase(String.java:2729)
      3. java.beans.NameGenerator.capitalize(NameGenerator.java:82)
      4. java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:71)
      4 frames
    3. com.datastax.driver
      InferredCQLType.from
      1. com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:209)
      2. com.datastax.driver.mapping.ExtendedMappingManager.convert(ExtendedMappingManager.java:107)
      3. com.datastax.driver.mapping.ExtendedMappingManager.parseUDT(ExtendedMappingManager.java:98)
      4. com.datastax.driver.mapping.ExtendedMappingManager.getUDTMapper(ExtendedMappingManager.java:40)
      5. com.datastax.driver.mapping.MappingManager.udtMapper(MappingManager.java:123)
      6. com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:84)
      7. com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:65)
      8. com.datastax.driver.mapping.InferredCQLType.from(InferredCQLType.java:43)
      9. com.datastax.driver.mapping.ReflectionMapper$ReflectionFactory.createColumnMapper(ReflectionMapper.java:221)
      10. com.datastax.driver.mapping.ExtendedMappingManager.convert(ExtendedMappingManager.java:107)
      11. com.datastax.driver.mapping.ExtendedMappingManager.parseUDT(ExtendedMappingManager.java:98)
      12. com.datastax.driver.mapping.ExtendedMappingManager.getUDTMapper(ExtendedMappingManager.java:40)
      13. com.datastax.driver.mapping.MappingManager.udtMapper(MappingManager.java:123)
      14. com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:84)
      15. com.datastax.driver.mapping.InferredCQLType.<init>(InferredCQLType.java:65)
      16. com.datastax.driver.mapping.InferredCQLType.from(InferredCQLType.java:43)
      16 frames