You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Andreas Beeker <ki...@apache.org> on 2016/05/02 22:58:20 UTC
Re: Fwd: Re: xmlbeans successor
On 24.04.2016 23:59, Nick Burch wrote:
> I think we still need more prototyping to check what is and isn't a viable option, before we go voting on things
>
Although we are using Jibx at my $dayjob, I have already problems with basic schemas [1].
Looking at the answers at stackoverflow [2] or in the mailing list [3] Jibx seems to be dead ...
So I'm stuck...
- xmlbeans (dead)
- Jaxb (gpl licensed/not working on android)
- Jasons modified Jaxb (gpl licensed)
- jibx (dead?)
- simple.sourceforge.net (as far as I can see, no real schema support [4])
- Axiom (~ DOM ... too low level)
... and need to put that stuff aside (already spent too many unproductive hours on this) ... maybe someone else has an idea ...
Andi
[1] https://sourceforge.net/p/jibx/mailman/message/35056172/
[2] http://stackoverflow.com/questions/tagged/jibx
[3] https://sourceforge.net/p/jibx/mailman/jibx-users/
[4] http://stackoverflow.com/questions/6193372/how-to-generate-simple-xml-java-annotated-object-from-xsd-schema
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by Jason Harrop <jh...@gmail.com>.
I made a new POC of using current docx4j in Android Studio:
https://github.com/plutext/Docx4j4Android4
So I thought I'd share my JAXB related experiences:
MOXy
^^^^^^
MOXy generates class files on the fly during Context init (see stack trace
copied below)
org.eclipse.persistence.internal.jaxb.JaxbClassLoader.generateClass:
public Class <http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/Class.java#Class>
<http://grepcode.com/file/repo1.maven.org/maven2/org.eclipse.persistence/eclipselink/2.4.2/org/eclipse/persistence/internal/jaxb/JaxbClassLoader.java#>generateClass(String
<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/String.java#String>
className, byte[] bytes) {
Class <http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/Class.java#Class>
theClass = this.defineClass
<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/ClassLoader.java#ClassLoader.defineClass%28java.lang.String%2Cbyte%5B%5D%2Cint%2Cint%29>(className,
bytes, 0, bytes.length);
You can't just use https://github.com/linkedin/dexmaker there instead,
since dexmaker works at a lower level than just ingesting the bytes.
At this point I turned my attention to the JAXB RI instead...
JAXB RI
^^^^^^^^^
Things are easier these days, now Android has annotation support.
I compiled JAXB RI tip for Java 7, with https://github.com/gf-metro/
jaxb/pull/34 so life goes on even though
org.apache.harmony.xml.parsers.SAXParser
doesn't support http://javax.xml.XMLConstants/feature/secure-processing.
JAXB still uses AWT etc which I haven't looked into removing...
ciao .. Jason
-----------------
MOXy stack trace:
[java.lang.UnsupportedOperationException: can't load
this type of class file]
at org.eclipse.persistence.jaxb.J
AXBContext$ContextPathInput.createContextState(JAXBContext.java:922)
at org.eclipse.persistence.jaxb.J
AXBContext$ContextPathInput.createContextState(JAXBContext.java:855)
at org.eclipse.persistence.jaxb.J
AXBContext.<init>(JAXBContext.java:189)
at org.eclipse.persistence.jaxb.J
AXBContextFactory.createContext(JAXBContextFactory.java:129)
at java.lang.reflect.Method.invoke(Native
Method)
at javax.xml.bind.ContextFinder.n
ewInstance(ContextFinder.java:186)
at javax.xml.bind.ContextFinder.n
ewInstance(ContextFinder.java:146)
... 24 more
Caused by: java.lang.UnsupportedOperationException:
can't load this type of class file
at java.lang.ClassLoader.defineCl
ass(ClassLoader.java:520)
at org.eclipse.persistence.intern
al.jaxb.JaxbClassLoader.generateClass(JaxbClassLoader.java:110)
at .generateWrapperClass(Mapping
sGenerator.java:3231)
at org.eclipse.persistence.jaxb.c
ompiler.MappingsGenerator.generateWrapperClassAndDescriptor(
MappingsGenerator.java:3000)
at org.eclipse.persistence.jaxb.c
ompiler.MappingsGenerator.addEnumerationWrapperAndDescriptor
(MappingsGenerator.java:2971)
at org.eclipse.persistence.jaxb.c
ompiler.MappingsGenerator.processGlobalElements(MappingsGenerator.java:2918)
at org.eclipse.persistence.jaxb.c
ompiler.MappingsGenerator.generateProject(MappingsGenerator.java:274)
E/org.docx4j.jaxb.Context: at org.eclipse.persistence.jaxb.c
ompiler.Generator.generateProject(Generator.java:188)
at org.eclipse.persistence.jaxb.J
AXBContext$ContextPathInput.createContextState(JAXBContext.java:927)
at org.eclipse.persistence.jaxb.J
AXBContext$ContextPathInput.createContextState(JAXBContext.java:920)
On Mon, Aug 1, 2016 at 11:37 PM, kiwiwings <ki...@apache.org> wrote:
> In the meantime, there was some discussion on the legal list [1]
>
> There was no definitely DO nor DON'T, but it looks like a Moxy fork would
> be
> the way to go.
> It would be nice if you read through that thread and post your two pence
> here or there ...
> If there's a lazy consensus, I'll continue my JAXB endeavour after my
> current work (HSSF cryptoapi)
>
> Andi.
>
>
> [1] https://issues.apache.org/jira/browse/LEGAL-264
>
>
>
> --
> View this message in context: http://apache-poi.1045710.n5.
> nabble.com/xmlbeans-successor-tp5722870p5724274.html
> Sent from the POI - Dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>
Re: Fwd: Re: xmlbeans successor
Posted by kiwiwings <ki...@apache.org>.
In the meantime, there was some discussion on the legal list [1]
There was no definitely DO nor DON'T, but it looks like a Moxy fork would be
the way to go.
It would be nice if you read through that thread and post your two pence
here or there ...
If there's a lazy consensus, I'll continue my JAXB endeavour after my
current work (HSSF cryptoapi)
Andi.
[1] https://issues.apache.org/jira/browse/LEGAL-264
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/xmlbeans-successor-tp5722870p5724274.html
Sent from the POI - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by kiwiwings <ki...@apache.org>.
I've opened a ticket for it:
https://issues.apache.org/jira/browse/LEGAL-264
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/xmlbeans-successor-tp5722870p5724030.html
Sent from the POI - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by Jason Harrop <jh...@gmail.com>.
Its the one Andreas linked to:
http://www.docx4java.org/blog/2012/05/jaxb-can-be-made-to-run-on-android/
On Tue, May 3, 2016 at 8:53 PM, Nick Burch <ap...@gagravarr.org> wrote:
> On Tue, 3 May 2016, Jason Harrop wrote:
>>
>> I'm pretty relaxed about the license; whatever is compatible with the
>> original license and makes sense for ASL v2 code bases, and on Android ...
>
>
> Thanks!
>
>> In any case, anyone could follow the recipe in the blog post to redo it.
>>
>> It might be worth redoing it in any case, based on the current JAXB RI
>> code (since 4 years have now passed). I'd like to have a look...
>
>
> Any chance you could point me to the blog post / send us a 1-2 paragraph
> summary of what's needed?
>
> I can then ask the ASF legal committeee if CDDL JAXB + proposed changes
> would be allowed or not
>
> Thanks
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by Nick Burch <ap...@gagravarr.org>.
On Tue, 3 May 2016, Jason Harrop wrote:
> I'm pretty relaxed about the license; whatever is compatible with the
> original license and makes sense for ASL v2 code bases, and on Android
> ...
Thanks!
> In any case, anyone could follow the recipe in the blog post to redo it.
>
> It might be worth redoing it in any case, based on the current JAXB RI
> code (since 4 years have now passed). I'd like to have a look...
Any chance you could point me to the blog post / send us a 1-2 paragraph
summary of what's needed?
I can then ask the ASF legal committeee if CDDL JAXB + proposed changes
would be allowed or not
Thanks
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by Jason Harrop <jh...@gmail.com>.
I'm pretty relaxed about the license; whatever is compatible with the
original license and makes sense for ASL v2 code bases, and on Android
...
In any case, anyone could follow the recipe in the blog post to redo it.
It might be worth redoing it in any case, based on the current JAXB RI
code (since 4 years have now passed). I'd like to have a look...
On Tue, May 3, 2016 at 7:50 AM, Nick Burch <ap...@gagravarr.org> wrote:
> On Mon, 2 May 2016, Andreas Beeker wrote:
>>
>> On 02.05.2016 23:11, Nick Burch wrote:
>>>
>>> On Mon, 2 May 2016, Andreas Beeker wrote:
>>>>
>>>> - Jaxb (gpl licensed/not working on android)
>>>
>>>
>>> Isn't it dual GPL/CDDL 1.1? https://jaxb.java.net/ suggests it is, unless
>>> that's something else?
>>>
>>> Under certain restrictions, CDDL can be used:
>>> http://www.apache.org/legal/resolved.html#category-b
>>
>>
>> as no-one opted out Android, it doesn't make sense to use plain Jaxb -
>> only something like Jasons version.
>
>
> If Jason re-licensed his version as GPL/CDDL, then we might be able to use
> it. We'd have to have a chat with the legal-discuss@ list if we were
> considering that route
>
> Nick
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by Nick Burch <ap...@gagravarr.org>.
On Mon, 2 May 2016, Andreas Beeker wrote:
> On 02.05.2016 23:11, Nick Burch wrote:
>> On Mon, 2 May 2016, Andreas Beeker wrote:
>>> - Jaxb (gpl licensed/not working on android)
>>
>> Isn't it dual GPL/CDDL 1.1? https://jaxb.java.net/ suggests it is, unless that's something else?
>>
>> Under certain restrictions, CDDL can be used:
>> http://www.apache.org/legal/resolved.html#category-b
>
> as no-one opted out Android, it doesn't make sense to use plain Jaxb -
> only something like Jasons version.
If Jason re-licensed his version as GPL/CDDL, then we might be able to use
it. We'd have to have a chat with the legal-discuss@ list if we were
considering that route
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by Andreas Beeker <ki...@apache.org>.
On 02.05.2016 23:11, Nick Burch wrote:
> On Mon, 2 May 2016, Andreas Beeker wrote:
>> - Jaxb (gpl licensed/not working on android)
>
> Isn't it dual GPL/CDDL 1.1? https://jaxb.java.net/ suggests it is, unless that's something else?
>
> Under certain restrictions, CDDL can be used:
> http://www.apache.org/legal/resolved.html#category-b
as no-one opted out Android, it doesn't make sense to use plain Jaxb - only something like Jasons version.
Taken from that link - the keyword "unmodified"
"For small amounts of source that is directly consumed by the ASF product at runtime in source form,
and for which that source is unmodified and unlikely to be changed anyway (say, by virtue of being specified by a standard),
inclusion of appropriately labeled source is also permitted."
If we decide to ignore Android, I'd like to use the jaxb-impl.jar instead on relying on the jdk version -
e.g. prefix declaration via package-java didn't work on jdk6 without further manipulation
opposed to jdk7, where it works out of the box.
OT: I think the concept of source licenses in a world of cloud services is a relic
and if you make money out of open source, licenses are usually not an issue ...
Andi.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
Re: Fwd: Re: xmlbeans successor
Posted by Nick Burch <ap...@gagravarr.org>.
On Mon, 2 May 2016, Andreas Beeker wrote:
> - Jaxb (gpl licensed/not working on android)
Isn't it dual GPL/CDDL 1.1? https://jaxb.java.net/ suggests it is, unless
that's something else?
Under certain restrictions, CDDL can be used:
http://www.apache.org/legal/resolved.html#category-b
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org