Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed Class Name error on Nested Class Names #6

Open
madsmith opened this issue Jun 20, 2013 · 5 comments
Open

Malformed Class Name error on Nested Class Names #6

madsmith opened this issue Jun 20, 2013 · 5 comments
Assignees
Labels
Milestone

Comments

@madsmith
Copy link

Took a while to track down the cause of this issue. I was having issues invoking Dynamo operations with the API. Eventually, I tried the simple example QuickStart (blocking using nonblocking api) that is at the top of the Readme and it raised the following error. Looks like there's an issue with calling getSimpleName() on nested scala classes.

Moving the case class definition for Person out of the try (or better yet out of the object) changes the way the object's classname is generated which circumvents the error.

Ultimately, this is a scala/java bug where scala's classnames are at times incompatible with java.lang.class.getSimpleName(). I'd recommend not using getSimpleName in DynamicObject.

See https://issues.scala-lang.org/browse/SI-2034 for background.

[info] Running QuckStart
[info] [ERROR] [06/19/2013 20:26:41.937] [Dynamo-dynamo-connection-dispatcher-5] [akka://Dynamo/user/DynamoClient/DynamoConnection/$a] AmazonDB Error [Malformed class name] while executing [TableExists(asyncdynamo.DynamoObject$$anon$1@6af2da21)]. To see the operation origin please add -Dasyncdynamo.debug system property.
[info] asyncdynamo.ThirdPartyException: AmazonDB Error [Malformed class name] while executing [TableExists(asyncdynamo.DynamoObject$$anon$1@6af2da21)]. To see the operation origin please add -Dasyncdynamo.debug system property.
[info]  at asyncdynamo.DbOperation.safeExecute(DbOperation.scala:49)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1$$anonfun$1$$anonfun$apply$1.apply(Dynamo.scala:53)
[info]  at asyncdynamo.AmazonThrottlingRecoveryStrategy.onExecute(ThrottlingRecoveryStrategy.scala:18)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1$$anonfun$1.apply(Dynamo.scala:53)
[info]  at asyncdynamo.Dynamo.asyncdynamo$Dynamo$$time(Dynamo.scala:75)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1.liftedTree1$1(Dynamo.scala:53)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1.applyOrElse(Dynamo.scala:52)
[info]  at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
[info]  at akka.actor.ActorCell.invoke(ActorCell.scala:386)
[info]  at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
[info]  at akka.dispatch.Mailbox.run(Mailbox.scala:212)
[info]  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
[info]  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
[info]  at java.lang.Thread.run(Thread.java:680)
[info] Caused by: java.lang.InternalError: Malformed class name
[info]  at java.lang.Class.getSimpleName(Class.java:1135)
[info]  at asyncdynamo.DynamoObject$.className$lzycompute$1(DynamoObject.scala:67)
[info]  at asyncdynamo.DynamoObject$.asyncdynamo$DynamoObject$$className$1(DynamoObject.scala:67)
[info]  at asyncdynamo.DynamoObject$$anon$1.table(DynamoObject.scala:75)
[info]  at asyncdynamo.DynamoObject$class.table(DynamoObject.scala:31)
[info]  at asyncdynamo.DynamoObject$$anon$1.table(DynamoObject.scala:70)
[info]  at asyncdynamo.nonblocking.TableExists.execute(admin-operations.scala:63)
[info]  at asyncdynamo.nonblocking.TableExists.execute(admin-operations.scala:61)
[info]  at asyncdynamo.DbOperation.safeExecute(DbOperation.scala:44)
[info]  ... 13 more
[info]
[info] [ERROR] [06/19/2013 20:26:41.946] [Dynamo-akka.actor.default-dispatcher-2] [akka://Dynamo/user/DynamoClient/DynamoConnection] AmazonDB Error [Malformed class name] while executing [TableExists(asyncdynamo.DynamoObject$$anon$1@6af2da21)]. To see the operation origin please add -Dasyncdynamo.debug system property.
[info] asyncdynamo.ThirdPartyException: AmazonDB Error [Malformed class name] while executing [TableExists(asyncdynamo.DynamoObject$$anon$1@6af2da21)]. To see the operation origin please add -Dasyncdynamo.debug system property.
[info]  at asyncdynamo.DbOperation.safeExecute(DbOperation.scala:49)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1$$anonfun$1$$anonfun$apply$1.apply(Dynamo.scala:53)
[info]  at asyncdynamo.AmazonThrottlingRecoveryStrategy.onExecute(ThrottlingRecoveryStrategy.scala:18)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1$$anonfun$1.apply(Dynamo.scala:53)
[info]  at asyncdynamo.Dynamo.asyncdynamo$Dynamo$$time(Dynamo.scala:75)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1.liftedTree1$1(Dynamo.scala:53)
[info]  at asyncdynamo.Dynamo$$anonfun$receive$1.applyOrElse(Dynamo.scala:52)
[info]  at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
[info]  at akka.actor.ActorCell.invoke(ActorCell.scala:386)
[info]  at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
[info]  at akka.dispatch.Mailbox.run(Mailbox.scala:212)
[info]  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
[info]  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
[info]  at java.lang.Thread.run(Thread.java:680)
[info] Caused by: java.lang.InternalError: Malformed class name
[info]  at java.lang.Class.getSimpleName(Class.java:1135)
[info]  at asyncdynamo.DynamoObject$.className$lzycompute$1(DynamoObject.scala:67)
[info]  at asyncdynamo.DynamoObject$.asyncdynamo$DynamoObject$$className$1(DynamoObject.scala:67)
[info]  at asyncdynamo.DynamoObject$$anon$1.table(DynamoObject.scala:75)
[info]  at asyncdynamo.DynamoObject$class.table(DynamoObject.scala:31)
[info]  at asyncdynamo.DynamoObject$$anon$1.table(DynamoObject.scala:70)
[info]  at asyncdynamo.nonblocking.TableExists.execute(admin-operations.scala:63)
[error] asyncdynamo.ThirdPartyException: AmazonDB Error: [AmazonDB Error [Malformed class name] while executing [TableExists(asyncdynamo.DynamoObject$$anon$1@6af2da21)]. To see the operation origin please add -Dasyncdynamo.debug system property.] while executing [Some(PendingOperation(TableExists(asyncdynamo.DynamoObject$$anon$1@6af2da21),Deadline(1371691611687620000 nanoseconds)))]
[info]  at asyncdynamo.nonblocking.TableExists.execute(admin-operations.scala:61)
[error]         at asyncdynamo.Dynamo.preRestart(Dynamo.scala:70)
[info]  at asyncdynamo.DbOperation.safeExecute(DbOperation.scala:44)
[info]  ... 13 more
[info]
[error]         at akka.actor.dungeon.FaultHandling$class.faultRecreate(FaultHandling.scala:67)
[error]         at akka.actor.ActorCell.faultRecreate(ActorCell.scala:306)
[error]         at akka.actor.ActorCell.systemInvoke(ActorCell.scala:356)
[error]         at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:256)
[error]         at akka.dispatch.Mailbox.run(Mailbox.scala:211)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
[error]         at java.lang.Thread.run(Thread.java:680)
[error] Caused by: asyncdynamo.ThirdPartyException: AmazonDB Error [Malformed class name] while executing [TableExists(asyncdynamo.DynamoObject$$anon$1@6af2da21)]. To see the operation origin please add -Dasyncdynamo.debug system property.
[error]         at asyncdynamo.DbOperation.safeExecute(DbOperation.scala:49)
[error]         at asyncdynamo.Dynamo$$anonfun$receive$1$$anonfun$1$$anonfun$apply$1.apply(Dynamo.scala:53)
[error]         at asyncdynamo.AmazonThrottlingRecoveryStrategy.onExecute(ThrottlingRecoveryStrategy.scala:18)
[error]         at asyncdynamo.Dynamo$$anonfun$receive$1$$anonfun$1.apply(Dynamo.scala:53)
[error]         at asyncdynamo.Dynamo.asyncdynamo$Dynamo$$time(Dynamo.scala:75)
[error]         at asyncdynamo.Dynamo$$anonfun$receive$1.liftedTree1$1(Dynamo.scala:53)
[error]         at asyncdynamo.Dynamo$$anonfun$receive$1.applyOrElse(Dynamo.scala:52)
[error]         at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
[error]         at akka.actor.ActorCell.invoke(ActorCell.scala:386)
[error]         at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
[error]         at akka.dispatch.Mailbox.run(Mailbox.scala:212)
[error]         ... 3 more
[error] Caused by: java.lang.InternalError: Malformed class name
[error]         at java.lang.Class.getSimpleName(Class.java:1135)
[error]         at asyncdynamo.DynamoObject$.className$lzycompute$1(DynamoObject.scala:67)
[error]         at asyncdynamo.DynamoObject$.asyncdynamo$DynamoObject$$className$1(DynamoObject.scala:67)
[error]         at asyncdynamo.DynamoObject$$anon$1.table(DynamoObject.scala:75)
[error]         at asyncdynamo.DynamoObject$class.table(DynamoObject.scala:31)
[error]         at asyncdynamo.DynamoObject$$anon$1.table(DynamoObject.scala:70)
[error]         at asyncdynamo.nonblocking.TableExists.execute(admin-operations.scala:63)
[error]         at asyncdynamo.nonblocking.TableExists.execute(admin-operations.scala:61)
[error]         at asyncdynamo.DbOperation.safeExecute(DbOperation.scala:44)
[error]         ... 13 more
@glidester
Copy link
Collaborator

Could you provide a demonstrating example and I'll try and take a look at this.

@alexanderdean
Copy link
Collaborator

This is still live in 2.0.0. We should fix it as it affects the README's example, which is very confusing for new starters...

@petervandenabeele
Copy link

Confirmed ... I just hit this as a starter (found this issue via Googling the issue).

Thanks for the explanation :-)

@sathish-io
Copy link

I do face this problem while running QuickStart example. What is the fix ?
I am trying to evaluate AWScala vs async-dynamo.

@sathish-io
Copy link

Between, I am using following library dependency,

resolvers += Resolver.bintrayRepo("zzztimbo", "maven")
libraryDependencies += "com.github.piotrga" % "async-dynamo_2.10" % "2.0.1.14" withSources()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants