classcastexception

java swing- escape key event causes classCastException in look and feel

Good morning everyone! I need your help! My application processes patient records. In the main frame user can open several internal frames. Each internal frame contains a tabbed pane and each tab created by the user contains a form where he can enter patient's data and a jtable where all added patients are shown. When the user clicks ...

Eclipse ClassCastException when trying to expand XML layout for Android

I am new to java, eclipse, and android development, so I may be missing something simple although I have checked basic stuff like spelling several times. Because there is no number picker control (such as that used in the date picker) in the public Android SDK, the conventional wisdom is to "clone and own" the control that exists in the...

java.lang.ClassCastException when casting Object-result of java.lang.reflect.Method.invoke

I load dynamically an external class from my eclipse rcp application with urlClassLoader. The invoke()-method returns an Object of self-defined Type. ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader cl = URLClassLoader.newInstance( url); Thread.currentThread().setContextClassLoader(cl); S...

Share interface classes using the same classloader on J2EE/Weblogic 10, without using the system classpath

Hi, I have a "framework" running on a Weblogic 10.0 (or 10.3) appserver, where the framework consists of multiple enterprise apps, each responsible for a different resource adapter. A client application gets deployed into the domain, uses JNDI to obtain reference to one of the resource adapter Connector classes, does its invocations and...

Need help understanding JNDI and a particular ClassCastException in J2EE

Hi! I have an enterprise application A and B deployed (in WLS 10.0). A is the "framework", B is a client app. The client issues the following calls: Object o = ctx.lookup(jndiName); // line 1 cf = (ConnectionFactory) o; // line 2 ConnectionFactory is an interface, defined as: public interface ConnectionFactory extends java.io.S...

Interpreting a JVM Class cast exception error message - what is the original type that can't be casted

I have a Java production system with IBM JVM running on Linux. A customer reports the following exception printed to the log: java.lang.ClassCastException: [B incompatible with java.lang.String When trying to cast the individual attributes returned from: javax.naming.directory.InitialDirContext(...) From this exception I can't figure ou...

ClassCastException when call local ejb3 from different classloader on Websphere 7

Hello, I have two ears, ear1 contains an ejb project and client, containing the interfaces (local). Ear2 contains a war that needs to call the ejb3 service. When I call the ejb service I am getting a classcastexception, I think because there are two classloaders involved here. Is there a clean way to achieve this? I'm working in RAD75 ...

Java, getting class cast exception where both classes are exactly the same

Hi, I am doing a JBoss SEAM project and when I view a form I get this error. java.lang.ClassCastException: it.cogitoweb.csi.entity.csiorelav.CsiTipoLav cannot be cast to it.cogitoweb.csi.entity.csiorelav.CsiTipoLav Its alway the same JPA class which is related to the form which is shown on the screen, it doesn't make sense to me why...

ClassCastException caused by bug in Just In Time ?

Given this piece of code : public static void writeFile(File file,List buffer)throws IOException{ File fic = new File(file.getCanonicalPath()); cat.debug("writing file : "+fic.getAbsolutePath()); FileOutputStream out = new FileOutputStream(fic); PrintStream ps = new PrintStream(out); for(int i=0;i<buffer.size();i++){...

java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl while starting the weblogic.

As part of our application we are using apache's xerces jaxp parser. When we deploy the application on weblogic 9.2, we are getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource [META-INF/cxf/cxf.xml]: Instanti...

How does one declare the type of an Android preference?

I have a preferences.xml that looks like this: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt; <EditTextPreference android:name="Sample" android:enabled="true" android:persistent="true" android:summary="Sample" android:defaultValue="3.0" android:title...

List to TreeSet conversion produces: "java.lang.ClassCastException: MyClass cannot be cast to java.lang.Comparable"

List<MyClass> myclassList = (List<MyClass>) rs.get(); TreeSet<MyClass> myclassSet = new TreeSet<MyClass>(myclassList); I don't understand why this code generates this: java.lang.ClassCastException: MyClass cannot be cast to java.lang.Comparable MyClass does not implement Comparable. I just want to use a Set to filter the unique ele...

Java Webservice java.lang.ClassCastException: org.apache.cxf.jaxws.ServiceImpl

I am using Maven, CXF 2.2.7, JBoss 4.2.3 and JRE 1.5 Updated I have a Webservice that I can see on the server by using the URL myURL/myService?wsdl I am trying to develop a web app to ping that webservice by calling this in my bean: MyWebService webservice = new MyWebService(); However, it dies and throws the following error, which i...

Java.lang.reflext.Proxy returning another proxy from invocation results in ClassCastException on assignment

So I'm playing with geotools and I thought I'd proxy one of their data-access classes and trace how it was being used in their code. I coded up a dynamic proxy and wrapped a FeatureSource (interface) in it and off it went happily. Then I wanted to look at some of the transitive objects returned by the featureSource as well, since the ma...

weblogic-10.3.2 + xfire-1.2.6 ClassCast exception

Unnable to deploy and start application on weblogic with xfire dependency lib wstx-asl-3.2.0.jar. Exception occurs: Caused by: java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory cannot be cast to javax.xml.stream.XMLInputFactory at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:137) at ...

ClassCastException with JDialog and Thread

I have a JDialog with a thread in it. It sporadically gives me a ClassCastException when the dialog is created (which means I can have succesful ones with no exception), and I have no clue to where it should occur. Here's a snippet of my JDialog class public class ConfirmExitDialog extends JDialog implements Runnable, ActionListen...

ClassCastException when creating an instance of a class using reflection and ClassLoaders.

Hi, First of all, this is Java 1.4 (project restrictions). I'm trying to create a application manager. It loads each application's main class using it's own instance of a custom classloader. After that, it creates an instance of the main class using reflection. Each application implements a common interface so after the instance is crea...

Broken Hibernate Save Method

I have the following method in my Java application's DAO layer: public void save(Employee emp) { System.out.println("emp type: " + emp.getClass().getName); getHibernateTemplate().save(emp); System.out.println("object saved!"); System.out.flush(); } The employee class does not extend from any other classes and has t...

ServiceRegistry constructor fails with ClassCastException on concrete class

Trying to use javax.imageio.spi.ServiceRegistry to dynamically register request processors for an HttpServlet: private static final Class PROVIDER_CLASS = IRequestProcessor.class; private void loadProviders() throws ClassNotFoundException { _serviceRegistry = new ServiceRegistry(ServiceRegistry.lookupProviders(PROVIDER_CLASS)); ...

quartz - java.lang.ClassCastException org.quartz.JobDetail cannot be cast to ScheduledJobDetail with JobStoreTX

I'm using quartz 1.6.5. I recently moved from Quartz Job Store from RamJobStore to org.quartz.impl.jdbcjobstore.JobStoreTX. Since this, I've started to see ClassCastException in my log whenever quartz tries to run a job. Jul 26, 2010 3:10:00 AM org.quartz.core.ErrorLogger schedulerError SEVERE: Job (group52.52 threw an exception. org....