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

Trouble deleting a dynamodb item #9

Closed
gorsuch opened this issue Jul 24, 2013 · 8 comments
Closed

Trouble deleting a dynamodb item #9

gorsuch opened this issue Jul 24, 2013 · 8 comments

Comments

@gorsuch
Copy link

gorsuch commented Jul 24, 2013

Hello!

I'm having some issues when deleting a DynamoDB item using amazonica.aws.dynamodbv2.

An example:

(delete-item :table-name "my-table" :key {:id {:s "12345"}})

This fails with a java.lang.IllegalArgumentException: null exception.

Any ideas here? I am wracking my brain trying to understand what I am doing wrong. Thanks!

@gorsuch
Copy link
Author

gorsuch commented Jul 24, 2013

Bah, sorry to waste your time. This was a local environment issue.

@gorsuch gorsuch closed this as completed Jul 24, 2013
@mcohen01
Copy link
Owner

If you switched from JDK 1.7 to 1.6 and the issue "went away" I think we should probably leave the issue open. I think there's a few places in the code where we're not specific enough / search exhaustively enough through the available methods to choose the correct one to invoke on the AWS SDK Javabean. So for example, I believe maybe in a recent upgrade of the AWS SDK, they added another setKey() method that takes Map.Entry's in addition to simply Maps. http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/GetItemRequest.html

The ordering of methods returned from a call to Class.getDeclaredMethods() is different on different JDKs. On one particular JDK the first setKey method returned works, on another it doesn't. I've seen this once before somewhere else in the code, so I think this might be a similar bug. If you switched JDKs and it worked I'm pretty sure that's what's going on.

@gorsuch
Copy link
Author

gorsuch commented Jul 24, 2013

I'm going to attempt to reproduce this (no luck so far). I am using JDK 1.7.

I was doing a lot of refactoring in a long-running repl. After restarting the repl, things worked just fine. I am assuming that I had fudged something up that way.

I'll update here if I can make this happen again. Thanks!

@gorsuch
Copy link
Author

gorsuch commented Jul 25, 2013

I was able to reproduce for a short period. Another function began throwing this same exception. I ran lein clean, and the problem went away. I'm unsure if it has shifted elsewhere or what.

@mcohen01
Copy link
Owner

I'm pretty sure its a bug, where were dependent on the ordering of methods
returned by class.getDeclaredMethod. ill have look today or tonight. Thanks.
On Jul 25, 2013 8:49 AM, "Michael Gorsuch" notifications@github.com wrote:

I was able to reproduce for a short period. Another function began
throwing this same exception. I ran lein clean, and the problem went
away. I'm unsure if it has shifted elsewhere or what.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-21563367
.

@gorsuch
Copy link
Author

gorsuch commented Jul 25, 2013

Naw, thank you, sir.

On Thu, Jul 25, 2013 at 11:34 AM, Michael Cohen notifications@github.comwrote:

I'm pretty sure its a bug, where were dependent on the ordering of methods
returned by class.getDeclaredMethod. ill have look today or tonight.
Thanks.
On Jul 25, 2013 8:49 AM, "Michael Gorsuch" notifications@github.com
wrote:

I was able to reproduce for a short period. Another function began
throwing this same exception. I ran lein clean, and the problem went
away. I'm unsure if it has shifted elsewhere or what.


Reply to this email directly or view it on GitHub<
https://github.com/mcohen01/amazonica/issues/9#issuecomment-21563367>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-21567030
.

@mcohen01
Copy link
Owner

not pretty but....

@gorsuch
Copy link
Author

gorsuch commented Jul 26, 2013

Thank you so much for fixing this. Works like a champ over here.

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

No branches or pull requests

2 participants