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

PJ Fanning edited comment on XMLBEANS-628 at 9/7/22 2:54 PM:
-------------------------------------------------------------

Thanks [~Kaufhold] for reporting the issue. XMLBeans is not under active 
development. None of the volunteers have much time to spend on it. If you want 
to have a go at fixing this yourself, I'm sure someone can review any PRs etc 
you might have. One path to pursue would be to get the maven plugin task to 
fork a new JVM per run (at least as an optional feature).

One question - do you really need to split up the schema compilation? A single 
schema compilation job should be able to handle more than one schema. The 
Apache POI build successfully builds classes for multiple schemas with no issue.

If you can't do all of schema compilation in one task, maybe you could you use 
maven-antrun-plugin to call an Apache Ant based task that schema compiles in a 
forked JVM - see Apache POI 
[build.xml|https://github.com/apache/poi/blob/trunk/build.xml] (xmlbeans 
taskdef and next few lines that call that as a task).


was (Author: pj.fanning):
Thanks [~Kaufhold] for reporting the issue. XMLBeans is not under active 
development. None of the volunteers have much time to spend on it. If you want 
to have a go at fixing this yourself, I'm sure someone can review any PRs etc 
you might have. One path to pursue would be to get the maven plugin task to 
fork a new JVM per run (at least as an optional feature).

One question - do you really need to split up the schema compilation? A single 
schema compilation job should be able to handle more than one schema. The 
Apache POI build successfully builds classes for multiple schemas with no issue.

> XMLBeans compiler plugin not stateless between subsequent build steps
> ---------------------------------------------------------------------
>
>                 Key: XMLBEANS-628
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-628
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: Version 5.1.0
>            Reporter: Johannes
>            Priority: Major
>         Attachments: mv-ibs-ebics-types-h000-1.0.jar, 
> mv-ibs-ebics-types-h005-3.0.1.jar, pom-1.xml, pom-2.xml, pom-3.xml, pom.xml
>
>
> I have a multi-module maven build generating and compiling XMLBeans bindings 
> for multiple XML schemas (using the compile goal).
> When I execute just a single build out of them, the result is correct and 
> executable.
> But when executing them subsequent in the same maven build (and thus the same 
> Java VM session), the subsequent builds are affected by the first one and the 
> schema bindings (xsb files) are written to the wrong package - leading to a 
> LinkageError reported at runtime.
> Output of the first JAR (compiling ebics_hev.xsd from 
> [here|https://www.ebics.de/de/ebics-standard/ebics-schema]):
> Package org/ebics/h000 contains the sub packages attributegroup,, element, 
> ... system, type
> Output of the second JAR (compiling H005 schemas from the same source):
> Package org/ebics/h005 contains interfaces and an impl sub package.
> There is another package org/ebics/h000 containing the attributegroup, 
> element, ... system, type
>  
> At runtime this leads to:
> Caused by: java.lang.LinkageError: Loading of resource 
> \{urn:org:ebics:H005}ebicsKeyManagementResponse.ebicskeymanagementresponse2269doctypefailed,
>  information from \{urn:org:ebics:H005}ebicsKeyManagementResponse.index.xsb 
> is  out of sync (or conflicting index files found)
>     at 
> org.apache.xmlbeans.impl.schema.XsbReader.checkContainerNotNull(XsbReader.java:654)
>     at 
> org.apache.xmlbeans.impl.schema.XsbReader.finishLoadingType(XsbReader.java:1038)
>     at 
> org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.resolveHandle(SchemaTypeSystemImpl.java:938)
>     at 
> org.apache.xmlbeans.impl.schema.ElementFactory.<init>(ElementFactory.java:29)
>     at 
> org.apache.xmlbeans.impl.schema.AbstractDocumentFactory.<init>(AbstractDocumentFactory.java:33)
>     at 
> org.apache.xmlbeans.impl.schema.DocumentFactory.<init>(DocumentFactory.java:23)
>     at 
> org.ebics.h004.EbicsKeyManagementResponseDocument.<clinit>(EbicsKeyManagementResponseDocument.java:23)
>  
> Since this happens only when building these schemas in the same maven build, 
> the reason must be some state in the XMLBeans plugin.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to