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 6682017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:39:26+00:00 2026-05-26T04:39:26+00:00

For a larger project using XML as an export/import format, I recieved an XSD

  • 0

For a larger project using XML as an export/import format, I recieved an XSD schema file. I used JAXB to generate the classes, added routines to fill the data into the generated classes. Now I am marshalling the whole file into an XML file on disk:

Spmigration mig = new Spmigration(); //Main migration object
mig.setBestellungen(new OrdersImpl().getOrders(shop));
JAXBContext jc = JAXBContext.newInstance( "my.migration.context" );
Marshaller m = jc.createMarshaller();
m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
m.marshal( mig, new File("test.xml") );

This works like a charm. The output file is well-formed and, given the right schema, even valid. Now, I am trying to export the file, but adding the schema directly. I added a few lines:

Spmigration mig = new Spmigration(); //Main migration object
mig.setBestellungen(new OrdersImpl().getOrders(shop));
JAXBContext jc = JAXBContext.newInstance( "my.migration.context" );
Marshaller m = jc.createMarshaller();
SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
Schema schema = schemaFactory.newSchema(new File("myschema.xsd"));
m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
m.setSchema(schema);
m.marshal( mig, new File("test.xml") );

The schema file exists and is readable (I know because I got another error when I forgot to supply the file when I first tried). Now, the line

Schema schema = schemaFactory.newSchema(new File("myschema.xsd"));

generated the following exception:

java.lang.VerifyError: (class: org/apache/xerces/impl/xs/XSAnnotationImpl, method: writeToDOM signature: (Lorg/w3c/dom/Node;S)V) Incompatible object argument for function call
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)

Of course, this is not the whole stack trace. But it seems to be the problem. I’m not reading anything significant from the very low number of problems that the net knows about with this specific error message.

Is there anything I could check, anything I am doing wrong?

  • 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-26T04:39:26+00:00Added an answer on May 26, 2026 at 4:39 am

    It’s not really a solution, but what we finally did was not add the schema using the methods described for that, but add the schema later via a textual replace in another step.

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

Sidebar

Related Questions

I auto-generated some classes using xsd.exe for a project I am working on. I
As part of a larger project I'm trying to implement a facility using JOGL
In a recent project the lead developer designed a database schema where larger tables
As a personal project, I'm making an AJAX chatroom application using XML as a
While working on a larger project, a few lines of code using java.net.Socket failed
My C++ project is growing larger. We are also moving to using cmake for
Background My project is urgent and requires that I iterate a large XML file
I'm re-working an ant build file that we've been using on our project for
I'm trying to add something to a larger C++ project which is developed using
Currently I am using a single .js file for a whole project (plus included

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.