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] [Commented] (OPENJPA-2403) Enhancer yields "does not have a public no-args constructor." exception for entity with protected qualified constructor
Date Thu, 11 Jul 2013 15:03:50 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13705894#comment-13705894
] 

Albert Lee commented on OPENJPA-2403:
-------------------------------------

Kunde() declaration is package qualifier; "The no-arg constructor must be public or protected"
qualified, so neither one of these requirement.
                
> 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
>         Attachments: OPENJPA-2403.patch
>
>
> 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