Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 2017922
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:56:42+00:00 2026-05-17T08:56:42+00:00

Has anyone got EclipseLink MOXy (I’m using eclipselink 2.1.0) to work with Java 5?

  • 0

Has anyone got EclipseLink MOXy (I’m using eclipselink 2.1.0) to work with Java 5? Whenever I try to unmarshal I get a null pointer exception in org.eclipse.persistence.oxm.record.UnmarshalRecord, in the startCDATA() method (xPathNode is null). The exact same code and XML works wonderfully in Java6.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T08:56:42+00:00Added an answer on May 17, 2026 at 8:56 am

    I’m the tech lead for MOXy. Can you provide the stack trace & more details on your use case?

    For more information on MOXy check out:

    • https://wiki.eclipse.org/EclipseLink/FAQ/MOXy
    • http://bdoughan.blogspot.com

    Re your update:

    I haven’t been able to reproduce this on my end. I am using the following env. Do you have a test case you can send (blaise.doughan@gmail.com) or point out what I’m doing differently?:

    • JDK: 1.5.0_22
    • EclipseLink 2.1.0

    The following model:

    package cdata;
    
    import javax.xml.bind.annotation.XmlRootElement;
    
    @XmlRootElement
    public class Customer {
    
        private String firstName;
        private String lastName;
    
        public String getFirstName() {
            return firstName;
        }
    
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        }
    
        public String getLastName() {
            return lastName;
        }
    
        public void setLastName(String lastName) {
            this.lastName = lastName;
        }
    
    }
    

    Demo code:

    package cdata;
    
    import java.io.File;
    
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Marshaller;
    import javax.xml.bind.Unmarshaller;
    
    public class Demo {
    
        public static void main(String[] args) throws Exception {
            JAXBContext jc = JAXBContext.newInstance(Customer.class);
    
            Unmarshaller unmarshaller = jc.createUnmarshaller();
            Customer customer = (Customer) unmarshaller.unmarshal(new File("src/cdata/input.xml"));
    
            Marshaller marshaller = jc.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
            marshaller.marshal(customer, System.out);
        }
    }
    

    And XML:

    <?xml version="1.0" encoding="UTF-8"?>
    <customer>
        <firstName>Jane</firstName>
        <middleName><![CDATA[<?xml version="1.0"?>]]></middleName>
        <lastName>Doe</lastName>
    </customer>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone got any idea to why doesn't the following work ? $file =
Has anyone got a working solution without some Java/COM-bridge? E.g. process the Email as
Has anyone got any idea how to implement a rudimentary semaphore in java without
I'm using webview in my xcode javascript refuses to run. has anyone got any
Has anyone got to some good code to zoom into an image using javascript?
Has anyone got this exception thrown when using the the controls databinding methods?? I
Has anyone got any experience with the following exception when using GAE urlfetch? DownloadError:
1.1 or 2.0 runtime? Also has anyone got any exprience using OTP.NET?
has anyone got NCover, TypeMock and MSTest to work together? and if so how.
Has anyone got a RESTful WCF service (in .NET4) successfully using JSON.NET to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.