jaxb2

Jaxb2Marshaller fails after upgrading from JDK 1.8.0.77 to 1.8.0.162

限于喜欢 提交于 2019-12-25 00:26:45
问题 This one has me stumped. I have a Java String Batch app that runs without any error when run against Java 1.8.0.77. It reads in an XML file and writes it to a DB flawlessly. After updating to JDK 1.8.0.162 the reader simply does not work and does not send any error messages even with logging set to DEBUG. Changing back to Java 1.8.0.77 resolves the issue. Our servers are running 162 though so I have to make this work in 162. Here is the reader: @Bean   ItemReader<Product> reviewItemReader() {

Include DOCTYPE for Spring Jaxb2Marshaller

我的未来我决定 提交于 2019-12-24 14:44:28
问题 I am using Spring's Jaxb2Marshaller to unmarshall a java object into an XML file. The unmarshalling has been successful. But I want to add the doctype declaration to the XML. I have searched a lot. Does here anybody knows how to add the doctype declaration to the xml ? Please help Current XML <?xml version="1.0" encoding="ISO-8859-1"?> <rootElement> Expected XML <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE XYZ PUBLIC "FPNID" "ABC.dtd"> <rootElement> 回答1: Try this. @Bean public

IntelliJ doesn't recognize import statements for JAXB classes

北慕城南 提交于 2019-12-24 14:06:22
问题 I'm using IntelliJ IDEA 14 as IDE and jaxb2-maven-plugin for creating Java classes from XSD files. When compiling my module with Maven no errors are displayed. Even when using the command make or compile in IntelliJ no errors are displayed in the status popup. But in the files itself and in the project browser compile errors are constantly displayed. It seems like IntelliJ doesn't recognize the import statements of my classes in the target folder. The error statements look like this (bold

Jaxb : Append field of Request XML without modfying JAXB java class

给你一囗甜甜゛ 提交于 2019-12-24 11:16:08
问题 I am using JAXB 2.0 for the Application Deveopment which is using RestFul Webservices . Now there is a modification in the request , that is i will be getting another filed/variable in the request XML . <Root Id="567" att="758" /> Modified Request will be <Root Id="567" att="758" anotherfiledadded ="kiran" /> My question is , is it possible to automatically append that field (anotherfiledadded)in the UserData class (Without modifying the UserData ??) The below is my UserData class

Spring AOP Logging Interceptor and JAXB issue

落爺英雄遲暮 提交于 2019-12-24 00:54:19
问题 I am trying to implement logging aspect into my application. This is the first time I am attempting AOP, so please let me know if I am missing something obvious. In order to achieve weaving external jars, I am trying to implement load time weaver. I did specify the load-time-weaver in my application context and mentioned TomcatInstrumentableClassLoader in my context.xml file along with the aop.xml. My application is a Spring MVC REST application and utilizes JAXB content negotiation as well.

How do you call a web service in Java with only XSD and NO WSDL?

余生颓废 提交于 2019-12-23 17:02:24
问题 I have a web service outside of my company that provides no WSDL for their service. They do provide: a detailed document on how to POST to their service what a SoapEnvelope should look like and even an .xsd that I can use to create the message to put in the SOAP <env:Body></env:Body> of the call. How do you make a SOAP call to a web service without a WSDL (in Java)? I need a tool that can take my JAXB-formatted XML message, wrap it in a SOAP Envelope, and send it as HTTP POST to some web

Skip the Generated on… in Java files using jaxb2 maven plugin

▼魔方 西西 提交于 2019-12-23 07:57:22
问题 I'd like to get the maven-jaxb2-plugin to do not write the 'disclaimer': This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.2-hudson-jaxb-ri-2.2-63- See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> Any modifications to this file will be lost upon recompilation of the source schema. Generated on: 2011.08.01 at 09:20:43 AM CEST At least the timestamp. Thank you. Udo. 回答1: Use -no-header if you use command line

Confused as how to use JAXB XML Adapter for my requirement

丶灬走出姿态 提交于 2019-12-23 07:56:22
问题 I am Using JAXB for unmarshalling process , for which the request comes from the UI to our service class . The below is the format of XML request . <SampleRequest user="testUser" account="testAccount" Specifier= "value1a,value1b,value1c : name2a,value2b,value2c"/> My requirement is that , the Specifier attribute has got Multiple series of values (: colon separated) i need to map each series of values to my custom java class I tried this way @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD

Nested elements in XSD cause Illegal class inheritance loop exception in JAXB, how can I properly override the bindings?

假如想象 提交于 2019-12-23 07:13:32
问题 I have got a problem, I'm trying to bind an XML where there are the name ' Contains ' three times. So I read that it's possible to override node names with a binding file. At the moment it doesn't work. I think mistake come from Xpath in the binding file, but I not sure. I have tried lot of way, but I have never succeed. There is my XSD File : <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="fr:gouv:ae:archive:draft:standard_echange_v0.2" xmlns:xs=

Spring hateoas xml serialization for list of resources built with ResourceAssemblerSupport

江枫思渺然 提交于 2019-12-23 05:55:19
问题 I am trying to support XML responses for my Spring HATEOAS based application. JSON responses work fine as well as XML for a single resource. The problem starts with the list of the resources. Spring MVC controller cannot serialize the list built with help of ResourceAssemblerSupport derived class. The controller throws "org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation" for the curl command curl -k -i -H "Accept:application/xml" -H "Media