openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OPENJPA-2403) Enhancer yields "does not have a public no-args constructor." exception for entity with protected qualified constructor
Date Wed, 19 Jun 2013 21:52:20 GMT
Albert Lee created OPENJPA-2403:
-----------------------------------

             Summary: Enhancer yields "does not have a public no-args constructor." exception
for entity with protected qualified constructor
                 Key: OPENJPA-2403
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2403
             Project: OpenJPA
          Issue Type: Bug
          Components: Enhance
    Affects Versions: 2.0.3, 2.1.2, 2.3.0, 2.2.3
            Reporter: Albert Lee
            Assignee: Albert Lee


Entity with protected qualified constructor:

@Entity 
public class Kunde {
    ....
	protected Kunde() {
		// jpa constructor
	}
    ....
}

causes enhancer to fail with message like:

C:\>wsenhancer test\Kun*.class
82  ConstructorDemoWeb  INFO   [main] openjpa.Tool - Enhancer running on type "class at.arz.domain.core.Kunde".
Exception in thread "main" <openjpa-2.2.3-SNAPSHOT-r422266:1485013 fatal user error>
org.apache.openjpa.util.MetaDataException: The id class "class test.Kundennummer"
 specified by type "class test.Kunde" does not have a public no-args constructor.
        at org.apache.openjpa.meta.ClassMetaData.validateAppIdClassMethods(ClassMetaData.java:2161)
        at org.apache.openjpa.meta.ClassMetaData.validateAppIdClass(ClassMetaData.java:2067)
        at org.apache.openjpa.meta.ClassMetaData.validateIdentity(ClassMetaData.java:2034)
        at org.apache.openjpa.meta.ClassMetaData.validateMeta(ClassMetaData.java:1946)
        at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1807)
        at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:828)
        at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:725)
        at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:649)
        at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:417)
        at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:388)
        at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:286)
        at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4885)
        at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4831)
        at org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4801)
        at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:761)
        at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:751)
        at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4796)
        at org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:4787)
Caused by: java.lang.NoSuchMethodException: test.Kundennummer.<init>()
        at java.lang.Class.throwNoSuchMethodException(Class.java:327)
        at java.lang.Class.getConstructor(Class.java:354)
        at org.apache.openjpa.meta.ClassMetaData.validateAppIdClassMethods(ClassMetaData.java:2159)
        ... 17 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message