Regarding JiBX_bindingFactory class:--(Related to issue with key JIBX-335) --------------------------------------------------------------------------
Key: JIBX-336 URL: http://jira.codehaus.org/browse/JIBX-336 Project: JiBX Issue Type: Bug Components: CodeGen Affects Versions: JiBX 1.2.2 Environment: Windows XP Reporter: Rahul Sansthan Yewale Attachments: samplexsds.zip *The Description below will give clear idea about what is going wrong in generated Factory class.* Suppose there are four schema files in four *DIFFERENT* namespaces as follows:-- 1.*first.xsd* --> (http://first.system.com) 2.*second.xsd* --> (http://second.system.com) 3.*third.xsd* --> (http://third.system.com) 4.*fourth.xsd* --> (http://fourth.system.com) 1.*first.xsd* is *standalone*. 2.*second.xsd* is importing *first.xsd* 3.*third.xsd* is importing *second.xsd* and *first.xsd* 4.*fourth.xsd* is importing *third.xsd* i am using PRECOMPILED classes for imported xsd's.*(using precompiled="true")* now there is a PROBLEM in the *JiBX_binding_thirdFactory* class generated for *third.xsd.* *third.xsd* is importing *first.xsd* and *second.xsd*,hence it will generate prenames (precompiled base binding names blob) as *"binding_first|binding_second"* now prefacts (base binding factory classes blob) generated are:-- *"com.system.first.JiBX_binding_firstFactory|..second.JiBX_binding_secondFactory{color:red}com.system.first.JiBX_binding_firstFactory"{color}* {color:red} WHICH IS WRONG......!!!!!!{color} IDEALLY it MUST generate prefacts as follows:-- *"com.system.first.JiBX_binding_firstFactory|..second.JiBX_binding_secondFactory"* Because of this whenever i am trying to *COMPILE* bindings generated for *fourth.xsd*(which is importing third.xsd) I am getting following EXCEPTION:--- {color:red}----------------------------------------------------------------------------------------------------------------------------------------------------------------------{color} [java] Error running binding compiler [java] *** Error during code generation for file 'binding.xml' - please enter a bug report for this error in Jira if the problem is not listed as fixed on the online status page *** [java] Unable to access binding 'binding_third' [java] Make sure classes generated by the binding compiler are available at runtime [java] java.lang.reflect.InvocationTargetException [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:585) [java] at org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:243) [java] at org.jibx.binding.def.BindingBuilder.unmarshalInclude(BindingBuilder.java:2044) [java] at org.jibx.binding.def.BindingBuilder.unmarshalBindingDefinition(BindingBuilder.java:2142) [java] at org.jibx.binding.Utility.loadBinding(Utility.java:314) [java] at org.jibx.binding.Utility.loadFileBinding(Utility.java:434) [java] at org.jibx.binding.Compile.compile(Compile.java:215) [java] at org.jibx.binding.Compile.main(Compile.java:382) [java] *{color:red}Caused by: java.lang.ArrayIndexOutOfBoundsException: 2{color}* [java] at org.jibx.runtime.impl.BindingFactoryBase.<init>(BindingFactoryBase.java:173) [java] at com.system.third.JiBX_binding_thirdFactory.<init>() [java] at com.system.third.JiBX_binding_thirdFactory.getInstance() [java] ... 11 more {color:red}----------------------------------------------------------------------------------------------------------------------------------------------------------------------{color} After debugging..i found problem in the below code in *org.jibx.binding.def.BindingDefinition.java* class in *generateCode(boolean verbose)* METHOD. *String namesblob* = *buildClassNamesBlob (m_baseBindingFactories.toArray())* + *buildClassNamesBlob(m_closureFactories.toArray());* *namesblob* generated for Factory class of third.xsd is=*"com.system.first.JiBX_binding_firstFactory|..second.JiBX_binding_secondFactory{color:red}com.system.first.JiBX_binding_firstFactory{color}"* so i think there might be an issue with buildClassNamesBlob method used to construct precompiled factory class names Please look into this.....!! I am attaching all xsd's and corresponding jars containing factory classes generated for your reference. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ jibx-devs mailing list jibx-devs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-devs