jaxb

Intefacing EJB - XML using JAXB interface.

I was trying to add the xml schema to an existing EJB project. JAXB is used to bind the XML-Schema to java class. As we are going to use the search engine to crawl thru 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...

JAXB 2 in an Oracle 10g Webapp

I have a web application that uses JAXB 2. When deployed on an Oracle 10g app server I get errors as soon as I try to marshal an XML file. It turns out that Oracle includes JAXB 1 in a jar sneakily renamed "xml.jar". Does anyone know how I can force my webapp to use the version of the jaxb jars that I deployed in web-inf/lib over that...

"loader constraints violated when linking javax/xml/namespace/QName class" from webapp on Oracle 10g

We have a web application that can be deployed on many application servers, including Oracle 10g. On that platform, however, we are having classpath issues. The webapp uses JAXB 2, but Oracle 10g ships with JAXB 1, and this was causing errors. To get around those we configured Oracle to prefer classes in our webapp, but now we are get...

JAXB Binding Customization

Hi people, While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal class inheritance loop. Outer class OrderPropertyList may not subclass from inner class: OrderPropertyList My xsd define a element to group a unbounded element like this: <element minOccurs="0" name="orderProperty...

ArrayIndexOutOfBoundsException in XMLEntityScanner.peekChar reading XML from HttpRequest

I'm reading XML data from the HttpServletRequest in my servlets doPost() and passing the Reader from req.getReader() to a JAXB unmarshaller. I've tried a couple of different input XMLs but I always get this exception. SEVERE: Servlet.service() for servlet RESTPhotoAdmin threw exception java.lang.ArrayIndexOutOfBoundsException: 8192 ...

getter for boolean properties with JAXB

Hi guys! I´m trying to expose services using jax-ws but the first surprise i got was that Weblogic does not support inner classes for request/response objects. After get over this situation here, i´m facing another challenge: Generate getXXX() rather than/additionally to the isXXX() Method. I need to generate this methods cause when i ...

Java XML Binding

What are you using for binding XML to Java? JAXB, Castor, and XMLBeans are some of the available choices. The comparisons that I've seen are all three or four years old. I'm open to other suggestions. Marshalling / unmarshalling performance and ease of use are of particular interest. Clarification: I'd like to see not just what framewor...

JAXB - XJC - influencing generated typesafe enum class and members

Hi there, When compiling the following simpleType with the XJC compile (from the JAXB package)... <xs:simpleType name="test"> <xs:annotation> <xs:appinfo> <jaxb:typesafeEnumClass/> </xs:appinfo> </xs:annotation> <xs:restriction base="xs:string"> <xs:enumeration value="4"> <xs:annota...

JAXB or StAX Message Limits

I'm current developing a WebService in a Bea Websphere 6.1 environment with Axis 2 implementation, I'm trying to respect the current standards for Web Services (JAXB, JAXWS, StAX...). How long can be an XML message on this platform? I've searched around but I haven't found anything related to this topic. ...

unmarshalling an axis generated (multiref containing) soap response with jaxb

hi! I'm consuming an axis 1.4 web service that returns soap responses that I want to unmarshal into my domain objects using jaxb annotations. My initial tests worked very well until some of the returned messages had multiRef elements. Objects that were marshalled using multiRef were showing up as null in my client side annotated model ...

Updating from Jaxb 1 to Jaxb 2

I'm looking to update our project's jaxb version from 1 to 2. Has anyone tried doing this on their projects and are there any tips that anyone wanting to do this? I understand that each project is unique, I'm just looking for general tips. ...

JAXB: How to ignore namespace during unmarshalling XML document?

My schema specifies a namespace, but the documents don't. What's the simplest way to ignore namespace during JAXB unmarshalling (XML -> object)? In other words, I have <foo><bar></bar></foo> instead of, <foo xmlns="http://tempuri.org/"&gt;&lt;bar&gt;&lt;/bar&gt;&lt;/foo&gt; ...

JAXB - Remove 'standalone="yes"' from generated XML

Hi people, Do you know of a JAXB setting to prevent standalone="yes" from being generated in the resulting XML? <?xml version="1.0" encoding="UTF-8" standalone="yes"?> ...

java.util.List is an interface, and JAXB can't handle interfaces

Hi. I seemed to get the following exception when trying to deploy my application: Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions java.util.List is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at java.util.List ...

Namespaces unmarshaling problem with Jaxb on Spring WS

Hi all, I am using JAXB1 (v1.0.6) for marshaling/unmarshaling on Spring WS 1.0.4 and JDK 1.4.2. Everything was working well until I have tried to add namespaces to the original XSD files from which I have generated java classes by JAXB, so that the system could accept requests with namespaces. Now, when I send a requst to my system, I...

How to let JAXB render boolean as 0 and 1, not true and false

Hey guys. Got a quick question. Does anyone know how to let JAXB (marshall) render boolean fields as 1 and 0 instead of printing out "true" and "false"? ...

How to configure JAXB so it trims whitespaces when unmarshalling tag value?

How to configure JAXB unmarshaller so it will trim leading and trailing whitespaces from strings? For instance let's consider a simple binding between a Java bean and XML using JAXB annotations: @XmlRootElement(name="bean") class Bean { @XmlElement(required=true) String name; @XmlElement(required=true) int number; } I woul...

Java REST client without schema

Goal Java client for Yahoo's HotJobs Resumé Search REST API. Background I'm used to writing web-service clients for SOAP APIs, where wsimport generates proxy stubs and you're off and running. But this is a REST API, which is new to me. Details REST API No WADL No formal XML schema (XSD or DTD files). There are example XML request/...

How to ignore Unexpected element situation in JAXB?

How can one ignore Unexpected element situation in JAXB ans still get all other kind of javax.xml.bind.UnmarshalException? obj = unmler.unmarshal(new StringReader(xml)) Notice i still want to get the obj result of the xml parsing. ...

Unmarshalling using a CLOB

Hi All, I am using JAXB 1.0 along with Oracle XML DB. I have the XML Documents stored in the database in the columns of type XMLTYPE. Using XML DB APIs, I will be able to query the XMLType as CLOB or a String. Now, I would like to unmarshal/marshal based on the CLOB/String. How can I achieve this? Please advise. Thanks, Ramesh ...