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

  • SEARCH
  • Home
  • 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 6675937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:55:25+00:00 2026-05-26T03:55:25+00:00

What are the steps getting an (model) object from an XML file? Given an

  • 0

What are the steps getting an (model) object from an XML file?

Given an XSD and JAXB dependency at Spring 3, built with Maven using Java 1.6.

Note: I am new to Spring and that technologies.

What I tried

I put that dependency (can I use a newer version):

    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-oxm-tiger</artifactId>
        <version>1.5.4</version>
    </dependency>

and that

        <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <executions>
                <execution>
                    <id>generate-oxm</id>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <schemaDirectory>src/main/resources/META-INF/xsd</schemaDirectory>
                        <generatePackage>com.aaa.xjc</generatePackage>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>

to my POM file.

I made a class like that:

@Configuration
public class XmlAdapter {
    @Autowired
    private ResourcePatternResolver resourceResolver;

    @Bean
    public Jaxb2Marshaller oxmMarshaller() throws IOException {
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setContextPath("com.aaa.xjc");
        marshaller.setSchemas(resourceResolver.getResources("classpath:/META-INF/xsd/*.xsd"));
        return marshaller;
    }

}

Problem

Actually I didn’t understand that context path and how to call that oxmMarshaller method.

How can I use my existing XSD to validate them?
I tried that according to my previous question: Xml to Object java Spring 3

  • 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-26T03:55:26+00:00Added an answer on May 26, 2026 at 3:55 am

    You will first need to run xjc on the XSD to generate the JaxB classes. You will then need to create these JaxB objects, ideally using the generated ObjectFactory. At that point you can send that object to the JaxB2Marshaller. If you want to return as a response in a web application, you can use the MarshallingView.

    As far as the maven deps, all the JaxB stuff will be included with Java 6. You will need to properly manage the spring deps. At the very least, you will need Spring OXM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a AWS::S3::NoConnectionEstablished exception when trying to download a file using paperclip
I followed the sitemap activation steps on the django site but i keep getting
What steps I need to perform in order to convert asp.net 2 application from
What steps should I follow to upgrade a Ruby project from 1.8.6 to 1.8.7?
I'm using a VBO with an interleaved array to render a obj (model format)
I'm using nested_form for a situation where: Parent (climb) ==has_one==> Join Model (route_ascent) ==polymorphic
p = Factory(:model) ap Model.find(:all) #output to prove that it's getting created so... the
The xmlns attribute in the following code stops me getting the value I need.
I am getting OutOfMemoryError: java heap snippets of the method: { // step 1:
Steps: Run the build including unit tests. Expected result: the unit tests are executed

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.