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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:35:24+00:00 2026-06-16T01:35:24+00:00

I have an xsd provided by a client I can’t change. I’m using jaxb

  • 0

I have an xsd provided by a client I can’t change. I’m using jaxb to generate the classes. The resulting class has an annotation like:

@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar expires;

I try to turn this into json using GSON and I get a classnotfoundexception for javax.xml.bind.XmlSchemaType. I add the dependency for javax.xml.bind in maven pom.xml:

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.xml.bind</artifactId>
    <version>3.0-b54</version>
    <scope>compile</scope>
</dependency>

Then I get this crazy error:

Attempt to include a core class (java.* or javax.*) in something other
than a core library. It is likely that you have attempted to include
in an application the core library (or a part thereof) from a desktop
virtual machine. This will most assuredly not work. At a minimum, it
jeopardizes the compatibility of your app with future versions of the
platform. It is also often of questionable legality.

If you really intend to build a core library — which is only
appropriate as part of creating a full virtual machine distribution,
as opposed to compiling an application — then use the
“–core-library” option to suppress this error message.

If you go ahead and use “–core-library” but are in fact building an
application, then be forewarned that your application will still fail
to build or run, at some point. Please be prepared for angry customers
who find, for example, that your application ceases to function once
they upgrade their operating system. You will be to blame for this
problem.

If you are legitimately using some code that happens to be in a core
package, then the easiest safe alternative you have is to repackage
that code. That is, move the classes in question into your own package
namespace. This means that they will never be in conflict with core
system classes. If you find that you cannot do this, then that is an
indication that the path you are on will ultimately lead to pain,
suffering, grief, and lamentation.

!!!

I either need to skip the annotation, tell jaxb not to generate themor gson to ignore them or import the dependency correctly.

  • 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-06-16T01:35:26+00:00Added an answer on June 16, 2026 at 1:35 am
    <scope>provided</scope>
    

    fixed me up – i wasn’t aware that everything under javax.* is provided by android.

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

Sidebar

Related Questions

I want to generate java code from xsd using JAXB 2.1 XJC. I have
I have been provided with an xsd that I compiled to Java classes using
I have xsd schema file which I can't change. Here is an excerpt that
I have multiple WSDL/XSD files and using JAXB I'm generating it's clients. But there
I have been trying to generate a Proxy class in VB.NET using a WSDL
I have been provided an XSD and a sample Xml file that contains the
I have an XSD file which is used to generate some objects which are
We have an XSD file along with some java src files. How can we
It seems I can't easily have an XSD declaration for this simple XML <root>
I'm working in Visual Studio 2008 using c#. Let's say I have 2 xsd

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.