Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NullPointerException while using jaxb moxy
NullPointerException while using jaxb moxy [message #1072367] Mon, 22 July 2013 15:56 Go to next message
Nageshwara Musini is currently offline Nageshwara MusiniFriend
Messages: 1
Registered: July 2013
Junior Member
Hi,

when we are using following javaclass in jaxb moxy binding file getting NullPointerException.

public class MultipleContainers extends
com.ibm.connector2.cics.ECIChannelRecord{}


Exception:

Caused by: java.lang.NullPointerException
at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.java:245)


when we debug source its actually failing at isMapType(javaClass) method in AnnotationsProcessor.java file. can anyone help us how to resolve this issue. we are using v2.4.0 libraries.
Re: NullPointerException while using jaxb moxy [message #1072469 is a reply to message #1072367] Mon, 22 July 2013 20:48 Go to previous message
Blaise Doughan is currently offline Blaise DoughanFriend
Messages: 163
Registered: July 2009
Senior Member

Is there data from com.ibm.connector2.cics.ECIChannelRecord that you wish to map, or does your domain class simply need to extend it?

If ECIChannelRecord contains data that you need to map, could you post some details about this class or provide a similar class that demonstrates the same issue to help us debug? Also the latest EclipseLink release is 2.5.0 (there is also EclipseLink 2.4.2) do you see the same error in the latest releases:

- http://www.eclipse.org/eclipselink/downloads/

If none of the super class properties are mapped then you can use an external mapping file to override the super class for MultipleContainers to be Object rather than ECIChannelRecord.

Mapping File (oxm.xml)

<?xml version="1.0"?>
<xml-bindings
    xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
    package-name="com.example.foo">
    <java-types>
        <java-type name="MultipleContainers" super-type="java.lang.Object"/>
    </java-types>
</xml-bindings>


Bootstrapping from the Mapping File

import java.util.*;
import javax.xml.bind.JAXBContext;
import org.eclipse.persistence.jaxb.JAXBContextProperties;

public class Demo {

    public static void main(String[] args) throws Exception {
        Map<String, Object> properties = new HashMap<String, Object>(1);
        properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, "com/example/foo/oxm.xml");
        JAXBContext jc = JAXBContext.newInstance(new Class[] {MultipleContainers.class}, properties);
    }

}

Previous Topic:EclipseLink in RCP: javax.naming.NoInitialContextException
Next Topic:Canonical model class is not working after changing the class name
Goto Forum:
  


Current Time: Thu Apr 25 15:05:29 GMT 2024

Powered by FUDForum. Page generated in 0.02905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top