jaxb

WARNING: Provider com.sun.xml.internal.bind.v2.ContextFactory not found

空扰寡人 提交于 2020-01-13 10:34:08
问题 I have integrated within a JSF app a few webservices through Jersey . Everything works fine, even the OAuth identification is working. BUT! When starting my webserver, I ALWAYS get this error : INFO: Scanning for root resource and provider classes in the packages: com.mysite.webService INFO: Root resource classes found: class com.mysite.webService.Accounts INFO: No provider classes found. INFO: Initiating Jersey application, version 'Jersey: 1.17 01/17/2013 03:31 PM' SEVERE: The provider

WARNING: Provider com.sun.xml.internal.bind.v2.ContextFactory not found

情到浓时终转凉″ 提交于 2020-01-13 10:33:33
问题 I have integrated within a JSF app a few webservices through Jersey . Everything works fine, even the OAuth identification is working. BUT! When starting my webserver, I ALWAYS get this error : INFO: Scanning for root resource and provider classes in the packages: com.mysite.webService INFO: Root resource classes found: class com.mysite.webService.Accounts INFO: No provider classes found. INFO: Initiating Jersey application, version 'Jersey: 1.17 01/17/2013 03:31 PM' SEVERE: The provider

Do XML parsers tell the difference between xsi:nil=“true” and omitted elements?

你。 提交于 2020-01-13 10:11:58
问题 Are XML parsers/deserializers in general able to tell the difference between nillable elements explicitly set to null and optional elements that are left out? Assume that we have the following complex type: <complexType name="NiceType"> <sequence> <element name="niceElem" nillable="true" type="int" minOccurs="0" /> </sequence> </complexType> Element explicitly set to null (example 1): <niceType> <niceElem xsi:nil="true"/> </niceType> Element omitted (example 2): <niceType> </niceType> Would

Do XML parsers tell the difference between xsi:nil=“true” and omitted elements?

让人想犯罪 __ 提交于 2020-01-13 10:11:10
问题 Are XML parsers/deserializers in general able to tell the difference between nillable elements explicitly set to null and optional elements that are left out? Assume that we have the following complex type: <complexType name="NiceType"> <sequence> <element name="niceElem" nillable="true" type="int" minOccurs="0" /> </sequence> </complexType> Element explicitly set to null (example 1): <niceType> <niceElem xsi:nil="true"/> </niceType> Element omitted (example 2): <niceType> </niceType> Would

Java/JAXB: Unmarshall XML elements with same name but different attribute values to different class members

非 Y 不嫁゛ 提交于 2020-01-12 09:29:11
问题 I am trying to parse XML that has several "Fields" elements to different class members according to one of their attributes. Here is the XML: <Series> <Fields type="SelectedFields" operation="SUM"> <Field name="Remaining" /> <Field name="Invested" /> </Field> <Fields type="FirstSelectedFields" operation="SUM"> <Field name="Estimated" /> </Field> </Series> And here is the java class it should be mapped to: public class APMSeries { private List<Field> selectedFields; private List<Field>

Create new JAXB Marshaller instance in static method… is it ThreadSafe?

好久不见. 提交于 2020-01-11 13:38:05
问题 I have implemented a util class with the following static method: public static String objToXml(JAXBContext jaxbContext, ClassA obj) throws Exception{ Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); jaxbMarshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, true ); StringWriter writer = new StringWriter(); marshaller.marshal(obj, writer); return writer.toString(); } My understanding is that JAXB Marshaller and StringWriter are both thread safe ... but I want to double confirm

Can JAXB Incrementally Marshall An Object?

限于喜欢 提交于 2020-01-11 13:24:08
问题 I've got a fairly simple, but potentially large structure to serialize. Basically the structure of the XML will be: <simple_wrapper> <main_object_type> <sub_objects> </main_object_type> ... main_object_type repeats up to 5,000 times </simple_wrapper> The main_object_type can have a significant amount of data. On my first 3,500 record extract, I had to give the JVM way more memory than it should need. So, I'd like to write out to disk after each (or a bunch of) main_object_type . I know that

Transform From one JAXB object to another using XSLT template

假如想象 提交于 2020-01-11 10:58:47
问题 Is there a way to transform a JAXB generated object to another JAXB object using an XSLT template file. The two objects are generated by two different JAXB bindings. I know that I can marshall the object to strings and then using a XSLT processor to transform it to the other format. After that unmarshall it to the other JAXB object. The question is if this is possible in to do in JAXB. 回答1: I don't think its possible without any intermediate serialization or dom tree construction, but

Java unmarshlling XML to Object which are dynamic

痞子三分冷 提交于 2020-01-11 05:45:30
问题 I'm looking for best tool/way to create and load JAVA objects from XML definitions. I had checked out JAXB, seems pretty nice, but didn't find is there a way to work with Entities which properties are dynamic, or changed from time to time, so want to have something like automatic way of working with entities, without converting Object into predefine Entity object. Does something like that exists? Workflow would be like this read from XML create class for each Entity with dynamic set of

报文解析

╄→尐↘猪︶ㄣ 提交于 2020-01-11 04:10:22
jackson、fastjson、gson,json与对象的转换 jaxb、xstream,json与对象、对象与xml间的转换,主要用于后者,jaxb性能更好、xstream使用更加简单 dom、sax、dom4j、stax,xml解析 结构简单固定的用jaxb;jdom可以选用sax方式处理,用于解析文件不太大,需要反复修改的xml文件;对内存资源要求较高时用stax 来源: CSDN 作者: n369497017 链接: https://blog.csdn.net/n369497017/article/details/103856393