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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:25:54+00:00 2026-06-04T18:25:54+00:00

I am trying to validate the incoming jsons by xsds. I had several services

  • 0

I am trying to validate the incoming jsons by xsds. I had several services exposed and every service had different JSON each mapped to different POJOs. So i wrote a master xsd which would contain all root elements of JSONs as sub elements and will import the respective xsds.

Now the problem is that I always get this exception:

WARNING: javax.xml.bind.UnmarshalException
 - with linked exception:
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'RequestBean'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement

My xsd is :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/RequestBean"
    xmlns:tns="http://www.example.org/RequestBean" elementFormDefault="unqualified"
    xmlns:poi="http://www.example.org/PoiRequest" xmlns:sendcar="http://www.example.org/SendCar">
 <xs:import namespace="http://www.example.org/PoiRequest"
            schemaLocation="PoiRequest.xsd"/>
 <xs:import namespace="http://www.example.org/SendCar"
            schemaLocation="SendCar.xsd"/>
    <xs:element name="RequestBean">
        <xs:complexType>
            <xs:all>
                <xs:element name="PoiRequest" type="poi:PoiRequest" minOccurs="0"/>
                <xs:element name="SendCar" type="sendcar:SendCar" minOccurs="0"/>
                </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

My config is below:

<jaxrs:server id="restContainer" address="/">
        <jaxrs:serviceBeans>
            <ref bean="PoiSearch" />
            <ref bean="SendCar" />
        </jaxrs:serviceBeans>
        <jaxrs:providers>
            <bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
            <property name="dropRootElement" value="true" /> 
            <property name="supportUnwrapped" value="true" />                               </bean>
        </jaxrs:providers> 
        <jaxrs:schemaLocations>
        <jaxrs:schemaLocation>file:C:\Desktop\xsds\RequestBean.xsd</jaxrs:schemaLocation>       <jaxrs:schemaLocation>file:C:\Desktop\xsds\PoiRequest.xsd</jaxrs:schemaLocation>
    <jaxrs:schemaLocation>file:C:\Desktop\xsds\Route.xsd</jaxrs:schemaLocation>
    <jaxrs:schemaLocation>file:C:\Desktop\xsds\Poi.xsd</jaxrs:schemaLocation>
    <jaxrs:schemaLocation>file:C:\Desktop\xsds\SendCar.xsd</jaxrs:schemaLocation> 

        </jaxrs:schemaLocations>
    </jaxrs:server>
  • 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-04T18:25:56+00:00Added an answer on June 4, 2026 at 6:25 pm

    Your first thing to check is the namespace or your XML document element. Your error points to an unqualified name, whereas your XSD uses a target namespace for RequestBean.

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

Sidebar

Related Questions

I'm trying to validate my JSON API using node.js + json-schema.js from commonjs-utils. Just
I am trying to validate a list of object on Struts2. Suppose you had
I’m trying to validate a string which contains numbers where each four numbers are
When trying to validate my site, I get the following error: Line 188, column
While trying to validate my forms i get the following error: Expected a {
While trying to validate form data on my page i get the following error:
I am trying to validate the entry in a cell based on the contents
I'm trying to validate a simple XML file against an XML schema using the
I am trying to validate an e-mail address using javascript. The problem is the
I am trying to validate two checkboxes. One of them must be checked in

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.