|
To Whom It May Concern: I am trying (quite intensively) to apply the Jibx 1.1
binding logic from xml to java. Dev env: Eclipse – java project Build tool - ANT Performed actions: 1) Constructed my own java package in which I compiled
my Item.java source to Item.class. 2) Constructed a binding.xml according to given
explanations at the Jibx website. 3) Constructed a build.xml file with the user-defined
<taskdef name=”bind” ….> definition. 4) Applied on build.xml the compile task and afterwards
the bind task. After applying both tasks, I observed the newly created tree
structure of my project. I saw that in addition to the Item.class I also got 5) I applied a jar operation thus now I have a file.jar
file with Item.class, JiBX_bindingItem_access.class and
JiBX_bindingFactory.class. I opened a new
project with a single RunMe.java
as follows: import org.jibx.runtime.BindingDirectory; import
org.jibx.runtime.IBindingFactory; import org.jibx.runtime.IUnmarshallingContext; import
org.jibx.runtime.JiBXException; public class RunMe {
/**
* @param args
*/
public static void main(String[] args) {
try
{
String value = "<product
quantity=\"1\" value=\"1\" id=\"3\"
name=\"Multi Action Day Cream\" ml=\"50 ml\"
ml1=\"70 ml\" price=\"$55.00\" price1=\"$75.00\"
image=\"images/products_pic/facial/MultiActionDayCreamForNormalAndCombinationSkin.swf\"/>";
IBindingFactory bfact =
BindingDirectory.getFactory(extoler.oceanwhite.order.Item.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
Object obj = uctx.unmarshalDocument
(new StringReader(value), null);
}catch (JiBXException
jibx)
{
jibx.printStackTrace();
}
} }
6) I added to this project the following jars: file.jar, jibx-run.jar and
xpp3.jar. Expected: Project RunMe. Java completes its run. Through this class
I am bounding the given String value variable to Item.class Actual: I keep getting the following error: java.lang.NoClassDefFoundError:
Item
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at com.extoler.xml.RunMe.main(RunMe.java:21) Exception in
thread "main" This is in spite of the fact that Item.class is in my
classpath. I’d highly appreciate any help, Thanks, Eviho17 |
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ jibx-devs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jibx-devs
