castor

Error creating bean with name : Scope 'request' is not active for the current thread

无人久伴 提交于 2019-12-12 14:34:21
问题 I have integrated SWF 2.2.1,Primefaces 2.2.1,JSF 2,Spring Security 3,Spring 3.1.0M1I and EhCache and AspectJ and Castor. I have defined beans for castor in my app-config.xml like <bean id="oXMapper" class="com.abc.xyz.util.OXMapper"> <property name="unmarshaller" ref="unmarshaller" /> <property name="marshaller" ref="marshaller" /> <property name="acordRequest" ref="acordRequest" /> <property name="acordResponse" ref="acordResponse" /> </bean> <bean id="unmarshaller" class="org

How to generate Castor mapping.xml file from given multiple XSDs?

匆匆过客 提交于 2019-12-12 01:08:33
问题 How to generate Castor mapping.xml file from given multiple XSDs? 回答1: import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; //import org.exolab.castor.builder.SourceGenerator; import org.exolab.castor.mapping.MappingException; import org.exolab.castor.tools.MappingTool; public class CastorMappingToolUtil { public static void generate() throws MappingException, FileNotFoundException {

Maven: No marketplace entries found to handle castor, antrun, and ear plugins

喜欢而已 提交于 2019-12-10 12:43:03
问题 I am importing a maven project into Eclipse. I have the m2e plugin installed and it is pointing to maven 2.2.1 on my machine. I am getting these three errors: No marketplace entries found to handle castor-maven-plugin:1.0:generate in Eclipse No marketplace entries found to handle maven-antrun-plugin:1.1:run in Eclipse No marketplace entries found to handle maven-ear-plugin:2.3.1:generate-application-xml in Eclipse Any resources provided would be greatly appreciated. Thanks 回答1: You can define

How to tell castor to marshall a null field to an empty tag?

99封情书 提交于 2019-12-08 02:21:59
问题 I'm marshalling an object that can have some field set to null. I'm using castor with a xml-mapping file for the configuration. The class I'm marshalling is like this: class Entity { private int id; private String name; private String description; // THIS CAN BE NULL /* ... getters and setters follow ... */ } ...and a mapping file like this: <mapping> <class name="Entity"> <field name="id" type="integer"/> <field name="name" type="string"/> <field name="description" type="string"/> </class> <

How to tell castor to marshall a null field to an empty tag?

◇◆丶佛笑我妖孽 提交于 2019-12-06 06:45:11
I'm marshalling an object that can have some field set to null. I'm using castor with a xml-mapping file for the configuration. The class I'm marshalling is like this: class Entity { private int id; private String name; private String description; // THIS CAN BE NULL /* ... getters and setters follow ... */ } ...and a mapping file like this: <mapping> <class name="Entity"> <field name="id" type="integer"/> <field name="name" type="string"/> <field name="description" type="string"/> </class> </mapping> What I'm getting at the moment if the field is null (simplified example): <entity> <id>123<

How change Castor mapping to remove “xmlns:xsi” and “xsi:type” attributes from element in XML output?

China☆狼群 提交于 2019-12-05 14:26:57
How do I change the Castor mapping <?xml version="1.0"?> <!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" "http://castor.org/mapping.dtd"> <mapping> <class name="java.util.ArrayList" auto-complete="true"> <map-to xml="ArrayList" /> </class> <class name="com.db.spgit.abstrack.ws.response.UserResponse"> <map-to xml="UserResponse" /> <field name="id" type="java.lang.String"> <bind-xml name="id" node="element" /> </field> <field name="deleted" type="boolean"> <bind-xml name="deleted" node="element" /> </field> <field name="name" type="java.lang.String"> <bind-xml name="name"

What is the difference between Castor XML binding and JAXB binding

戏子无情 提交于 2019-12-05 01:57:28
What is the difference between Castor XML and JAXB binding since both are binding java object to XML and vice versa. Updated : As using Castor I can do this Assume packageA.ClassA and packageB.ClassA have same attributes and class name just that they were located in different package. packageA.ClassA - > XML -> packageB.ClassA By using JAXB if I am doing this Marshall object packageA.ClassA to XML and from XML unmarshall into object packageB.ClassA I got Casting error. Please note that JAXB is an API, and there are multiple implementations available. Sun provides a reference implementation and

Sorting an XML in Java

佐手、 提交于 2019-12-04 21:01:27
问题 I have an XML similar to below, which needs to be sorted using the date field. <root> <Node1> <date></date> </Node1> <Node1> <date></date> </Node1> <Node1> <date></date> </Node1> <Node1> <date></date> </Node1> <Node2> <date></date> </Node2> <Node2> <date></date> </Node2> <Node2> <date></date> </Node2> <Node2> <date></date> </Node2> </root> I would like to sort the XML based on the date(say ascending order), irrespective of whether the date is under Node1 or Node2. Actually, in Java code I

Sorting an XML in Java

拥有回忆 提交于 2019-12-03 13:54:50
I have an XML similar to below, which needs to be sorted using the date field. <root> <Node1> <date></date> </Node1> <Node1> <date></date> </Node1> <Node1> <date></date> </Node1> <Node1> <date></date> </Node1> <Node2> <date></date> </Node2> <Node2> <date></date> </Node2> <Node2> <date></date> </Node2> <Node2> <date></date> </Node2> </root> I would like to sort the XML based on the date(say ascending order), irrespective of whether the date is under Node1 or Node2. Actually, in Java code I have two separate lists, one with Node1 objects and other with Node2 objects. I can sort the list in any

Can Castor handle class generation from multiple XSDs importing from a base XSD?

大城市里の小女人 提交于 2019-11-28 12:43:10
I have several XSDs that reuse the same entities. For example, both the XSDs for the ProductPurchaseRequest.xsd and ProductQuoteRequest.xsd both have a <product> tag in them to describe the product in question. For this reason I created a Product.xsd file to define the <product> tag and both ProductPurchaseRequest.xsd and ProductQuoteRequest.xsd import the Product.xsd with a `. I would like to use Castor to generate Java classes from theses XSDs, and for both of them to use the same class for representing the Product so that I could reuse the same logic for mapping them to our model's