You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by "davidnadeau (via GitHub)" <gi...@apache.org> on 2025/01/23 22:52:49 UTC

[I] java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory [fury]

davidnadeau opened a new issue, #2021:
URL: https://github.com/apache/fury/issues/2021

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/fury/issues) and found no similar issues.
   
   
   ### Version
   
   0.9.0
   
   ### Component(s)
   
   Other, Java
   
   ### Minimal reproduce step
   
   I am trying to deserialize into the scala type: Map[String, String].
   
   ### What did you expect to see?
   
   No error
   
   ### What did you see instead?
   
   ```
   Failed to deserialize key:
   * binary data *
   due to exception: java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory (scala.collection.immutable.HashMap and scala.collection.Factory are in unnamed module of loader 'app')"
   ```
   
   ### Anything Else?
   
   I do not see any errors like this in version 0.7.0. In 0.9.0 i've started using the new Scala serializers 
   ```scala
   import org.apache.fury.serializer.scala.ScalaSerializers
   ScalaSerializers.registerSerializers(fury)
   ```
   
   I think there is an issue with the scala serializers.
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [I] java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #2021:
URL: https://github.com/apache/fury/issues/2021#issuecomment-2613763208

   Hi @davidnadeau , I tested HashMap with jdk 21, it still works:
   
   ```scala
   val v = scala.collection.immutable.HashMap("k1" -> "v1", "k2" -> "v2")
   fury.deserialize(fury.serialize(v)) shouldEqual v
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [I] java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory [fury]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #2021:
URL: https://github.com/apache/fury/issues/2021#issuecomment-2611661293

   @davidnadeau  could you provide reproduction code?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [I] java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory [fury]

Posted by "davidnadeau (via GitHub)" <gi...@apache.org>.
davidnadeau commented on issue #2021:
URL: https://github.com/apache/fury/issues/2021#issuecomment-2637980075

   Thanks for checking @chaokunyang , I have not been able to reproduce this issue in my test environment. I'll close the ticket for now, and re-open it with more details if I find something interesting.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [I] java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory [fury]

Posted by "davidnadeau (via GitHub)" <gi...@apache.org>.
davidnadeau closed issue #2021: java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory
URL: https://github.com/apache/fury/issues/2021


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [I] java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory [fury]

Posted by "davidnadeau (via GitHub)" <gi...@apache.org>.
davidnadeau commented on issue #2021:
URL: https://github.com/apache/fury/issues/2021#issuecomment-2612825203

   Hi @chaokunyang my fury config looks like:
   
   ```scala
     val fury = Fury
       .builder()
       .withLanguage(Language.JAVA)
       .withScalaOptimizationEnabled(true)
       .requireClassRegistration(false)
       .withRefTracking(false)
       .buildThreadSafeFuryPool(Runtime.getRuntime.availableProcessors() * 2, Runtime.getRuntime.availableProcessors() * 2)
   
     ScalaSerializers.registerSerializers(fury)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


Re: [I] java.lang.ClassCastException: class scala.collection.immutable.HashMap cannot be cast to class scala.collection.Factory [fury]

Posted by "davidnadeau (via GitHub)" <gi...@apache.org>.
davidnadeau commented on issue #2021:
URL: https://github.com/apache/fury/issues/2021#issuecomment-2612850627

   I am working to provide more details. I want to test 3 scenarios:
   1. jdk 21 fury 0.9.0 fury_core dep
   2. jdk 21 fury 0.9.0 fury_scala dep (no scala serializers)
   3. jdk 21 fury 0.9.0 fury_scala dep + scala serializers
   
   I will report back my findings. And try to provide a more detailed reproduction code, however I have a suspicion that it may be a thread race condition. Alongside the failures to deserialize I also saw other errors.
   
   ```
   java.lang.ArrayIndexOutOfBoundsException
   ```
   and
   ```
   ERROR  ThreadPoolFury:84 [finagle/netty4-1-49] - null
   java.lang.NullPointerException
   ```
   
   
    


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org