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

Freeman Fang commented on CXFXJC-34:
------------------------------------

I believe this is the same root cause as
CXF-7998

And actually this is a jaxb 2.3.x bug, which is fixed by 
https://github.com/eclipse-ee4j/jaxb-ri/issues/1287
and we need to wait for a new jaxb(2.3.3) release which would contain this fix.

Freeman

> Code generation breaks on boolean restricted to 0 or 1
> ------------------------------------------------------
>
>                 Key: CXFXJC-34
>                 URL: https://issues.apache.org/jira/browse/CXFXJC-34
>             Project: CXF XJC Utils
>          Issue Type: Bug
>          Components: Maven Plugin
>    Affects Versions: 3.3.0
>            Reporter: Ruud de Jong
>            Assignee: Freeman Fang
>            Priority: Major
>
> Exception in thread "main" java.lang.InternalError: Unable to load source 
> code of com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter as a resource
>  at 
> com.sun.codemodel.fmt.JStaticJavaFile$ResourceLoader.getResourceAsStream(JStaticJavaFile.java:234)
>  at com.sun.codemodel.fmt.JStaticJavaFile.build(JStaticJavaFile.java:84)
>  at com.sun.codemodel.JPackage.build(JPackage.java:446)
>  at com.sun.codemodel.JCodeModel.build(JCodeModel.java:327)
>  at com.sun.codemodel.JCodeModel.build(JCodeModel.java:317)
>  at org.apache.cxf.maven_plugin.XSDToJavaRunner.run(XSDToJavaRunner.java:226)
>  at 
> org.apache.cxf.maven_plugin.AbstractXSDToJavaMojo.run(AbstractXSDToJavaMojo.java:368)
>  at 
> org.apache.cxf.maven_plugin.AbstractXSDToJavaMojo.execute(AbstractXSDToJavaMojo.java:276)
>  at org.apache.cxf.maven_plugin.XSDToJavaMojo.execute(XSDToJavaMojo.java:41)
>  
> This happens in 3.3.0 (not in 3.2.3).
>  
> The XSD uses this definition:
> <xs:attribute name="mustUnderstand" > 
>  <xs:simpleType>
>  <xs:restriction base='xs:boolean'>
>  <xs:pattern value='0|1' />
> </xs:restriction>
>  </xs:simpleType>
> </xs:attribute>
> which triggers a special piece of code within JCodeModel of jaxb-xjc and 
> tries to copy some Java source file from classpath.
> Apparently, this has changed from 3.2.3 to 3.3.0 and does not work properly 
> anymore within the Maven plugin scope.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to