Questions tagged [classcastexception]
The Java exception thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance.
classcastexception
1,707
questions
0
votes
0
answers
39
views
CompletedAccountDTO is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @2db52090)
I dont understand this error, the log is giving me a ClassCastException of same class
Caused by: java.lang.ClassCastException: class com.exceltic.commons.api.model.datacollector.accounts....
0
votes
1
answer
261
views
An internal error occurred during: "Refreshing workspace". Eclipse 2024-03 fresh install
at importing project time I already got this error
An internal error occurred during: "Refreshing workspace".
class org.eclipse.jdt.internal.core.JavaNature cannot be cast to class org....
7
votes
0
answers
81
views
Why the <T extend Map> could be assigned to a List
I have missed a problem with the Java Generic type
public class MyTest {
@Test
public void test1() throws Exception {
List<Integer> list = getMapInstance();
}
public ...
0
votes
1
answer
46
views
How to fix this problem: androidx.appcompat.widget.AppCompatEditText cannot be cast to android.content.Context
The following error occurs when I try to execute the code and app also terminates. (Caused by:java.lang.ClassCastException: androidx.appcompat.widget.AppCompatEditText cannot be cast to android....
0
votes
1
answer
42
views
Java - Why can't i take an array of a superclass, and get the subclass functions?
I'm trying to write a Chess Program from scratch. I have a superclass called "Piece", and subclasses for all the individual chess pieces (Pawn, Bishop, Knight, ect). I also have another ...
0
votes
0
answers
13
views
Getting classCastException when upgrade from strom/zookeepr 2.5/3.8.0 to 2.6/3.9.1
I can't find any channel to connect with Apache storm developer, but we used Apache Storm for our pricing engine for a long time, and currently we are upgrade to Storm latest version 2.6 + zookeeper 3....
0
votes
0
answers
80
views
java.time.OffsetDateTime cannot be cast to java.sql.Timestamp after Upgrading the H2database2.2.220
Application is using the Oracle database. And we have the H2 database used for Junit.
We were using the h2 version of 1.4.182. Because of the vulnerability we have to upgrade to 2.2.220.
When i update ...
1
vote
1
answer
83
views
java.lang.ClassCastException: LinkedTreeMap cannot be cast to ProductDetails$OneTimePurchaseOfferDetails
I am using in-app billing (com.android.billingclient:[email protected]:2) lib for payment in Android.
Billing Library: Provides product detail information as ProductDetails in response of QueryInventory.
...
0
votes
0
answers
132
views
ClassCastException after upgrading to Spring6
I m getting the following exception after migrating to Spring 6:
java.lang.ClassCastException: class com.example.application.profile.publicapi.oidcprovider.WebConfig$$SpringCGLIB$$0 cannot be cast to ...
0
votes
0
answers
92
views
Flutter: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
When I run the app on android emulator the app builds and it also installs but the wierd thing is that it installs two instances of same app and then crashes with this error :
java.lang....
0
votes
1
answer
37
views
ClassCastException when using JUnit5 @ExtendWith and a customer ParameterResolver
I am currently learning JUnit, and the nice new features it has. Specifically, I am working with a simple ParameterResolver, reproduced below
package com.junit.test.me.junit_testing;
import org.junit....
0
votes
2
answers
73
views
Is it bad to use an instance of an operator to access child class variables from a parent reference?
I have a class, e.g., Person, having some parameters, e.g., name and age.
Now I want to add some other parameters, e.g., employment. These new parameters are only useful to one mode of the ...
0
votes
0
answers
11
views
JedisClusterStringCommands.get(...) 67 line throw java.lang.ClassCastException by chance
In the case of high concurrency and frequent reads of the same key,JedisClusterStringCommands.get(...) 67 line throw java.lang.ClassCastException,it's an accidental event.
spring-data-redis version:2....
0
votes
0
answers
477
views
Hibernate String column - found [character (Types#CHAR)], but expecting [char (Types#VARCHAR)]
So I have a String attribute about a code which is exactly 4 characters long: "1A9C".
Therefor I chose CHAR(4) as a datatype on the database (DB2 z/OS or in-mem H2).
My entity looks like ...
2
votes
0
answers
138
views
Kafka stream with protobuf messages
I have stream of protobuf messages with one type AccountHolder.proto with {name,balance,time} as fields and doing some aggregations on the data content and writing the result as protobuf message of ...