Stephen, you used the wrong patch. The name of an very old patch may have leaded you to download it. To omit this I have removed this old patch. Please try again with:
http://jira.codehaus.org/secure/attachment/28597/patch-C1342-20070724-01.txt or use 1.2 release of Castor that already contains this patch. Regards Ralf Stephen Ince schrieb: > Sure I can provide a test case. I would just need some direction. > > org.exolab.castor.xml.Marshall.java > * $Id: Marshaller.java 5961 2006-06-03 13:02:04Z rjoachim $ > > I applied the marshalling fixes also. > line: 922 > + if (object instanceof net.sf.cglib.proxy.Factory) { > + _class = object.getClass().getSuperclass(); > + } > + else if (Proxy.isProxyClass(object.getClass()) ) { > - if (Proxy.isProxyClass(object.getClass()) ) { > if (LOG.isDebugEnabled()) { > LOG.debug("Current object is a proxy class"); > } > XMLMappingLoader mappingLoader = (XMLMappingLoader) > _cdResolver.getMappingLoader(); > if (mappingLoader != null) { > Class[] interfaces = > object.getClass().getInterfaces(); > for (int i = 0; i < interfaces.length; i++) { > Class interfaceClass = interfaces[i]; > if (LOG.isDebugEnabled()) { > LOG.debug("Looking up interface on proxy: " > + interfaceClass.getName()); > } > ClassDescriptor classDescriptor = > mappingLoader.getDescriptor(interfaceClass.getName()); > if (classDescriptor != null) { > if (LOG.isDebugEnabled()) { > LOG.debug("Found mapping for interface > " + interfaceClass.getName()); > } > _class = interfaceClass; > break; > } > } > if (_class == null) { > if (LOG.isDebugEnabled()) { > LOG.debug("No mapped interface found on > proxy class ... using proxy class"); > } > > _class = object.getClass(); > } > } else { > if (LOG.isDebugEnabled()) { > System.out.println("No XMLMappingLoader found"); > } > } > } else > _class = object.getClass(); > } > > ----- Original Message ----- From: "Ralf Joachim" > <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Monday, September 29, 2008 3:12 AM > Subject: Re: [castor-dev] marshalling lazy loaded class > > >> Hi Stephen, >> >> are you in a position to provide us with a test case to replay the >> problem at hand. I view the code fragment as a patch to Marshaller but >> which lines in Marshaller do you refer to? >> >> Regards >> Ralf >> >> >> Stephen Ince schrieb: >>> Castor seems to be not able to marshall classes that are loaded. >>> I applied the last patch. >>> http://jira.codehaus.org/browse/CASTOR-1342 >>> >>> >>> I got to work using doing the following. >>> >>> org.exolab.castor.xml.Marshall.java >>> >>> // opendemand fix for marshalling lazy loaded class >>> (Proxy.isProxyClass) did not work >>> if (object instanceof net.sf.cglib.proxy.Factory) { >>> _class = object.getClass().getSuperclass(); >>> } >>> else if (Proxy.isProxyClass(object.getClass()) ) { >>> : >>> >>> >>> I have the following lazy loaded configuration. >>> <class name="com.opendemand.jdo.WebResource" auto-complete="false" >>> identity="webResourceId" key-generator="keygen" > >>> >>> : >>> >>> <field name="response" type="com.opendemand.jdo.WebResourceResponse" >>> get-method="getResponse" set-method="setResponse" lazy="true"> >>> >>> <sql /> >>> >>> </field> >>> >>> </class> >>> >>> Steve >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > -- Syscon Ingenieurbüro für Meß- und Datentechnik GmbH Ralf Joachim Raiffeisenstraße 11 72127 Kusterdingen Germany Tel. +49 7071 3690 52 Mobil: +49 173 9630135 Fax +49 7071 3690 98 Internet: www.syscon.eu E-Mail: [EMAIL PROTECTED] Sitz der Gesellschaft: D-72127 Kusterdingen Registereintrag: Amtsgericht Stuttgart, HRB 382295 Geschäftsleitung: Jens Joachim, Ralf Joachim --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

