Java XML Difference APIs

Hello all,
I am trying to do an analysis on Open source APIs for finding the difference between 2 XMLs. Both the XML documents would belong to the same schema and the individual differences between the tags have to be found. For eg. Lets say the XML A is the initial version of a XML and XML B is updated version of XML A, I should be able to prepare a report on which I should be able to find out what are all the new XML tags which have been added, what XML tags have been modified and what XML tags have been deleted. And the size of these XMLs could be anywhere from few Kbs to 500 Mb.
I see quite a few open source APIs available on the site below
http://www.roseindia.net/opensource/xmldiff.php
But it would help if someone had worked on these APIs before and provide a feedback and suggestions about the same.
Thanks
IK
Edited by: IronKnight on Apr 20, 2010 8:47 AM

I see quite a few open source APIs available on the site below
http://www.roseindia.net/opensource/xmldiff.php
Let me give you a word of advice. Ignore anything and everything you find on that site. It is a notorious source of drivel.

Similar Messages

  • Implementing XAdES in Java XML Digital Signature API

    Hi,
    I've got some problems with implementing XAdES standard with Java XML Digital Signature API. Below is a code (SignatureTest1), that produces a digital signature with some XAdES tags placed in <ds:Object> tag. The signature is later validated with a Validator class. Everything works fine, until I set a XAdES namespace (SignatureTest1.xadesNS="http://uri.etsi.org/01903/v1.3.2#"). In this case validation of XAdES elements fails.
    The reason of validation failture is a difference between arguments passed to a digest method when document is being signed and validated. When the document is being signed a log looks like this:
    FINER: Pre-digested input:
    2007-08-21 15:38:44 org.jcp.xml.dsig.internal.DigesterOutputStream write
    FINER: <SignedProperties xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SignP"></SignedProperties>
    2007-08-21 15:38:44 org.jcp.xml.dsig.internal.dom.DOMReference digest
    FINE: Reference object uri = #SignP
    2007-08-21 15:38:44 org.jcp.xml.dsig.internal.dom.DOMReference digest
    FINE: Reference digesting completed,but while validating:
    FINER: Pre-digested input:
    2007-08-21 15:38:44 org.jcp.xml.dsig.internal.DigesterOutputStream write
    FINER: <SignedProperties xmlns="http://uri.etsi.org/01903/v1.3.2#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SignP"></SignedProperties>
    2007-08-21 15:38:44 org.jcp.xml.dsig.internal.dom.DOMReference validate
    FINE: Expected digest: MAQ/vctdkyVHVzoQWnOnQdeBw8g=
    2007-08-21 15:38:44 org.jcp.xml.dsig.internal.dom.DOMReference validate
    FINE: Actual digest: D7WajkF0U5t1GnVJqj9g1IntLQg=
    2007-08-21 15:38:44 org.jcp.xml.dsig.internal.dom.DOMXMLSignature validate
    FINE: Reference[#SignP] is valid: falseHow can I fix this?
    Signer class:
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.OutputStream;
    import java.security.KeyPair;
    import java.security.KeyPairGenerator;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Iterator;
    import java.util.List;
    import javax.xml.crypto.dom.DOMStructure;
    import javax.xml.crypto.dsig.CanonicalizationMethod;
    import javax.xml.crypto.dsig.DigestMethod;
    import javax.xml.crypto.dsig.Reference;
    import javax.xml.crypto.dsig.SignatureMethod;
    import javax.xml.crypto.dsig.SignedInfo;
    import javax.xml.crypto.dsig.Transform;
    import javax.xml.crypto.dsig.XMLObject;
    import javax.xml.crypto.dsig.XMLSignature;
    import javax.xml.crypto.dsig.XMLSignatureFactory;
    import javax.xml.crypto.dsig.dom.DOMSignContext;
    import javax.xml.crypto.dsig.dom.DOMValidateContext;
    import javax.xml.crypto.dsig.keyinfo.KeyInfo;
    import javax.xml.crypto.dsig.keyinfo.KeyInfoFactory;
    import javax.xml.crypto.dsig.keyinfo.KeyValue;
    import javax.xml.crypto.dsig.spec.C14NMethodParameterSpec;
    import javax.xml.crypto.dsig.spec.TransformParameterSpec;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import com.sun.org.apache.xml.internal.security.utils.IdResolver;
    public class SignatureTest1 {
         public static String xadesNS=null;//"http://uri.etsi.org/01903/v1.3.2#";
         public static String signatureID="Sig1";
         public static String signedPropID="SignP";
         public static void main(String[] arg) {
            try{
              XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
              List<Reference> refs = new ArrayList<Reference>();
              Reference ref1 = fac.newReference
                  ("", fac.newDigestMethod(DigestMethod.SHA1, null),
                      Collections.singletonList
                    (fac.newTransform
                   (Transform.ENVELOPED, (TransformParameterSpec) null)),
                   null, null);
              refs.add(ref1);
              Reference ref2 = fac.newReference("#"+signedPropID,fac.newDigestMethod(DigestMethod.SHA1,null),null,"http://uri.etsi.org/01903/v1.3.2#SignedProperties",null);
              refs.add(ref2);
              SignedInfo si = fac.newSignedInfo
                  (fac.newCanonicalizationMethod
                   (CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,
                    (C14NMethodParameterSpec) null),
                   fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
                   refs);
             KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA");
              kpg.initialize(512);
              KeyPair kp = kpg.generateKeyPair();
              KeyInfoFactory kif = fac.getKeyInfoFactory();
              KeyValue kv = kif.newKeyValue(kp.getPublic());
             KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              dbf.setNamespaceAware(true);
              Document doc =
                  dbf.newDocumentBuilder().parse("purchaseOrder.xml");
              DOMSignContext dsc = new DOMSignContext
                  (kp.getPrivate(), doc.getDocumentElement());
              dsc.putNamespacePrefix(XMLSignature.XMLNS, "ds");
              Element QPElement = createElement(doc, "QualifyingProperties",null,xadesNS);
            QPElement.setAttributeNS(null, "Target", signatureID);
            Element SPElement = createElement(doc, "SignedProperties", null,xadesNS);
            SPElement.setAttributeNS(null, "Id", signedPropID);
            IdResolver.registerElementById(SPElement, signedPropID);
            QPElement.appendChild(SPElement);
            Element UPElement = createElement(doc, "UnsignedProperties", null,xadesNS);
            QPElement.appendChild(UPElement);
            DOMStructure qualifPropStruct = new DOMStructure(QPElement);
            List<DOMStructure> xmlObj = new ArrayList<DOMStructure>();
            xmlObj.add(qualifPropStruct);
            XMLObject object = fac.newXMLObject(xmlObj,"QualifyingInfos",null,null);
            List objects = Collections.singletonList(object);
            XMLSignature signature = fac.newXMLSignature(si, ki,objects,signatureID,null);
              signature.sign(dsc);
              OutputStream os = new FileOutputStream("signedPurchaseOrder.xml");
              TransformerFactory tf = TransformerFactory.newInstance();
              Transformer trans = tf.newTransformer();
              trans.transform(new DOMSource(doc), new StreamResult(os));
            }catch(Exception e){
                 e.printStackTrace();
            try{
            Validator.main(null);
            }catch(Exception e){
                 System.out.println("Validator exception");
                 e.printStackTrace();
         public static Element createElement(Document doc, String tag,String prefix, String nsURI) {
              String qName = prefix == null ? tag : prefix + ":" + tag;
             return doc.createElementNS(nsURI, qName);
    }Validator class:
    import javax.xml.crypto.*;
    import javax.xml.crypto.dsig.*;
    import javax.xml.crypto.dom.*;
    import javax.xml.crypto.dsig.dom.DOMValidateContext;
    import javax.xml.crypto.dsig.keyinfo.*;
    import java.io.FileInputStream;
    import java.security.*;
    import java.util.Collections;
    import java.util.Iterator;
    import java.util.List;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    * This is a simple example of validating an XML
    * Signature using the JSR 105 API. It assumes the key needed to
    * validate the signature is contained in a KeyValue KeyInfo.
    public class Validator {
        // Synopsis: java Validate [document]
        //       where "document" is the name of a file containing the XML document
        //       to be validated.
        public static void main(String[] args) throws Exception {
         // Instantiate the document to be validated
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         Document doc =
                dbf.newDocumentBuilder().parse(new FileInputStream("signedPurchaseOrder.xml"));
         // Find Signature element
         NodeList nl =
             doc.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature");
         if (nl.getLength() == 0) {
             throw new Exception("Cannot find Signature element");
         // Create a DOM XMLSignatureFactory that will be used to unmarshal the
         // document containing the XMLSignature
         XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
         // Create a DOMValidateContext and specify a KeyValue KeySelector
            // and document context
         DOMValidateContext valContext = new DOMValidateContext
             (new KeyValueKeySelector(), nl.item(0));
         // unmarshal the XMLSignature
         XMLSignature signature = fac.unmarshalXMLSignature(valContext);
         // Validate the XMLSignature (generated above)
         boolean coreValidity = signature.validate(valContext);
         // Check core validation status
         if (coreValidity == false) {
                 System.err.println("Signature failed core validation");
             boolean sv = signature.getSignatureValue().validate(valContext);
             System.out.println("signature validation status: " + sv);
             // check the validation status of each Reference
             Iterator i = signature.getSignedInfo().getReferences().iterator();
             for (int j=0; i.hasNext(); j++) {
              boolean refValid =
                  ((Reference) i.next()).validate(valContext);
              System.out.println("ref["+j+"] validity status: " + refValid);
         } else {
                 System.out.println("Signature passed core validation");
         * KeySelector which retrieves the public key out of the
         * KeyValue element and returns it.
         * NOTE: If the key algorithm doesn't match signature algorithm,
         * then the public key will be ignored.
        private static class KeyValueKeySelector extends KeySelector {
         public KeySelectorResult select(KeyInfo keyInfo,
                                            KeySelector.Purpose purpose,
                                            AlgorithmMethod method,
                                            XMLCryptoContext context)
                throws KeySelectorException {
                if (keyInfo == null) {
              throw new KeySelectorException("Null KeyInfo object!");
                SignatureMethod sm = (SignatureMethod) method;
                List list = keyInfo.getContent();
                for (int i = 0; i < list.size(); i++) {
              XMLStructure xmlStructure = (XMLStructure) list.get(i);
                     if (xmlStructure instanceof KeyValue) {
                        PublicKey pk = null;
                        try {
                            pk = ((KeyValue)xmlStructure).getPublicKey();
                        } catch (KeyException ke) {
                            throw new KeySelectorException(ke);
                        // make sure algorithm is compatible with method
                        if (algEquals(sm.getAlgorithm(), pk.getAlgorithm())) {
                            return new SimpleKeySelectorResult(pk);
                throw new KeySelectorException("No KeyValue element found!");
            //@@@FIXME: this should also work for key types other than DSA/RSA
         static boolean algEquals(String algURI, String algName) {
                if (algName.equalsIgnoreCase("DSA") &&
              algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) {
              return true;
                } else if (algName.equalsIgnoreCase("RSA") &&
                           algURI.equalsIgnoreCase(SignatureMethod.RSA_SHA1)) {
              return true;
                } else {
              return false;
        private static class SimpleKeySelectorResult implements KeySelectorResult {
         private PublicKey pk;
         SimpleKeySelectorResult(PublicKey pk) {
             this.pk = pk;
         public Key getKey() { return pk; }
    }PurchaseOrder.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <PurchaseOrder>
    <Item number="130046593231">
      <Description>Video Game</Description>
      <Price>10.29</Price>
    </Item>
    <Buyer id="8492340">
      <Name>My Name</Name>
      <Address>
       <Street>One Network Drive</Street>
       <Town>Burlington</Town>
       <State>MA</State>
       <Country>United States</Country>
       <PostalCode>01803</PostalCode>
      </Address>
    </Buyer>
    </PurchaseOrder>signedPurchaseOrder.xml with XAdES namespace:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?><PurchaseOrder>
    <Item number="130046593231">
      <Description>Video Game</Description>
      <Price>10.29</Price>
    </Item>
    <Buyer id="8492340">
      <Name>My Name</Name>
      <Address>
       <Street>One Network Drive</Street>
       <Town>Burlington</Town>
       <State>MA</State>
       <Country>United States</Country>
       <PostalCode>01803</PostalCode>
      </Address>
    </Buyer>
    <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Sig1"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>tVicGh6V+8cHbVYFIU91o5+L3OQ=</ds:DigestValue></ds:Reference><ds:Reference Type="http://uri.etsi.org/01903/v1.3.2#SignedProperties" URI="#SignP"><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>MAQ/vctdkyVHVzoQWnOnQdeBw8g=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>lSgzfZCRIlgrgr6YpNOdB3XWdF9P9TEiXfkNoqUpAru/I7IiyiFWJg==</ds:SignatureValue><ds:KeyInfo><ds:KeyValue><ds:DSAKeyValue><ds:P>/KaCzo4Syrom78z3EQ5SbbB4sF7ey80etKII864WF64B81uRpH5t9jQTxeEu0ImbzRMqzVDZkVG9
    xD7nN1kuFw==</ds:P><ds:Q>li7dzDacuo67Jg7mtqEm2TRuOMU=</ds:Q><ds:G>Z4Rxsnqc9E7pGknFFH2xqaryRPBaQ01khpMdLRQnG541Awtx/XPaF5Bpsy4pNWMOHCBiNU0Nogps
    QW5QvnlMpA==</ds:G><ds:Y>p48gU203NGPcs9UxEQQQzQ19KBtDRGfEs3BDt0cbCRJHMh3EoySpeqOnuTeKLXuFr96nzAPq4BEU
    dNAc7XpDvQ==</ds:Y></ds:DSAKeyValue></ds:KeyValue></ds:KeyInfo><ds:Object Id="QualifyingInfos"><QualifyingProperties Target="Sig1" xmlns="http://uri.etsi.org/01903/v1.3.2#"><SignedProperties Id="SignP"/><UnsignedProperties/></QualifyingProperties></ds:Object></ds:Signature></PurchaseOrder>

    I believe the problem is that you are not explicitly adding the xades namespace
    attribute to the SignedProperties element before generating the signature. Thus,
    the namespace attribute is not visible when canonicalizing, but when you serialize the
    DOM tree to an output stream, (for reasons I'm not entirely sure why), the namespace
    attribute is visible and is added to the SignedProperties element, which breaks the
    signature.
    You must always explicitly add namespace attributes using the Element.setAttributeNS
    method. Try changing the following code from:
    Element SPElement = createElement(doc, "SignedProperties", null,xadesNS);
    to:
    Element SPElement = createElement(doc, "SignedProperties", null,xadesNS);
    SPElement.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", xadesNS);

  • Java XML Digital Signature API, how to sign different files

    Hello,
    I need to sign several files: binary and/or xml (in some cases just part of xml), and to implement digitla signatures in xAdes standard. So I'm looking to use Java XML Digital signature API, but can't find any examples, that would cover issues I encountered:
    How to sign binary file?
    Just to sign some simple "aaa.png" file and have it's signature in XML. How in right way to create referece?
    (should it be something like: Reference ref = fac.newReference("aaa.png", fac.newDigestMethod(DigestMethod.SHA1, null), null, null, null); )
    And how to pass file for signing? what to add/change to this code:
    Document doc = dbf.newDocumentBuilder().parse(new FileInputStream("aaa.png"));
    DOMSignContext dsc = new DOMSignContext(keyEntry.getPrivateKey(), doc.getDocumentElement());
    (I have only found some information about needing to "dereference" or so - but no examples, how to make things work.)
    How to sing several different files?
    As I wrote before, several files needs to be signed, but in all examples, it's only one Document object (and only one file), how/where to add more files and if API will be capable to deal with such thing?
    In one of examples what I have to achive was such code:
    <Reference URI="aaa.png" xmlns="http://www.w3.org/2000/09/xmldsig#">
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
    <DigestValue>8rl/xzjAnE4yQQ2LTBvFTU2JH+c=</DigestValue>
    </Reference>
    If I do write code like: "fac.newReference("aaa.png", <...> );
    I'll get an error during signing: signature.sign(dsc);
    *"java.net.MalformedURLException: no protocol: aaa.png"*
    How to avoid this?
    Also, from exmaple (what to reach) above:
    <Reference URI="aaa.png" xmlns="http://www.w3.org/2000/09/xmldsig#">
    There is additional attribute "xmlns=<...>" - the question is if it is possible to add it by XMLSignatureFactory.newReference ?
    Java API adds a lot of prefixes "ds:" , like:
    <...>
    <ds:Reference URI="file:/D:/try5/SignableMetadata0.xml">
    <ds:Transforms>
    <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
    </ds:Transforms>
    <...>
    Is it possible to avoid them?
    Any help on any of these questions would be very appreciated

    Hi,
    I would like to sign a specific part of a xml message [Only the contents under the <Buyer> tag]. I have also pasted the code which i used to do this. I am getting an output xml after the xml is signed, but when I validate the xml , the xml is valid even after I change the xml contents. Could you pls tell me what I am doing wrong here. I want to know whether the xpath implementation which I have done is correct.
    <?xml version="1.0" encoding="UTF-8"?>
    <PurchaseOrder>
    <Item number="130046593231">
    <Description>Video Game</Description>
    <Price>10.29</Price>
    </Item>
    *<Buyer id="8492340">*
    *<Name>My Name</Name>*
    *<Address>*
    *<Street>One Network Drive</Street>*
    *<Town>Burlington</Town>*
    *<State>MA</State>*
    *<Country>United States</Country>*
    *<PostalCode>01803</PostalCode>*
    *</Address>*
    *</Buyer>*</PurchaseOrder>
    // The code which i have used to perform the xpath transformation.
              XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
         XPathFilterParameterSpec xpathFilter = new XPathFilterParameterSpec("PurchaseOrder/Buyer");
              javax.xml.crypto.dsig.Reference ref = fac.newReference
              ("", fac.newDigestMethod(DigestMethod.SHA1, null),
              Collections.singletonList
              (fac.newTransform
              (Transform.XPATH, xpathFilter)),
              null, null);
              SignedInfo si = fac.newSignedInfo
              (fac.newCanonicalizationMethod
              (CanonicalizationMethod.INCLUSIVE,
              (C14NMethodParameterSpec) null),
              fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null),
    Collections.singletonList(ref));
    // Load the KeyStore and get the signing key and certificate.
         KeyStore ks = KeyStore.getInstance("JKS");
         char[] password = "changeme".toCharArray();
         ks.load(new FileInputStream("c:\\KeyStore"), password);
         KeyStore.PrivateKeyEntry keyEntry =
         (KeyStore.PrivateKeyEntry) ks.getEntry
         ("EISKeys", new KeyStore.PasswordProtection(password));
         X509Certificate cert = (X509Certificate) keyEntry.getCertificate();
         // System.out.println("X509Certificate:"+cert);
         // Create the KeyInfo containing the X509Data.
         KeyInfoFactory kif = fac.getKeyInfoFactory();
         List x509Content = new ArrayList();
         x509Content.add(cert.getSubjectX500Principal().getName());
         x509Content.add(cert);
         X509Data xd = kif.newX509Data(x509Content);
         KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));
         // Instantiate the document to be signed.
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         Document doc = dbf.newDocumentBuilder().parse
         (new FileInputStream("C:\\Life2012\\DigSign\\ACORD_Request.xml"));
         NodeList rootChildList = doc.getDocumentElement().getChildNodes();
         Node bodyNode = null;
         for(int i=0;i<rootChildList.getLength();i++){
              if("Buyer".equalsIgnoreCase(rootChildList.item(i).getLocalName())){
                   bodyNode = rootChildList.item(i);
                   System.out.println("Body Node is obtained"+bodyNode);
                   break;
         // Create a DOMSignContext and specify the RSA PrivateKey and
         // location of the resulting XMLSignature's parent element.
         //DOMSignContext dsc = new DOMSignContext
         // (keyEntry.getPrivateKey(), doc.getDocumentElement());
              // Sign only the body node
         DOMSignContext dsc = new DOMSignContext
         (keyEntry.getPrivateKey(), bodyNode);
         // Create the XMLSignature, but don't sign it yet.
         XMLSignature signature = fac.newXMLSignature(si, ki);
         // Marshal, generate, and sign the enveloped signature.
         signature.sign(dsc);

  • How to trigger xml publisher API (ex:Delivering Documents via e-Mail)?

    Dear All:
    How to use xml publisher API ?
    In user's guide always talk API's code.(ex:Delivering Documents via e-Mail
    // create delivery manager instance
    DeliveryManager dm = new DeliveryManager();
    // create a delivery request
    DeliveryRequest req =
    dm.createRequest(DeliveryManager.TYPE_SMTP_EMAIL);
    // set email subject
    req.addProperty(DeliveryPropertyDefinitions.SMTP_SUBJECT, "Invoice");
    // set SMTP server host
    req.addProperty(
    DeliveryPropertyDefinitions.SMTP_HOST, "mysmtphost");
    // set the sender email address
    req.addProperty(DeliveryPropertyDefinitions.SMTP_FROM,
    "[email protected]");
    // set the destination email address
    req.addProperty(
    DeliveryPropertyDefinitions.SMTP_TO_RECIPIENTS,
    "[email protected], [email protected]" );
    // set the content type of the email body
    req.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_TYPE,
    "text/html");
    // set the document file name appeared in the email
    req.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_FILENAME,
    "body.html");
    // set the document to deliver
    req.setDocument("/document/invoice.html");
    // submit the request
    req.submit();
    // close the request
    req.close(); )
    Not say how to use this code to account effect !!
    Having anybody to use API before?
    Please tell me how to use that,thanks!!
    BY Emily_ye

    Hi Emily
    I had the same question. After much research and a lot of deduction I produced the following:
    import oracle.apps.fnd.cp.request.*;
    import java.io.*;
    import java.sql.*;
    import java.util.Vector;
    import oracle.apps.fnd.util.*;
    import oracle.apps.xdo.XDOException;
    import oracle.apps.xdo.common.pdf.util.PDFDocMerger;
    import oracle.apps.xdo.delivery.DeliveryException;
    import oracle.apps.xdo.delivery.DeliveryManager;
    import oracle.apps.xdo.delivery.DeliveryPropertyDefinitions;
    import oracle.apps.xdo.delivery.DeliveryRequest;
    import oracle.jdbc.driver.OracleCallableStatement;
    public class RunTravProgram implements JavaConcurrentProgram {
    CpContext mCtx; // global reference to concurrent program context
    LogFile logFile; // global reference to context logfile
    OutFile outFile; // global reference to context outfile
    Connection mConn = null;
    ReqCompletion lRC;
    //File Separator
    private String mFileSeparator;
    // globals for template
    String XDOAppShortName = "";
    String XDOtemplateCode = "";
    // hard-wired constants for template addition
    final String XDOLanguage = "en";
    final String XDOTerritory = "US";
    final String XDOFinal_format = "PDF";
    final String XDOtemplateType = "TEMPLATE_SOURCE";
    String PDFFile = "";
    String outFilePath = "";
    String progShortName = "";
    String progDesc = "";
    Integer iRequestID = 0;
    String sWatermark = ""; // watermark text
    String emailAddress = ""; // Not Implemented
    String emailServer = "";
    public static final String M_SUCCESS = "SUCCESS";
    public static final String M_ERROR = "ERROR";
    public static final String M_WARNING = "WARNING";
    * Create a Java FND ConcurrentRequest objec to call fnd_request.submit_request
    * The first three parameters are:
    * Application Short Name -- Application Short name (ie. WAHC)
    * Current Program Short Name -- Concurrent Program being called
    * Current Program Description -- description for above
    * These should be the first three parameters passed by the concurrent
    * program in this order. The next two are constants set to null
    * These are followed by the parameters passed by the first concurrent
    * program that are being passed to the next concurrent program.
    * I am limiting the parameter list to ten for now.
    // Dynamic PLSQL statement used to get a concurrent request completion status
    // This is necessary because the java class does not provide this method :-(
    String mGetCompleteStatus =
    "DECLARE R_VAL BOOLEAN; " + "b_phase VARCHAR2 (80) := NULL; " +
    "b_status VARCHAR2 (80) := NULL; " +
    "b_dev_phase VARCHAR2 (80) := NULL; " +
    "b_dev_status VARCHAR2 (80) := NULL; " +
    "b_message VARCHAR2 (240) := NULL; " + "BEGIN " +
    "r_val := fnd_concurrent.wait_for_request (:1,5,1000," +
    "b_phase,b_status,b_dev_phase,b_dev_status,b_message); " +
    ":2 := b_phase; " + ":3 := b_status; " + ":4 := b_message; " + "end;";
    public RunTravProgram() {
    // no constructor necessary for now
    * Concurrent Processing provides an interface 'JavaConcurrentProgram' with abstract method
    * runProgram() which passes the concurrent processing context 'CpContext'. The concurrent
    * program developer will implement all of their business logic for a concurrent program in
    * runProgram(). The main() method, implemented by AOL, will call runProgram() after
    * performing all of the required initialization for the concurrent program, including
    * establishing a database connection, initializing the required contexts, and setting up
    * the log and output files. CpContext will have the request specific log and output
    * file input methods
    public void runProgram(CpContext pCpContext) {
    mCtx = pCpContext;
    OracleCallableStatement lStmt = null;
    boolean bCompletion = true;
    String sPhase = "";
    String sStatus = "";
    String sMessage = "";
    //get handle on request completion object for reporting status
    lRC = pCpContext.getReqCompletion();
    // assign logfile
    logFile = pCpContext.getLogFile();
    // assign outfile
    outFile = pCpContext.getOutFile();
    // assign fileseparator
    mFileSeparator = getFileSeparator();
    // get the JDBC connection object
    mConn = pCpContext.getJDBCConnection();
    outFilePath =
    ((new File(outFile.getFileName())).getParent() == null ? "" :
    (new File(outFile.getFileName())).getParent() +
    mFileSeparator);
    logFile.writeln("OutFile File Path: -> " + outFilePath, 0);
    // get parameter list object from CpContext
    // these come from the concurrent program
    ParameterList lPara = pCpContext.getParameterList();
    // create a temporary array and retrieve the parameters created by
    // the program. Currently limiting the number of parameters to 10 for now
    String pvals[] = new String[10];
    int pcount = 0;
    while (lPara.hasMoreElements()) {
    NameValueType aNVT = lPara.nextParameter();
    pvals[pcount] = aNVT.getValue();
    pcount++;
    if (pcount > 9)
    break;
    // send parameter values to the log file
    logFile.writeln("Arg 1: APPL_SHORT_NAME -> " + pvals[0], 0);
    logFile.writeln("Arg 2: CURR_PROG_SHORT_NAME -> " + pvals[1], 0);
    logFile.writeln("Arg 3: CURR_PROG_DESCRIPTION -> " + pvals[2], 0);
    logFile.writeln("Arg 4: TEMPLATE_CODE -> " + pvals[3], 0);
    logFile.writeln("Arg 5: P_PLANT_CODE -> " + pvals[4], 0);
    logFile.writeln("Arg 6: P_BATCH_NO -> " + pvals[5], 0);
    logFile.writeln("Arg 7: P_SHOW_PROMISE -> " + pvals[6], 0);
    logFile.writeln("Arg 8: P_WATERMARK -> " + pvals[7], 0);
    XDOtemplateCode = pvals[3]; // store the template name globally
    progShortName = pvals[1]; // store the program short name globally
    XDOAppShortName = pvals[0]; // store the application short name
    sWatermark = pvals[7]; // store the watermark globally
    progDesc = pvals[2];
    try {
    // create a concurrent request object
    ConcurrentRequest cr = new ConcurrentRequest(mConn);
    // use the parameters to call fnd_request.submit_request
    cr.addLayout(XDOAppShortName, XDOtemplateCode, XDOLanguage,
    XDOTerritory, XDOFinal_format);
    Vector param = new Vector();
    param.add(pvals[4]); // plant code
    param.add(pvals[5]); // batch ID
    param.add(pvals[6]); // Show SO info flag
    iRequestID =
    cr.submitRequest(XDOAppShortName, progShortName, progDesc,
    null, false, param);
    mConn.commit();
    // send the request ID to the log file
    logFile.writeln("-- Request ID: ->" + Integer.toString(iRequestID),
    0);
    // call fnd_concurrent.wait_for_request to wait until the request
    // has ended - use this to check the request status before proceeding
    lStmt =
    (OracleCallableStatement)mConn.prepareCall(mGetCompleteStatus);
    lStmt.setInt(1, iRequestID);
    lStmt.registerOutParameter(2, java.sql.Types.VARCHAR, 0, 255);
    lStmt.registerOutParameter(3, java.sql.Types.VARCHAR, 0, 255);
    lStmt.registerOutParameter(4, java.sql.Types.VARCHAR, 0, 255);
    lStmt.execute();
    // get the results of the completion
    sPhase = lStmt.getString(2);
    sStatus = lStmt.getString(3);
    sMessage = lStmt.getString(4);
    lStmt.close();
    // send the results of the request processing to the log file
    logFile.writeln("-- Phase: -> " + sPhase, 0);
    logFile.writeln("-- Status: -> " + sStatus, 0);
    logFile.writeln("-- Message: -> " + sMessage, 0);
    // test here to make sure it completed correctly
    if (sPhase.equals("Completed") && sStatus.equals("Normal")) {
    // construct the PDF file name generated by the called request
    PDFFile = progShortName + "_" + iRequestID + "_1.pdf";
    // add a watermark to the generated PDF
    // create an output stream for the existing PDF
    // and set ouput to append
    OutputStream pdfout =
    new FileOutputStream(outFilePath + PDFFile, true);
    // create an inputstream array (required by calling method)
    InputStream pdfin[] = new InputStream[1];
    pdfin[0] = new FileInputStream(outFilePath + PDFFile);
    // add the watermark passed as a parameter
    bCompletion = addWatermark(pdfin, pdfout);
    // assign the modified file to the context out
    // this will print using this request
    if (bCompletion)
    outFile.setOutFile(outFilePath + PDFFile);
    // release the connection object
    // and set the completion status for the request
    if (bCompletion) {
    pCpContext.getReqCompletion().setCompletion(ReqCompletion.NORMAL,
    } else {
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } catch (SQLException s) {
    logFile.writeln("SQL Error: Exception thrown w/ error message: " +
    s.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } catch (IOException ioe) {
    logFile.writeln("IO Error: Exception thrown w/ error message: " +
    ioe.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } catch (Exception e) {
    logFile.writeln("General Exception: " + e.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    pCpContext.releaseJDBCConnection();
    } finally {
    try {
    if (lStmt != null)
    lStmt.close();
    pCpContext.releaseJDBCConnection();
    } catch (SQLException e) {
    logFile.writeln(e.getMessage(), 0);
    lRC.setCompletion(ReqCompletion.WARNING, M_WARNING);
    * addWatermark()
    * @param pdfin
    * @param pdfout
    * @return boolean
    * This method will work for an existing document or a newly generated
    * one. Set the outputstream append flag to false for a new document
    * and true for an existing one.
    * NOTE: PDFDocMerger requires an inputstream array even if it only
    * contains one document.
    private boolean addWatermark(InputStream[] pdfin, OutputStream pdfout) {
    if (!sWatermark.equals("")) {
    try {
    PDFDocMerger docMerger = new PDFDocMerger(pdfin, pdfout);
    //docMerger.setTextDefaultWatermark(sWatermark);
    docMerger.setTextWatermark(sWatermark, 80f, 50f);
    docMerger.setTextWatermarkAngle(25);
    docMerger.setTextWatermarkColor(1.0f, .50f, .50f);
    docMerger.setTextWatermarkFont("Garamond", 100);
    docMerger.process();
    docMerger = null;
    return true;
    } catch (XDOException e) {
    logFile.writeln("Watermark process Failed: " + e.getMessage(),
    0);
    return false;
    return true;
    * Returns the file separator
    private String getFileSeparator() {
    return (System.getProperty("file.separator"));
    * EBSEmailDelivery
    * @return
    * Just for testing right now.
    private boolean EBSEmailDelivery() {
    if (!emailAddress.equals("")) {
    try {
    // create delivery manager instance
    DeliveryManager delMgr = new DeliveryManager();
    // create a delivery request
    DeliveryRequest delReq =
    delMgr.createRequest(DeliveryManager.TYPE_SMTP_EMAIL);
    // set email subject
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_SUBJECT,
    "EBS Report:" + progDesc +
    " for request: " + iRequestID);
    // set SMTP server host
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_HOST,
    emailServer); // need to supply the email smtp server
    // set the sender email address
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_FROM,
    emailAddress);
    // set the destination email address
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_TO_RECIPIENTS,
    emailAddress);
    // set the content type of the email body
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_TYPE,
    "application/pdf");
    // set the document file name appeared in the email
    delReq.addProperty(DeliveryPropertyDefinitions.SMTP_CONTENT_FILENAME,
    PDFFile);
    // set the document to deliver
    delReq.setDocument(outFilePath + PDFFile);
    // submit the request
    delReq.submit();
    // close the request
    delReq.close();
    return true;
    } catch (DeliveryException de) {
    logFile.writeln("email process Failed: " + de.getMessage(), 0);
    return false;
    return true;
    This is the class for a JCP I created to perform the following:
    1) Launch an existing Concurrent Program that produces PDF output
    2) Grab the PDF and apply a watermark based on user input or conditions
    3) associate the modified PDF to CP output for PASTA printing
    It isn't elegant but it is fairly simple. I added the email capability and tested it but am not implementing it at the present time.
    there is a fair amount of information out there that explains how to create a JCP councurrent program but very little that demonstrates the class needed.
    I hope this helps

  • "package java.xml.registry does not exist" error in NetBeans

    Hi all
    I'm using netbeans for developing webservices and and have to use JAXR. I have downloaded and installed jwsdp1.5.
    When I view the source code for the JAXR sample java files that accompany the java EE tutorial in the NetBeans IDE Source Editor, I get the error : package java.xml.registry does not exist.
    However, the release note for NetBeans says that it supports JAXR.
    Also, when I compile and run the same files using DOS and the ant command, the files work.
    Can someone please tell me what to do and how to work on JAXR clients in NetBeans because the Help files don't have any documentation on it nor does the NeBeans Field Guide?

    Do you have the jaxrpc-api.jar and jaxprc-ri.jar in your classpath?
    They are in <wspack1.1 installation>/jaxrpc-1.0.2/lib
    Regards,
    Bhakti

  • Query on XML Beans replacing Castor Java -XML Bindings

    Hello,
    We use Castor XML Framework for today Java - XML bindings and were looking for XML Beans replacement.
    One of the key problems we face in using XML (maybe a flawed design) is we create XSD for our applications and run Castor to generate Java Classes as Libraries (XMLFramework.jar).
    Applications are compiled with these Java libraries and Castor is used to Marshal the Java Object as XML Document when invoking a remote API and at the receiving side it is used to unmarshal back the XML document to Java Object.
    Major issues we have seen is that if any XSD (that defines application ICD) changes, we need to re-generate Castor Java classes (new XMLFramework.jar) and re-compile applications that were using these classes with new JAR files..... Thus for small XSD changes the impact is in lot of applications (where an application is an EAR deployed on WLS)
    Does XMLBeans help here that I can change XSD without changing all the end-points that use Classes generated out of these XSDs (when additing mandatory or optinal elements) ?
    Or there is a flaw in which we have used the Java-XML binding framework like Castor and XMLBeans do not help much ?

    Can someone please suggest on how I can go about
    converting an XML file into word format using Java
    ?How about POI?

  • TYLAR Java/XML binding technology

    In WL10, when using the default TYLAR Java/XML data bindings for our web service implementation, is there a way to get the XML that was used to produce an instance of the TYLAR-generated object? I would assume WebLogic exposes an API that I could use to accomplish this. Thanks.

    AFAIK, Tylar binding is for internal used (implement JAX-RPC 1.1 specification). If you want to handle Xml Databinding, you should try XmlBeans or JAXB in JAXWS.
    -LJ

  • Java invoke Ant API usage collection (Chinese)

    Ant��Java��������������������������������������������java��������������������������������������������������������������������ant������������API������������������������������������������������������������������������
    Ant����������������������������������������Ant��������build.xml��������������������������������������������Ant��������API����������Ant��API����������
    ��������Ant ��������������������������Java ���� Ant API������������������������������������Ant��������������������������������������������������������������������Java����Ant API������������������������������������������������������������Ant 1.7.0����������������������������Ant��API����������������������������������������������������������������Ant��API����������������
    1�� ����������
    1�� ��������
    Project prj=new Project();
    Mkdir mkdir=new Mkdir();
    mkdir.setProject(prj);
    mkdir.setDir(new File("d:\\temp\\dir1"));
    mkdir.execute();
    2�� ��������
    Project prj=new Project();
    Delete delete=new Delete();
    delete.setProject(prj);
    delete.setDir(new File("d:\\temp\\dir1")); //����������������������������
    delete.execute();
    ������������Ant Task����Mkdir��Delete��Copy��Move��Zip������������������Project��������������Ant Task��������Project��������������Ant Task������Project������
    2. ��������������������
    1������copy
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����copy��dir1��
    2��copy�������������������������� ���� xml���� @eosapp_name@ ��������������������
    Project prj=new Project();
    Copy copy = new Copy();
    copy.setEncoding("UTF-8");
    copy.setProject(prj);
    copy.setTodir("d:\\temp");
    FileSet fileSet=new FileSet();
    fileSet.setDir(new File(eosHome+"/base/template.app"));
    fileSet.setIncludes("**/*.xml");
    copy.addFileset(fileSet);
    FilterSet filter=copy.createFilterSet();
    filter.addFilter("eosapp_name","app1");
    copy.execute();
    2����������������Move��������Copy��������������Move������Copy��������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����������dir1��
    3������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\f2.txt"));
    copy.execute(); //��f1.txt����������f2.txt��
    4������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\dir1");
    copy.setTodir(new File("d:\\temp\\dir2"));
    copy.execute(); //��dir1����������dir2,��������dir1��������������������dir2������
    3������������ FileSet��������������������������������������������������copy��move��������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setTodir(new File("d:\\temp\\todir"));
    FileSet fs=new FileSet();
    fs.setProject(prj);
    fs.setDir(new File("d:\\javaprj\\src"));
    fs.setIncludes("**/*.*"); //������������
    fs.setExcludes("**/CVS,**/*.class"); //����CVS��������������.class����
    copy.addFileset(fs);
    copy.execute();
    ���� FileSet��setIncludes, ��setExcludes��������pattern, pattern���������������������������������������������� ��**������������������������*.*���������������� ��*.java������������������java��������
    4��������������������
    DirectoryScanner ds=new DirectoryScanner();
    ds.setBasedir(new File("d:\\temp\\war"));
    ds.setIncludes(new String[] {"**/*.jsp"});
    ds.scan();
    if(ds.getIncludedFilesCount()>0) {
    System.out.println("found jsp!");
    String[] includeFiles=ds.getIncludedFiles();
    for(String file:includeFiles){
    System.out.println(file);
    5����������������//������zip����
    Project prj=new Project();
    Zip zip=new Zip();
    zip.setProject(prj);
    zip.setDestFile(new File("d:\\temp\\src.zip"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\src"));
    fileSet.setIncludes("**/*.java");
    zip.addFileset(fileSet);
    zip.execute();
    //��class��������jar��
    Project prj=new Project();
    Jar jar=new Jar();
    jar.setProject(prj);
    jar.setDestFile(new File("d:\\temp\\prj1.jar"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\bin"));
    fileSet.setIncludes("**/*.class,**/*.properties");
    jar.addFileset(fileSet);
    jar.execute();
    6����������1����������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    expand.execute();
    2��������������������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    PatternSet patternset = new PatternSet();
    patternset.setIncludes("**/*.java");
    patternset.setProject(prj);
    expand.addPatternset(patternset);
    expand.execute();
    3������Mapper��������: ���� .../lib/*.jar ������ .../WEB-INF/lib����������������������
    Expand expand = new Expand();
    expand.setProject(prj);
    expand.setSrc(new File(zipFilePath));
    expand.setDest(new File(webDir+"/WEB-INF/lib"));
    PatternSet pattern = new PatternSet();
    pattern.setIncludes("lib/*.jar");
    expand.addPatternset(pattern);
    FileNameMapper mapper=new FlatFileNameMapper();
    expand.add(mapper);
    /* another way using mapper
    Mapper mapper=expand.createMapper();
    MapperType type=new MapperType();
    type.setValue("flatten");
    mapper.setType(type);
    expand.execute();
    7������zip����1�� ����zip������������������
    ZipFile zipfile = new ZipFile(new File(filepath));
    for (Enumeration entries = zipfile.getEntries(); entries.hasMoreElements();) {
    ZipEntry entry = (ZipEntry) entries.nextElement();
    if(entry.isDirectory())
    System.out.println("Directory: "+entry.getName());
    else
    System.out.println("file: "+entry.getName());
    zipfile.close(); //ZipFile��������close����������������
    2��zip��������,��Zip��������������������, ������glob
    ZipScanner scan=new ZipScanner();
    scan.setSrc(new File("d:\\temp\\test.zip"));
    scan.setIncludes(new String[] {"*","*/*"}); //��������������������������
    scan.scan();
    String dirs[]=scan.getIncludedDirectories();
    scan.setIncludes(new String[]{"**/*.xml"}); //��������
    scan.scan();
    String files[]=scan.getIncludedFiles();

    Ant��Java��������������������������������������������java��������������������������������������������������������������������ant������������API������������������������������������������������������������������������
    Ant����������������������������������������Ant��������build.xml��������������������������������������������Ant��������API����������Ant��API����������
    ��������Ant ��������������������������Java ���� Ant API������������������������������������Ant��������������������������������������������������������������������Java����Ant API������������������������������������������������������������Ant 1.7.0����������������������������Ant��API����������������������������������������������������������������Ant��API����������������
    1�� ����������
    1�� ��������
    Project prj=new Project();
    Mkdir mkdir=new Mkdir();
    mkdir.setProject(prj);
    mkdir.setDir(new File("d:\\temp\\dir1"));
    mkdir.execute();
    2�� ��������
    Project prj=new Project();
    Delete delete=new Delete();
    delete.setProject(prj);
    delete.setDir(new File("d:\\temp\\dir1")); //����������������������������
    delete.execute();
    ������������Ant Task����Mkdir��Delete��Copy��Move��Zip������������������Project��������������Ant Task��������Project��������������Ant Task������Project������
    2. ��������������������
    1������copy
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����copy��dir1��
    2��copy�������������������������� ���� xml���� @eosapp_name@ ��������������������
    Project prj=new Project();
    Copy copy = new Copy();
    copy.setEncoding("UTF-8");
    copy.setProject(prj);
    copy.setTodir("d:\\temp");
    FileSet fileSet=new FileSet();
    fileSet.setDir(new File(eosHome+"/base/template.app"));
    fileSet.setIncludes("**/*.xml");
    copy.addFileset(fileSet);
    FilterSet filter=copy.createFilterSet();
    filter.addFilter("eosapp_name","app1");
    copy.execute();
    2����������������Move��������Copy��������������Move������Copy��������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����������dir1��
    3������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\f2.txt"));
    copy.execute(); //��f1.txt����������f2.txt��
    4������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\dir1");
    copy.setTodir(new File("d:\\temp\\dir2"));
    copy.execute(); //��dir1����������dir2,��������dir1��������������������dir2������
    3������������ FileSet��������������������������������������������������copy��move��������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setTodir(new File("d:\\temp\\todir"));
    FileSet fs=new FileSet();
    fs.setProject(prj);
    fs.setDir(new File("d:\\javaprj\\src"));
    fs.setIncludes("**/*.*"); //������������
    fs.setExcludes("**/CVS,**/*.class"); //����CVS��������������.class����
    copy.addFileset(fs);
    copy.execute();
    ���� FileSet��setIncludes, ��setExcludes��������pattern, pattern���������������������������������������������� ��**������������������������*.*���������������� ��*.java������������������java��������
    4��������������������
    DirectoryScanner ds=new DirectoryScanner();
    ds.setBasedir(new File("d:\\temp\\war"));
    ds.setIncludes(new String[] {"**/*.jsp"});
    ds.scan();
    if(ds.getIncludedFilesCount()>0) {
    System.out.println("found jsp!");
    String[] includeFiles=ds.getIncludedFiles();
    for(String file:includeFiles){
    System.out.println(file);
    5����������������//������zip����
    Project prj=new Project();
    Zip zip=new Zip();
    zip.setProject(prj);
    zip.setDestFile(new File("d:\\temp\\src.zip"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\src"));
    fileSet.setIncludes("**/*.java");
    zip.addFileset(fileSet);
    zip.execute();
    //��class��������jar��
    Project prj=new Project();
    Jar jar=new Jar();
    jar.setProject(prj);
    jar.setDestFile(new File("d:\\temp\\prj1.jar"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\bin"));
    fileSet.setIncludes("**/*.class,**/*.properties");
    jar.addFileset(fileSet);
    jar.execute();
    6����������1����������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    expand.execute();
    2��������������������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    PatternSet patternset = new PatternSet();
    patternset.setIncludes("**/*.java");
    patternset.setProject(prj);
    expand.addPatternset(patternset);
    expand.execute();
    3������Mapper��������: ���� .../lib/*.jar ������ .../WEB-INF/lib����������������������
    Expand expand = new Expand();
    expand.setProject(prj);
    expand.setSrc(new File(zipFilePath));
    expand.setDest(new File(webDir+"/WEB-INF/lib"));
    PatternSet pattern = new PatternSet();
    pattern.setIncludes("lib/*.jar");
    expand.addPatternset(pattern);
    FileNameMapper mapper=new FlatFileNameMapper();
    expand.add(mapper);
    /* another way using mapper
    Mapper mapper=expand.createMapper();
    MapperType type=new MapperType();
    type.setValue("flatten");
    mapper.setType(type);
    expand.execute();
    7������zip����1�� ����zip������������������
    ZipFile zipfile = new ZipFile(new File(filepath));
    for (Enumeration entries = zipfile.getEntries(); entries.hasMoreElements();) {
    ZipEntry entry = (ZipEntry) entries.nextElement();
    if(entry.isDirectory())
    System.out.println("Directory: "+entry.getName());
    else
    System.out.println("file: "+entry.getName());
    zipfile.close(); //ZipFile��������close����������������
    2��zip��������,��Zip��������������������, ������glob
    ZipScanner scan=new ZipScanner();
    scan.setSrc(new File("d:\\temp\\test.zip"));
    scan.setIncludes(new String[] {"*","*/*"}); //��������������������������
    scan.scan();
    String dirs[]=scan.getIncludedDirectories();
    scan.setIncludes(new String[]{"**/*.xml"}); //��������
    scan.scan();
    String files[]=scan.getIncludedFiles();

  • Java invoking Ant API usage collection (GBK)

    Java����Ant API��������
    Ant��Java��������������������������������������������java��������������������������������������������������������������������ant������������API������������������������������������������������������������������������
    Ant����������������������������������������Ant��������build.xml��������������������������������������������Ant��������API����������Ant��API����������
    ��������Ant ��������������������������Java ���� Ant API������������������������������������Ant��������������������������������������������������������������������Java����Ant API������������������������������������������������������������Ant 1.7.0����������������������������Ant��API����������������������������������������������������������������Ant��API����������������
    1�� ����������
    1�� ��������
    Project prj=new Project();
    Mkdir mkdir=new Mkdir();
    mkdir.setProject(prj);
    mkdir.setDir(new File("d:\\temp\\dir1"));
    mkdir.execute();
    2�� ��������
    Project prj=new Project();
    Delete delete=new Delete();
    delete.setProject(prj);
    delete.setDir(new File("d:\\temp\\dir1")); //����������������������������
    delete.execute();
    ������������Ant Task����Mkdir��Delete��Copy��Move��Zip������������������Project��������������Ant Task��������Project��������������Ant Task������Project������
    2. ��������������������
    1������copy
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����copy��dir1��
    2��copy�������������������������� ���� xml���� @eosapp_name@ ��������������������
    Project prj=new Project();
    Copy copy = new Copy();
    copy.setEncoding("UTF-8");
    copy.setProject(prj);
    copy.setTodir("d:\\temp");
    FileSet fileSet=new FileSet();
    fileSet.setDir(new File(eosHome+"/base/template.app"));
    fileSet.setIncludes("**/*.xml");
    copy.addFileset(fileSet);
    FilterSet filter=copy.createFilterSet();
    filter.addFilter("eosapp_name","app1");
    copy.execute();
    3����������������Move��������Copy��������������Move������Copy��������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����������dir1��
    4������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\f2.txt"));
    copy.execute(); //��f1.txt����������f2.txt��
    5������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\dir1");
    copy.setTodir(new File("d:\\temp\\dir2"));
    copy.execute(); //��dir1����������dir2,��������dir1��������������������dir2������
    3������������ FileSet��������������������������������������������������copy��move��������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setTodir(new File("d:\\temp\\todir"));
    FileSet fs=new FileSet();
    fs.setProject(prj);
    fs.setDir(new File("d:\\javaprj\\src"));
    fs.setIncludes("**/*.*"); //������������
    fs.setExcludes("**/CVS,**/*.class"); //����CVS��������������.class����
    copy.addFileset(fs);
    copy.execute();
    ���� FileSet��setIncludes, ��setExcludes��������pattern, pattern���������������������������������������������� ��**������������������������*.*���������������� ��*.java������������������java��������
    4��������������������
    DirectoryScanner ds=new DirectoryScanner();
    ds.setBasedir(new File("d:\\temp\\war"));
    ds.setIncludes(new String[] {"**/*.jsp"});
    ds.scan();
    if(ds.getIncludedFilesCount()>0) {
    System.out.println("found jsp!");
    String[] includeFiles=ds.getIncludedFiles();
    for(String file:includeFiles){
    System.out.println(file);
    5����������������//������zip����
    Project prj=new Project();
    Zip zip=new Zip();
    zip.setProject(prj);
    zip.setDestFile(new File("d:\\temp\\src.zip"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\src"));
    fileSet.setIncludes("**/*.java");
    zip.addFileset(fileSet);
    zip.execute();
    //��class��������jar��
    Project prj=new Project();
    Jar jar=new Jar();
    jar.setProject(prj);
    jar.setDestFile(new File("d:\\temp\\prj1.jar"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\bin"));
    fileSet.setIncludes("**/*.class,**/*.properties");
    jar.addFileset(fileSet);
    jar.execute();
    6����������
    1����������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    expand.execute();
    2��������������������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    PatternSet patternset = new PatternSet();
    patternset.setIncludes("**/*.java");
    patternset.setProject(prj);
    expand.addPatternset(patternset);
    expand.execute();
    3������Mapper��������: ���� .../lib/*.jar ������ .../WEB-INF/lib����������������������
    Expand expand = new Expand();
    expand.setProject(prj);
    expand.setSrc(new File(zipFilePath));
    expand.setDest(new File(webDir+"/WEB-INF/lib"));
    PatternSet pattern = new PatternSet();
    pattern.setIncludes("lib/*.jar");
    expand.addPatternset(pattern);
    FileNameMapper mapper=new FlatFileNameMapper();
    expand.add(mapper);
    /* another way using mapper
    Mapper mapper=expand.createMapper();
    MapperType type=new MapperType();
    type.setValue("flatten");
    mapper.setType(type);
    expand.execute();
    7������zip����
    1�� ����zip������������������
    ZipFile zipfile = new ZipFile(new File(filepath));
    for (Enumeration entries = zipfile.getEntries(); entries.hasMoreElements();) {
    ZipEntry entry = (ZipEntry) entries.nextElement();
    if(entry.isDirectory())
    System.out.println("Directory: "+entry.getName());
    else
    System.out.println("file: "+entry.getName());
    zipfile.close(); //ZipFile��������close����������������
    2��zip��������,��Zip��������������������
    ZipScanner scan=new ZipScanner();
    scan.setSrc(new File("d:\\temp\\test.zip"));
    scan.setIncludes(new String[] {"*","*/*"}); //��������������������������
    scan.scan();
    String dirs[]=scan.getIncludedDirectories();
    scan.setIncludes(new String[]{"**/*.xml"}); //��������
    scan.scan();
    String files[]=scan.getIncludedFiles();
    Edited by: wannachan on Jun 16, 2008 6:58 AM

    Java����Ant API��������
    Ant��Java��������������������������������������������java��������������������������������������������������������������������ant������������API������������������������������������������������������������������������
    Ant����������������������������������������Ant��������build.xml��������������������������������������������Ant��������API����������Ant��API����������
    ��������Ant ��������������������������Java ���� Ant API������������������������������������Ant��������������������������������������������������������������������Java����Ant API������������������������������������������������������������Ant 1.7.0����������������������������Ant��API����������������������������������������������������������������Ant��API����������������
    1�� ����������
    1�� ��������
    Project prj=new Project();
    Mkdir mkdir=new Mkdir();
    mkdir.setProject(prj);
    mkdir.setDir(new File("d:\\temp\\dir1"));
    mkdir.execute();
    2�� ��������
    Project prj=new Project();
    Delete delete=new Delete();
    delete.setProject(prj);
    delete.setDir(new File("d:\\temp\\dir1")); //����������������������������
    delete.execute();
    ������������Ant Task����Mkdir��Delete��Copy��Move��Zip������������������Project��������������Ant Task��������Project��������������Ant Task������Project������
    2. ��������������������
    1������copy
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����copy��dir1��
    2��copy�������������������������� ���� xml���� @eosapp_name@ ��������������������
    Project prj=new Project();
    Copy copy = new Copy();
    copy.setEncoding("UTF-8");
    copy.setProject(prj);
    copy.setTodir("d:\\temp");
    FileSet fileSet=new FileSet();
    fileSet.setDir(new File(eosHome+"/base/template.app"));
    fileSet.setIncludes("**/*.xml");
    copy.addFileset(fileSet);
    FilterSet filter=copy.createFilterSet();
    filter.addFilter("eosapp_name","app1");
    copy.execute();
    3����������������Move��������Copy��������������Move������Copy��������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\dir1"));
    copy.execute(); //��f1.txt����������dir1��
    4������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\f1.txt");
    copy.setTodir(new File("d:\\temp\\f2.txt"));
    copy.execute(); //��f1.txt����������f2.txt��
    5������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setFile(new File("d:\\temp\\dir1");
    copy.setTodir(new File("d:\\temp\\dir2"));
    copy.execute(); //��dir1����������dir2,��������dir1��������������������dir2������
    3������������ FileSet��������������������������������������������������copy��move��������������
    Project prj=new Project();
    Copy copy=new Copy();
    copy.setProject(prj);
    copy.setTodir(new File("d:\\temp\\todir"));
    FileSet fs=new FileSet();
    fs.setProject(prj);
    fs.setDir(new File("d:\\javaprj\\src"));
    fs.setIncludes("**/*.*"); //������������
    fs.setExcludes("**/CVS,**/*.class"); //����CVS��������������.class����
    copy.addFileset(fs);
    copy.execute();
    ���� FileSet��setIncludes, ��setExcludes��������pattern, pattern���������������������������������������������� ��**������������������������*.*���������������� ��*.java������������������java��������
    4��������������������
    DirectoryScanner ds=new DirectoryScanner();
    ds.setBasedir(new File("d:\\temp\\war"));
    ds.setIncludes(new String[] {"**/*.jsp"});
    ds.scan();
    if(ds.getIncludedFilesCount()>0) {
    System.out.println("found jsp!");
    String[] includeFiles=ds.getIncludedFiles();
    for(String file:includeFiles){
    System.out.println(file);
    5����������������//������zip����
    Project prj=new Project();
    Zip zip=new Zip();
    zip.setProject(prj);
    zip.setDestFile(new File("d:\\temp\\src.zip"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\src"));
    fileSet.setIncludes("**/*.java");
    zip.addFileset(fileSet);
    zip.execute();
    //��class��������jar��
    Project prj=new Project();
    Jar jar=new Jar();
    jar.setProject(prj);
    jar.setDestFile(new File("d:\\temp\\prj1.jar"));
    FileSet fileSet=new FileSet();
    fileSet.setProject(prj);
    fileSet.setDir(new File("d:\\javaprj\\prj1\\bin"));
    fileSet.setIncludes("**/*.class,**/*.properties");
    jar.addFileset(fileSet);
    jar.execute();
    6����������
    1����������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    expand.execute();
    2��������������������������������������
    Project prj=new Project();
    Expand expand=new Expand();
    expand.setProject(prj);
    expand.setSrc(new File("d:\\temp\\src.zip"));
    expand.setOverwrite(overwrite);
    expand.setDest("d:\\temp\\out\\src");
    PatternSet patternset = new PatternSet();
    patternset.setIncludes("**/*.java");
    patternset.setProject(prj);
    expand.addPatternset(patternset);
    expand.execute();
    3������Mapper��������: ���� .../lib/*.jar ������ .../WEB-INF/lib����������������������
    Expand expand = new Expand();
    expand.setProject(prj);
    expand.setSrc(new File(zipFilePath));
    expand.setDest(new File(webDir+"/WEB-INF/lib"));
    PatternSet pattern = new PatternSet();
    pattern.setIncludes("lib/*.jar");
    expand.addPatternset(pattern);
    FileNameMapper mapper=new FlatFileNameMapper();
    expand.add(mapper);
    /* another way using mapper
    Mapper mapper=expand.createMapper();
    MapperType type=new MapperType();
    type.setValue("flatten");
    mapper.setType(type);
    expand.execute();
    7������zip����
    1�� ����zip������������������
    ZipFile zipfile = new ZipFile(new File(filepath));
    for (Enumeration entries = zipfile.getEntries(); entries.hasMoreElements();) {
    ZipEntry entry = (ZipEntry) entries.nextElement();
    if(entry.isDirectory())
    System.out.println("Directory: "+entry.getName());
    else
    System.out.println("file: "+entry.getName());
    zipfile.close(); //ZipFile��������close����������������
    2��zip��������,��Zip��������������������
    ZipScanner scan=new ZipScanner();
    scan.setSrc(new File("d:\\temp\\test.zip"));
    scan.setIncludes(new String[] {"*","*/*"}); //��������������������������
    scan.scan();
    String dirs[]=scan.getIncludedDirectories();
    scan.setIncludes(new String[]{"**/*.xml"}); //��������
    scan.scan();
    String files[]=scan.getIncludedFiles();
    Edited by: wannachan on Jun 16, 2008 6:58 AM

  • Latest Java XML technology

    Hi, can anyone tell me what's the latest Java XML technology? Is there anything similar to .NET DataSet? I know SDO has a feature "changeSummary" to make the update of XML data easy. But it looks SDO is not popular now (correct me if I am wrong). Is JAXB the only popular framework for Java XML? Is it as powerful as .NET DataSet? Thanks

    Dude, this is a Java forum. Do you really expect people to know .NET stuff?
    JAXB is an API, not a framework. Its not popular, its part of the JEE spec which basically makes it a given to use it. You can use it to do XML binding stuff; nothing more, nothing less. It is used by several other APIs to do the XML binding stuff, like JAX-WS. When used properly you can quite effectively bind XML documents to an Object hierarchy and the other way around.
    A piece of advice: if you want to do Java stuff, forget .NET exists. If you can't do that, at least stop doing that "I do it like this in .NET, how I do it in Java?" way of thinking. You have a problem which needs to be solved, go find something that works.

  • Confusion on choosing the right Java XML tehcnology

    Hi there,
    I have a question about Java XML. I am still confuse on whether should I choose JAXP or JAXB for XML documents processing. I need to access a the configuration values form a properties file which stored in XML format to startup an application server, the configuration values might be using while the application server is running all the time. And probably write a tool to add/delete/modify the config values in XML file. From my point of view, I think JAXB is suitable for my needs, but I'm not sure whether the DOM tree manipulation from JAXP will be useful in my application or not. Any suggestion?
    Thanks,
    Jax

    You might want to have a look at the tutorials here:
    http://java.sun.com/webservices/docs/1.1/tutorial/doc/index.html
    When you go to the page about JAXP you will see that it says, right up front, "The Java API for XML Processing (JAXP) makes it easy to process XML data using applications written in the Java programming language." That sounds like what you want to do. And the page about JAXB says "The Java Architecture for XML Binding (JAXB) is a Java technology that enables you to generate Java classes from XML schemas." That doesn't sound like what you want to do.

  • Using Java XML 1.5 toolkit instead of sapxmltoolkit for xslt mappings

    Hi All
       We have a case whereby our xlst requires a number of customised java class functions as we are porting webmethods systems across to PI.
    eg in the xslt adding
    <xsl:when test="function-available('java:concat">
        <xsl:value-of select="java:concat($first, $last, $inputparam)"/>
    We are running sap PI 7.1 ehp1. I have been referring to a number of posts on how to complete these tasks.
    namely we have implemented the example as provided in:
        http://help.sap.com/saphelp_nwpi71/helpdata/EN/73/f61eea1741453eb8f794e150067930/frameset.htm
    This only works if "Sap XML Toolkit" is enabled in the operational mapping.
    Left unticked (default setting in the mapping) whenever a testcase is run I end up with the error "could not compile sytle sheet".
    I would like to use the Java 1.5 xml processing capability as it is supposed to perform better than the sapxmltoolkit option and support for the latter will be discontinued in future.
    Has anyone been able run the case with sapxmltoolkit enabled?
    If so did you add any other libraries for java xml 1.5?
    thanks

    Thanks, I would have thought as much, but theres no guide on the deployment.
    For now i assume this will fit into the java/ext area and Pi would need a reboot after the libraries are copied.
    Has anyone deployed the additional libraries to PI.

  • Nested while defining class: com.sun.xml.ws.api.WSBinding ???

    Why is this happening, I am trying to access servlet, 2.4 on the Webshere 6.1, installation as succesfull and the servlet is running without exceptions.
      nested while defining class: com.sun.xml.ws.api.WSBinding
    This error indicates that the class: javax.xml.ws.Binding
    could not be located while defining the class: com.sun.xml.ws.api.WSBinding
    This is often caused by having the class at a higher point in the classloader hierarchy
    Dumping the current context classloader hierarchy:
        ==> indicates defining classloader
        *** indicates classloader where the missing class could have been found
    ==>[0]
    com.ibm.ws.classloader.CompoundClassLoader@51905190
       Local ClassPath: C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\classes;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\aopalliance-1.0.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\commons-logging-1.1.1.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxb-impl-2.1.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxb-xjc-2.1.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxws-rt-2.1.4.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxws-rt-2.1.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jaxws-spring-1.8.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jboss-j2ee.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\jremote.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\log4j-1.2.9.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.aop-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.asm-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.beans-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.context-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.core-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.expression-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.jms-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.transaction-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\org.springframework.web-3.0.1.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\spring-batch-infrastructure-2.1.0.RELEASE.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\stax-ex-1.2.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\streambuffer-0.7.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\TWSCore.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war\WEB-INF\lib\xbean-spring-3.4.3.jar;C:\Program Files\IBM\WebSphere\AppServer2\profiles\AppSrv01\installedApps\UKDSK-DBURFORD1Node02Cell\myappservelett2_4_again_war.ear\myappservelett2.4_again.war
       Delegation Mode: PARENT_FIRST
       [1] com.ibm.ws.classloader.JarClassLoader@777399894 Local Classpath:  Delegation mode: PARENT_FIRSTEdited by: romanshtekelman on Sep 9, 2010 7:34 AM

    For future reference...
    We followed the following instructions and created a shared lib.
    http://download.oracle.com/docs/cd/E12524_01/web.1013/e12290/opensrc.htm#BABDDAIF
    We resolved most of our class loading issues.
    BR//Bahman

  • How to use Thread.sleep() with Java Berkeley Base API?

    Hi,
    I have explained the weird problem about the server was too busy to response to SSH but it continued to finish to run (Server not response when inserting millions of records using Java Base API
    Even I tried to increase CachSize and renice Java program, but it did not work. So, I am thinking to set sleeping time for threads in Java Berkeley Base API (using “ps” command, there were 18 light weight processes created). My program did not implement transaction or concurrency because it simply creates (millions) databases records only. Is it possible and correct to do like this in the code:
    try{
    //do create a db record
    Thread.currentThread().sleep(1000);//sleep for 1000 ms
    catch(ItrerruptedException ie){
    Thank you for your kindly suggestion.
    Nattiya

    where can I get the help doc about use AT commands in java.
    Can you give me some code example about this. It is
    difficulty to me to write it myself.You simply have to send the characters and receive the characters via the comm extension. Here is the ITU standard command set - http://ridge.trideja.com/wireless/atcommands/v250.pdf. Various modems and other devices extend this in a number of ways, you may need to find documentation specific to your device as well. But start with the standard.

  • Java XML Parser:Null Pointer exception in EntityReader

    I got NullPointer Exception when trying to parse a XML file which
    is pointed by a net URL, (say "http://www..."). The code causing
    problem is like:
    parser.parse(new URL("http://www.../demo.xml"));
    the exception I got is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at oracle.xml.parser.EntityReader.initXMLInput(Compiled
    Code)
    at
    oracle.xml.parser.EntityReader.<init>(EntityReader.java:64)
    at oracle.xml.parser.XMLParser.parse(XMLParser.java:245)
    at DemoXML.main(DemoXML.java:47)
    The very same code works fine with a simple local file URL and we
    also know that the URL exists in correct in XML format because we
    can open the URL with IE5.
    Another question - where can we get the source for the Java XML
    Parser.
    null

    This bug has already been reported and will be fixed in our next
    release.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Fiona Lu (guest) wrote:
    : I got NullPointer Exception when trying to parse a XML file
    which
    : is pointed by a net URL, (say "http://www..."). The code
    causing
    : problem is like:
    : parser.parse(new URL("http://www.../demo.xml"));
    : the exception I got is:
    : java.lang.NullPointerException
    : java.lang.NullPointerException
    : at oracle.xml.parser.EntityReader.initXMLInput
    (Compiled
    : Code)
    : at
    : oracle.xml.parser.EntityReader.<init>(EntityReader.java:64)
    : at oracle.xml.parser.XMLParser.parse
    (XMLParser.java:245)
    : at DemoXML.main(DemoXML.java:47)
    : The very same code works fine with a simple local file URL and
    we
    : also know that the URL exists in correct in XML format because
    we
    : can open the URL with IE5.
    : Another question - where can we get the source for the Java
    XML
    : Parser.
    null

Maybe you are looking for