On my current project we generate JAXB beans from an XSD file.
We need line number information on the beans (beyond XSD validation errors!) so I used the -Xlocator option specified here:
http://java.sun.com/webservices/docs/1.6/jaxb/xjc.html
However, I'm missing the Locator class. The jar file referenced to on that six-year old page ca...
Hi, I am getting Out of Memory error:
Memory Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at org.apache.xerces.dom.CoreDocumentImpl.createElement(CoreDocumentImpl.java:564)
I have a standalone Java program which fetches data from DB and create an XML file using DOM. I get the above error if the data ...
Is there a way to configure JAXB to so that a generated class implements a specified interface? I'm intending to use JAXB generated classes as DAO's and they should be able implement my DAO interface.
...
I am marshalling (serializing) JAXB beans to output stream. How can I add DOCTYPE declaration and xml processing instructions to ouput?
I am doing currently marshalling like this:
JAXBContext jaxbContext = JAXBContext.newInstance("com.example.package");
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Mar...
I have 3 xsd files:
a.xsd
b.xsd
shared.xsd
shared.xsd is imported to both a.xsd and b.xsd using
<xs:import schemaLocation="shared.xsd"/>
shared.xsd defines
<xs:element name="item">
<xs:complexType> ....
If I generate java code using xjc a.xsd and b.xsd is generated into different packages and in each package a separate java c...
If I have Map setup like:
map.put("foo", "123");
map.put("bar", "456");
map.put("baz", "789");
then I want to do something like:
for (String key : map.keySet().toArray(new String[0])) {
// marshall out to .xml a tag with the name key and the
// value map.get(key)
}
So what it will marshal out is something like:
<map>
...
How can I remove leading/trailing white space before/while marshalling in JAXB?
...
I have a problem with Jaxb enumerations that is related to this bug
https://jaxb.dev.java.net/issues/show_bug.cgi?id=708
A patch has been supplied to the issue that can resolve the problem.
How can I apply this patch to resolve my problem
...
Im using JAXWS 2.1.7, using some classes to run through JAXWS's 'apt' to generate the WSDL. For dates, I use
@XmlSchemaType(name="time")
private Date wakeupTime;
and this generates a schema with xs:time, but when this all comes out in XML, the value is something like
<wakeupTime>1901-01-01T01:00:00 +10</wakeupTime>
I want JUS...
I put together an XSD and used JAXB to generate classes out of it.
Here are my XSDs-
myDoc.xsd :
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.mydoc.org"
targetNamespace="http://www.mydoc.org"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mtp="http://www.mytypes.com" elementFormDefault="qu...
Hi,
Could you, please, help with the following issue?
When generate WS client code (with wsimport ant task), all classes are generated automatically in the same package (e.g. helloservice.endpoint) as web service, e.g. if my web-service has method
public Node getNode();
so class helloservice.endpoint.Node is generated.
Nevertheless, ...
I have a JPA entity class mimicking a table. Something like this:
@XmlType(name="MyClassElementType")
public class MyClass {
String name;
String xmlDesc;
public MyClass() {}
@XmlElement
String getName() { return name; }
void setName(String name) { this.name = name; }
@XmlElement
String getXmlDesc() { r...
Hi there,
I've inherited a project which uses JAXB heavily to map XML messages onto Java objects. The problem I have is that some of the data which I receive (in this case nested XML of unknown form) has NOT to be unmarshalled, rather captured as a String.
An example will help
<a>
<b></b>
<c></c>
<d>
<!-- "Unknown" XML...
I have an xsd (for basecamp xml) that contains
<xsd:complexType name="ProjectType">
<xsd:sequence>
<xsd:element name="announcement"
type="TypedNilableStringElementType"
maxOccurs="1" minOccurs="1">
</xsd:element>
<xsd:element name="created-on"
type="TypedDateElementType" maxOccurs="1"
minOccurs="1">
...
Hi I'm very new to XML, and webservices but I'm recieving XML from a SOAP webservice that looks kind of like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ArrayOfCreditCardSettlement xmlns="http://schemas.datacontract.org/2004/07/Borgun.Library.Common">
<ns0:CreditCardSettlement xmlns="http://Borgun.Services...
We're using apache cxf 2.2.2 with JaxB and I need to change the wsdl:definitions name of an exported wsdl to something else. Does anyone know how I could change it, possibly via a JAXB annotation?
...
Is it possible to use JAXB to unmarshall xml to a specific Java class based on an attribute of the xml?
<shapes>
<shape type="square" points="4" square-specific-attribute="foo" />
<shape type="triangle" points="3" triangle-specific-attribute="bar" />
</shapes>
I would like to have a List of Shape objects containing a triangle and ...
I have eventually managed to fiddle HyperJAXB so that when XSD has complexType A and this has an IDREF to complexType B, then HyperJAXB will generate @OneToOne JPA annotations between the the two generated entities.
However now I'm facing another problem: the XSD has complex type X that can IDREF to either complex type Y or complex type...
Hello
I want to generate a xsd file dynamically, I don't want to use jaxb because it creates alot of files when I use schemagen and I want the schema in one file only.
any idea?
thx
al
...
I have the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<details>
...
<address1>Test&Address</address1>
...
</details>
When I try to unmarshal it using JAXB, it throws the following exception:
Caused by: org.xml.sax.SAXParseException: The reference to entity "Address" must end with the ';' delimiter.
at org...