Search Results

Search found 10 results on 1 pages for 'ekeren'.

Page 1/1 | 1 

  • Customizing error handling of JAXB unmarshall process

    - by ekeren
    Assuming I have a schema that describes a root element class Root that contains a List<Entry> where the Entry class has a required field name. Here is how it looks in code: @XmlRootElement class Root{ @XmlElement(name="entry") public List<Entry> entries = Lists.newArrayList(); } @XmlRootElement class Entry{ @XmlElement(name="name",required=true) public String name; } If I supply the following XML for unmarshalling: <root> <entry> <name>ekeren</name> </entry> <entry> </entry> </root> I have a problem because the second entry does not contain a name. So unmarshall produces null. Is there a way to customize JAXB to unmarshall a Root object that will only contain the "good" entry?

    Read the article

  • how can I write a schema that produce an unordered xml with extension

    - by ekeren
    In the following schema I am trying to make an unordered xml that extends simpleConfigurationObject: <xs:complexType name="forTestingConfigurationObjectCreator"> <xs:complexContent> <xs:extension base="simpleConfigurationObject"> <xs:all> <xs:element name="a" type="xs:string"/> <xs:element name="b" type="xs:string" minOccurs="0"/> </xs:all> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="simpleConfigurationObject"> <xs:all> <xs:element name="base" type="xs:string" minOccurs="0"/> </xs:all> </xs:complexType> But I get the following error on the xs:all "all is not the only particle in the group, or is being used as an extension" (which is correct) Off-course if put the base element inside the xs:all and not use xs:extension at all I will get an unordered schema restriction. (but that is not what I want) The question is: how can I produce unordered schema with the extension? Thanks

    Read the article

  • jaxb unmarshaling with schema validation in runtime

    - by ekeren
    I am using jaxb for my application configurations I feel like I am doing something really crooked and I am looking for a way to not need an actual file or this transaction. As you can see in code I: 1.create a schema into a file from my JaxbContext (from my class annotation actually) 2.set this schema file in order to allow true validation when I unmarshal Schema mySchema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile); jaxbContext.generateSchema(new MySchemaOutputResolver()); // ultimately creates schemaFile Unmarshaller u = m_context.createUnmarshaller(); u.setSchema(mySchema); u.unmarshal(...); do any of you know how I can validate jaxb without needing to create a schema file that sits in my computer? Do I need to create a schema for validation, it looks redundant when I get it by JaxbContect.generateSchema ? How do you do this?

    Read the article

  • how can i unmarshall in jaxb and enjoy the schema validation without using an explicit schema file

    - by ekeren
    I am using jaxb for my application configurations I feel like I am doing something really crooked and I am looking for a way to not need an actual file or this transaction. As you can see in code I: 1.create a schema into a file from my JaxbContext (from my class annotation actually) 2.set this schema file in order to allow true validation when I unmarshal JAXBContext context = JAXBContext.newInstance(clazz); Schema mySchema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile); jaxbContext.generateSchema(new MySchemaOutputResolver()); // ultimately creates schemaFile Unmarshaller u = m_context.createUnmarshaller(); u.setSchema(mySchema); u.unmarshal(...); do any of you know how I can validate jaxb without needing to create a schema file that sits in my computer? Do I need to create a schema for validation, it looks redundant when I get it by JaxbContect.generateSchema ? How do you do this?

    Read the article

  • how to debug SIGSEGV in jvm GCTaskThread

    - by ekeren
    Hi, My application is experiencing cashes in production. The crash dump indicates a SIGSEGV has occurred in GCTaskThread It uses JNI, so there might be some source for memory corruption, although I can't be sure. How can I debug this problem - I though of doing -XX:OnError... but i am not sure what will help me debug this. Also, can some of you give a concrete example on how JNI code can crash GC with SIGSEGV EDIT: OS:SUSE Linux Enterprise Server 10 (x86_64) vm_info: Java HotSpot(TM) 64-Bit Server VM (11.0-b15) for linux-amd64 JRE (1.6.0_10-b33), built on Sep 26 2008 01:10:29 by "java_re" with gcc 3.2.2 (SuSE Linux)

    Read the article

  • creative way for implementing Data object with it's corespanding buisness logic class in java

    - by ekeren
    I have a class that need to be serialized (for both persistentcy and client-server communication) for simplicity reasons lets call the classes Business a BusinessData and I prefix for their Interfaces. All the getter and setter are delegated from Business class to BusinessData class. I thought about implementing IBusinessData interface that will contain all the getter and setters and IBusiness interface that will extend it. I can either make Business extend BuisnessData so I will not need to implement all getter and setter delegates, or make some abstract class ForwardingBusinessData that will only delegate getter and setters. Any of the above option I loose my hierarchy freedom, does any of you have any creative solution for this problem... I also reviewed DAO pattern: http://java.sun.com/blueprints/patterns/DAO.html

    Read the article

  • creative way for implementing Data object with its corresponding business logic class in java

    - by ekeren
    I have a class that need to be serialized (for both persistentcy and client-server communication) for simplicity's sake let's call the classes Business a BusinessData and I prefix for their Interfaces. All the getter and setter are delegated from Business class to BusinessData class. I thought about implementing IBusinessData interface that will contain all the getter and setters and IBusiness interface that will extend it. I can either make Business extend BuisnessData so I will not need to implement all getter and setter delegates, or make some abstract class ForwardingBusinessData that will only delegate getter and setters. Any of the above option I lose my hierarchy freedom, do any of you have any creative solutions for this problem... I also reviewed DAO pattern: http://java.sun.com/blueprints/patterns/DAO.html

    Read the article

  • what is your java 1.6 favorite feature

    - by ekeren
    what is your java 1.6 favorite feature? Java 6 has some nifty feature: SeriveLocator Support to Scripting language Acess to Compiler APT enhancement (Annotation) And more... What is the one you like the most, and found it very useful?

    Read the article

1