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

Cannot add objects of class class org.joda.time.LocalDate to JsonArray #17

Closed
pjs7678 opened this issue Feb 13, 2014 · 6 comments
Closed

Comments

@pjs7678
Copy link

pjs7678 commented Feb 13, 2014

I have a module exception. "Cannot add objects of class class org.joda.time.LocalDate to JsonArray"
All fields type except for date and date time are returned successfully, but date and date time type column value raises the exception..
How can I solved it??

@Narigo
Copy link
Member

Narigo commented Feb 13, 2014

Not sure what you're trying to do here... I usually put a String like 2014-02-13 as a date field for example. If that doesn't help, please provide additional info how you expect the module to work and what you do to get this error. Thanks!

@pjs7678
Copy link
Author

pjs7678 commented Feb 14, 2014

I make a table like this for testing.

CREATE TABLE test (
id int(11) unsigned NOT NULL AUTO_INCREMENT,
date date DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

After that, I insert the row (1, 2014-02-13).

Using these json object { "action": "select", "table": "test"}, I send an message to mod-mysql-postgresql module. And then, the output is like this.

{u'message': u'Cannot add objects of class class org.joda.time.LocalDate to JsonArray', u'status': u'error', u'error': u'MODULE_EXCEPTION'}

Help me..

@Narigo
Copy link
Member

Narigo commented Mar 24, 2014

Okay, I finally got around replicating this. This happens due to the driver giving back a joda.time value, which needs to be converted into something that JsonArray can work with. I believe this only happened after using a newer version of Vert.x, since it disallowed sending arbitrary classes through JSON.

@Narigo
Copy link
Member

Narigo commented Apr 7, 2014

Just pushed a new 0.3.0-SNAPSHOT which uses a new version of the underlying driver, Vert.x and does not involve Scala mod 1.0.0-RC1. Could you retry with this?

Thanks

@Narigo
Copy link
Member

Narigo commented Sep 22, 2014

If this is still an issue, please reopen. Released 0.3.0 and should be fixed. Thanks!

@Narigo Narigo closed this as completed Sep 22, 2014
@pjs7678
Copy link
Author

pjs7678 commented Sep 22, 2014

As I dropped out that project, I couldn't find out whether it's fixed or not.

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