openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leon Noordermeer (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-721) ClassFormatError occurs when method name is wrong
Date Thu, 11 Sep 2008 15:29:47 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Leon Noordermeer updated OPENJPA-721:
-------------------------------------

    Description: 
A ClassFormatError occures when the case of a referenced method in an orm file is incorrect.


I imagine this error could be handled a bit more gracefull with a more informative error message.
(this one took me 6 hrs to solve). I guess it should be handled the same as when the reference
to the method can not be found.

example of foo-orm.xml:

<entity class="Foo">
        <table name="FOO" />
        <attributes>
            <id name="FooId"> <!-- should be fooId -->
                <column name="FOO_ID" />
            </id>
        </attributes>
    </entity>


example of Foo.java:

package model;

public class Foo  {
    public Long fooId;

    public Foo() {
    }

    public Long getFooId() {
        return fooId;
    }

    public void setFooId(Long fooId) {
        this.fooId = fooId;
    }
}


The error will look like this:

java.lang.ClassFormatError: Repetitive method name/signature in class file com/aciworldwide/tm/configmodule/model/SecretKey
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1326)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:242)
	at org.apache.openjpa.meta.MetaDataRepository.classForName(MetaDataRepository.java:1298)
	at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(MetaDataRepository.java:1280)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:276)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
etc...


  was:
A ClassFormatError occures when the case of a referenced method in an orm file is incorrect.


I imagine this error could be handled a bit more gracefull with a more informative error message.
(this one took me 6 hrs to solve). I guess it should be handled the same as when the reference
to the method can not be found.

example of foo-orm.xml:

<entity class="Foo">
        <table name="FOO" />
        <attributes>
            <id name="FooId"> <!-- should be fooId -->
                <column name="FOO_ID" />
            </id>
        </attributes>
    </entity>


example of Foo.java:

package model;

public class Foo  {
    public Long fooId;

    public Foor() {
    }

    public Long getFooId() {
        return fooId;
    }

    public void setFooId(Long fooId) {
        this.fooId = fooId;
    }
}


The error will look like this:

java.lang.ClassFormatError: Repetitive method name/signature in class file com/aciworldwide/tm/configmodule/model/SecretKey
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1326)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:242)
	at org.apache.openjpa.meta.MetaDataRepository.classForName(MetaDataRepository.java:1298)
	at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(MetaDataRepository.java:1280)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:276)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
etc...



> ClassFormatError occurs when method name is wrong
> -------------------------------------------------
>
>                 Key: OPENJPA-721
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-721
>             Project: OpenJPA
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>         Environment: Windows, Tomcat 5.5, Spring tomcat weaving 2.05, Oracle 10g
>            Reporter: Leon Noordermeer
>            Priority: Minor
>
> A ClassFormatError occures when the case of a referenced method in an orm file is incorrect.

> I imagine this error could be handled a bit more gracefull with a more informative error
message. (this one took me 6 hrs to solve). I guess it should be handled the same as when
the reference to the method can not be found.
> example of foo-orm.xml:
> <entity class="Foo">
>         <table name="FOO" />
>         <attributes>
>             <id name="FooId"> <!-- should be fooId -->
>                 <column name="FOO_ID" />
>             </id>
>         </attributes>
>     </entity>
> example of Foo.java:
> package model;
> public class Foo  {
>     public Long fooId;
>     public Foo() {
>     }
>     public Long getFooId() {
>         return fooId;
>     }
>     public void setFooId(Long fooId) {
>         this.fooId = fooId;
>     }
> }
> The error will look like this:
> java.lang.ClassFormatError: Repetitive method name/signature in class file com/aciworldwide/tm/configmodule/model/SecretKey
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> 	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
> 	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)
> 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1326)
> 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
> 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:242)
> 	at org.apache.openjpa.meta.MetaDataRepository.classForName(MetaDataRepository.java:1298)
> 	at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(MetaDataRepository.java:1280)
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:276)
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
> 	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
> etc...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message