JFormsDesigner importing a Netbeans form

67 Views Asked by At

When using JFormDesigner, importing a form originally created in Netbeans results in an exception.

What can we do to prevent this error and get JFormDesigner loading the form correctly?

Do we need to put anything on the project classpath?

Failed to convert .form Exception outputting document: Reflection failed while creating new JAXP document.

jformdesigner error msg

2

There are 2 best solutions below

0
p.campbell On

In the Users/xxxx/Applications/JFormDesigner.app/Info.plist file, add this line to the JVMDefaultOptions values array:

<string>--add-opens java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED</string>   

So now you should have:

<array>
    <string>-Xmx512m</string>
    <string>--add-opens java.desktop/javax.swing=ALL-UNNAMED</string>
    <string>--add-opens java.desktop/com.apple.laf=ALL-UNNAMED</string>
    <string>--add-opens java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED</string>       
</array>
0
themetman On

Many thanks @p.campbell for your fix.

I had the same problem using Linux Version which is fixed by adding this:

--add-opens java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED

to the last line in the JFormDesigner.sh file making the line which launches JFormDesigner look like this:

"$JFD_JAVA_EXEC" -Xmx$JFD_MAX_MEM_SIZE --add-opens java.desktop/javax.swing=ALL-UNNAMED --add-opens java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED --add-opens java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED $JFD_VM_PARAMS -jar "$JFD_HOME/lib/JFormDesigner.jar" "$@"

And I could import my Netbeans Forms.