Received: (qmail 35620 invoked by uid 501); 6 Feb 2001 22:26:22 -0000 Message-Id: <20010206222622.35619.qmail@apache.org> Date: 6 Feb 2001 22:26:22 -0000 From: Ross Sargant Reply-To: rgsargan@engmail.uwaterloo.ca To: submit@bugz.apache.org Subject: Strange IncompatibleClassChangeError as a servlet exception X-Send-Pr-Version: 3.110 >Number: 7209 >Category: mod_jserv >Synopsis: Strange IncompatibleClassChangeError as a servlet exception >Confidential: no >Severity: serious >Priority: medium >Responsible: jserv >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Tue Feb 06 14:30:02 PST 2001 >Closed-Date: Tue Feb 06 16:47:36 PST 2001 >Last-Modified: Tue Feb 06 16:47:36 PST 2001 >Originator: rgsargan@engmail.uwaterloo.ca >Release: 1.3.14 >Organization: >Environment: Win32/NT 4.0 running Service Pack 5. Jserv version 1.1 >Description: I have class which is using the reflection API to dynamically create another class at runtime. The class which it creates is a subclass of an abstract class For example, a concrete class called "SomeInterface" extends public abstract class "ApplicationInterface". Here is the basic idea: try{ ClassDefinition cd= Class.forName("SomeInterface") ApplicationInterface tempInterface=(ApplicationInterface) cd.newInstance() }.... This works fine However, when I attempt to assign tempInterface to anything else.. such as: ApplicationInterface rootInterface=tempInterface; The servlet logs the following message: java.lang.IncompatibleClassChangeError at org.apache.jserv.JServConnection.processRequest(JServConnection.java:323) at org.apache.jserv.JServConnection.run(JServConnection.java:188) at java.lang.Thread.run(Thread.java:484) Oddly, no exception is caught inside the try block surrounding the original code, and execution actually continues fairly normally. Until at some point later where I attempt to access a local member variable that is null, even though it is absolutely impossible for it to be. One last thing worth noting is that I did NOT have this problem when the superclass was purely virtual and thus declared as an interface. The above code was identical. However,when I made some design changes to incorporate some common methods into the superclass and thus changed it to be an abstract class instead of an interface, the problem started. I have dug through everything I can find and found no help so Im submitting this as a bug.I have also tested the above code in a non servlet environment and I do not have that problem. The ClassChange exception does not occur. >How-To-Repeat: Test the same situation. Try creating an abstract class, one concrete implementation of it and use the reflecion Api to create an instance of the concrete class, referenced through the abstract class inside doGet... In fact, I think I will try that myself in the meantime. >Fix: Unfortunately no. >Release-Note: >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: jon@clearink.com State-Changed-When: Tue Feb 6 16:47:35 PST 2001 State-Changed-Why: Given that JServ is no longer in development, unless you provide a fix, don't hope for a solution from us. You may wish to ask the java-apache-users mailing list to see if anyone else has a solution. thanks, -jon >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]