• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jibx under multimodule maven project:

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It’s been frustrating trying to use JiBX on my project. I have the following configuration:

Maven muti-module project:

parent-project
+—— model-project This project will have the common domain objects defined on XSD files
+—— message-project This project will contain the Webservice Request/Response definitions on XSD and logic
+—— backend-project
+—— frontend-project

the thing is:

on model-project I have let’s say: person.xsd is

and under message-project I have let’s say: personService.xsd:

If I were using JAXB I would be able to use oasis catalogs to reference the external xsd: from message-project to the stored under model-project but I have not been able to find something equivalent for JiBX.

I have been reading the jibx customizations but seems not to be the right paht, neither the multimodule configuration, as I am not facing a binding issue (yet) I just need to generate the service classes that references the Person object from the model-project

Best,

-Martin
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try setting schemaLocation in your XMLs?
 
Martin Hermosilla
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
schemaLocation works locally within the project let's say
if both described xsd where in the same project directory
won't be any trouble.

the problem is that each file is located on each project directory.
so JAXB works with oasis catalog, so I can define schema locations
and export them using those catalogs, on the other hand JiBX seems
not to be following that way of working. So I'm looking how to generate
the java source code under this configuration.

Thanks,

-Martin
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is your import namespace different? one says person and another says personservice?
I'm just posting one of the xml which I use. Each reside in it's own project.







Also, did you try using this - http://jibx.sourceforge.net/maven-jibx-plugin/schema-codegen-mojo.html
I've used it for the example above and had no issues.
 
Martin Hermosilla
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because one file person.xsd defines a person model and the project has a module which holds all the model objects.
another sub-module holds the messaging objects, those message objects will use the objects of module (among others)..
that is the reason there are different namespaces, but either I have the same namespace or not JiBX will have the same
issue regarding the xsd location when generating code on message-project, cannot access the person.xsd under model-project
 
Martin Hermosilla
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using schema-codegen-mojo... it is so limited!
 
Martin Hermosilla
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to see if customization can help somehow!
 
Martin Hermosilla
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update:

Finally I was able to generate the java source code with the desired references to module-package using JiBX customizations and maven copy files.

The only problem that now I am facing is that both modules model-project and message-project are generating the person object.

Let's say that
model-project generates com.example.model.Person

and
message-project generates
com.example.message.GetPersonRequest
com.example.message.GetPersonResponse

classes are generated.

Now message-project is also generating
com.example.model.Person
(after fixing with JiBX customization before was com.example.message.Person)
the thing is, I don't want that class and package to be generated under message-project.

So let's see if anyone can help on that.

Thanks,


-Martin
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic