1,703 questions
1
vote
2
answers
103
views
How to handle ClassCastException when trying to cast CLOB to String in Java?
I'm maintaining a Java application using Hibernate 5.0.7 to interact with an Oracle 19C database. The data type of remark attribute in orders table is CLOB, java.lang.ClassCastException: com.org.proxy....
1
vote
0
answers
141
views
ClassCastException when comparing elements in custom ArrayOrderedList using Comparator
I am implementing an ordered list that automatically inserts elements in the correct sorted position using a Comparator. The list is built from scratch (not using java.util.ArrayList) and uses an ...
0
votes
0
answers
39
views
ClassCastException when traversing childNodes in GWT Elemental2 during text highlighting implementation
Problem Description:
I'm implementing text highlighting functionality using GWT and Elemental2. When traversing through childNodes to process text nodes for highlighting, I'm encountering a ...
0
votes
0
answers
67
views
Kotlin/Compose Multiplatform: ClassCastException while running web app
I am developing an application using Kotlin and Compose Multiplatform. The Android and iOS versions work correctly, but the web application displays a blank screen.
Here is the content of Main.kt ...
0
votes
0
answers
43
views
ClassCastException is not coming in JDK21 in Eclipse
ClassCastException is not coming in JDK21 in Eclipse
I check whether I get a ClassCastException in the console by using the TreeSet<StringBuffer>. However, the values are sorted and the output ...
1
vote
1
answer
149
views
How to fix this ClassCastException in UnitTest
I'm currently facing some problems while adding UnitTests to my JetPack Compose Project.
I want to test the following (a bit shortened) function in my viewmodel:
fun onPressSignUp() {
...
0
votes
1
answer
2k
views
ClassCastException in Hibernate with BasicTypeImpl and BasicPluralType
I'm encountering a ClassCastException while working with Hibernate in my Java project. The error occurs when Hibernate attempts to cast an instance of BasicTypeImpl to BasicPluralType. Here is the ...
0
votes
0
answers
222
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....
1
vote
1
answer
4k
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
113
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
151
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
72
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 ...
1
vote
1
answer
145
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
1
answer
120
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
1
answer
94
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 ...
2
votes
0
answers
277
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 ...
1
vote
1
answer
48
views
How to achieve an quantity summed up object list where the name of object is same in java stream collect operation avoiding toMap
I'm trying to get the quantity of the object summed up if the name of the object matches.
The POJO details are as below:
@Data
@NoArgsConstructor
@AllArgsConstructor
public class InventoryDetail {
...
0
votes
0
answers
124
views
Android Studio Giraffe IDE internal error, java.lang.ClassCastException, everytime I launch Studio
Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 15, 2023
Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
VM: OpenJDK 64-Bit Server VM by ...
0
votes
3
answers
148
views
ClassCastException when using clojure.string/split
I'm writing a website using clojure hiccup for html and clojure garden for css. Now I'm having trouble using clojure.string/split to split a path for the filename. So for some/path/file.md I want file....
1
vote
1
answer
411
views
java.lang.ClassCastException: com.google.firebase.FirebaseException cannot be cast to com.google.firebase.auth.FirebaseAuthException [duplicate]
Whenever I am trying to get the errorCode from the exception received from task.getException() by typecasting to "FirebaseAuthException" it gives and error as java.lang.ClassCastException: ...
3
votes
2
answers
759
views
Google Play In-App Reviews API java.lang.ClassCastException
After implementing google play In-App reviews API in my app i keep getting ClassCastException crash in firebase.
Fatal Exception: java.lang.ClassCastException: android.os.RemoteException cannot be ...
1
vote
1
answer
698
views
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType in the pre launch report
I updated my app recently and I've got the Google Play pre-launch report found this issue on 9 tested devices
Exception java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang....
0
votes
0
answers
66
views
WebLogic 12c ClassCastException when Using JPA
We are currently migrating our Java EE application from Weblogic 11g to Weblogic 12c.
Here were are facing ClassCastException when using JPA EntityManager's query.getSingleResult() method.
It seems to ...
1
vote
0
answers
1k
views
java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class com.springboot.Employeeportal.dto.EmployeeDto
I am using Elastic Search Request object to perform a Get request by passing a SQL query. The EntityUtils.toString(response.getEntity()) returns a String with following values,
{
"columns":
[...
0
votes
0
answers
81
views
Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: cannot be cast to class
Exception in thread "JavaFX Application Thread" java.lang.ClassCastException:
class application.Admin_HomePage_Controller cannot be cast to
class application.HomePage_Controller
(...
27
votes
6
answers
19k
views
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType with retrofit2
I have this code:
val profile: UserProfile = userApi.profile()
@GET("users/profile")
suspend fun profile(): UserProfile
When i run userApi.profile() i get this error:
java.lang....
1
vote
0
answers
342
views
Java classcasting / classloading mess in SAP CPI
I'm working on a Groovy script in the SAP CPI environment which means the script runs in a somewhat canned JVM.
I uploaded the jjwt-api-0.11.2, jjwt-impl-0.11.2 and jjwt-jackson-0.11.2 jars, in order ...
0
votes
0
answers
264
views
ClassCastException with Spring and eclipselink configuration
I'm getting a strange error while using Spring with eclipselink
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The class, [MigriertAttributeTransformer] cannot be used ...
0
votes
0
answers
1k
views
Java throwing class cast exception even if types are correct
I was learning about Matrix Variables in spring boot but I encountered problems while extracting the data.
@GetMapping(value = "/{query}/plan", produces = {"application/xml"})
...
1
vote
1
answer
516
views
java.lang.ClassCastException: BottomNavigationView cannot be cast to BottomNavigationItemView
I was working on adding a top bar to my bottom navigation view selected item, I followed this thread. But I got hit with a cast exception and the app crash. How to fetch the BottomNavigationItemView ...
2
votes
1
answer
2k
views
Kotlin, Retrofit, ClassCastException, com.google.gson.internal.LinkedTreeMap cannot be cast to List<CatListItem>?
My interface
interface ApiService {
@GET("URL")
fun getCatList(
@Query("var1") var1: String,
@Query("var2") var2: String,
): Call<List<...
0
votes
0
answers
220
views
Can SnakeYAML be used to parse a map of objects?
I have the following YAML file:
a:
name: alpha
b:
name: beta
I want to turn this into a Map<String, Item>, where an Item looks like this:
@Data
@NoArgsConstructor
public static class Item {
...
2
votes
1
answer
218
views
Force inlining of Kotlin inline-class?
@LukasEder, this question is more Kotlin related, you can probably skip it in favour of the more jOOQ-related continuation in https://github.com/jOOQ/jOOQ/issues/14972 :)
So part of a legacy database ...
0
votes
0
answers
176
views
`ClassCastException` with Eclipse RCP Internals on 2022-12
I am currently responsible for upgrading a legacy Eclipse RCP application at my job from Java 11 to Java 17. As part of this, I am upgrading from Eclipse 2018-12 to 2022-12.
However, this has ...
4
votes
4
answers
16k
views
ClassCastException: with unnamed module of loader 'app': Spring Data Redis
I am working on a small demo project for Redis and Spring Boot. But for the following GET endpoints I am getting ClassCastException.-
@GetMapping("/all")
public List<Product> ...
0
votes
1
answer
33
views
java.lang.ClassCastException:com.eltoh.date.onboarding.screens.FavouriteListFragment cannot cast to com.eltoh.date.onboarding.screens.ChatListFragment
I tried to execute a method in a specific fragment from the ViewPager2 fragment of that fragment.
It works fine on startup, but when moving between other fragments in ViewPager and back again for that ...
1
vote
1
answer
1k
views
ClassCastExceptions running Keycloak with remote Infinispan cache
Setup
Keycloak 16.1.1 wired up to an Infinispan 14 cluster for remote caching of session data (user sessions, authentication sessions, client sessions, etc.). Both Keycloak and Infinispan are using ...
3
votes
1
answer
2k
views
Spring Cloud route to webscoket service causes "ResponseFacade cannot be cast to class HttpServerResponse"
I have this section in application.yml
cloud:
gateway:
routes:
- id: websocket
uri: ws://localhost:53110
predicates:
- Path=/ws/**
- id: ...
-2
votes
2
answers
119
views
JavaFX ClassCastException using iText PDF
I am trying to download a TableView in JavaFx as an pdf document. I am using iText 7.2.5 . When I am clicking the button to download the TableView, it is asking me to select the folder then it is ...
0
votes
1
answer
549
views
Apache Avro does not print BigDecimal into parquet file Error : java.math.BigDecimal cannot be cast to java.nio.ByteBuffer
I need to create parquet file with using apache-avro library in Java8. the POJO created automatically from ".avsc" file with maven generation-resource. but I have trouble with BigDecimal ...
1
vote
0
answers
65
views
org.springframework.security.core.userdetails.User cannot be cast
@RestController
public class ChangePasswordController {
@Autowired
private UserService userService;
@Autowired
private PasswordEncoder passwordEncoder;
@PostMapping("/...
1
vote
1
answer
393
views
Unable to read and write DELTA files via SPYLON-KERNEL in JupyterLab: java.lang.ClassCastException
Unable to read delta files via spylon kernel in JupyterLab.
Upon trying to read the delta files via spylon kernel in JupyterLab I am facing the java.lang.ClassCastException error as below,
I tested ...
1
vote
1
answer
100
views
Understanding why inlining function fixes runtime crash when collecting
I want to understand why inlining function fixes runtime error.
The following code results in a runtime error (see bellow)
[error] java.lang.ClassCastException: class Herbivore cannot be cast to class ...
0
votes
1
answer
292
views
Jetty WARs container - different class loader for the same class
I have a jetty server that contains 6 wars.
for example: a.war, b.war and more..
a and b have a dependency on x jar. both of them use the same version.
I have a strange problem:
when the jetty is ...
0
votes
2
answers
230
views
Cannot cast object 'class centaur.demo.Profile' with class 'java.lang.Class' to class 'centaur.demo.Profile'
Please help me to fix this issue. Thank you!
I am working on a Grails-5.2.4 project with Java 1.8. Class Loader is not working as expected.
I am getting class cast exception for the following piece of ...
0
votes
0
answers
44
views
ClassCastException handling
I have a legacy code that looks like this,
///
....
List<Object[]> reportResults = new ArrayList<Object[]>();
reportResults = query.getResultList();
logger.info("reportResults ==== &...
0
votes
1
answer
3k
views
SPARK java.lang.ClassCastException: org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema cannot be cast
i am trying to use the agg function with type safe check ,i created a case class for the dataset and defined its schema
case class JosmSalesRecord(orderId: Long,
...
1
vote
0
answers
507
views
AvroParquetWriter - addLogicalTypeConversion not working as expected (using version parquet-avro 1.12.3) - causing ClassCastException
I am writing ResultSet to parquet file using AvroParquetWriter. One column in the ResultSet is java.sql.Timestamp. When writing, I get the exception :
java.sql.Timestamp cannot be cast to java.lang....
0
votes
1
answer
204
views
How can I debug this java.lang.ClassCastException that occurs when using an iterator?
I am trying to separate Passenger objects from an ArrayList into eight smaller lists. I am traversing the list of Passengers using iterator.
I have tried to use the iterator without explicitly casting ...
6
votes
1
answer
688
views
ClassCastException with Stacktrace Hazelcast version 4.2.5 using ReplicatedMap
Using Hazelcast version 4.2.5 in a webapp deployed on Tomcat on Kubernetes. We're frequently("every 5 seconds") seeing ClassCastException with a stacktrace in the application logs.
Here's ...