[ http://jira.codehaus.org/browse/JIBX-53?page=history ]

Dennis Sosnoski updated JIBX-53:
--------------------------------

    Fix Version:     (was: CVS)
                 1.0-RC0

> Attempting to use binding not in binding factory gives obscure error
> --------------------------------------------------------------------
>
>          Key: JIBX-53
>          URL: http://jira.codehaus.org/browse/JIBX-53
>      Project: JiBX
>         Type: Improvement
>   Components: core
>     Versions: 1.0-beta3c
>  Environment: Gentoo Linux, JDK 1.4
>     Reporter: Tim Sawyer
>     Assignee: Dennis Sosnoski
>     Priority: Minor
>      Fix For: 1.0-RC0

>
>
> If I run this code I get an error:
> LoginApplicationCallParameter lCallParam = new 
> LoginApplicationCallParameter();
> lCallParam.setPassword("tim");
> lCallParam.setUserName("tim");
> LoginApplicationResponseParameter lResponseParam = new 
> LoginApplicationResponseParameter();
> lResponseParam.setApplicationDate(new Date());
> lResponseParam.setSecurityToken("fhkjhgkjdfhgkjhdfgkjdhfk");
> lResponseParam.setUserName("tim");
> IBindingFactory lBindingFactory1 = 
> BindingDirectory.getFactory(LoginApplicationCallParameter.class);
> IMarshallingContext lMarshallContext1 = 
> lBindingFactory1.createMarshallingContext();
> lMarshallContext1.setIndent(2);
> lMarshallContext1.marshalDocument(lCallParam, "UTF-8", null, new 
> FileOutputStream("/home/tjs/LoginCall.xml"));
> IBindingFactory lBindingFactory2 = 
> BindingDirectory.getFactory(LoginApplicationResponseParameter.class);
> IMarshallingContext lMarshallContext2 = 
> lBindingFactory2.createMarshallingContext();
> lMarshallContext2.setIndent(2);
> lMarshallContext2.marshalDocument(lCallParam, "UTF-8", null,
> new FileOutputStream("/home/tjs/LoginResponse.xml"));
> The important thing to note is that both lMarshallContexts are passed the 
> lCallParameter, where the second one should have been passed 
> lResponseParameter (and if you do it works fine)  So in the second case, I'm 
> trying to marshall lCallParameter given a factory from 
> LoginApplicationResponseParameter.  The error is:
> java.lang.NullPointerException
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
>  at java.security.AccessController.doPrivileged(Native Method)
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
>  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>  at 
> org.jibx.runtime.impl.MarshallingContext.getMarshaller(MarshallingContext.java:876)
>  at 
> com.comany.gateway.base.param.classes.LoginApplicationCallParameter.marshal(LoginApplicationCallParameter.java)
>  at 
> org.jibx.runtime.impl.MarshallingContext.marshalRoot(MarshallingContext.java:919)
>  at 
> org.jibx.runtime.impl.MarshallingContext.marshalDocument(MarshallingContext.java:967)
>  at com.company.webservices.test.BindingTest.testBinding(BindingTest.java:69)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:324)
>  at junit.framework.TestCase.runTest(TestCase.java:154)
>  at junit.framework.TestCase.runBare(TestCase.java:127)
>  at junit.framework.TestResult$1.protect(TestResult.java:106)
>  at junit.framework.TestResult.runProtected(TestResult.java:124)
>  at junit.framework.TestResult.run(TestResult.java:109)
>  at junit.framework.TestCase.run(TestCase.java:118)
>  at junit.framework.TestSuite.runTest(TestSuite.java:208)
>  at junit.framework.TestSuite.run(TestSuite.java:203)
>  at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
>  at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
>  at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to