I have the Individual.XML placed in the directory: Files\InputApps
<?xml version="1.0" encoding="UTF-8"?>
-<topmostSubform>
-<Header1>
<TextField2>**A123**</TextField2>
</Header1>
Just wanted to print out "A123" but I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/xmlbeam/XBProjector
at rb.form.submitter.Function_Library.printWeatherData(Function_Library.java:758)
at rb.form.submitter.RB_base.main(RB_base.java:81)
Caused by: java.lang.ClassNotFoundException: org.xmlbeam.XBProjector
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Please see my XMLBean code below:
@XBDocURL("resource://Files//InputApps//Individual.XML")
public interface XMLData {
@XBRead("/topmostSubform/Header1/TextField2")
String getValue();
}
protected void printData() throws IOException {
// We let the projector fetch the data for us
XMLData ValueData = new XBProjector().io().fromURLAnnotation(XMLData.class);
// Print some values
System.out.println("test " + ValueData.getValue());
}
You are using an external library (enter link description here), but that lib is not in your class path during execution. You have to either include the library contents to your jar (creating a fat jar), or provide a valid class path for the execution (java.exe -cp ...).