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

[ClassCastException: java.nio.channels.ClosedChannelException cannot be cast to scala.collection.Seq] #13

Closed
ohde opened this issue Aug 23, 2014 · 16 comments

Comments

@ohde
Copy link

ohde commented Aug 23, 2014

I updated and switched to version 3 for JSON support and now I am having trouble running my existing code.

val auth = coreBroker.authenticatorsTable.filter(Map("authId" -> id)).run match {
    case Right(x) => if(x.size == 0) None else Some(x.head)
    case Left(x) => None
}

Please let me know if after switching I need to change something else. Thanks.

@kclay
Copy link
Owner

kclay commented Aug 23, 2014

I'll push a fix for this, I actually never implemented the json serialization should of mentioned that in the readme lol. I'm fixing a few things I broke for the change-feed support so once I get that fixed and all tests pass I'll push an update.

kclay added a commit that referenced this issue Aug 23, 2014
- Major refactor to allow json support and setup the groundwork for change feed cursors #13,#10
kclay added a commit that referenced this issue Aug 23, 2014
- Major refactor to allow json support and setup the groundwork for change feed cursors #13,#12
@kclay
Copy link
Owner

kclay commented Aug 26, 2014

Pushed new snapshot give it a try also you can do

val auth  = coreBroker.authenticatorsTable.filter(Map("authId" -> id))(0).toOpt 

@kclay
Copy link
Owner

kclay commented Aug 26, 2014

Actually publish new version 0.4.4

@ohde
Copy link
Author

ohde commented Aug 30, 2014

Interesting, I pulled the latest and ensured Version 3 was being used, and I get the following at runtime:

[error] c.r.n.Version3 - Unable to read from socket
java.io.IOException: null
    at org.jboss.netty.handler.queue.BlockingReadHandler.read(BlockingReadHandler.java:170) ~[netty-3.9.2.Final.jar:na]
    at com.rethinkscala.net.ConfigureAuth$class.configure(Version.scala:352) ~[core_2.11.jar:0.4.4]
    at com.rethinkscala.net.Version3.configure(Version.scala:439) [core_2.11.jar:0.4.4]
    at com.rethinkscala.net.AbstractConnection$$anon$4.configure(Connection.scala:109) [core_2.11.jar:0.4.4]
    at com.rethinkscala.net.AbstractConnection$$anon$4.configure(Connection.scala:96) [core_2.11.jar:0.4.4]
Caused by: java.io.IOException: Connection reset by peer
    at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.7.0_60]
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.7.0_60]
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.7.0_60]
    at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.7.0_60]
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) ~[na:1.7.0_60]

I will continue to look into this error.

@ohde
Copy link
Author

ohde commented Sep 2, 2014

This is caused by:
ERROR: this is the rdb protocol port (bad magic number)
So I am looking at the compatibility of the driver with the db. Since I have not updated my database I will look at updating from 1.12 -> 1.13

@ohde
Copy link
Author

ohde commented Sep 4, 2014

Moving to new version has allowed me to use Version 3 and return results, however after results are returned it doesn't appear to be releasing it.
Since, after so many requests I get no results returned. I will keep investigating.

@kclay
Copy link
Owner

kclay commented Sep 4, 2014

Yeah Version 3 should work for 1.13+. And are you saying that after you query the connection isn't being released?

@ohde
Copy link
Author

ohde commented Sep 4, 2014

That is correct. I will write some Unit tests outside of my application for better testing/debugging of the issue at hand. However, all I have done is pulled and published the latest from your repo and in my application updated version2 -> version3, then updated to 1.13.4 of rethinkdb.

@kclay
Copy link
Owner

kclay commented Sep 4, 2014

Great I'll test this out as well, I don't have any tests for the connection pool but I have an idea on why its not returning it.

@ohde
Copy link
Author

ohde commented Sep 4, 2014

I have confirmed this is an issue with the connection pool. As I have increased the max and now I am not getting the timeout issues as before when I run unit tests. Looking through implementation now in hopes of finding where the issue arises.

@kclay
Copy link
Owner

kclay commented Sep 7, 2014

Sorry for the delay man been a crazy week. I'm working on reproducing this , let you know what I find. I'm wondering if you are getting any exceptions that are being hidden causing the connection to not return to the pool.

@kclay
Copy link
Owner

kclay commented Sep 7, 2014

Ok test out 0.4.5-SNAPSHOT

@ohde
Copy link
Author

ohde commented Sep 7, 2014

No problem, today is the day I was going to take a look.
I'm sorry I don't see any recent commits or releases in the repo.

@necrodome
Copy link

Are you going to release 0.4.5-SNAPSHOT?

@kclay
Copy link
Owner

kclay commented Sep 26, 2014

@necrodome was released for 2.11 19days ago ,was waiting for confirmation from @maohde if it fixed his problem or not.

@ohde
Copy link
Author

ohde commented Oct 1, 2014

Crazy last few weeks. Works great, thanks.

@ohde ohde closed this as completed Oct 1, 2014
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

3 participants