Build XML with DOM

Why does this loop works well if I COMMENT OUT the second node -
but I get a NULL document if I try to add the second node ?
//Loop through the result set
for (int i=0; i < iRows; i++) {
System.out.println(result.getString("SiteID"));
Node newSiteIDNode = document.createElement("SiteID");
Text tnSiteIDNode = document.createTextNode(result.getString("SiteID"));
newSiteIDNode.appendChild(tnSiteIDNode);
root.appendChild(newSiteIDNode);
Node newItemNode = document.createElement("ItemCode");
Text tnItemNode = document.createTextNode(result.getString("ItemCode"));
newItemNode.appendChild(tnItemNode);
root.appendChild(newItemNode);

The XML file that I'm creating via the following is empty
TransformerFactory transFactory =TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer();
// Using the DOM tree root node, the following line of code constructs a DOMSource object as the source of the transformation.
DOMSource source = new DOMSource(document);
// The following code fragment creates a StreamResult object to take the results of the transformation
// and transforms the tree into an XML file.
newXML = new File("FTHSites.xml");
FileOutputStream os = new FileOutputStream(newXML);
resultXML = new StreamResult(os);
transformer.transform(source, resultXML);     

Similar Messages

  • Compile build.xml with Ant for web service with annotations

    Hi Friends,
    I have a web service with annotations, using javax.annotation.PostConstruct, and javax.annotation.PreDestroy.
    I have a build.xml to create a EAR for this web service.
    When I run the ant task, the build complete successfully but the .war file cannot be deployed on the WLS server. Taking a closer look, I see that the required files such as, webservices.xml, weblogic.xml, weblogic-webservices.xml, Provision.wsdl files are not generated.
    Following is the build.xml file:
    <?xml version="1.0" encoding="windows-1252" ?>
    <project default="jwsc">
    <property file="build.properties"/>
    <property name="weblogic.jar.classpath"
    value="C:/bea_jDev/wlserver_10.3/server/lib"/>
    <property name="oimclient.jar.classpath"
              value="C:/_data/Project_Dc/OIM_jars" />
         <property name="com.jar.classpath" value="C:/JDeveloper/mywork/Service_Test/lib" />
    <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask">
    <classpath>
    <path id="weblogic.classpath">
    <pathelement path="WEBLOGIC_HOME"/>
    <fileset dir="${weblogic.jar.classpath}">
    <include name="**/*.jar"/>
    </fileset>
    </path>
    </classpath>
    </taskdef>
    <target name="all" depends="clean,build-service,deploy"></target>
    <target name="build-service">
         <jwsc srcdir="${src.home}" destdir="ear_directory" >
    <classpath>
    <path id="oim.classpath">
    <pathelement path="OIM_HOME"/>
    <fileset dir="${oimclient.jar.classpath}">
    <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${com.jar.classpath}">
    <include name="**/*.jar"/>
    </fileset>
    </path>
    </classpath>
    <jws file="${jws.home}" type="JAXWS" />
    </jwsc>
    </target>
    <target name="deploy">
    <!--add wldeploy task here -->
    </target>
    <target name="clean">
    <delete dir="output" />
    </target>
    </project>
    Can you please point out what else is to be done and where exactly am I going wrong in writing the build.xml file.
    Let me know if some else information is required.

    This is what I get when I run the ant task:
    Buildfile: C:\JDeveloper\mywork\ProvisioningService_Test2\Provision\resource\build.xml
    build-service:
    [jwsc] JWS: processing module /com/fox/provision/webservice/endpoint/impl/ProvisionEndPointImpl
    [jwsc] Parsing source files
    [jwsc] Parsing source files
    [jwsc] 1 JWS files being processed for module /com/.../provision/webservice/endpoint/impl/ProvisionEndPointImpl
    [jwsc] [JAM] Warning: failed to resolve class org.apache.xmlbeans.XmlObject
    [jwsc] [JAM] Warning: failed to resolve class com.bea.xml.XmlObject
    [jwsc] [JAM] Warning: failed to resolve class javax.xml.rpc.holders.Holder
    [jwsc] JWS: C:\..\...\..\...\code\ProvisioningService\src\com\...\provision\webservice\endpoint\impl\..EndPointImpl.java Validated.
    [jwsc] Processing 1 JAX-WS web services...
    [jwsc] warning: Specified AnnotationProcessorFactory, 'com.sun.istack.ws.AnnotationProcessorFactoryImpl', not found on search path.
    warning: No annotation processors found but annotations present.
    2 warnings
    [jwsc] Compiling 2 source files to C:\DOCUME~1\....\LOCALS~1\Temp\_lsgijm
    [jwsc] Building jar: C:\..\...\..\...\code\ProvisioningService\src\com\...\provision\webservice\deploy\ear_directory\com\fox\provision\webservice\endpoint\impl\...EndPointImpl.war
    [jwsc] Created JWS deployment outputFile: C:\..\...\..\...\code\ProvisioningService\src\com\...\provision\webservice\deploy\ear_directory\....\...\provision\webservice\endpoint\impl\..EndPointImpl.war
    [jwsc] [EarFile] Application File : C:\..\...\..\...\code\ProvisioningService\src\com\.....\provision\webservice\deploy\ear_directory\META-INF\application.xml
    [AntUtil.deleteDir] Deleting directory C:\DOCUME~1\....\LOCALS~1\Temp\_lsgijm
    BUILD SUCCESSFUL
    Total time: 7 seconds
    Due to some limitations, I edited the path in the build.xml files.
    Please let me know what can be done. Thanks.
    Edited by: user9112073 on Nov 22, 2011 9:52 PM

  • *URGENT * Parsing nd Searching XML with DOM

    Hi,
    I am Juliana, I am a new grad, a new employee and brand new to XML, I am learning to parse XML with the XML parser for PLSQL.
    Please anyone help me how to parse the following XML string so that I will display all the session and its time schedule, or if possible display only the session that I want to display.
    Thank you very much for any of your help
    Juliana
    <Student> Id="9130099">
    <Class>
    <Session>A-100</Session>
    <Session>A-200</Session>
    <Session>A-300</Session>
    <Session>A-400</Session>
    <session>A-500</Session>
    </Class>
    <Time> At:
    <At>10:30</At>
    <At>12:30</At>
    <At>02:30</At>
    <At>04:30</At>
    <At>05:30</At>
    </time>
    </Student>

    thx for the replay
    1) i thought of using xpath but wanted to know how to do it over DOM
    2) i mean that the 3 <item> have other element inside like that:
    <item>
    <title>Implementing Service-Oriented Architectures (SOA) with the Java EE 5 SDK</title>
      <link>http://java.sun.com/developer/technicalArticles/WebServices/soa3/?feed=JSC</link>
      <description>This article presents concepts and language constructs needed to develop a Service-Oriented Architecture composite application in Java EE 5. It then describes an example application designed to solve a business problem.</description>
      <date />
      </item>and all of them have <title>, <link> etc. I want to get the same values(eg. <title>) from all the 3 <item> and not including the <title> in the begining of xml
    3) i am a professional child.....joke....
    try to get to your sensitive side...thats way.

  • How to use Weblogic Server 6.1 build.xml with ant

    Hi Java's
    I have downloaded the latest version of BEA Weblogic server 6.1,they have changed the build.cmd to build.xml for compiling and building the ejb applications.they are telling that we have use $ant to run the build.xml but i couldn't able to do that.i'm getting "command not found error"..i'm using winnt.please help me how to use $ ant.Is it a seperate exe or batch file that i have to download ?if so where to download it.how to use it.please help.
    Regards
    Balaji

    To use it after installation, set your path to your
    <ant_installation_dir>\bin, then navigate to the diectory containing the build.xml. then follow the instructions in the weblogic documentation for running ant.

  • Validate xml with DOM - no grammar found

    Validation with XmlSpy is OK!
    Please help me. My problem is...
    ==========================================================
    // Schema...
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:complexType name="ParentType">
    <xs:sequence>
    <xs:element name="parent1" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ChildType">
    <xs:complexContent>
    <xs:extension base="ParentType">
    <xs:sequence>
    <xs:element name="child1" type="xs:string"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="root">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="element" type="ParentType" maxOccurs="2"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    ==========================================================
    // Xml-file:
    <?xml version="1.0" encoding="UTF-8"?>
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://pctoiv/etktoiv/Extending.xsd">
    <element xsi:type="ChildType">
    <parent1/>
    <child1/>
    </element>
    <element xsi:type="ParentType">
    <parent1/>
    </element>
    </root>
    =================================================================
    //java code...
    String W3C_XML_SCHEMA = "http://www.w3c.org/2001/XMLSchema";
    String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    String schemaSource = "http://pctoiv/etktoiv/Extending.xsd";
    javax.xml.parsers.DocumentBuilder documentBuilder = null;
    org.w3c.dom.Document xmlDoc = null;
    javax.xml.parsers.DocumentBuilderFactory docBuildFactory =
    javax.xml.parsers.DocumentBuilderFactory.newInstance();
    docBuildFactory.setNamespaceAware(true);
    docBuildFactory.setValidating(true);
    docBuildFactory.setAttribute(JAXP_SCHEMA_SOURCE, W3C_XML_SCHEMA);
    docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE, schemaSource);
    documentBuilder = docBuildFactory.newDocumentBuilder();
    documentBuilder.setErrorHandler(new MyErrorHandler(System.out));
    xmlDoc = documentBuilder.parse(new java.io.File("Extending.xml"));
    ================================================
    // And errors...
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
    org.xml.sax.SAXParseException: Document root element "root", must match DOCTYPE root "null".

    Validation with XmlSpy is OK!
    Please help me. My problem is...
    =======================================================
    ==
    // Schema...
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:complexType name="ParentType">
    <xs:sequence>
    <xs:element name="parent1" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="ChildType">
    <xs:complexContent>
    <xs:extension base="ParentType">
    <xs:sequence>
    <xs:element name="child1" type="xs:string"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="root">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="element" type="ParentType"
    maxOccurs="2"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    =======================================================
    ==
    // Xml-file:
    <?xml version="1.0" encoding="UTF-8"?>
    <root
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://pctoiv/etktoiv/Ex
    ending.xsd">
    <element xsi:type="ChildType">
    <parent1/>
    <child1/>
    </element>
    <element xsi:type="ParentType">
    <parent1/>
    </element>
    </root>
    =======================================================
    =========
    //java code...
    String W3C_XML_SCHEMA =
    "http://www.w3c.org/2001/XMLSchema";
    String JAXP_SCHEMA_SOURCE =
    "http://java.sun.com/xml/jaxp/properties/schemaSource";
    String schemaSource =
    "http://pctoiv/etktoiv/Extending.xsd";
    javax.xml.parsers.DocumentBuilder documentBuilder =
    null;
    org.w3c.dom.Document xmlDoc = null;
    javax.xml.parsers.DocumentBuilderFactory
    docBuildFactory =
    javax.xml.parsers.DocumentBuilderFactory.newInstance();
    docBuildFactory.setNamespaceAware(true);
    docBuildFactory.setValidating(true);
    docBuildFactory.setAttribute(JAXP_SCHEMA_SOURCE,
    W3C_XML_SCHEMA);
    docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE,
    schemaSource);
    documentBuilder =
    docBuildFactory.newDocumentBuilder();
    documentBuilder.setErrorHandler(new
    MyErrorHandler(System.out));
    xmlDoc = documentBuilder.parse(new
    java.io.File("Extending.xml"));
    ================================================
    // And errors...
    org.xml.sax.SAXParseException: Document is invalid: no
    grammar found.
    org.xml.sax.SAXParseException: Document root element
    "root", must match DOCTYPE root "null".
    Try this:
    private static final String JAXP_SCHEMA_SOURCE
    = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    private static final String JAXP_SCHEMA_LANGUAGE
    = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    private static final String W3C_XML_SCHEMA
    = "http://www.w3.org/2001/XMLSchema";
    docBuildFactory.setNamespaceAware(true);
    docBuildFactory.setValidating(true);
    docBuildFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); // use LANGUAGE here instead of SOURCE
    docBuildFactory.setAttribute( JAXP_SCHEMA_SOURCE, schemaSource);
    documentBuilder = docBuildFactory.newDocumentBuilder();
    Good luck!
    Paul Niedenzu

  • Persisting unexplained errors when parsing XML with schema validation

    Hi,
    I am trying to parse an XML file including XML schema validation. When I validate my .xml and .xsd in NetBeans 5.5 beta, I get not error. When I parse my XML in Java, I systematically get the following errors no matter what I try:
    i) Document root element "SQL_STATEMENT_LIST", must match DOCTYPE root "null".
    ii) Document is invalid: no grammar found.
    The code I use is the following:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    My XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Defining the SQL_STATEMENT_LIST element -->
    <xs:element name="SQL_STATEMENT_LIST" type= "SQL_STATEMENT_ITEM"/>
    <xs:complexType name="SQL_STATEMENT_ITEM">
    <xs:sequence>
    <xs:element name="SQL_SCRIPT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <!-- Defining simple type ApplicationType with 3 possible values -->
    <xs:simpleType name="ApplicationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="DawningStreams"/>
    <xs:enumeration value="BaseResilience"/>
    <xs:enumeration value="BackBone"/>
    </xs:restriction>
    </xs:simpleType>
    <!-- Defining the SQL_SCRIPT element -->
    <xs:element name="SQL_SCRIPT" type= "SQL_STATEMENT"/>
    <xs:complexType name="SQL_STATEMENT">
    <xs:sequence>
    <xs:element name="NAME" type="xs:string"/>
    <xs:element name="TYPE" type="xs:string"/>
    <xs:element name="APPLICATION" type="ApplicationType"/>
    <xs:element name="SCRIPT" type="xs:string"/>
    <!-- Making sure the following element can occurs any number of times -->
    <xs:element name="FOLLOWS" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and my XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : SQLStatements.xml
    Created on : 1 juillet 2006, 15:08
    Author : J�r�me Verstrynge
    Description:
    Purpose of the document follows.
    -->
    <SQL_STATEMENT_LIST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.dawningstreams.com/XML-Schemas/SQLStatements.xsd">
    <SQL_SCRIPT>
    <NAME>CREATE_PEERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE PEERS (
    PEER_ID           VARCHAR(20) NOT NULL,
    PEER_KNOWN_AS      VARCHAR(30) DEFAULT ' ' ,
    PRIMARY KEY ( PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITIES_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITIES (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    COMMUNITY_KNOWN_AS VARCHAR(25) DEFAULT ' ',
    PRIMARY KEY ( COMMUNITY_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITY_MEMBERS (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    PEER_ID VARCHAR(20) NOT NULL,
    PRIMARY KEY ( COMMUNITY_ID, PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_PEER_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE PEERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITIES_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITIES IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITY_MEMBERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_VIEW</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE VIEW COMMUNITY_MEMBERS_VW AS
    SELECT P.PEER_ID, P.PEER_KNOWN_AS, C.COMMUNITY_ID, C.COMMUNITY_KNOWN_AS
    FROM PEERS P, COMMUNITIES C, COMMUNITY_MEMBERS CM
    WHERE P.PEER_ID = CM.PEER_ID
    AND C.COMMUNITY_ID = CM.COMMUNITY_ID
    </SCRIPT>
    <FOLLOWS>CREATE_PEERS_TABLE</FOLLOWS>
    <FOLLOWS>CREATE_COMMUNITIES_TABLE</FOLLOWS>
    </SQL_SCRIPT>
    </SQL_STATEMENT_LIST>
    Any ideas? Thanks !!!
    J�r�me Verstrynge

    Hi,
    I found the solution in the following post:
    Validate xml with DOM - no grammar found
    Sep 17, 2003 10:58 AM
    The solution is to add a line of code when parsing:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    The errors are gone !!!
    J�r�me Verstrynge

  • Build.xml classpath ref to be used in another build XML file

    Hi,
    I have ant build.xml with a target as
    <target name="build_project">
              <ant antfile="C:/projects/antbuild/build.xml" inheritAll="true">
                   <target name="clean" />
              </ant>
         </target>
         in report1.xml.
         This build.xml inturn have the classpath defined in it with the JARS added to the classpath.
         In the report2.xml,
         Can I use the classpathref in build.xml which is defined in report2.xml? Where report2.xml is imported in report1.xml as
         <import file="report2.xml" />
         If I can do so I don't have to create duplicate class path ref again adding all the JARS in report2.xml?
         Please clarify.
    Thanks.

    I've used quite a bit of ANT in the past, but I don't really know what to answer to your question that is in any way helpful to you. I remember that ANT has some form of build file inheritance built in, I've played around with it in years ago to try and crank out somewhat standardized build files with reusable elements. What I can recall is that I had to read a book on advanced ANT usage to be able to work it out, the online manual wasn't nearly enough.

  • FU4CIListener build.xml not setting properties?

    I am following the Ant Task Setup.  I have flex sdk 3.6.0.X, apache-ant 1.8.2 and the flexunit source 4.1.0.
    When I run > ant -v clean package
    function(){return A.apply(null,[this].concat($A(arguments)))}
    Apache Ant(TM) version 1.8.2 compiled on December 20 2010
    Trying the default build file: build.xml
    Buildfile: C:\projects\FlexUnit4CIListener\build.xml
    Detected Java version: 1.7 in: C:\Program Files\Java\jdk1.7.0\jre
    Detected OS: Windows XP
    parsing buildfile C:\projects\FlexUnit4CIListener\build.xml with URI = file:/C:/projects/FlexUnit4CIListener/build.xml
    Project base dir set to: C:\projects\FlexUnit4CIListener
    parsing buildfile jar:file:/C:/apacheAnt/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/apacheAnt/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
    Importing file C:\projects\utils.xml from C:\projects\FlexUnit4CIListener\build.xml
    Overriding previous definition of reference to ant.projectHelper
    parsing buildfile C:\projects\utils.xml with URI = file:/C:/projects/utils.xml
    [macrodef] creating macro  gpg
    [macrodef] creating macro  sonatype-bundle
    Overriding previous definition of reference to ant.projectHelper
    [property] Loading Environment env.
    Property "build.version" has not been set
    Property "build.number" has not been set
    Property "build.sdk" has not been set
    Build sequence for target(s) `clean' is [clean]
    Complete build sequence is [clean, init, compile, report, package, deploy, ]
    clean:
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target\bin
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target\docs
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target\sonatype
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target
       [delete] Deleting C:\projects\FlexUnit4CIListener\libs\flexunit-4.1.0-x-as3_y.y.y.y.swc
    Build sequence for target(s) `package' is [init, compile, report, package]
    Complete build sequence is [init, compile, report, package, clean, deploy, ]
    init:
        [mkdir] Skipping C:\projects\FlexUnit4CIListener\libs because it already exists.
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target\sonatype
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target\bin
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target\docs
         [copy] Copying 1 file to C:\projects\FlexUnit4CIListener\libs
         [copy] Copying C:\projects\FlexUnit4\target\flexunit-4.1.0-x-as3_y.y.y.y.swc to C:\projects\FlexUnit4CIListener\libs\flexunit-4.1.0-x-as3_y.y.y.y.swc
    compile:
        [compc] Loading configuration file C:\flexunit\frameworks\flex-config.xml
        [compc] Adobe Compc (Flex Component Compiler)
        [compc] Version 3.6.0 build 16995
        [compc] Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
        [compc]
        [compc] command line: Error: configuration variable 'output' value contains unknown token 'build.version'
        [compc]
        [compc] Use 'compc -help' for information about using the command line.
    BUILD FAILED
    C:\projects\FlexUnit4CIListener\build.xml:50: compc task failed
            at flex.ant.FlexTask.executeInProcess(FlexTask.java:299)
            at flex.ant.FlexTask.execute(FlexTask.java:225)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:390)
            at org.apache.tools.ant.Target.performTasks(Target.java:411)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
            at org.apache.tools.ant.Main.runBuild(Main.java:809)
            at org.apache.tools.ant.Main.startAnt(Main.java:217)
            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
    Total time: 1 second
    build.version, build.number & build.sdk are properties that are not being set.  I would assume that they should be set internally somehow.  However, if I manually set them via -D switches (with arbitrary values) I get the following:
    >ant -v clean package -Dbuild.version=1.2.3.4 -Dbuild.number=666 -Dbuild.sdk=4.1
    function(){return A.apply(null,[this].concat($A(arguments)))}
    Apache Ant(TM) version 1.8.2 compiled on December 20 2010
    Trying the default build file: build.xml
    Buildfile: C:\projects\FlexUnit4CIListener\build.xml
    Detected Java version: 1.7 in: C:\Program Files\Java\jdk1.7.0\jre
    Detected OS: Windows XP
    parsing buildfile C:\projects\FlexUnit4CIListener\build.xml with URI = file:/C:/projects/FlexUnit4CIListener/build.xml
    Project base dir set to: C:\projects\FlexUnit4CIListener
    parsing buildfile jar:file:/C:/apacheAnt/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/apacheAnt/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
    Importing file C:\projects\utils.xml from C:\projects\FlexUnit4CIListener\build.xml
    Overriding previous definition of reference to ant.projectHelper
    parsing buildfile C:\projects\utils.xml with URI = file:/C:/projects/utils.xml
    [macrodef] creating macro  gpg
    [macrodef] creating macro  sonatype-bundle
    Overriding previous definition of reference to ant.projectHelper
    [property] Loading Environment env.
    Build sequence for target(s) `clean' is [clean]
    Complete build sequence is [clean, init, compile, report, package, deploy, ]
    clean:
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target\bin
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target\docs
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target\sonatype
       [delete] Deleting directory C:\projects\FlexUnit4CIListener\target
       [delete] Deleting C:\projects\FlexUnit4CIListener\libs\flexunit-4.1.0-x-as3_y.y.y.y.swc
    Build sequence for target(s) `package' is [init, compile, report, package]
    Complete build sequence is [init, compile, report, package, clean, deploy, ]
    init:
        [mkdir] Skipping C:\projects\FlexUnit4CIListener\libs because it already exists.
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target\sonatype
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target\bin
        [mkdir] Created dir: C:\projects\FlexUnit4CIListener\target\docs
         [copy] Copying 1 file to C:\projects\FlexUnit4CIListener\libs
         [copy] Copying C:\projects\FlexUnit4\target\flexunit-4.1.0-x-as3_y.y.y.y.swc to C:\projects\FlexUnit4CIListener\libs\flexunit-4.1.0-x-as3_y.y.y.y.swc
    compile:
        [compc] Loading configuration file C:\flexunit\frameworks\flex-config.xml
        [compc] C:\projects\FlexUnit4CIListener\target\bin\flexunit-cilistener-1.2.3.4-666-4.1.swc (11773 bytes)
    report:
    Skipped because property 'build.report' not set.
    package:
         [copy] Copying 1 file to C:\projects\FlexUnit4CIListener\target
         [copy] Copying C:\projects\FlexUnit4CIListener\target\bin\flexunit-cilistener-1.2.3.4-666-4.1.swc to C:\projects\FlexUnit4CIListener\target\flexunit-cilistener-1.2.3.4-666-4.1.swc
    BUILD SUCCESSFUL
    Total time: 4 seconds
    I can see where the previous 3 properties are being used in the swc output file name, but now there is a build.report property that is not being set.  How do I know which properties need to be set, and what to set them to?

    I was using the 4.5.1 flex SDK but there seemed to be other issues so I just used the link directly from the Ant Task Setup page (instead of using the newest SDK).  Upon following your instructions to ant build from the root directory, everything seemed to work correctly with a few exceptions.  Below is the last part of the output from the build.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    test:
    Detected Java version: 1.7 in: C:\Program Files\Java\jdk1.7.0\jre
    Detected OS: Windows XP
    Project base dir set to: C:\projects\FlexUnit4Test
          [ant] calling target(s) [test] in build file C:\projects\FlexUnit4Test\build.xml
    parsing buildfile C:\projects\FlexUnit4Test\build.xml with URI = file:/C:/projects/FlexUnit4Test/build.xml
    Project base dir set to: C:\projects\FlexUnit4Test
    [property] Loading Environment env.
    Override ignored for property "FLEX_HOME"
    Property "env.FLEX_COVER_VIEWER" has not been set
    [macrodef] creating macro  compile-runner
    [macrodef] creating macro  execute-tests
    [macrodef] creating macro  execute-tests-using-flexcover
    [macrodef] creating macro  generate-html-report
          [ant] Entering C:\projects\FlexUnit4Test\build.xml...
    Build sequence for target(s) `test' is [init, test-only, test-and-instrument, test]
    Complete build sequence is [init, test-only, test-and-instrument, test, clean, ]
    init:
        [mkdir] Created dir: C:\projects\FlexUnit4Test\target
        [mkdir] Created dir: C:\projects\FlexUnit4Test\target\bin
        [mkdir] Created dir: C:\projects\FlexUnit4Test\target\report\xunit\flex
        [mkdir] Created dir: C:\projects\FlexUnit4Test\target\report\xunit\as3
        [mkdir] Created dir: C:\projects\FlexUnit4Test\target\report\flexcover
         [copy] Copying 5 files to C:\projects\FlexUnit4Test\libs
         [copy] Copying C:\projects\FlexUnit4CIListener\target\flexunit-cilistener-4.1.0-x-y.y.y.y.swc to C:\projects\FlexUnit4Test\libs\flexunit-cilistener-4.1.0-x-y.y.y.y.swc
         [copy] Copying C:\projects\FlexUnit4FluintExtensions\target\fluint-extensions-4.1.0-x-y.y.y.y.swc to C:\projects\FlexUnit4Test\libs\fluint-extensions-4.1.0-x-y.y.y.y.swc
         [copy] Copying C:\projects\FlexUnit4\target\flexunit-4.1.0-x-as3_y.y.y.y.swc to C:\projects\FlexUnit4Test\libs\flexunit-4.1.0-x-as3_y.y.y.y.swc
         [copy] Copying C:\projects\FlexUnit4\target\flexunit-4.1.0-x-flex_y.y.y.y.swc to C:\projects\FlexUnit4Test\libs\flexunit-4.1.0-x-flex_y.y.y.y.swc
         [copy] Copying C:\projects\FlexUnit4FlexCoverListener\target\flexunit-flexcoverlistener-4.1.0-x-y.y.y.y. swc to C:\projects\FlexUnit4Test\libs\flexunit-flexcoverlistener-4.1.0-x-y.y.y.y.swc
         [copy] Copying 1 file to C:\projects\FlexUnit4Test\libs\build
         [copy] Copying C:\projects\FlexUnit4AntTasks\target\flexUnitTasks-4.1.0-x.jar to C:\projects\FlexUnit4Test\libs\build\flexUnitTasks-4.1.0-x.jar
    test-only:
         [echo] Testing FlexUnit Flex build...
        [mxmlc] Loading configuration file C:\flexunit\frameworks\flex-config.xml
        [mxmlc] C:\projects\FlexUnit4Test\target\bin\TestRunner-flex.swf (924564 bytes)
    [flexunit] Validating task attributes ...
    [flexunit] Generating default values ...
    [flexunit] Using default working dir [C:\projects\FlexUnit4Test]
    [flexunit] Using the following settings for the test run:
    [flexunit]  FLEX_HOME: [C:\flexunit]
    [flexunit]  haltonfailure: [false]
    [flexunit]  headless: [false]
    [flexunit]  display: [99]
    [flexunit]  localTrusted: [true]
    [flexunit]  player: [flash]
    [flexunit]  port: [1024]
    [flexunit]  swf: [C:\projects\FlexUnit4Test\target\bin\TestRunner-flex.swf]
    [flexunit]  timeout: [60000ms]
    [flexunit]  toDir: [C:\projects\FlexUnit4Test\target\report\xunit\flex]
    [flexunit] Setting up server process ...
    [flexunit] Starting server ...
    [flexunit] Entry [C:\projects\FlexUnit4Test\target\bin] already available in local trust file at [C:\Documents and Settings\Administrator\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust\flexUnit.cfg].
    [flexunit] Executing 'rundll32' with arguments:
    [flexunit] 'url.dll,FileProtocolHandler'
    [flexunit] 'C:\projects\FlexUnit4Test\target\bin\TestRunner-flex.swf'
    [flexunit]
    [flexunit] The ' characters around the executable and arguments are
    [flexunit] not part of the command.
    [flexunit]
    [flexunit] Opening server socket on port [1024].
    [flexunit] Waiting for client connection ...
    [flexunit]
    [flexunit] Stopping server ...
    [flexunit] End of test data reached, sending acknowledgement to player ...
    [flexunit] Closing client connection ...
    [flexunit] Closing server on port [1024] ...
          [ant] Exiting C:\projects\FlexUnit4Test\build.xml.
    After this part of the log I get the following:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    BUILD FAILED
    C:\projects\build.xml:103: The following error occurred while executing this line:
    C:\projects\FlexUnit4Test\build.xml:180: The following error occurred while executing this line:
    C:\projects\FlexUnit4Test\build.xml:62: java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
            at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
            at java.util.concurrent.FutureTask.get(FutureTask.java:111)
            at org.flexunit.ant.tasks.TestRun.run(Unknown Source)
            at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:390)
            at org.apache.tools.ant.Target.performTasks(Target.java:411)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
            at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:3 8)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
            at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:390)
            at org.apache.tools.ant.Target.performTasks(Target.java:411)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
            at org.apache.tools.ant.Main.runBuild(Main.java:809)
            at org.apache.tools.ant.Main.startAnt(Main.java:217)
            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
    Caused by: Socket timeout waiting for flexunit report
            at org.flexunit.ant.FlexUnitSocketServer.start(Unknown Source)
            at org.flexunit.ant.FlexUnitSocketThread.call(Unknown Source)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
            at java.util.concurrent.FutureTask.run(FutureTask.java:166)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
            at java.lang.Thread.run(Thread.java:722)
    Caused by: java.net.SocketTimeoutException: Accept timed out
            at java.net.TwoStacksPlainSocketImpl.socketAccept(Native Method)
            at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:396)
            at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:183)
            at java.net.ServerSocket.implAccept(ServerSocket.java:522)
            at java.net.ServerSocket.accept(ServerSocket.java:490)
            at org.flexunit.ant.FlexUnitSocketServer.openClientSocket(Unknown Source)
            ... 7 more
    Total time: 1 minute 38 seconds
    So everything seems to be building correctly now, but not executing correctly.  Also, there are still a number of properties that are not being set:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    report:
    Skipped because property 'build.report' not set.
    instrument-compile:
    Skipped because property 'build.instrument' not set.
    package-instrument:
    Skipped because property 'build.instrument' not set.
    pmdReport:
    Skipped because property 'build.pmd' not set.
    Where should these values be set and what are appropriate values?  What could be causing the socket timeout and what exactly is it waiting for or attempting to accomplish with the sockets?
    The end goal is to be able to use the flex SDK, flexunit and ANT on a linux server to automate my build/test process.  I am currently just trying to get ANT to work with the flex SDK and flexunit on a windows XP box so I can see what the output should be and how the whole system works before trying to inject it into my CI system.

  • To convert XML to ABAP internal table can we do it with DOM or we need XSLT

    I have a requirement where I need to collect the data from XML file into an internal table.
    I need to collect this data into an internal table as I should make use of this data and do Goods Receipt in SAP.
    My XML file is very very complex and the child nodes in my XML file may occur ones or 10 times and change dynamically.
    I want to know if XML to ABAP internal table is possible with DOM or does it need XSLT too.
    I used the blog of Robert which uses DOM, but it I am unable to collect the data in internal table. The blog explains only how to wtite the out put to screen as element and value.
    I want to know if XML to ABAP internal table is possible with DOM or do I need XSLT too? I am confused please help.
    Any help will be highly appreciated.
    Regards,
    Jessica Sam

    Hello Jessica
    Why not using the DOM itself for processing?
    Below you see the post-processing coding which I use to add the interchange control number (ICN) into an EDI message (which at this stage is still an XML-EDI stream). This is done on SAP-XI yet on the ABAP stack so you could use this approach on your R/3 system as well.
    method POSTPROCESSING.
    * Post-Processing of outbound EDI invoices & dispatch advices
      me->map_icn( ).
    endmethod.
    method MAP_ICN.
    * define local data
      DATA: lo_node       TYPE REF TO if_ixml_node,
            ld_name       TYPE string,
            ld_value      TYPE string,
            ld_error_code type MPG_ERRCODE,
    **        ld_control_number   TYPE char13,
            ld_rc         TYPE i,
            ld_msg        TYPE string.  " bapi_msg.
      DATA: ld_interface  TYPE string.
      DATA: incode TYPE REF TO if_ixml_node_collection.
      LOG-POINT ID zedi
        SUBKEY mc_subkey_method_trace.
      ld_error_code = md_clsname.
    * Get next interchange control number (ICN)
      me->md_next_number = me->get_next_number(
          id_nrobj  = me->md_nrobj   " Object (SNRO)
          id_nrnr   = me->md_nrnr ). " Number Range
      CALL METHOD zcl_edi_uk_counter=>calculate_modulo_n09
        EXPORTING
          id_input  = me->md_next_number
        receiving
          rd_output = me->md_next_number.
    * Build ICN according to naming conventions agreed with EDI customer
      me->md_icn = me->generate_icn( me->md_next_number ).
      ld_value = me->md_icn.  " type conversion to string
      CLEAR: incode,
             lo_node.
      incode  = me->mo_document->get_elements_by_tag_name( mc_d_0020 ).
      lo_node = incode->get_item( index = 0 ).
      CALL METHOD lo_node->set_value
        EXPORTING
          value = ld_value
        RECEIVING
          rval  = ld_rc.
      IF ( ld_rc NE 0 ).
        CONCATENATE 'Error [' mc_d_0020
                    ']: Method SET_VALUE (IF_IXML_NODE)'
                    INTO ld_msg.
        CONDENSE ld_msg.
        me->mif_trace->trace2( message = ld_msg ).
        RAISE EXCEPTION TYPE cx_mapping_fault
          EXPORTING
    *        textid =
    *        previous =
            error_code = ld_error_code
            error_text = ld_msg.
    **    MESSAGE ld_msg TYPE 'A'.
      ENDIF.
      CLEAR: incode,
             lo_node.
      incode  = me->mo_document->get_elements_by_tag_name( mc_d_0020_2 ).  " element for ICN
      lo_node = incode->get_item( index = 0 ).
      CALL METHOD lo_node->set_value
        EXPORTING
          value = ld_value
        RECEIVING
          rval  = ld_rc.
      IF ( ld_rc NE 0 ).
        CONCATENATE 'Error [' mc_d_0020_2
                    ']: Method SET_VALUE (IF_IXML_NODE)'
                    INTO ld_msg.
        CONDENSE ld_msg.
        me->mif_trace->trace2( message = ld_msg ).
        RAISE EXCEPTION TYPE cx_mapping_fault
          EXPORTING
    *        textid =
    *        previous =
            error_code = ld_error_code
            error_text = ld_msg.
    **    MESSAGE ld_msg TYPE 'A'.
      ENDIF.
    * define local data
      DATA: ls_record       TYPE mpp_dynamic.
      CLEAR: ls_record.
      ls_record-namespace = mc_dynamic_namespace.
      ls_record-name      = mc_icn.
      ls_record-value     = ld_value.
      mif_dynamic->add_record( ls_record ).
    endmethod.
    In your case you would need to do a DO...ENDDO loop until you parsed all required nodes.
    NOTE: ME->MO_DOCUMENT is of TYPE REF TO IF_IXML_DOCUMENT.
    Regards
       Uwe

  • Build page with screen definition in XML using XSLT in ADF 11.1.1.x

    Hi folks,
    I'm figuring out how best integrating Oracle Policy Automation/Webdeterminations in ADF. My idea is that in a ADF Taskflow I first call a Init-session webservice on OPA to initiate a session with facts queried from ADF Components.
    Then I would query a Determinations Server Webservice to get the next interview-screen definition. This gives me an xml with the definition of a screen to present. I could create an xslt that transform this to an HTML form. Then I would show a page with this (x)html form included in a container. The user could fill in the question-fields. Then on a command button I would read the values from the HTTP request and feed it into a webservice call to the Determinations Service.
    Is a scenario like this possible in ADF? And could you give me some hints to get me on track? Or would you suggest otherwise?
    The recommendation from OPA is to use data-adapters. But that are then java-classes based on an java-interface that are to be custom build on a datamodel. And I could imagine several security implications on that.
    Thanks in advance.
    Regards,
    Martien

    Can you use JAXB to unmarshall the XML document to a Java Class (and create a POJO data control out of the java class) and use it in the ADF pages as form or table or tree table?
    Take a look at the following sample how an XML document having a schema associated can be converted to a Java class and used in the UI:
    http://adftree.googlecode.com/svn/trunk/TreeSample.zip
    Thanks,
    Navaneeth

  • Help with flex4unit ant build.xml: Socket timeout waiting for flexunit report

    I'm having trouble setting up ant to build and test my project locally and I'm not sure what the next step is.
    Info:
    Running on XP/Cygwin.
    All of the files that FlexUnit4 references when used in Flash Builder are in my '${basename}/libs' folder (eg FlexUnit4_1.0.swc).
    I've placed the flexunit4 task in my ant/libs folder.
    I'm getting two errors...
    I don't think I've set up the 'socket' stuff right for the tests. It just sits and waits then dies...
    [flexunit] Waiting for client connection ...
    (about a minute later)
    [flexunit] Stopping server ...
    [flexunit] End of test data reached, sending acknowledgement to player ...
    [flexunit] Closing client connection ...
    [flexunit] Closing server on port [1024] ...
    BUILD FAILED
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    Plus this is the error I get from the flash player:
    ReferenceError: Error #1065: Variable mx.skins.spark::BorderSkin is not defined.
    I don't know why it's complaining about Borderskin as I think I have included all the flex4 libs I could find. I suspect this second error is causing the first error?
    Any help appreciated. I think I'm just setting it up all wrong.
    Screencap of errors:
    http://twitpic.com/l7ay8
    build.xml:
    http://gist.github.com/20804

    Finally got everything working using the files from the CI Example which what i probably should have done in the first place.
    So a rough guide for anyone just starting out with this:
    Download the Flex 4 'workspace' from the digital primates hudson server . This appears to contain flexunit library and examples in various stages of development.
    I used Flex Builder 4 Beta 2 to set up my Test Suite and Test Cases.
    I then loaded the libs folder from:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject
    into my flex project's libs folder:
    this includes:
    FlexUnit4.swc
    FlexUnit4CIListener.swc
    flexUnit4UIRunner.swc
    flexTasks.jar
    flexUnitTasks.jar
    I didn't need to remove the FlexUnit4 stuff that is 'referenced' automatically by flash builder when you start adding flexunit4 tests/suites.
    Then I used a modified version of the TestRunner.mxml found in:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject\src\test\flex
    The lines to pay attention to are the ones that look like:
    static public function currentRunTestSuite():Array {
        var testsToRun:Array = new Array();
        testsToRun.push(packagename.TestSuiteName);
        testsToRun.push(packagename.TestClassName);
        return testsToRun;
    Just make sure you update this list to include all of the test suites &/or individual tests you want to run.
    I made this a static function and modified the code in the "FlexUnitApplication.mxml" file to use this function so i'd only need to update one list of suites/tests.
    FlexUnitApplication.mxml is generated automatically when you run FlexUnit4 tests in the Flash Builder 4 Beta 2 IDE.
    This is the build.xml file I'm using in the project:
    http://gist.github.com/208211
    Change the name of the project from "Flare" to whatever and adjust the other path settings where required (though you might want to write this from scratch at least once so you understand roughly what is going on).
    The Debug Flash Player must be installed on the server otherwise you'll get a:
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    ...while it waits for the non-existant debugger to attach. (This is obvious but I did forget and was a bit bewildered for a moment)
    Need to also ensure the environment variable:FLEX_HOME is set to the location you installed the flex sdk...by editing your .bashrc setting the environment variable the in the Hudson Configuration.
    You'll need to point Hudson at your ant installation and your jdk installation. If you downloaded he sdk, be aware you might need to point it to the jdk folder inside the place you installed the sdk.
    And I think that's all the problems I had. Hope it's useful to someone... if anyone who actually knows what they are doing can point out any potential issues/better ways of doing things, feel free to comment.
    Thanks to Brian (legrosb) and Mike (mlabriola) for their assistance!

  • Help with Flex Ant build.xml error

    So I've started on a new project and I'm new to Flex. A lot of learning curve here. Anyway, I'm trying to deploy a project that uses flex and is built with Ant. We've moving up from a version of Flex 2 to Flex 3. The build file works fine in the Flex 2 app but for some reason does not seem to be working with Flex 3. I'm hoping someone can give me some insight on what might be wrong or where to start.
    The error is Command not found: compc
    The part of the build file it has a problem with is:
    <compc include-classes="${classes}"
         ouput="${flex.dist.dir}/${flex.app.name}.swc"
         keep-generated-actionscript="false"
         headless-server="${headless.server}"
         incremental="true">
    <load_config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
    <source-path path-element="${FLEX_HOME}/frameworks" />
    <source-path path-element="${flex.app.root}" />
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
         <include name="libs" />
         <include name="../bundles/{local}" />
    </compiler.library-path>
    <compiler.library-path dir="${flex.app.root}" appent="true">
         <include name="libs" />
    </compiler.library-path>
    </compc>
    Any help at all would be greatly appreciated, thank you.

    Sorry, I meant to address that. Yes, since we've moved up to the Flex 3 sdk, we are pointing at a new directory. The old directory was flex_sdk and the new directory is flex_sdk_340.
    FLEX_HOME is being set in the build.properties file for local building and then overidden in the build.xml file with this code:
    <target name="build">
         <available property="FLEX_HOME" value="/apps/flex_sdk_340" file="/apps/flex_sdk_340" />
         <echo>FLEX_HOME = ${FLEX_HOME}</echo>
         <antcall target="compile" />
    </target>
    I did notice a warning about not using the available property, so I removed it and just changed what FLEX_HOME was set to in the build.properties file to the server directory. Would mess up local building but regardless it didn't matter because it had no effect on the error being generated. I alos looked a little into the file property of the available tag trying to figure out if that was somehow an issue but I wasn't able to come to any conclusion.
    Before the program errors out, it does displayt he echo statement and the value of FLEX_HOME appears to be correct in that it does show /apps/flex_sdk_340.
    Thank you so much for your continued help. This is truly frustrating because nothing but a directory name has really changed and yet it stopped working. I can't find any information anywhere on what could be wrong and this is really my last resort.

  • Building XPath with the XML having the Namespace using PL SQL

    While trying to build the path of each node, when the XML has no namespace in it , the below code works fine providing the result
    1~/
    2~/person/
    3~/person/age/
    4~/person/homecity/
    5~/person/name/
    6~/person/homecity/lat/
    7~/person/homecity/name/
    8~/person/homecity/long/
    But when the xml is changed to
    <person xmlns="urn:person" xmlns:lat="urn:lat">
    <name>Rob</name>
    <age>37</age>
    <homecity>
        <name>London</name>
        <lat>123.000</lat>
        <long>0.00</long>
    </homecity>
    </person>"
    The result on executing the below code is resulting into only into below result
    1~/
    2~/person/
    In the XML provided above, XML name space is not constant and it may vary for every XML. My requirement is to parse the complete XML, where i can read the XML with namespace and get the result as mentioned below
    1~/
    2~/person/
    3~/person/age/
    4~/person/homecity/
    5~/person/name/
    6~/person/homecity/lat:lat/
    7~/person/homecity/name/
    8~/person/homecity/long/
    Can you please help me resolving the issue mentioned. Thanks in advance. --Code Snippet below :
    DECLARE
      l_File VARCHAR2(32000) := '<person>
    <name>Rob</name>
    <age>37</age>
    <homecity>
        <name>London</name>
        <lat>123.000</lat>
        <long>0.00</long>
    </homecity>
    </person>';
    l_Where_Clause VARCHAR2(100) := '/*';
    l_Append_Var   VARCHAR2(100) := '/';
    TYPE Ty_Paths IS TABLE OF VARCHAR2(1000) INDEX BY PLS_INTEGER;
    l_Ty_Paths      Ty_Paths;
    l_Ty_Paths_Temp Ty_Paths;
    TYPE Ty_Verifier IS TABLE OF VARCHAR2(1000) INDEX BY VARCHAR2(1000);
    l_Ty_Varifier Ty_Verifier;
    l_Prev_Query_Rec VARCHAR2(100);
    l_Index_Num      NUMBER := 0;
    l_Cur_Exec_Row   NUMBER := 0;
    BEGIN
    l_Ty_Paths(Nvl(l_Ty_Paths.COUNT, 0) + 1) := l_Append_Var;
    l_Cur_Exec_Row := 1;
    --Dbms_Output.put_line('Before entering the loop');
    LOOP
       l_Ty_Paths_Temp.DELETE;
      SELECT DISTINCT REPLACE(l_Append_Var || '/' || t.Xml || '/', '//', '/') BULK COLLECT
       INTO   l_Ty_Paths_Temp
      FROM   (SELECT Xmltype(Extract(VALUE(e), '/').Getstringval()) .Getrootelement() AS Xml
               FROM   TABLE(Xmlsequence(Extract(Xmltype(l_File), l_Where_Clause))) e) t;
      l_Ty_Varifier(Nvl(l_Ty_Varifier.COUNT, 0) + 1) := l_Append_Var;
      --Dbms_Output.put_line('L_TY_PATHS_TEMP.Count::'||L_TY_PATHS_TEMP.Count);
      IF l_Ty_Paths_Temp.COUNT > 0 THEN
         l_Index_Num := Nvl(l_Ty_Paths.COUNT, 0) + 1;
         FOR i IN l_Ty_Paths_Temp.FIRST .. l_Ty_Paths_Temp.LAST LOOP
            l_Ty_Paths(l_Index_Num) := l_Ty_Paths_Temp(i);
            --Dbms_Output.put_line('L_INDEX_NUM::'||L_INDEX_NUM);
            --Dbms_Output.put_line('L_TY_PATHS(L_INDEX_NUM)::'||L_TY_PATHS(L_INDEX_NUM));
            l_Index_Num := l_Index_Num + 1;
         END LOOP;
      END IF;
      --Dbms_Output.put_line('L_TY_PATHS.Count::'||L_TY_PATHS.Count);
      --Dbms_Output.put_line('L_TY_PATHS.Count::'||L_CUR_EXEC_ROW);
      IF (NOT l_Ty_Paths.EXISTS(l_Cur_Exec_Row + 1)) OR (l_Cur_Exec_Row = l_Ty_Paths.COUNT) THEN
         --Dbms_Output.put_line('Exiting');
         EXIT;
      ELSE
         --Dbms_Output.put_line('Inside the Else part');
         l_Cur_Exec_Row := l_Cur_Exec_Row + 1;
         l_Append_Var   := l_Ty_Paths(l_Cur_Exec_Row);
         l_Where_Clause := l_Ty_Paths(l_Cur_Exec_Row) || '*';
      END IF;
      --To Display the record:
         --Dbms_Output.put_line(L_TY_PATHS.Count);
      END LOOP;
      IF l_Ty_Paths.COUNT > 0 THEN
        FOR i IN l_Ty_Paths.FIRST .. l_Ty_Paths.LAST LOOP
          Dbms_Output.Put_Line(i || ' record is ' || l_Ty_Paths(i));
       END LOOP;
    END IF;
    END;

    Hi,
    Thanks for the reply.
    Please find the details :
    1) What's your database version ?
    Database version  :
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    2) What's the practical use of extracting all the paths like this, what are you trying to achieve, besides a purely academic exercise ?
    The XML provided was for sample XML.
    The practical use being ,I wanted to parse the SEPA messages using the below code snippet dynamically.
    create table data_table (
         data xmltype
        xmltype column data store as securefile binary xml
    insert into data_table values (
        xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <SCTScfBlkCredTrf xmlns="urn:S2SCTScf:xsd:$SCTScfBlkCredTrf">
      <SndgInst>CMCIFRPPXXX</SndgInst>
      <RcvgInst>RLBBAT2E083</RcvgInst>
      <FileRef>006FRID2516PH712</FileRef>
      <SrvcId>SCT</SrvcId>
      <TstCode>T</TstCode>
      <FType>SCF</FType>
      <FDtTm>2012-11-01T01:12:22</FDtTm>
      <NumCTBlk>1</NumCTBlk>
      <NumPCRBlk>0</NumPCRBlk>
      <NumRFRBlk>0</NumRFRBlk>
      <NumROIBlk>0</NumROIBlk>
    <FIToFICstmrCdtTrf xmlns="urn:iso:std:iso:20022:tech:xsd:sct:pacs.008.001.02">
      <GrpHdr>
        <MsgId>006MSID12511PH712</MsgId>
        <CreDtTm>2012-11-01T08:09:14</CreDtTm>
        <NbOfTxs>1</NbOfTxs>
        <TtlIntrBkSttlmAmt Ccy="EUR">20000</TtlIntrBkSttlmAmt>
        <IntrBkSttlmDt>2012-11-01</IntrBkSttlmDt>
        <SttlmInf>
          <SttlmMtd>INGA</SttlmMtd>
          <ClrSys>
            <Prtry></Prtry>
          </ClrSys>
        </SttlmInf>
        <InstgAgt>
          <FinInstnId>
            <BIC>RLBBAT2E083</BIC>
          </FinInstnId>
        </InstgAgt>
        <InstdAgt>
          <FinInstnId>
            <BIC>HELADEF1XXX</BIC>
          </FinInstnId>
        </InstdAgt>
      </GrpHdr>
      <CdtTrfTxInf>
        <PmtId>
          <EndToEndId>006SEOP23END1712</EndToEndId>
          <TxId>006SEOP231PH1712</TxId>
        </PmtId>
        <PmtTpInf>
          <SvcLvl>
            <Cd>SEPA</Cd>
          </SvcLvl>
        </PmtTpInf>
        <IntrBkSttlmAmt Ccy="EUR">20000</IntrBkSttlmAmt>
        <AccptncDtTm>2012-11-01T12:00:00</AccptncDtTm>
        <ChrgBr>SLEV</ChrgBr>
        <Dbtr>
          <Nm>Mrinmoy Sahu</Nm>
          <PstlAdr>
            <Ctry>FR</Ctry>     
            <AdrLine>6</AdrLine>
            <AdrLine>Bangalore</AdrLine>
          </PstlAdr>
          <Id>
            <PrvtId>
              <Othr>
                <Id>E20809</Id>
                <SchmeNm></SchmeNm>
                <Issr>ORACLE CORP</Issr>
              </Othr>
            </PrvtId>
          </Id>
        </Dbtr>
        <DbtrAcct>
          <Id>
            <IBAN>FR7030087330086000000000591</IBAN>
          </Id>
        </DbtrAcct>
        <DbtrAgt>
          <FinInstnId>
            <BIC>CMCIFRPPXXX</BIC>
          </FinInstnId>
        </DbtrAgt>
        <CdtrAgt>
          <FinInstnId>
            <BIC>RLBBAT2E083</BIC>
          </FinInstnId>
        </CdtrAgt>
        <Cdtr>
          <Nm>Mrinmoy Sahu</Nm>
          <PstlAdr>
            <Ctry>FR</Ctry>     
            <AdrLine>22 </AdrLine>
          </PstlAdr>
          <Id>
            <PrvtId>
              <Othr>
                <Id>F676869</Id>
                <SchmeNm></SchmeNm>
                <Issr>GOVT OF INDIA</Issr>
              </Othr>
            </PrvtId>
          </Id>
        </Cdtr>
        <CdtrAcct>
          <Id>
            <IBAN>FR7630087330086000000004266</IBAN>
          </Id>
        </CdtrAcct>
        <RmtInf>
            <Ustrd>abc</Ustrd>
          </RmtInf>
      </CdtTrfTxInf>   
      </FIToFICstmrCdtTrf>
    </SCTScfBlkCredTrf>
    alter session set nls_numeric_characters = ".,";
          SELECT Msgid, Msgid1, Sttlmmtd
       FROM   data_table t,Xmltable(Xmlnamespaces('urn:S2SCTScf:xsd:$SCTScfBlkCredTrf' AS "A", 'urn:iso:std:iso:20022:tech:xsd:sct:pacs.008.001.02' AS "B")
                        ,'/A:SCTScfBlkCredTrf/B:FIToFICstmrCdtTrf' Passing t.data Columns
                        Msgid Path 'A:SndgInst'
                        ,Msgid1 Path 'B:GrpHdr/B:MsgId'
                        ,Sttlmmtd Path 'B:GrpHdr/B:SttlmInf/B:SttlmMtd');
    MSGID             ;MSGID1           ;STTLMMTD         ;
                     ;006MSID12511PH712;INGA             ;
    The idea was to :
    1). Map the Column Names for the XPath built using the previous code.
    2). Build the Select statement shown above dynamically based on the Xpath built in the previous code using a PLSQL block, and to process the data by doing a bulk collect on the XML.
    The above XML may contain multiple <FIToFICstmrCdtTrf></FIToFICstmrCdtTrf> nodes.
    Since the name space in the XML varies for each version of the SEPA messages , i need to get the names spaces ALSO to be picked up dynamically and parse the XML data based on the select statement as shown above.
    Could you please guide me with
    1). Is the approach taken appropriate?
    2). Any alternative approach should be looked for ?
    3). How to extract the name spaces available in the XML?
    Thanks.

  • Need help with build.xml / junit - pls ignore my previous posting

    i'm trying to add unit tests for another class file in a larger package. the package is built with ant. relevant lines of the build.xml that pertain to unit tests are
            </target>
            <target name="test" depends="dist, build-tests">
                    <!-- the grouper project doesn't use the junit ant task that's fine with me -->
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="organization.organizationSuite"/>
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>
            </target>
            <target name="test-individual" depends="dist, build-tests">
                    <!-- the grouper project doesn't use the junit ant task that's fine with me -->
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="organization.testFoo"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="organization.oldTest"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>i'm trying to add
      <arg value="organization.anotherTest"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../organization.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>right now i can
    right now i can
    java junit.textui.TestRunner organization.testSuite
    or to run a specific test
    java junit.textui.TestRunner organization.oldTest
    i added the above lines to my build.xml, added the .java file for the anotherTest class to the ${testdir} where oldTest and testSuite and other junit related classes live within the package directory structure, then ran 'ant' to make a new .jar file.
    now when i switch in the new .jar file, i get errors whenever i try to
    java junit.textui.TestRunner organization.oldTest
    i get 'no class oldTest' found
    can anyone point me in the right direction?

    My Ant build.xml doesn't look like yours. I usually do it like this, and it works fine:
        <target name="test" depends="compile" description="run all unit tests">
            <junit>
                <jvmarg value="-Xms32m" />
                <jvmarg value="-Xmx64m" />
                <classpath>
                    <path refid="project.class.path" />
                </classpath>
                <formatter type="xml" />
                <batchtest fork="yes" todir="${reports}">
                    <fileset dir="${output.classes}">
                        <include name="**/*TestCase.class" />
                    </fileset>
                    <fileset dir="${output.classes}">
                        <include name="**/*TestSuite.class" />
                    </fileset>
                </batchtest>
            </junit>
        </target>
        <target name="report" depends="test" description="create HTML report for JUnit test results">
            <junitreport todir="${reports}">
                <fileset dir="${reports}">
                    <include name="TEST-*.xml"/>
                </fileset>
                <report format="frames" todir="${reports}"/>
            </junitreport>
        </target>I don't understand why you're running individual tests like that. why not run them all?
    %

  • Need help with build.xml / junit

    i'm trying to add unit tests for another class file in a larger package. the package is built with ant. relevant lines of the build.xml that pertain to unit tests are
            </target>
            <target name="test" depends="dist, build-tests">
                    <!-- the grouper project doesn't use the junit ant task that's fine with me -->
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="nsit.testSuite"/>
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../nsit.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>
            </target>
            <target name="test-individual" depends="dist, build-tests">
                    <!-- the grouper project doesn't use the junit ant task that's fine with me -->
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="nsit.testFoo"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../nsit.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>
                    <java fork="yes"
              classname="junit.textui.TestRunner"
              taskname="junit"
              failonerror="true">
                    <arg value="nsit.ServiceTest"/> <!-- ADJUST THIS FOR YOUR OWN TEST -->
                    <classpath>
                            <pathelement path="${java.class.path}"/>
                            <pathelement path="../nsit.jar"/>
                            <pathelement path="${buildir}" />
                    </classpath>
                    </java>right now i can
    java junit.textui.TestRunner organization.testSuite
    or to run a specific test
    java junit.textui.TestRunner organization.oldTest
    i added the above lines to my build.xml, added the .java file for the anotherTest class to the ${testdir} where oldTest and testSuite and other junit related classes live within the package directory structure, then ran 'ant' to make a new .jar file.
    now when i switch in the new .jar file, i get errors whenever i try to
    java junit.textui.TestRunner organization.oldTest
    i get 'no class oldTest' found
    can anyone point me in the right direction?

    My Ant build.xml doesn't look like yours. I usually do it like this, and it works fine:
        <target name="test" depends="compile" description="run all unit tests">
            <junit>
                <jvmarg value="-Xms32m" />
                <jvmarg value="-Xmx64m" />
                <classpath>
                    <path refid="project.class.path" />
                </classpath>
                <formatter type="xml" />
                <batchtest fork="yes" todir="${reports}">
                    <fileset dir="${output.classes}">
                        <include name="**/*TestCase.class" />
                    </fileset>
                    <fileset dir="${output.classes}">
                        <include name="**/*TestSuite.class" />
                    </fileset>
                </batchtest>
            </junit>
        </target>
        <target name="report" depends="test" description="create HTML report for JUnit test results">
            <junitreport todir="${reports}">
                <fileset dir="${reports}">
                    <include name="TEST-*.xml"/>
                </fileset>
                <report format="frames" todir="${reports}"/>
            </junitreport>
        </target>I don't understand why you're running individual tests like that. why not run them all?
    %

Maybe you are looking for

  • Remote Desktop Services: corrupt system database, how to remove and start again?

    Hi. This is my first Windows Server 2012 R2 installation, and I have a made a small mess. I'd be very grateful for any assistance in sorting it out. I had some problems which I eventually tracked down to an incorrectly installed SSL certificate, but

  • Any resolution to 10.4.10, wireless router/encryption issues?

    Like many others, I upgraded to 10.4.10 and soon began experiencing connecting to the Internet problems on my ATT/2WIRE gateway/router using WEP encryption as well as kernel panics. Having had my MBP for only two months, I did not have many files so

  • Logic Will Randomly Lose Phantom Power

    I have an Apogee One running into Logic Studio 9. On the Apogee One, I am running and XLR cable to an Apex Microphone, and a 1/4" cable to a guitar (At Different times). When recording either the Guitar, but most commonly with the Phantom Power on th

  • Error LiveKernelEvent

    Hello. I have a Lenovo G460, with a NVIDIA GeForce 310M, and the last week this error appeared: "Error LiveKernelEvent". Since that day and randomly, the screen changes colors with blue bands that appears and dissapears. I don't know what to do with

  • What kind of programming background do you need to start making iOS apps?

    I have zero knowledge of programming. I have done programming about 7 years ago and it was extremely basic stuff and mostly to do with C. I have learnt BASIC language (wonder if its even worth mentioning) in school!! But, I really want to program. Ev