xsd2pgschema Wiki
Relational database replication tool based on XML Schema
Brought to you by:
yokochi
Welcome to project xsd2pgschema!
The wiki uses Markdown syntax.
Initial release
Gret piece of work.
I sent you an email on an issue converting one of FPML XSDs.
I can resend you details just ask - 7mlapenna@gmail.com
Thank you for your notice.
I have released 1.15.3 to fix several issues in case of multiple namespaces (FpML XSD).
The rest of duplication issue you pointed out could not reproduced in my test.
Could you please verify with the latest one.
Best regards,
Masashi
Hi,
I have released 1.15.4 to address other issues while processing FpML XSD (fpml-cd-5.5.xsd).
Best regards,
Masashi
Thank you very much. I will you know of any other comments along the way.
On Mar 10, 2017 03:47, "Masashi Yokochi" yokochi@users.sf.net wrote:
Konnichi wa, Yokochi-san. Osore irimasu ga
I wanted to apologize for such a rude intrusion, but because I came across a rather unfortunate circumstance, I had no choice but to turn to you for help.
I have come across your great library a few days ago, and it appeared both very robust, and quite capable of dealing with a large data file (56G). Needless to say I was very excited. I got even more excited when I looked at the examples and discovered that they essentially were perfect for my task.
As I have both the data file and the schema already downloaded, I thought I only needed to use the XML-splitter feature and the cloning feature itself to get my DB going. When I couldn't get the splitter to work on my data file, I tried to give it a much smaller (2G) subset file fpds_test.xml just to try. What I discovered was two things:
1. For one reason or another the XML-splitter refused to work with the fpds_complete.xsd - the schema that came with the data. Luckily I was able to generate two alternative schemas: one using IdeaJ's plugin fpds_gen.xsd, and another using Liquid Studio 2017 fpds_test.xsd. Both of these schemas, both of them varied slightly, but when I compared them to the orginal schema I could not understand why your program didn't like it.
2. Having passed that stage I tried to run the XML-splitter against a smaller file, and again did not receive any outcome. At this point I took the liberty of running your code throug the debugger and it appeared that when traversing the XPath string "response/result/doc" the codes into an infinite loop on the word "result". Specifically the while loop on ln 5787 of PgSchema.java becomes infinite, because it's condition is never broken, however the foreign table it keep processing is the same table it gets on its first run. Alas I was not able to pinpoint the problem and to identify a good correction. However if you are interested I am attaching all of the XSDs and the test XML data file.
I sincerely ask for your forgivness for disturbing you on this matter and I very much thank you for listening to my problem, Youkochi-san.
Domo arigato.
Hello, Thank you for your notice.
I detected the problems pointed out using the attached test data.
Details of the fix are shown in README file of software update v2.6.6.
Please try with the latest version.
Best regards,
Masashi Yokochi
Hello - This is a great piece of work and is exactly what I was looking for in project. There is one issue I am facing though with primary keys and indexes not getting created. I might be providing incorrect arguments but I could not figure it out myself. The issue is here https://sourceforge.net/p/xsd2pgschema/discussion/general/thread/a47dffed92/?limit=25#830c
Hello, what a wonderfull work. that you follow for a long time.
Many, many thanks, it works perfect with Database Produc for a big reseller in France.
Is there a way to thank you ?
I had some issues with openjdk 17 and openjdk 21, but come back to openjdk 14 and it is not so simple, but when it's run it's so impressive!
You respect all the normalization for the database, wonderfull.
The only thing taht i have to say, i spent to much time to find it!
Thanks a lot.
Jean-Marc HENRY
Welcome Jean-Marc,
Thanks for comment. You can stay with OpenJDK 14.
FYI, OpenJDK 17 has been supported and tested well since v5.3.2. However, user must build tool from source code using jdk17 branch because of dependency of third party library FST, https://github.com/RuedigerMoeller/fast-serialization
Please see User Guide and README about installation and requirements.
As of now, FST developer does not release their stable version for OpenJDK 21 so we do not support as well. I don't know whether jdk17 branch source tree may work on OpenJDK 21.
Regards,
Masashi
Last edit: Masashi Yokochi 2024-02-29
A new git branch 'jdk21' has been created, which allows users to compile xsd2pgschema's source code for Java 21 environment. This branch passes all unit tests.
Currently, we have binary packages, v4.4.8 for Java 8/11 and v5.3.8 for Java 14. For Java 17 and Java 21, you need to compile the tool from the source tree, jdk17 and jdk21 branches, respectively.
The latest v5.3.8 package now includes JAR files for Java 14, 17, and 21.
Because of dependency of third party library FST (fast-serialization), which utilizes Foreign
Function & Memory API (marked as incubator at Java 14, 17 and third preview at Java 21) for
performance enhancement, we prepared JAR files for each Java version.
xsd2pgschema.jar (soft link to xsd2pgschema-jdk14.jar by default)
xsd2pgschema-jdk14.jar
xsd2pgschema-jdk17.jar
xsd2pgschema-jdk21.jar
xsd2pgschema-min.jar (soft link to xsd2pgschema-min-jdk14.jar by default)
xsd2pgschema-min-jdk14.jar
xsd2pgschema-min-jdk17.jar
xsd2pgschema-min-jdk21.jar
You need to switch these JAR files depending on Java version. In addition, PgSchema data
model server of each binary is not compatible, so if you change the Java
version, you need to restart the data model server.
As for Java 17 and Java 21, you must allow JRE (Java Runtime Environment) to access
unnamed classes using the following environment variable, JAVA_OPT_X2P.
Last edit: Masashi Yokochi 2024-03-01
Hello,
I am trying to run xsd2pgschema on FreeBSD 13.3. I have the following setup:
xsd2pgschema.jar@ -> xsd2pgschema-jdk17.jar
I have created a script to start the application:
!/usr/local/bin/zsh -f
export JAVA_OPT_X2P="--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.sql/java.sql=ALL-UNNAMED"
/usr/local/openjdk17/bin/java $JAVA_OPT_X2P -cp ./xsd2pgschema.jar xsd2pgschema FleurInputSchema.xsd
When I run the starter script I receive the error:
Unrecognized option: --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.sql/java.sql=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Thank you for your help.
Roger
Hi Roger,
JavaVM 17 (or later) recognizes --add-opens option, but older JavaVM does not accept.
Please check version of JavaVM again, Or type
if necessary.
Regards,
Masashi