The exception sounds like a classpath issue to me, too. The weird class name Angel points out may be part of the problem, though. Looking at it I see that you've got a full directory path embedded in that class name. That shouldn't normally happen. I think what's going on is that JiBX is missing the directory separators in the path you supply for a binding definition. Are you doing the binding from Ant, and running under Windows? I think that could cause this to occur, since Ant always uses '/' separators and JiBX looks for separators matching the platform setting ('\' under Windows). I need to figure out a better way of handling this - any suggestions? It seems like something people writing Ant extensions must often run into.

JiBX is probably generating this file (the long name with a .class extension) in a place you don't expect, too. It would normally go into the package of the first <mapping> class, but in this case that's a system package so it instead gets dumped in the default package. It may be output directly to the current directory of where you're running, or to the default package directory of your classpath entry.

As for the basic question of whether this will work - it won't. The problem is that TypedArrayMapper is intended for use with arrays of some object type, where the object type has a <mapping> defined. You can't do that for java.lang.String (or other java.* classes) in a way that will work here. Your choices are either to use the TypedArrayMapper example as a base for doing your own StringArrayMapper or use the size-method/get-method/add-method user methods to do the array handling within the containing object. Sorry; I realize this is fairly ugly, and hope to clean it up soon.

- Dennis

???e??? ?a???t?a??? wrote:

Hi Scott, are sure that this isn't what it says it is ? a classpath issue ? Before looking at anything else, I'd make sure that this weird extremely long-named class that jiBX generates is actually on the classpath.
If it's really not a classpath problem ... you're in trouble i suspect :}
Anyhow, hope I've helped out a bit at least ...
Angel
O:]


    ----- Original Message -----
    *From:* Scott Stevenson <mailto:[EMAIL PROTECTED]>
    *To:* [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    *Sent:* Friday, July 30, 2004 7:30 PM
    *Subject:* [jibx-users] TypedArrayMapper of Strings

    I’m trying to write a binding that uses the
    org.jibx.extras.TypedArrayMapper to marshal/unmarchal an array of
    java.lang.String[]. The binding compiles OK, but I get the
    following exception when trying to run a test:

    ERRORwriteXMLFile , org.jibx.runtime.JiBXException: Unable to
    access binding information for class
    boeing.engineering.leangi3.metadata.ClassInfo

    Make sure classes generated by the binding compiler are available
    at runtime

    Root cause: java.lang.ClassNotFoundException:
    JiBX_U__cvsProjects_ltk_src_boeing_engineering_leangi3_metadata_bindingFactory


Do I need a custom mapper for String to make this work, or could there be some other problem?

    Thanks in advance,

    Scott…

    <mapping class="java.lang.String[]" name="String[]"

    marshaller="org.jibx.extras.TypedArrayMapper"

    unmarshaller="org.jibx.extras.TypedArrayMapper"/>




-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to