jaxb « jaxb « Java Enterprise Q&A





1. Why can't JAXB find my jaxb.index when running inside Apache Felix?    stackoverflow.com

It's right there, in the package that it should be indexing. Still, when I call

JAXBContext jc = JAXBContext.newInstance("my.package.name");
I get a JAXBException saying that
"my.package.name" doesnt contain ObjectFactory.class or jaxb.index
although ...

2. JAXB only marshals/unmarshals root node    stackoverflow.com

I am new to JAXB. All I want to do is, given an existing xml string marshal it, and return it in an ejb. The problem is the following code only ...

3. Apache Camel inOut routes, out exchange marshaling/unmarshaling with jaxb    stackoverflow.com

we have this apache camel route,

from(commandDrop).marshal(jaxbDataFormat).to(jmsQueue);    
from(jmsQueue).inOut("jms:doCommand?requestTimeout=500000");          
from("jms:doCommand").unmarshal(jaxbDataFormat).beanRef("bean");
.... and a bean class like this
class BeanClass {
    ...

4. jaxb.properties within a JAR file    stackoverflow.com

I am using JAXB version 2. I am using the Sun version so that I can use the replacement of namespaces that is not functioning with standard implementation. This ...

5. java: use two version of the same lib in one webapp    stackoverflow.com

I'm facing the following problem: I have one module in my webapp that needs jaxb 1.x and the other module needs jaxb 2.x. The first module doesn't work with the new ...

6. JAXB Annotations and SuperClass    stackoverflow.com

I'm trying to use JAXB annotations in a parent class so that all the sub classes can inherit them but I'm running into a marshaling error. I don't get the ...

7. JAXB, DOM, SAX    coderanch.com

Hi Thanks to all who replied ... I'm now clearer on the differences between JAXB and SAX/DOM. Found the following from the sun's site. Hope that it's useful . * JAXB simplifies access to an XML document from a Java program: - JAXB allows you to access and process XML data without having to know XML or XML processing. Unlike SAX-based ...

8. jaxb - getting InvocationTargetException during parsing    coderanch.com

Hi all, I'm trying to get JAXB to generate the java classes by using xjc.sh on test.xsd (shown below). Apparently, JAXB does not like it when i try to use extension on a complexType/simpleContent/Restriction? Is there something i'm doing wrong or does xjc.sh not support what i'm trying to do? Would appreciate any help/hints. Thanks! I am using jwsdp-1.3 and j2sdk1.4.1_02. ...

9. JAXB sample in the JWSDP1.3    coderanch.com





10. Jaxb+Webservices    coderanch.com

11. JAXB nested interfaces.    coderanch.com

I'm trying to figure out JAXB, I've succesfully autogenerated the classes and interfaces, but I ran into an error. One of the nested interfaces gives the error "Nested Type FOO hides an enclosing type". The code looks something like: package myPackage.jaxb; public interface FOO { java.util.List getBAR(); public interface BAR extends javax.xml.bind.Element, myPackage.jaxb.FOO.FOO { } public interface FOO { java.lang.String getAssortedStuff(); ...

12. Problem while using JAXB    coderanch.com

13. Cannot use JAXP and JAXB because they are not thread-safe?    coderanch.com

Hi All, I was participating in meeting about a Web Service project yesterday and I was surprised when I discovered that the architects where planning to use their own in-house Java API instead of using JAXB or JAXP APIs. When I asked why did decide that, the answer was: JAXP and JAXB are not thread-safe APIs Well, now I am more ...

14. New to Web Services and JAXB    coderanch.com

I have downloaded and installed the JWSDP and installed it with tomcat 5 for Java WSDP on my Win XP workstations. I am able to build and compile the source files for the unmarshal-read sample application. However, when I go on to try to run the application, i get the following stack trace: C:\Sun\jwsdp-1.6\jaxb\samples\unmarshal-read\classes>java Main java.lang.SecurityException: class "javax.xml.namespace.NamespaceContext"'s signer information does ...

15. SOAPElement and JAXB    coderanch.com

16. JAXB----- InterningXMLReader problem    coderanch.com





17. web service that takes a JAXB class    coderanch.com

Forgive this question, but I'm very new to web services! I've got an application that takes a xml document in a request parameter attribute of a HTTP post. This xml document validates to custom xsd I created and I currently use JAXB to unmarshall the xml so I can pull the data out and insert it into my database. What I'd ...

18. jaxb.properties file    coderanch.com

19. ANT build script fails with JAXB classes in use    coderanch.com

Hi All, I have installed Weblogic SP3. I am trying to make a Web Service which uses JAXB to convert xml into Java Objects. My Web Service is a simple Java class which I compile in Eclipse 3.1. Because I am using JAXB so I created my Project in Eclipse and I set the 'project specific complaince' to 5.0 as it ...

20. jaxb    coderanch.com

Just sharing my experience. I wanted to seperate my code from the generated one. That will give me flexibility in terms of re-running the jaxb to generate the classes again. My xml had couple of nested levels of data, hence there were many type defn and many classes. In my wrapper code, I wrote set, get for each of those different ...

21. jaxb    coderanch.com

22. jaxb and complex types extending hashtable , dont work.    coderanch.com

hello all im trying to create web service with jaxws and jaxb for complex types but im facing problem when it comes with complex type that extend hashtable here is my code ( very simple ): the complex type : package com.ws.test; import java.util.Hashtable; public class MyHash extends Hashtable { public MyHash(){ super(); } public void add(String k,String v){ super.put(k,v); } ...

23. JAXB External Cutomization.    coderanch.com

I am trying to compile a bunch of XSD files those were placed in different directories under a main directory. My question is, Is there a way in external customization, that the class files generates automatically in the same directory structure as there are placed? And also is there a simple example where all calsses gets generated by the targeted name ...

24. unmarshal-read with JAXB 2.0 and jwsdp 2.0    coderanch.com

I don't get ./*Type.java and ./impl/*Impl.java generated using following command: C:\009>xjc -p primer.po po.xsd parsing a schema... compiling a schema... primer\po\Items.java primer\po\ObjectFactory.java primer\po\PurchaseOrder.java primer\po\USAddress.java What should I do to generate these two more type classes (./*Type.java and ./impl/*Impl.java )? I have installed JWSDP 2.0 and Sun Java System Application Server Platform Edition 9. C:\009>echo %PATH% C:\jdk1.5.0_05\bin; C:\Sun\AppServer\bin; C:\Sun\jwsdp-2.0\jwsdp-shared\bin; C:\Sun\jwsdp-2.0\jaxb\bin; C:\009>echo %CLASSPATH% ...

25. JAXB with JAX-RPC1.1    coderanch.com

Hello All, I am using JAX-RPC1.1 and going to use JAXB package for xml marshalling/unmarshlling. I wanted to know if any one using custom handler to marhalling/unmarshalling xml. Is there a way to turn off the JAX-RPC parsing and still use JAX-RPC method invocation mechanism to invoke the service method? Can that it be achieved by overwriting Serializer/Deserializer clases to not ...

26. JAXB    coderanch.com

27. JAXB step by step    coderanch.com

Thanks Peer In the site that you provided, I could find jar files that contain java classes. what I am looking for is the xjc command, this is the paragraph that shows how to use the xjc command : "Assuming that the JAXB EA Implementation v 1.0 is installed and set up correctly, run the following command in a command prompt ...

28. JAXB Parser    coderanch.com

29. Create WebService from JAXB Classes    coderanch.com

30. jaxb & object graphs    coderanch.com

Hi ya! I need to get an object graph into xml and back to object again. Get into trouble with cycles. The problem is very clear. I have an object referencing a node in a tree structure. That nodes holds references to both parent and subtasks. If we always started to advance from the root I understand it would be straightforward ...

31. JAXB and Illegal Character    coderanch.com

32. Jaxb2. 0 - How to display +00:00 instead of Z in timezone info ?    coderanch.com

I was using Jaxb1.0/jdk1.4 in my application to convert java objects to xml. The date-time used to be output in the format 2008-02-04T15:04:48+00:00. I upgraded to Jaxb2.0 /jdk1.5 and am getting the output in the format 2008-02-04T15:04:48. ie the timezone information is lost. I tried to do a setTimezone on the xMLGregorianCalendar object but then it returns a format with an ...

33. JAXB Resources    coderanch.com

34. JAXB    coderanch.com

Hi, I am using jaxb 2.0, trying to generate classes using xjc compiler, could do it successfully, but the classes that were generated are using annotations, can any one let me know how to suppress the annotations using jaxb 2.0 I could also find an option for xjc "npa" -- to suppress only package level annonation, but not other class level ...

35. JAXB 1.0 and 1.0.2    coderanch.com

Hi guys, I wonder if you can help me out? I'm using JAXB (1.0.2) in the development of a web service (Java 1.4.2, WebLogic 8.1). In trying to run the code I get the following error: class "javax.xml.namespace.NamespaceContext"'s signer information does not match signer information of other classes in the same package I have the following JARs in the class path: ...

36. JAXB. order of items in List    coderanch.com

Hi, ranchers. Could oneone give me a reference to some official/reliable source to find answer for the following question? the following particle of a schema document: will be bound to: List name; So, the question is: is it ensured/guaranteed that items are placed in the List in the same order as them appear in the corresponding ...

37. JAXB field sizing    coderanch.com

I am parsing an XML message using JAXB. Everything is working fine except I need to truncate data in places to prevent overrunning my database column sizes. The XSD I used to generate the java classes has the appropriate size restrictions in it. Does anybody know how to use this information to truncate the data when appropriate? I did try set ...

38. Check Required Elements and Attributes in JAXB    coderanch.com

Hi I need check required elements and attributes in JAXB java classes , if there are any value for them place it , otherwise place default value in xml file , because of it I upgrade JAXB2.0 to JAXB 2.1 to support "required" in "XmlElement" , I read in "JavaWS(JAXB)Tutorial.pdf" that JAXB itself check required elements and attributes , if there ...

39. java.lang.LinkageError in JAXB    coderanch.com

Hi All, I finally resolved it and listing it for anyone else who may face the problem. The issue was that I was thinking that my JDK version was the culprit, but I found that the Java EE 5 libraries I was using were had the older version of JAXB(2.0) bundled while my JDK 1.5 update 16 had the JAXB 2.1 ...

40. Help: Creating web service proxy using JAXB generated domains    coderanch.com

Hi, I'm currently doing some investigation considering the use of web services (BPEL) as a complete application backend. The application should contain a pojo facade which communicates with some web service proxies. I generated my domain objects by using the JAXB Compilation option in JDeveloper. By using that, a java class can be generated based on an XSD. Disadvantage of this ...

41. Understanding @XmlElementRef in JAXB    coderanch.com

42. JAXB help    coderanch.com

HI All, I am working on an requirement to convert source XML to a Target XML. Iam using JAXB to Marhsall and UNMarshall the xml data. I am having issue with the DOCTYPE declaration in the source xml i.e when i use JAXB for transformation, the target xml doesnt contain the DOCTYPE information..I came to know that the below lines would ...

43. why JAXB ?    coderanch.com

I am learning JAXB, I know it could convert data between java and XML. But in real world, what is usage for this API ? 1. Why will we need to convert java to XML ? storage ? No, we could directly save data into relational database. 2. Why will we need to convert XML to java ? In J2EE, if ...

44. Regarding JAXB 1.3    coderanch.com

45. Problem with JAXB Unmarshaller    coderanch.com

String requestPost = request.getParameter("xmlString"); Master masterBinding = null; try { JAXBContext jc = JAXBContext.newInstance( "myjaxb.bindings" ); Unmarshaller u = jc.createUnmarshaller(); if (requestPost != null){ StringBuffer datapost = new StringBuffer(requestPost); logger.info("Datapost content: " + datapost + ":end"); masterBinding = (Master)u.unmarshal( new StreamSource( new StringReader( datapost.toString() ) ) ); } else{ masterBinding = (Master)u.unmarshal(siStream); } } catch (JAXBException jbe) { jbe.printStackTrace(response.getWriter()); logger.error("Exception encountered ...

46. JAXB Object Load time    coderanch.com

47. JAXB Problem...Any help ??    coderanch.com

Just a guess: The JAXB scripts will only generate the mapping classes. JAXB is only meant for mapping. If you are looking for generating the interface and implementation classes use wsimport and point it to wsdl. wsimport comes with JDK6+ . You are using JDK5 so look into your server documentation, there must be a wsimport or similar tool. Otherwise download ...

48. JAXB Problem - Need Help    coderanch.com

50. Parsing CDATA using JAXB.    coderanch.com

Hello Everyone, I am interacting with a web service which is providing me all the data in CDATA. Initially I was invoking a different web service operation which was providing me the response without the CDATA. I am using JAXB to fetch all the data from the reponse and set the appropriate methods. As this method was taking too much time ...

51. when to use jaxb and jax wc?    coderanch.com

52. toString() and Comparable on a JAXB generated entity class    coderanch.com

Hello, I'm trying to create a distributed system and therefore I have all my entity classes present in my Java EE app and hosted as a web service. The Swing frontend app autogenerate the entity classes for use in the presentation. I'm having some trouble using the Collections.sort() since a generated entity cannot implement an interface, does anyone have a hint ...

53. JAXB does not generate @XmlRootElement    coderanch.com

Why does JAXB put @XmlRootElement sometimes but not always? The above link is preety much where i am stuck.. It does not generate @XmlRootElement.. I also tried using their solution of :

54. JAXB persistency    coderanch.com

Hi, I am developing a web service in which there are JAXB generated objects and hibernate objects in the back-end for persistence. In my operation, I have to retrieve data from data base using hibernate and map those objects to JAXB objects, I am doing that this way JaxBObject.setName(HibernateObject.getName()); (//sample) As the complexity of the objects increases my java coding will ...

55. JAXB "AccessType cannot be resolved"    coderanch.com

Im working on a large project that is using JDK1.5 and it looks as if the xsds have generated java files using JAXB 1.0. Im trying to use JAXB 2.0 to generate new java files where I have modified the xsds. I generate the java files but there are compile errors: AccessType cannot be resolved and The import javax.xml.bind.annotation.AccessType cannot be ...

56. SPML JAXB with Custom Child Element of tag    coderanch.com

Hi, I am looking for solution to add custom child element to tag using jaxb generated source code. I am working with 2 xsd: spml2core xsd i attached to this post and second xsd for the child element under tag of spml payload. I was able to marshal the following spml2 payload using generated java class using xjc and ...

57. JAXB Customization    coderanch.com

Hi all, Today I am using XMLBeans, but we are interested to move to JAXB. But I don't know if I can do everything that we do with XMLBeans. For example, how can I use "choice" in JAXB, or validate the "in parameters" automatically before the webservice method execute. Somebody had some similar experience with both? What is better? Thanks

58. JAXB maxOccur/minOccur Annotation    coderanch.com

59. Can JAXB unmarshals child elements    coderanch.com

60. Problems updating JAXB    coderanch.com

61. JAXB - Weird Problem in unmarshling    coderanch.com

I am receiving a valid XML from server. lets say **XSD**

62. JAXB Namespaceing problem    coderanch.com

Hello, I am having problems with namespace prefixing for a SOAP response I am returning to a third party. I am returning something like this (I have trimmed it down and changed a lot of the names for this example): Test 1 What they need returned is ...

63. JAXB marshaller - neglect integer fields that are not set    coderanch.com

Hi, I am using JAXB to marshall a set of Java classes into XML. But, it includes all integer/long fields which are not set with a default value of 0. I do not want them to appear when the integer/long fields are not set. Please let me know how to achieve this. Regards, -Anand

64. jaxb with xop question    coderanch.com