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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:56:27+00:00 2026-05-10T15:56:27+00:00

I was trying to add the XML schema to an existing EJB project. JAXB

  • 0

I was trying to add the XML schema to an existing EJB project. JAXB is used to bind the XML-Schema to a Java class. As we are going to use the search engine to crawl through DTO when EJB is in session.

I could not find any direct approach as to map entity class file to XML-Schema.

The only way we could achieve so far is to create the Web Services, generate the WSDL which generates xml-schema (XSD) and then parsing the XSD file thru JAXB (xjc command) to create java class files. Now using mapping-binding.xml file we can map both XML and Java class file.

But now again the issue is to how map this to entity class.

This is what we want to achieve:

  • XML Data Object with XML Schema, (This is already present in the JAXB specification).
  • Entity Bean then Extends or has an interface to this JAXB object.
  • All Persistence functions are managed by the Entity Bean…
  • The Entity Bean would then contain the XML Marshalling and UnMarshalling features found in JAXB..
  • A Value Object could be retrieved in binary or XML form from the Entity Bean Object.
  • A JSP could easily extract the XML Schema and XML Data from the Value Object and perform operations on it such as XSL transformations.

My argument is that the Entity Beans have no standard way for interfacing to JAXB objects.

Castor may be the solution, but then again we have to implement web services or using castor JDO’s.

I found XStream to be pretty useful as it uses a converter class in which you can call the entity bean class objects and generate a xml file. But I was not preferring to use another class but incorporate the functions in existing bean class.

Can you help me in this regard?


I will tell you what I am actually trying to achieve. I’m creating a search engine which will be evoked during the EJB in session and will use crawler thru the DTO’s and get the snapshot in XML format. Search will be on different criteria.

Lucene is one of the search engine tools but then it uses its own properties and files (will act more like standalone)

I already have DTO’s which are used by webservices to communicate between PHP & Java application (EJB-layer). I wanted to re-use those DTO’s in jaxb as a crawler to get the output from tables in XML which I am not able to do as JAXB uses its own generated classes thru xml-schema. Like you said I have yet not found a way to instruct JAXB to bean classes.

  • 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. 2026-05-10T15:56:27+00:00Added an answer on May 10, 2026 at 3:56 pm

    Tightly coupling your data model (entity beans) to your XML interface might not be the best idea in the world; it prevents you from changing one without changing the other.

    I’m not 100% sure I understand what you are trying to do, but I think there is a way to instruct JAXB to extend classes rather than create new ones. You could create your Entity Beans as normal, and have your JAXB-generated beans extend those with the extra information.

    I can say that getting Entity beans instances from somewhere other than your persistence layer (such as deserializing them from XML) is going to be a huge problem for you.

    Also note that using XML to communicate between Java applications (such as between a JSP/Servlet and EJB layer) is a bad idea; the marshaling and added verbosity of the XML buys you very little; serializing objects via RMI (which is what EJB will do for you) would be much easier to implement, test and maintain.

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

Sidebar

Related Questions

No related questions found

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.