I don't know of anything else that could cause this problem. A couple of things you can try in order to clarify what's going on: Step into the BindingDirectory code to inspect the actual Customer class that's been loaded, and run this standalone (outside of the IDE, assuming you're experiencing the problem when you try and run within the IDE). Also, try renaming the class file that's been modified by the binding compiler and see what happens - if you're right that there's only one instance, this should cause a different kind of failure, with ClassNotFoundException.
- Dennis
Robert Augustyn wrote:
Dennis, Thanks for your reply. I am sure that I have just one class I am working with. I just run the search. Any other ideas how to resolve it? I can actually see the added methods to the class from the jdeveloper but when I run it I get that error? I have spend couple of days trying to resolve it. What would be your suggestion on correct approach? Thanks. robert
-----Original Message-----
From: Dennis Sosnoski [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 12:21 AM
To: Robert Augustyn
Cc: [EMAIL PROTECTED]
Subject: Re: [jibx-users] nable to access binding
information, after
successful binding?
This has happened before for a developer (I think also
using JBuilder, though I can't find the email) when they actually had
two sets of classes they were working with due to different
classpaths. One set of classes were modified by the binding compiler, but not
the set they were
actually trying to run. I'd strongly suspect the same thing is happening
for you.
- Dennis
Robert Augustyn wrote:
Hi,and would appreciate
I am not able to get the simplest test to work :(
your help.test it fails on
I am able to successfully bind and then when I run
ibf = BindingDirectory.getFactory(bin,target);wrong but I have
What gives? I must be doing something fundamentally
searched the list and did not find anything on thesubject.
I know that methods got successfully added to theclass ....
Thanks for taking the time ...com.unisys.tmp.Customer
this is an error:
Unable to access binding information for class
binding information
org.jibx.runtime.JiBXException: Unable to access
for class com.unisys.tmp.CustomerJiBX_bindingList
Root cause: java.lang.NoSuchFieldException:
org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:107)
at
JiBX_bindingList
at com.unisys.tmp.Test.main(Test.java:16)
Caused by: java.lang.NoSuchFieldException:
"H:\\jdev905\\jdev\\mywork\\Workspace1\\jix\\classes\\com\\unisys\\tmp\\
at java.lang.Class.getField0(Class.java:1735) ....
Source of my test.java
IBindingFactory ibf = null;
Class target = com.unisys.tmp.Customer.class;
Customer cust = new Customer();
String bin =
binding.xml";
try {ibf.createUnmarshallingContext();
ibf = BindingDirectory.getFactory(bin,target);
IUnmarshallingContext uctx =
Object obj = uctx.unmarshalDocument(newFileInputStream(
"H:\\jdev905\\jdev\\mywork\\Workspace1\\jix\\classes\\com\\unisys\\tmp
\\data.xml"),type");
null);
if (!target.isInstance(obj)) {
System.err.println("Unmarshalled result not expected
}class="com.unisys.tmp.Customer">
} catch (JiBXException ex1) {
System.err.println(ex1.getMessage());
}
<binding>
<mapping name="customer"
<value name="first-name" field="firstName"/>H:\jdev905\jdev\mywork\Workspace1\jix\src\build1.xml
<value name="last-name" field="lastName"/>
</mapping>
</binding>
<customer>
<first-name>John</first-name>
<last-name>Smith</last-name>
</customer>
package com.unisys.tmp;
public class Customer {
public String firstName;
public String lastName;
}
Buildfile:
[bind] Using the following paths:H:\jdev905\jdev\mywork\Workspace1\jix\classes
[bind]
[bind] H:\jdev905\java\jibx\lib\jibx-run.jarto element
[bind] Using the following binding paths:
[bind] com/unisys/tmp/binding.xml
[bind] binding com_unisys_tmp_binding:
[bind] context (mp#=1) (cv#=0) (fm#=0)
[bind] mapping class com.unisys.tmp.Customer
customer
[bind] element wrapper customercom.unisys.tmp.Customer
[bind] object binding for
[bind] structure orderedfirstName
[bind] element first-name from property
(java.lang.String)lastName
[bind] element last-name from property
(java.lang.String)size is 2570 bytes
[bind]
[bind] Wrote 3 files
[bind]
[bind] com.unisys.tmp.Customer output file
[bind] Found 6 methods:JiBX_com_unisys_tmp_binding_unmarshal_1_0
[bind] void marshal
[bind] void unmarshal
[bind] int JiBX_getIndex
[bind] com.unisys.tmp.Customer JiBX_com_unisys_tmp_binding_newinstance_1_0
[bind] void
[bind] voidJiBX_com_unisys_tmp_binding_marshal_1_0
[bind]com.unisys.tmp.JiBX_com_unisys_tmp_bindingCustomer_access
[bind]
output file size is 1927 bytescom.unisys.tmp.JiBX_com_unisys_tmp_bindingFactory
[bind] Found 4 methods:
[bind] void marshal
[bind] java.lang.Object unmarshal
[bind] boolean isPresent
[bind] boolean isExtension
[bind]
[bind]
output
file size is 1539 bytesgetInstance
[bind] Found 3 methods:
[bind] org.jibx.runtime.IBindingFactory
[bind] org.jibx.runtime.IMarshallingContext createMarshallingContext
[bind] org.jibx.runtime.IUnmarshallingContext
createUnmarshallingContext [bind] [bind] Kept 0 files unchanged: [bind] [bind] Deleted 0 files:
__________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html
-- Dennis M. Sosnoski Enterprise Java, XML, and Web Services Training and Consulting http://www.sosnoski.com Redmond, WA 425.885.7197
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users