users@jaxb.java.net

RE: Re: Re: Re: FW: JAXB memory leak issue

From: Tamanna Shah <tamannas_at_cybage.com>
Date: Thu, 18 Jun 2009 12:01:00 +0530

Hi,

 

I am trying out using the customize xjb file however I am getting
following error:

 

================================================

F:\test\JAXB\jaxb-ri-20090206\bin>xjc -b E:\Training\JAXB\ota.xjb -d
test E:\Training\JAXB\OTA_SimpleTypes.xsd
E:\Training\JAXB\OTA_CommonTypes.xsd
E:\Training\JAXB\OTA_CommonPrefs.xsd

parsing a schema...

[ERROR] Multiple <schemaBindings> are defined for the target namespace
""

  line 11 of file:/E:/Training/JAXB/ota.xjb

 

[ERROR] Another <schemaBindings> is defined here

  line 16 of file:/E:/Training/JAXB/ota.xjb

 

[ERROR] compiler was unable to honor this schemaBinding customization.
It is att

ached to a wrong place, or its inconsistent with other bindings.

  line 16 of file:/E:/Training/JAXB/ota.xjb

 

[ERROR] (the above customization is attached to the following location
in the sc

hema)

  line 3 of file:/E:/Training/JAXB/OTA_CommonTypes.xsd

 

Failed to parse a schema.

================================================

 

Here is my xjb file:

 

================================================

<?xml version="1.0" encoding="UTF-8"?>

<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"

               xmlns:xsd="http://www.w3.org/2001/XMLSchema"

               jaxb:version="2.0">

  <jaxb:bindings schemaLocation="OTA_SimpleTypes.xsd"
node="/xsd:schema">

    <jaxb:schemaBindings>

      <jaxb:package name="com.seekda.message.model.simpletypes"/>

    </jaxb:schemaBindings>

  </jaxb:bindings>

  <jaxb:bindings schemaLocation="OTA_CommonTypes.xsd"
node="/xsd:schema">

    <jaxb:schemaBindings>

      <jaxb:package name="com.seekda.message.model.commontypes"/>

    </jaxb:schemaBindings>

  </jaxb:bindings>

  <jaxb:bindings schemaLocation="OTA_CommonPrefs.xsd"
node="/xsd:schema">

    <jaxb:schemaBindings>

      <jaxb:package name="com.seekda.message.model.commonprefs"/>

    </jaxb:schemaBindings>

  </jaxb:bindings>

</jaxb:bindings>

================================================

 

I am also attaching my xsd file with this note.

 

Regards,

Tamanna Shah

Sr. Software Engineer

________________________________

From: Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com]
Sent: Thursday, June 18, 2009 11:43 AM
To: users_at_jaxb.dev.java.net
Subject: Re: Re: Re: FW: JAXB memory leak issue

 

What's keeping you from trying the customization approach?

-W



 

On 6/18/09, Tamanna Shah <tamannas_at_cybage.com> wrote:

Yes, we were giving the package name. We were using Eclipse plug in of
XJC. But still it was generating same classes.

 

I tried using this as well:

 

F:\test\JAXB\jaxb-ri-20090206\bin>xjc -episode simpletypes.episode
E:\Training\JAXB\OTA_SimpleTypes.xsd -p
com.seekda.message.model.simpletypes

 

F:\test\JAXB\jaxb-ri-20090206\bin>xjc -b simpletypes.episode
E:\Training\JAXB\OTA_CommonTypes.xsd -p
com.seekda.message.model.commontypes

 

but it did not worked.

 

Regards,

Tamanna Shah

Sr. Software Engineer

________________________________

From: Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com]
Sent: Thursday, June 18, 2009 11:26 AM
To: users_at_jaxb.dev.java.net
Subject: Re: Re: FW: JAXB memory leak issue

 

Do you specify the destination package with an xjc command line option?

 

In your case, you shoud define the package along with each

schema. You can do this with JAXB's customization feature,

either inline (in the schema) or as a separate .xjb file.

 

This is discussed in my JAXB Tutorial, see here
<https://jaxb.dev.java.net/tutorial/section_5_2-Defining-Package-Names.h
tml#Defining%2520Package%2520Names>

 

-W



 

On 6/18/09, Tamanna Shah <tamannas_at_cybage.com> wrote:

Hi,

I do have set of XSDs which are interlinked. Let's say I have 4 xsds
a.xsd, b.xsd,c.xsd and d.xsd. b.xsd include a.xsd and c.xsd and d.xsd
include b.xsd. When I try to generate classes using XJC for c.xsd, it
generates classes for b.xsd and a.xsd. Same of d.xsd. Hence, it is
generating duplicate classes in package of c.xsd and d.xsd. How can I
avoid this?


Regards,
Tamanna Shah
Sr. Software Engineer
-----Original Message-----
From: aleksei.valikov_at_gmail.com [mailto:aleksei.valikov_at_gmail.com] On
Behalf Of Aleksei Valikov
Sent: Wednesday, June 17, 2009 11:59 PM
To: users_at_jaxb.dev.java.net
Subject: Re: FW: JAXB memory leak issue

Hi,

> I am facing memory leak issue while loading the JAXB classes using
JAXBContext.newInstance(factoryClass); method.

What exactly leaks memory? How did you find it out?

> I am using JDK 1.6.0.14 and my application is deployed on tomcat
6.0.18.
>
> How do I resolve it? also, when I generate classes using XJC tool it
is generating too many classes basically, I wanted to avoid generation
of repeated classes. How do I do that?

I'm not sure what you mean with "repeated classes" but maybe episodes
are something you're looking for.

http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.htm
l

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net


"Legal Disclaimer: This electronic message and all contents contain
information from Cybage Software Private Limited which may be
privileged, confidential, or otherwise protected from disclosure. The
information is intended to be for the addressee(s) only. If you are not
an addressee, any disclosure, copy, distribution, or use of the contents
of this message is strictly prohibited. If you have received this
electronic message in error please notify the sender by reply e-mail to
and destroy the original message and all copies. Cybage has taken every
reasonable precaution to minimize the risk of malicious content in the
mail, but is not liable for any damage you may sustain as a result of
any malicious content in this e-mail. You should carry out your own
malicious content checks before opening the e-mail or attachment."
www.cybage.com <http://www.cybage.com/>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net

 

"Legal Disclaimer: This electronic message and all contents contain
information from Cybage Software Private Limited which may be
privileged, confidential, or otherwise protected from disclosure. The
information is intended to be for the addressee(s) only. If you are not
an addressee, any disclosure, copy, distribution, or use of the contents
of this message is strictly prohibited. If you have received this
electronic message in error please notify the sender by reply e-mail to
and destroy the original message and all copies. Cybage has taken every
reasonable precaution to minimize the risk of malicious content in the
mail, but is not liable for any damage you may sustain as a result of
any malicious content in this e-mail. You should carry out your own
malicious content checks before opening the e-mail or attachment."
www.cybage.com <http://www.cybage.com/>