InvalidClassException: JComponent; local class incompatible - JVM Version?

Iam having trouble deserializing some old objects.
My object header is
public class SoundMatrix extends AbstractTableModel implements Serializable
So i happend to save some swing components :(
Now i got the problem of deserializing them again. What can i do to recover the data?
The serialVersionUID is the same, none has changed.
java.io.InvalidClassException: javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = -2514362798440941654, local class serialVersionUID = -1030230214076481435
     at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
     at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
     at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
     at javax.swing.event.EventListenerList.readObject(EventListenerList.java:255)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
     at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
     at dk.tigermedia.Prog.main(Prog.java:119)
I guess its a JVM Versioning problem, the version may have changed over time, the application have been used.
I know the problem is, that i have serialized Swing objects- the docs even warn against this. Great :)
Can i see which version was used to make the files? Can take control over the deserializing process?
Tryed overwriting the readObject - but it dont seem to get that far.
Any help is much appreciated. Thanks.

Update versions don't matter, just 1.3, 1.4, 1.5 etc.
You don't need to recompile except backwards, e.g. if you're using JDK 1.3 you need binaries produced by 1.3 or with -target 1.3. But I'd advocate writing a new mini application for this conversion task, using 1.3 or whatever the JDK version actually was when the data was serialized.
You also need to inform management about this debacle and the reasons for it. The warnings about serialization-incompatibility of Swing classes have been right there in the Javadoc since the beginning. No competent IT professional should have perpetrated this act. Make sure it doesn't happen again.

Similar Messages

  • Local class incompatible: stream classdesc serialVersionUID

    The following code is being executed from the configFile class:
    if(configFileIn != null)
    try
    ourConfigItemsAL = (ArrayList)alInObjectStream.readObject();
    catch(Exception e)
    configIsValid = false;
    System.out.println("Error: Can't read (readObject ourConfigItemsAL) from \"" + theFileName + "\". (" + e.toString() + ")");
    configItemsAL = theDefList;
    I get the following error when trying to run. It worked with an older version of the jre.
    Creating new NewConfigFile object.
    About to read configuration from "c:/Program Files/HearingRecorder/HearingRecorder.cfg" file.
    Error: Can't read (readObject ourConfigItemsAL) from "c:/Program Files/HearingRecorder/HearingRecorder.cfg". (java.io.InvalidClassException: javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = -7908749299918704233, local class serialVersionUID = 7917968344860800289)
    java.lang.ExceptionInInitializerError
    Caused by: java.lang.NullPointerException
         at HearingRecorder.ConfigFile.readConfig(ConfigFile.java:150)
         at HearingRecorder.ConfigFile.<init>(ConfigFile.java:92)
         at HearingRecorder.HearingRecorder.<clinit>(HearingRecorder.java:4462)
    Exception in thread "main"

    The Java TutorialEssential Java Classes I/O: Object Serialization
    Lightweight persistence--the archival of an object for use in a later invocation of the same program.
    Serlization does not play nice between VM versions. It tells you this in the APIs for JComponent
    Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

  • Java.io.InvalidClassException: org.eclipse.persistence.internal.indirection.DatabaseValueHolder; local class incompatible: stream classdesc serialVersionUID = -6893195210780291759, local class serialVersionUID = 1128857921468654749

    Hi,
    I recently create a webservice application.
    It work fine when the server is implemented as java application. But when rewritten as web application( *.war),  the deploiement work on WLS.
    However it throws java.io.InvalidClassException: org.eclipse.persistence.internal.indirection.DatabaseValueHolder; local class incompatible: stream classdesc serialVersionUID = -6893195210780291759, local class serialVersionUID = 1128857921468654749 error when the client start consumming the web service methods.
    I add both eclipselink-javax.persistence-2.0.jar and eclipselink-2.0.2.jar(which are also used in the server side) in $WL_HOME/wlserver_10.3/common/deployable-libraries, that doesn't solve the problem yet.
    Any help will be appreciated, cheers.

    Abenk,
    This looks like a serial version mismatch due to multiple Eclipselink.jar files. Check if you have any under server/internal/ext folder.
    What are you putting in your classpath? Is there a "jrf.jar" and is it getting picked up first? Does this Jrf.jar have an entry of Eclipselink jar?
    Try to check the classpath of the jars used by Weblogic and remove any redundant Eclipselink/Toplink jars.
    What is the complete version of your Weblogic Server ?

  • Java.io.InvalidClassException:local class incompatible?

    hello everyone:
    I deploy a J2EE application called A in a weblogic domain called A, it can run correctly;
    then I deploy another J2EE application called B, which is a new edition of A, in another weblogic domain called B, it can also run correctly;
    The two domains use the same server. I don't know whether this will cause problems like this.
    But the previous A can't run correctly and throw exceptions as follows in Java Console:
    java.io.InvalidClassException: com.longzhou.oa.docnet.dto.abstractdto.DnBaseRole; local class incompatible: stream classdesc serialVersionUID = 1264764439065723117, local class serialVersionUID = -6834466395328850197
         at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at com.longzhou.oa.applet.util.EjbLocator.getInputStream(EjbLocator.java:18)
         at com.longzhou.oa.applet.DnIO.getDnAllByID(DnIO.java:63)
         at com.longzhou.oa.applet.DnIO.loadGraph(DnIO.java:33)
         at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:185)
         at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
         at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
         at org.enhydra.jawe.JaWE.init(JaWE.java:195)
         at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
         at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
         at com.longzhou.oa.applet.DnIO.getDnFromDto(DnIO.java:731)
         at com.longzhou.oa.applet.DnIO.loadGraph(DnIO.java:34)
         at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:185)
         at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
         at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
         at org.enhydra.jawe.JaWE.init(JaWE.java:195)
         at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
         at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Object
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at com.longzhou.oa.applet.util.EjbLocator.getInputStream(EjbLocator.java:18)
         at com.longzhou.oa.applet.InitModel.initEmpGroupList(InitModel.java:353)
         at org.enhydra.jawe.DnDefine._$1(Unknown Source:241)
         at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:186)
         at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
         at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
         at org.enhydra.jawe.JaWE.init(JaWE.java:195)
         at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
         at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.NotSerializableException: java.lang.Object
         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
         at java.io.ObjectOutputStream.writeObject(Unknown Source)
         at com.longzhou.oa.util.EgovServlet.service(EgovServlet.java:332)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
         at java.lang.Thread.startThreadFromVM(Unknown Source)
    java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Object
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at com.longzhou.oa.applet.util.EjbLocator.getInputStream(EjbLocator.java:18)
         at com.longzhou.oa.applet.InitModel.initSysRoleList(InitModel.java:371)
         at org.enhydra.jawe.DnDefine._$1(Unknown Source:242)
         at org.enhydra.jawe.DnDefine.loadDn(Unknown Source:186)
         at org.enhydra.jawe.AbstractEditor.<init>(Unknown Source:130)
         at org.enhydra.jawe.PackageEditor.<init>(PackageEditor.java:60)
         at org.enhydra.jawe.JaWE.init(JaWE.java:195)
         at org.enhydra.jawe.DnApplet.jbInit(DnApplet.java:67)
         at org.enhydra.jawe.DnApplet.init(DnApplet.java:54)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.NotSerializableException: java.lang.Object
         at java.io.ObjectOutputStream.writeObject0(Unknown Source)
         at java.io.ObjectOutputStream.writeObject(Unknown Source)
         at com.longzhou.oa.util.EgovServlet.service(EgovServlet.java:332)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
         at java.lang.Thread.startThreadFromVM(Unknown Source)
    Can anyone tell me the reason? Thanks

    "local class incompatible" error is due to the retrieving of serialized object, which might be dumping from memory to somewhere like database, file etc., that is of different edition of the class. Maybe an object A of AClass was stored in a database and lately the AClass changed to a new edition, let's call it A'Class, and they have something different, especially the serialVersionUID field. When the object A is retrieved from the database, which should be compatible with A'Class (be ware of that A'Class and AClass has the same name but of different edition), unfortunately, they don't, the error mentioned above occurs.
    So, I guess that although the app A and B uses different domain, if they uses the same database to store and retrieve something (here may refers to objects) of different edition and are run one after another, the compatible issues are going to occur.
    Separating app A from B as much as possible is not a good solution, but you could have a try.
    Hoping helpful, good luck!

  • Ava.io.InvalidClassException: local class incompatible: stream classdesc

    Hi,
    When I am testing a scnerio in my application, I am getting the following error. When I am trying to do again, I am not getting this error. Basically when first time serializable object creation, I am getting this error I guess. Pls reply as its really disturbs our application in Production.
    22 Apr 2005 14:27:12,442 ERROR [service-j2ee] model.TopsFileManager - java.io.InvalidClassException: com.gepower.gees.tops.data.JobCtxtMgr; local class incompatible: stream classdesc serialVersionUID = 7011266017804180214, local class serialVersionUID = 1299119170608910687
    java.io.InvalidClassException: com.gepower.gees.tops.data.JobCtxtMgr; local class incompatible: stream classdesc serialVersionUID = 7011266017804180214, local class serialVersionUID = 1299119170608910687
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    at com.gepower.gees.tops.model.TopsFileManager.getValue(TopsFileManager.java:159)
    at com.gepower.gees.tops.control.PlanJobAssocCtrl.process(PlanJobAssocCtrl.java:181)
    at com.gepower.gees.tops.control.LeafCommand.perform(LeafCommand.java:93)
    at com.ge.dialect.cb.DefaultController.processInteraction(DefaultController.java:790)
    at com.ge.dialect.cb.DefaultController.handleInteraction(DefaultController.java:607)
    at com.ge.dialect.cb.DefaultController.service(DefaultController.java:490)
    at com.ge.casper.servlet.CasperServlet.service(CasperServlet.java:231)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:309)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    22 Apr 2005 14:27:12,445 ERROR [service-j2ee] control.ProcessJobCtrl - com.gepower.gees.tops.data.JobCtxtMgr; local class incompatible: stream classdesc serialVersionUID = 7011266017804180214, local class serialVersionUID = 1299119170608910687
    Thanks in advance

    Hello
    I am using Netbeans5.5, JBoss 4.0.4 with hibernate3. I have a simple Entity bean (UserProfile), which i mapped from the database table.
    In the session bean, i am using EntityManager to find my Entity bean i.e. UserProfile. But i am getting the following exception:
    java.rmi.MarshalException: Failed to communicate.  Problem during marshalling/unmarshalling; nested exception is:
            java.io.InvalidClassException: org.hibernate.collection.PersistentBag; local class incompatible: stream classdesc serialVersionUID = -992182677146982163, local class serialVersionUID = 2819117614876030537
            at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:306)
            at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
            at org.jboss.remoting.Client.invoke(Client.java:525)
            at org.jboss.remoting.Client.invoke(Client.java:488)
            at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:78)
            at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProxy.java:133)
            at $Proxy1.findUser(Unknown Source)
            at anapro.Main.main(Main.java:34)
    Caused by: java.io.InvalidClassException: org.hibernate.collection.PersistentBag; local class incompatible: stream classdesc serialVersionUID = -992182677146982163, local class serialVersionUID = 2819117614876030537
            at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
            at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
            at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
            at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
            at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1753)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1711)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
            at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
            at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
            at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
            at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
            at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
            ... 14 moreSince netbeans creates an EJB module and a client module, I have added hibernate-entitymanager.jar to the class path of both the client and ejb module but this exception exists. can anyone please help me in this?
    thanks

  • Oracle.jbo.domain.Number; local class incompatible

    Hi Forum,
    Development Tool     : Jdeveloper 9.0.4 (part of Oracle 10g Suite)
    Target Application Summary:
    A simple application which displays the content of a database table and allows it to be modified both through a web interface as well as a Swing standalone client.
    A Workspace having three projects:
    1) A Business layer defined by using BC4J(Business Components For Java) provided with Jdeveloper 10g.
    2) A Swing/JClient application for BC4J which accesses the BCJ4 layer using a Business component client data model.
    3)A JSP application using JSP for business components which accesses the BC4j layer
    Target Deployment:
    1) Light-weight swing interface at machine 1
    2) Business components and JSP part in an application server on Machine 2
    3) Oracle DB on Machine3
    Problem Statement
    We deployed the BC4J Middle tier on OC4J standalone as a session bean. Then the client jar was deployed as a remote application(using Swing/JClient for business componments), the following error comes:
    (oracle.jbo.PiggybackException) JBO-28300: Piggyback read error
    ----- LEVEL 1: DETAIL 0 -----
    (java.io.InvalidClassException) oracle.jbo.domain.Number; local class incompatible: stream classdesc serialVersionUID = -6507359405709672486, local class serialVersionUID = -592084144037230518
    Can the forum help me with the problem (i am using the library BC4JOracleDomains which has oracle.jbo.domain.Number class)
    Thanking you in advance.

    Firstly, good job on describing your problem/situation. Some people just don't bother to be verbose.
    Secondly, I have to note that I don't do any development in this way so I have no 1st hand experience with this excpetion. But, it appears as though you are using different versions of the jar files (which in turn contain different versions of the classes). Maybe you should take a look at that?

  • Oracle.jdbc.pool.OracleDataSource; local class incompatible

    I want to place a DataSource in a InitialContext with the following code
    public void getEnvironment() throws Exception{ try{ System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); /*System.setProperty(Context.PROVIDER_URL, "t3://127.0.0.1:7001"); System.setProperty(Context.SECURITY_PRINCIPAL, "weblogic"); System.setProperty(Context.SECURITY_CREDENTIALS, "password");*/ InitialContext ic = new InitialContext(); ic.createSubcontext("java:"); ic.createSubcontext("java:/comp"); ic.createSubcontext("java:/comp/env"); ic.createSubcontext("java:/comp/env/jdbc"); // Construcvt Datasource OracleConnectionPoolDataSource ds = new OracleConnectionPoolDataSource(); ds.setURL("jdbc:oracle:thin:@cdcehr29:14985"); ds.setUser("user"); ds.setPassword("pwd"); //Connection conn = ds.getConnection(); ic.bind("java:/comp/env/jdbc/test", ds); System.out.println("see?"); Context envIc = (Context) ic.lookup("java:/comp/env"); envIc.bind("THIS_SERVICE_CD", ""); envIc.bind("THIS_SERVICE_VER", ""); envIc.bind("SERVICE_DATA_SOURCE_JNDI", "jdbc/test"); envIc.bind("ALS_PROJECT_CD", ""); envIc.bind("ALS_SYSTEM_CD", ""); envIc.bind("EHR_CONFIG_DATA_SOURCE_JNDI", ""); envIc.bind("SGR_PATH", ""); envIc.bind("AUDIT_TABLE_NAME", ""); envIc.bind("DEBUG_TABLE_NAME", ""); }catch(NamingException ex){ ex.printStackTrace(); }catch(Exception ex){ ex.printStackTrace(); } }
    but the following error is shown (but not catch in catch block, very strange)
    >
    <Jun 26, 2012 6:17:02 PM CST> <Error> <RJVM> <BEA-000503> <Incoming message header or abbreviation processing failed
    java.io.InvalidClassException: oracle.jdbc.pool.OracleDataSource; local class incompatible: stream classdesc serialVersionUID = 8680830911645568991, local class serialVersionUID = 3349652938965166731
    java.io.InvalidClassException: oracle.jdbc.pool.OracleDataSource; local class incompatible: stream classdesc serialVersionUID = 8680830911645568991, local class serialVersionUID = 3349652938965166731
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    Truncated. see log file for complete stacktrace
    >
    what is the problem come from?

    >
    but the following error is shown (but not catch in catch block, very strange)
    >
    <Jun 26, 2012 6:17:02 PM CST> <Error> <RJVM> <BEA-000503> <Incoming message header or abbreviation processing failed
    java.io.InvalidClassException: oracle.jdbc.pool.OracleDataSource; local class incompatible: stream classdesc serialVersionUID = 8680830911645568991, local class serialVersionUID = 3349652938965166731
    java.io.InvalidClassException: oracle.jdbc.pool.OracleDataSource; local class incompatible: stream classdesc serialVersionUID = 8680830911645568991, local class serialVersionUID = 3349652938965166731
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    Truncated. see log file for complete stacktrace
    what is the problem come from?
    >
    You didn't post the part of the stacktrace that shows the line number that the problem occured on. (Truncated. see log file for complete stacktrace)
    Are you sure the problem occured in the code you posted? If so did this line execute and print on the console?
    System.out.println("see?");That error can occur when the code used to deserialize an object uses a different version of the class than the version it was serialized with. The code you posted doesn't shown anything that appears to do any deserialization.
    Have their been any changes to the environment lately? Upgrades to Java version, WebLogic or the JDBC driver?

  • Help!:  local class incompatible exception

    Hi!, im new in the ejb tech, I'm using jboss 3.2.3, windows 2000, j2ee 1.4 and jdk 1.4.1.
    I already deploy the ejb in the app server, but at the Context.lookup statement from the client i get a local class incompatible exception!!, could anyone help me with this??? the client and the ejb are running in different machines, but the classes are the same ( I map the network drive and put it in my classpath to ensure im using the same classes with the same serial uid).
    Thanks a lot!!!
    The complete Stack trace is
    javax.naming.CommunicationException. Root exception is java.io.InvalidClassException: org.jboss.proxy.ejb.GenericEJBInterceptor; local class incompatible: stream classdesc serialVersionUID = 3844706474734439975, local class serialVersionUID = 4582256576523491346
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:459)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:104)

    Sorry, i already found the problem!!! . I was running the client within the forte 4 ee ide, and it seems that forte assigns the objects their own serial uid. When I execute the client from a terminal, it executes ok =)

  • Local class incompatible: different serialVersionUID

    Hi!
    I wrote an Object of type X to a file (in the server) and am sending the file to a client. This is done using:
    FileOutputStream fo = new FileOutputStream (filename);
    ObjectOutputStream so = new ObjectOutputStream (fo);
    so.writeObject(x); //x is of Object type X
    so.flush();
    so.close();
    fo.close();
    The file 'filename' is sent to the client and I read it as follows:
    FileInputStream in = new FileInputStream(filename);
    ObjectInputStream s = new ObjectInputStream(in);
    xobject = (X) x.readObject(); //xobject is of Object type X
    This is throwing an error as follows:
    java.util.Vector; local class incompatible:stream classdesc serialVersionUID = -2804478835259887871, local class serialVersionUID = -2767605614048989439
    Can anyone tell me what to do to be able to type cast the object and use it? I did go thro' some @serial documentation, but, couldn't understand it.
    Please help,
    Thanks,
    x86

    ...or, alternatively, maintain the X class in one package, the one where your server-side classes are compiled, say, and import it into the second, client side source code, which presumably lives in a separate package or this problem probably wouldn't have come up. The goal is never to have more than one copy of the compiled class file.
    You may have to modify your classpath.
    Hi!
    I wrote an Object of type X to a file (in theserver)
    and am sending the file to a client. This is done
    using:
    <snip>
    >
    This is throwing an error as follows:
    java.util.Vector; local class incompatible:stream
    classdesc serialVersionUID = -2804478835259887871,
    local class serialVersionUID = -2767605614048989439Hi
    try using one copy of the compiled class for the
    server
    and the client, I had this happen many times until I
    figured out
    the server compiled its version of the serialiable
    class and the client compiled its version of the
    serialiable class,
    then got class incompatable exceptions..among others
    easy way around this is to compile the code of botht
    he client and server, then copy the class code across
    to the client side
    Boris

  • InvalidClassException ImageIcon.$AccessibleImageIcon class incompatible

    Greetings,
    I cannot seem to find a solution for this problem, so I am turning to you - your help is greatly appreciated.
    Below is a snippet of some legacy code that has been deployed in an app running JRE 1.4.2.
    class NodeImage implements Serializable {
        final static long serialVersionUID = 2606889903904458364L;
        public Dimension dim;
        public transient Image img;
        public ImageIcon ii; //VERY PROBLEMATIC NOW!!!!
        public String name;
        public String description;
      }Now, with the application having been modified and upgraded to run on JRE 1.5.0, old serialized objects can no longer be read into the above class, because the ImageIcon.$AccessibleImageIcon serialVersionUID has changed. The exception being thrown is as follows:
    java.io.InvalidClassException: javax.swing.ImageIcon$AccessibleImageIcon;
    local class incompatible: stream classdesc serialVersionUID = -3994512798706967451,
    local class serialVersionUID = -1903458698681874148
            at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
            at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
            at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:468)
            at javax.swing.ImageIcon.readObject(ImageIcon.java:389)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            ...The object has no explicit readObject or writeObject methods.
    I have tried a variety of things - e.g. writing a new readObject method, and using java.io.ObjectInputStream.GetField fields = in.readFields(); but I cannot seem to find a way to read the offending field without the exception being thrown and the rest of the read process aborted.
    Is there ANY way around this?
    I don't care if the end result makes the ImageIcon ii field null. But because this is just one object in a serialized hierarchy, I just want to be able to get the dim, name, and description attributes and then continue loading the remainder of the object hierarchy.
    Thanks in advance for your help! Any insight would be great.
    .

    Your developers should have read the warning in the javadoc for javax.swing.ImageIcon before serializing ImageIcons across JDK versions.
    You may have to use JDK 1.4 to read these streams and write them out again using something other than classes with this warning when they occur.
    The only other thing I can suggest is a custom readObject method which doesn't call defaultReadObject() and instead picks apart the serialization protocol itself for the offending class(es), calling readObject() for all non-offending members.

  • Incompatible Xalan version in IDE class path?  (Max OS X Leopard)

    Hi all,
    I have been using NetBeans 6.1 for a while and all was well. I then installed a few plug-ins (including iReport, which I believe may be the problem). When I start the IDE I get the error "Incompatible Xalan version found in IDE class phat" and gives some link that didn't help. I have uninstalled NetBeans and reinstalled, which obviously didn't fix the problem. If anybody can help me at all, I would appreciate it very much. I really need this to run, I would hate to completely reinstall the OS to get it back going. Thanks in advance for any support.
    Edited by: JavaChip on Jul 7, 2008 4:32 PM

    Hi,
    I encountered this problem today and I'm also using Netbeans 6.1 on Mac OS X (10.5.4). It was definitely the iReports plugin. I found a solution here:
    [http://blogs.sun.com/geertjan/entry/analyzing_the_jasperreports_visual_designer]
    However, I only had to remove the file xalan.jar (and keep xalan-2.7.0.jar) from the ~/.netbeans/6.1/modules/ext directory. No changes to the config were required and the iReport plugin worked.
    Edited by: d_herb on Aug 5, 2008 7:45 AM

  • Javax.ejb.EJBException; Local class not compatible ???????

    Hi,
    Can you any one help me to resolve this exception below. The conext is I
    have successfully deplyed a bean and when i call the bean remot method I am
    getting the following exception.
    Can you any one help me in what situations we will get this type of
    exception. I am using jdk1.3
    Thanks
    Kumar
    *************** EXCEPTIN IS BELOW *****************************
    PayDateRespondRequestBean lookup successful
    creating session bean instance
    Calling operation operation
    java.io.InvalidClassException: javax.ejb.EJBException; Local class not
    compatible: stream classdesc serialVersionUID=-9219910240172116449 local
    class serialVers
    ionUID=796770993296843510
    at
    java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:523)
    at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)
    at
    java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
    at
    weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:29)
    at
    java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1212)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
    at
    weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:66)
    at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:38)
    at
    weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
    ava:175)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
    ava:154)
    at
    weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
    at
    weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
    at
    weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
    at
    weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
    creating response stream ] - with nested exception:
    [java.io.InvalidClassException: javax.ejb.EJBException; Local class not
    compatible: stream classdesc serialVersionUID=-9219910240172116449 local
    class serialVersionUID=796770993296843510]
    at
    weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
    ava:184)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
    ava:154)
    at
    weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
    at
    weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
    at
    weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
    at
    weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Error accessing PayDateRespondRequest bean
    weblogic.rjvm.PeerGoneException: ; nested exception is:
    weblogic.utils.NestedException: ***** ASSERTION FAILED
    ****[ Exception
    creating response stream ] - with nested exception:
    [weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
    creating
    response stream ] - with nested exception:

    Yes, this solved my problem. I was having two versions of javax.ejb package.
    --Sajith
    "Nils Winkler" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    it looks like you have two different versions of the same class in the
    classpath. Your client is expecting version A, but the server is
    returning an instance of version B. Make sure that you only have one
    version of the class in your classpath. If you're starting the client as
    a separate app, also make sure that it's using the same classes as the
    server.
    Hope that helps,
    Nils
    Sajith wrote:
    Hi,
    Can you any one help me to resolve this exception below. The conext is I
    have successfully deplyed a bean and when i call the bean remot method I
    am
    getting the following exception.
    Can you any one help me in what situations we will get this type of
    exception. I am using jdk1.3
    Thanks
    Kumar
    *************** EXCEPTIN IS BELOW *****************************
    PayDateRespondRequestBean lookup successful
    creating session bean instance
    Calling operation operation
    java.io.InvalidClassException: javax.ejb.EJBException; Local class not
    compatible: stream classdesc serialVersionUID=-9219910240172116449 local
    class serialVers
    ionUID=796770993296843510
    at
    java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:523)
    atjava.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)
    at
    java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
    atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
    atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
    at
    weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:29)
    at
    java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1212)
    atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
    atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
    at
    weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:66)
    at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:38)
    at
    weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
    ava:175)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
    ava:154)
    at
    weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
    at
    weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
    at
    weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
    at
    weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
    creating response stream ] - with nested exception:
    [java.io.InvalidClassException: javax.ejb.EJBException; Local class not
    compatible: stream classdesc serialVersionUID=-9219910240172116449 local
    class serialVersionUID=796770993296843510]
    at
    weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
    ava:184)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
    ava:154)
    at
    weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
    at
    weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
    at
    weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
    at
    weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
    at
    weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Error accessing PayDateRespondRequest bean
    weblogic.rjvm.PeerGoneException: ; nested exception is:
    weblogic.utils.NestedException: ***** ASSERTION FAILED
    ****[ Exception
    creating response stream ] - with nested exception:
    [weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
    creating
    response stream ] - with nested exception:--
    ============================
    [email protected]

  • Applets and local classes

    Hi
    I have recently had to do some applet redevelopment because of some security changes introduced in jdk1.5. In the old install of the application some files were copied from the install cd to the users jvm\classes folder. These files were then used from the applet when it was downloaded from the web server. I now want to include some of these files in the jar file that contains the applet rather than use the local version installed on the users machine. The JVM seems to pick up the local classes before the ones contained in the jar. Is this by design ? or has anyone seen similar behaviour ?
    Thanks
    Paul

    There is a seporate applet forum here.
    My guess is because you are using the depreciated applet tag the applet is run with the
    msjvm. This is version 1.1.2 and eaven when it can read the class file it does not support
    swing (since 1.2 I think).
    First of all try to use the object tag
    http://java.sun.com/products/plugin/versions.html
    http://forum.java.sun.com/thread.jspa?threadID=455931&messageID=2079929
    If it still doesn't work check if code and codebase are correct:
    http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html (works the same for object
    as for applet)
    If it still doesn't work try to inspect the full trace:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)

  • Custom class loader and local class accessing local variable

    I have written my own class loader to solve a specific problem. It
    seemed to work very well, but then I started noticing strange errors in
    the log output. Here is an example. Some of the names are in Norwegian,
    but they are not important to this discussion. JavaNotis.Oppstart is the
    name of my class loader class.
    java.lang.ClassFormatError: JavaNotis/SendMeldingDialog$1 (Illegal
    variable name " val$indeks")
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:431)
    at JavaNotis.Oppstart.findClass(Oppstart.java:193)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at JavaNotis.SendMeldingDialog.init(SendMeldingDialog.java:78)
    at JavaNotis.SendMeldingDialog.<init>(SendMeldingDialog.java:54)
    at JavaNotis.Notistavle.sendMelding(Notistavle.java:542)
    at JavaNotis.Notistavle.access$900(Notistavle.java:59)
    at JavaNotis.Notistavle$27.actionPerformed(Notistavle.java:427)
    JavaNotis/SendMeldingDialog$1 is a local class in the method
    JavaNotis.SendMeldingDialog.init, and it's accessing a final local
    variable named indeks. The compiler automatically turns this into a
    variable in the inner class called val$indeks. But look at the error
    message, there is an extra space in front of the variable name.
    This error doesn't occur when I don't use my custom class loader and
    instead load the classes through the default class loader in the JVM.
    Here is my class loading code. Is there something wrong with it?
    Again some Norwegian words, but it should still be understandable I hope.
         protected Class findClass(String name) throws ClassNotFoundException
             byte[] b = loadClassData(name);
             return defineClass(name, b, 0, b.length);
         private byte[] loadClassData(String name) throws ClassNotFoundException
             ByteArrayOutputStream ut = null;
             InputStream inn = null;
             try
                 JarEntry klasse = arkiv.getJarEntry(name.replace('.', '/')
    + ".class");
                 if (klasse == null)
                    throw new ClassNotFoundException("Finner ikke klassen "
    + NOTISKLASSE);
                 inn = arkiv.getInputStream(klasse);
                 ut = new ByteArrayOutputStream(inn.available());
                 byte[] kode = new byte[4096];
                 int antall = inn.read(kode);
                 while (antall > 0)
                     ut.write(kode, 0, antall);
                     antall = inn.read(kode);
                 return ut.toByteArray();
             catch (IOException ioe)
                 throw new RuntimeException(ioe.getMessage());
             finally
                 try
                    if (inn != null)
                       inn.close();
                    if (ut != null)
                       ut.close();
                 catch (IOException ioe)
         }I hope somebody can help. :-)
    Regards,
    Knut St�re

    I'm not quite sure how Java handles local classes defined within a method, but from this example it seems as if the local class isn't loaded until it is actually needed, that is when the method is called, which seems like a good thing to me.
    The parent class is already loaded as you can see. It is the loading of the inner class that fails.
    But maybe there is something I've forgotten in my loading code? I know in the "early days" you had to do a lot more to load a class, but I think all that is taken care of by the superclass of my classloader now. All I have to do is provide the raw data of the class. Isn't it so?

  • How to set JDeveloper JVM version

    Can you please let me know how to set JDeveloper JVM version?

    I'm going to assume you mean you want to "compile against"?
    in menu ->Application->progject properties -> Compiler->use custom settings->customer setting->change JDK Version Compatability by selecting the source and class files to be used and generated respectively.
    use "Helpful" or "Correct" to give points, else let us know you need some more help

Maybe you are looking for