users@jaxb.java.net

RE: JAXBContext.newInstance() - long time to execute

From: Beech Tanya <TBEECH_at_qinetiq.com>
Date: Tue, 28 Mar 2006 09:51:38 +0100

My schema is fairly short, I've included it here.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="retrieveItems" type="retrieveItem"/>
        <xsd:complexType name="retrieveItem">
                <xsd:all>
                        <xsd:element name="collection" type="xsd:string"/>
                        <xsd:element name="resourceToRetrieve"
type="xsd:string"/>
                </xsd:all>
        </xsd:complexType>
        <xsd:element name="ingestItems" type="ingestItem"/>
        <xsd:complexType name="ingestItem">
                <xsd:all>
                        <xsd:element name="collection" type="xsd:string"/>
                        <xsd:element name="itemName" type="xsd:string"/>
                        <xsd:element name="itemToIngest" type="xsd:string"/>
                </xsd:all>
        </xsd:complexType>
        <xsd:element name="deleteItems" type="deleteItem"/>
        <xsd:complexType name="deleteItem">
                <xsd:all>
                        <xsd:element name="collection" type="xsd:string"/>
                        <xsd:element name="nameOfItemToDelete"
type="xsd:string"/>
                </xsd:all>
        </xsd:complexType>
        <xsd:element name="updateItems" type="updateItem"/>
        <xsd:complexType name="updateItem">
                <xsd:all>
                        <xsd:element name="collection" type="xsd:string"/>
                        <xsd:element name="updataDetails"
type="xsd:string"/>
                </xsd:all>
        </xsd:complexType>
        <xsd:element name="bifData" type="requestBifData"/>
        <xsd:complexType name="GeoData">
                <xsd:sequence>
                        <xsd:element name="Latitude" type="xsd:double"/>
                        <xsd:element name="Longitude" type="xsd:double"/>
                </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="Annotation">
                <xsd:sequence minOccurs="0">
                        <xsd:element name="Keyword" type="xsd:string"
minOccurs="0" maxOccurs="unbounded"/>
                        <xsd:element name="FreeText" type="xsd:string"
minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="FrameData">
                <xsd:sequence>
                        <xsd:element name="FrameNumber" type="xsd:string"/>
                        <xsd:element name="FrameGeoData" type="GeoData"
minOccurs="0" maxOccurs="6"/>
                        <xsd:element name="FrameAnnotations"
type="Annotation" minOccurs="0"/>
                        <xsd:element name="GuiURL" type="xsd:anyURI"/>
                </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="VideoData">
                <xsd:sequence>
                        <xsd:element name="Title" type="xsd:string"/>
                        <xsd:element name="Description" type="xsd:string"/>
                        <xsd:element name="VideoGeoData" type="GeoData"
minOccurs="0" maxOccurs="unbounded"/>
                        <xsd:element name="GuiURL" type="xsd:anyURI"/>
                        <xsd:element name="VideoFrameData" type="FrameData"
minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="requestBifData">
                <xsd:sequence>
                        <xsd:element name="videoData" type="VideoData"
maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>
        <xsd:simpleType name="Latitude">
                <xsd:restriction base="xsd:double">
                        <xsd:maxInclusive value="90.0"/>
                        <xsd:minInclusive value="-90.0"/>
                </xsd:restriction>
        </xsd:simpleType>
        <xsd:simpleType name="Longitude">
                <xsd:restriction base="xsd:double">
                        <xsd:maxInclusive value="180"/>
                        <xsd:minInclusive value="-180"/>
                </xsd:restriction>
        </xsd:simpleType>
</xsd:schema>

Regards Tanya

Tanya Beech
Signal Processing

QinetiQ
Bldg E Rm 103
Malvern Technology Centre
St. Andrews Road, Malvern
Worcestershire, WR14 3PS

Tel: 01684 895232
Email: tbeech_at_QinetiQ.com
Mobile: 07766 134364
Web: www.QinetiQ.com

QinetiQ - The Global Defence and Security Experts
-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: 27 March 2006 19:53
To: users_at_jaxb.dev.java.net
Subject: Re: JAXBContext.newInstance() - long time to execute

Beech Tanya wrote:
> Hi
>
>
>
> I've been using JAXB (2) with Tomcat (5.5.16) inside axis2 and have found
> that first time JAXBContext.newInstance(...) is called it takes over 1
> minute with 100% cpu usage and often causes the connection to time out.
> Subsequent calls happen instantly as it does inside my test harness. Any
> ideas as to what can cause it to hang for this long?

How big is your schema?

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
The information contained in this E-Mail and any subsequent
correspondence is private and is intended solely for the intended
recipient(s).  The information in this communication may be confidential
and/or legally privileged.  Nothing in this e-mail is intended to
conclude a contract on behalf of QinetiQ or make QinetiQ subject to any
other legally binding commitments, unless the e-mail contains an express
statement to the contrary or incorporates a formal Purchase Order.
For those other than the recipient any disclosure, copying,
distribution, or any action taken or omitted to be taken in reliance on
such information is prohibited and may be unlawful.
Emails and other electronic communication with QinetiQ may be monitored
and recorded for business purposes including security, audit and
archival purposes.  Any response to this email indicates consent to
this.
Telephone calls to QinetiQ may be monitored or recorded for quality
control, security and other business purposes.