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

java.lang.ClassCastException when serializing object #136

Closed
teamon opened this issue Jul 27, 2011 · 2 comments
Closed

java.lang.ClassCastException when serializing object #136

teamon opened this issue Jul 27, 2011 · 2 comments

Comments

@teamon
Copy link

teamon commented Jul 27, 2011

The code to reproduce: https://gist.github.com/1af85bff5de659b3d266

The issue is that this code works under scala repl, but within sbt console it throws an exception.

It is not only related to sbt console, if I execute jetty-run from sbt it behaves the same way.

@harrah
Copy link
Member

harrah commented Jul 31, 2011

This is just standard OOIS behavior in the presence of class loaders, unfortunately. There isn't even a simple place you can say "use this class loader" and sbt can't work around it either as far as I know. You have to have a custom OOIS subclass, although it isn't too bad. See http://jira.codehaus.org/browse/GROOVY-1627, for example.

@harrah
Copy link
Member

harrah commented Aug 13, 2013

IO.objectInputStream implements a custom OOIS subclass as a convenience for working around the problem.

eed3si9n pushed a commit to eed3si9n/sbt that referenced this issue Sep 22, 2020
Added dependencyBrowseTreeHTML and dependencyBrowseTree tasks
eed3si9n pushed a commit to eed3si9n/sbt that referenced this issue Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants