java.lang.StackOverflowError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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}
    via by Roman Kondrashov,
  • 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}
    via by Roman Kondrashov,
    • 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)
    No Bugmate found.