Castor and ICVM

I converted an api written in Java to dll.net using IKVM and it has been fine so far.

It mainly uses xml behind the scenes to access some web services. The api is third party and I don't have access to the source code. The api uses Castor to (I believe) bind xml to objects.

However, when I started using some of the more useful parts of the api, I ran into a castor problem. My specific error:

"Attached error: org.exolab.castor.mapping.MappingException: Could not find class ..."

The specified class is part of the api. From cleaning up the webpage, it seems like castor cannot access the class because it is in a separate assembly from the movie.

My problem is that I really don't know enough about Classloaders in Java and probably don't know enough about IKVM to figure it out.

Has anyone used IKVM with Castor (or another library that might be using reflection on Java classes) and have encountered this problem before?

+1


a source to share


1 answer


Well I'm surprised no one answered this, so I submitted my question to the ikvm mailing list and got a response.

The answer really has something to do with splitting the Castor library and the third party api code I was using.

The solution I used was to add the option:



-classloader:ikvm.runtime.AppDomainAssemblyClassLoader

      

when compiling Castor with ikvmc.

This allowed Castor to communicate with the 3rd api part and let me grab the report from the web service.

+2


a source







All Articles