Exception thrown while reading an XML file using Properties

Exception thrown while reading an XML file using Properties.
Exception in thread "main" java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException:
The processing instruction target matching "[xX][mM][lL]" is not allowed.
at java.util.XMLUtils.load(Unknown Source)
<?xml version="1.0"?>
<Config>
     <Database>
          <Product>FX.O</Product>
          <URL>jdbc:oracle:thin:@0.0.0.0:ABC</URL>
     </Database>
</Config>Am I missing anything?

Thanks a lot for all yr help.I have got the basics of
the DTD
However,when I say thus
<!DOCTYPE Config SYSTEM "c:/PartyConfig">
?xml version="1.0"?>
<Config>
     <Database>
          <Product>FX</Product>
          <URL>jdbc:oracle:thin:@0.0.0.0:ABC</URL>
     </Database>
</Config>I get the error
Invalid system identifier: file:///c:/ParyConfig.dtd
Please advise?for goodness sake, how many times do I have to tell you that you can't just expect the Properties class to accept arbitrary XML in any format? it reads XML in the format I linked to, and nothing else. Properties is not a general purpose XML binding. you can't do what you're trying to do with it. read this and in particular pay attention to the following
The XML document must have the following DOCTYPE declaration:
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
Furthermore, the document must satisfy the properties DTD described above.
you are not reading my answers properly, are you? kindly do so

Similar Messages

  • Exception occured while reading the license file.

    Java Exception: java.lang.RuntimeException
    Exception occurred while reading the license file.
    java.lang.RuntimeException: Exception occurred while reading the license file.
    at weblogic.security.utils.SSLSetup.getLicenseLevel(SSLSetup.java:143)
    at weblogic.security.utils.SSLSetup.getSSLDelegateInstance(SSLSetup.java:196)
    at weblogic.security.utils.SSLContextWrapper.<init>(SSLContextWrapper.java:27)
    at weblogic.security.utils.SSLContextWrapper.getInstance(SSLContextWrapper.java:22)
    at weblogic.security.utils.SSLSetup.getSSLContext(SSLSetup.java:380)
    at weblogic.security.SSL.SSLClientInfo.getSSLSocketFactory(SSLClientInfo.java:56)
    at weblogic.socket.ChannelSSLSocketFactory.getSocketFactory(ChannelSSLSocketFactory.java:125)
    at weblogic.socket.ChannelSSLSocketFactory.createSocket(ChannelSSLSocketFactory.java:75)
    at weblogic.socket.AbstractMuxableSocket.createSocket(AbstractMuxableSocket.java:212)
    at weblogic.rjvm.t3.MuxableSocketT3.newSocketWithRetry(MuxableSocketT3.java:252)
    at weblogic.rjvm.t3.MuxableSocketT3.connect(MuxableSocketT3.java:421)
    at weblogic.rjvm.t3.MuxableSocketT3S.createConnection(MuxableSocketT3S.java:79)
    at weblogic.rjvm.ConnectionManager.createConnection(ConnectionManager.java:1729)
    at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.java:1392)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:445)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:323)
    at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:263)
    at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:206)
    at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:226)
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:189)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:154)
    at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:342)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:337)
    at weblogic.jndi.Environment.getContext(Environment.java:307)
    at weblogic.jndi.Environment.getContext(Environment.java:277)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    I read in the community, that i need to set -Dbea.home="Directory", the Directory should refer to the path where license.bea file is kept on the client side. After setting this i need to pass the
    -Dbea.home="path" to the client jvm.
    Am using tomcat 6.0 server, and weblogic server 10.0.1.  I kept license.bea file in bin folder of the tomcat server.  But i dint understand how to set -Dbea.home="path" and how to pass it to the client jvm. Am stucked up hear. Can pls anyone help me,  to overcome this issue.

    Hi,
    Thank you for contacting us, the best community to place your question is at the OTN JAVA: https://home.java.net/?intcmp=JNET-javanet-sm
    Please let us know if you have any question about OPN CLOUD! Have a great day!

  • Exception occurred while reading the license file.

    Hi,
    I am having the Weblogic 9.2 server installed on 64 bit JVM on Solaris. I have some EJB's deployed over there. When I use to try to connect to these EJB's from Windows 32 bit OS I am getting the following error.
    Exception in thread "main" java.lang.RuntimeException: Exception occurred while reading the license file.
         at weblogic.security.utils.SSLSetup.getLicenseLevel(SSLSetup.java:143)
         at weblogic.security.utils.SSLSetup.getSSLDelegateInstance(SSLSetup.java:196)
         at weblogic.security.utils.SSLContextWrapper.<init>(SSLContextWrapper.java:27)
         at weblogic.security.utils.SSLContextWrapper.getInstance(SSLContextWrapper.java:22)
         at weblogic.security.utils.SSLSetup.getSSLContext(SSLSetup.java:380)
         at weblogic.security.SSL.SSLClientInfo.getSSLSocketFactory(SSLClientInfo.java:56)
         at weblogic.socket.ChannelSSLSocketFactory.getSocketFactory(ChannelSSLSocketFactory.java:125)
         at weblogic.socket.ChannelSSLSocketFactory.createSocket(ChannelSSLSocketFactory.java:75)
         at weblogic.socket.AbstractMuxableSocket.createSocket(AbstractMuxableSocket.java:207)
         at weblogic.rjvm.t3.MuxableSocketT3.newSocketWithRetry(MuxableSocketT3.java:252)
         at weblogic.rjvm.t3.MuxableSocketT3.connect(MuxableSocketT3.java:421)
         at weblogic.rjvm.t3.MuxableSocketT3S.createConnection(MuxableSocketT3S.java:79)
         at weblogic.rjvm.ConnectionManager.createConnection(ConnectionManager.java:1749)
         at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.java:1410)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:448)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:326)
         at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:261)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:204)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:226)
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:189)
         at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:154)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:350)
         at weblogic.jndi.Environment.getContext(Environment.java:307)
         at weblogic.jndi.Environment.getContext(Environment.java:277)
         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at Test.main(Test.java:26)
    But the same client works when I use it from same Solaris machine....
    Please help with this to me. This is argent for me.
    Thanks in advance ,Sachin

    Thanks for reply... I am using all dependent files at the client side...I had license.bea as well at the client side but it was not in the root directory so after I put it in the root directory that error was gone.....
    But I have issue with Certificates now... Actually I am using 32 bit jvm as client and the Weblogic is on 64 bit..
    The error I am facing now is......
    <Apr 17, 2009 2:13:41 PM GMT+05:30> <Warning> <Security> <BEA-090542> <Certificate chain received from ctsa-qa-s03 - 137.72.228.123 was not trusted causing SSL handshake failure. Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.>
    Exception in thread "main" javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3s://ctsa-qa-s03:7009: Destination unreachable; nested exception is:
         javax.net.ssl.SSLKeyException: [Security:090542]Certificate chain received from ctsa-qa-s03 - 137.72.228.123 was not trusted causing SSL handshake failure. Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.; No available router to destination]
         at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:49)
         at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:365)
         at weblogic.jndi.Environment.getContext(Environment.java:307)
         at weblogic.jndi.Environment.getContext(Environment.java:277)
         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at Test.main(Test.java:26)
    Caused by: java.net.ConnectException: t3s://ctsa-qa-s03:7009: Destination unreachable; nested exception is:
         javax.net.ssl.SSLKeyException: [Security:090542]Certificate chain received from ctsa-qa-s03 - 137.72.228.123 was not trusted causing SSL handshake failure. Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.; No available router to destination
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:204)
         at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:154)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:350)
         ... 8 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
         javax.net.ssl.SSLKeyException: [Security:090542]Certificate chain received from ctsa-qa-s03 - 137.72.228.123 was not trusted causing SSL handshake failure. Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.; No available router to destination
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:475)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:326)
         at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:261)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:204)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:226)
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:189)
         ... 10 more
    Please help me in this if you can

  • Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?

    Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?
    �Unflatten From XML� is of little use in parsing because it requires the data type. So it seems that the user has to parse each data value, and then �Unflatten From XML� can help a little.
    I would like to see NI provide a VI for parsing it�s own schema.

    LabVIEW's XML functions are another way of saving data from controls and indicators that is in a more standardized format. If you look at the Unflatten From XML shipping example, it shows taking the data that you would normally send to a Digital Wveform Graph and converting it to XML instead. This data is then unflattend from XML and wired to the graph. Since you know what you wrote to the file, this is an easy thing to do. If what you are looking for is a way to look at any data in any LabVIEW XML file, then you are right, there is not a VI for that. However, I do not believe that that was the intention of the XML functions in the first place.
    By wiriting data in XML, this allows other applications outside of LabVIEW to parse and recognize the dat
    a. In LabVIEW, you would already know the types and can place a generic item of that type. The issue of knowing the type is that you need to know the type of the wire that comes out of the Unflatten function so that the VI will compile correctly. You could always choose a variant value to unflatten and then do some parsing to take the variant a part. Maybe this will help you out.
    See this example for using the Microsoft parser for XML. (http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CB9FE111EE034080020E74861&p_node=DZ52050&p_submitted=N&p_rank=&p_answer=)
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Problem reading an xml file using java

    i have a Com File which is called through .Net application and i made another java application that call the same COM file using JNI . but the problem is that the xml format generated from the Com file in case of the .Net application is approx 49.9K and the same Xml file Contents generated through java is half the size of the previous file in .net about 24.9K . I had figured out that the .Net application generates the xml file as unicode format while the java application generates the same xml format as ANSI format which is approx the half of the .Net counterpart .
    but the problem now is that i can't deserialize the java generated xml to convert it into its java object using XMLDecoder because it is ill formed xml whereas its tags are well structured .
    even when i try to open that .NEt xml file into the IE browser it structures the xml file successfully
    while the java xml file version tells me that the file is ill formed knowing that the file is well structured and all the tags are valid.

    First of, that's not "Unicode" and "ANSI". Those are not really encodings per-se. "Unicode" is sometimes used to refer to UTF-16/UCS-2, and "ANSI" is sometimes used to refer to whatever the current 1-byte encoding of the machine is. But again: Those are not valid encoding names. The encodings used are probably UTF-16 (or UCS-2) and UTF-8, respectively.
    Next: unless you tell us some exact error message we can't tell you what went wrong.
    And if you want to find out if any given XML file is valid, just run it through some validator (such as [the one from the W3C|http://validator.w3.org/]).

  • Reading from XML file using DOM parser.

    Hi,
    I have written the following java code to read the XML file and print the values. It reads the XML file. It gets the node NAME and prints it. But it returns null when trying to get the node VALUE. I am unable to figure out why.
    Can anyone please help me with this.
    Thanks and Regards,
    Shweta
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import oracle.xml.parser.v2.*;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    public class ReadNodes
    private static XMLDocument mDoc;
    public ReadNodes () {
         try {
    DOMParser lParser = new DOMParser();
    URL lUrl = createURL("mot.xml");
    System.out.println("after creating the URL object ");
    lParser.setErrorStream(System.out);
    lParser.showWarnings(true);
    lParser.parse(lUrl);
    mDoc = lParser.getDocument();
         System.out.println("after creating the URL object "+mDoc);
    lParser.reset();
    } catch (Exception e) {
    e.printStackTrace();
    } // end catch block
    } // End of constructor
    public void read() throws DOMException {
    try {
         NodeList lTrans = this.mDoc.getElementsByTagName("TRANSLATION");
         for(int i=0;i<lTrans.getLength();i++) {
              NodeList lTrans1 = lTrans.item(i).getChildNodes();
              System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getNodeName());
              System.out.println("lTrans1.item(0).getNodeValue : " + lTrans1.item(0).getNodeValue());
              System.out.println("lTrans1.item(1).getNodeName : " + lTrans1.item(1).getNodeName());
              System.out.println("lTrans1.item(1).getNodeValue : " + lTrans1.item(1).getNodeValue());
         } catch (Exception e) {
         System.out.println("Exception "+e);
         e.printStackTrace();
         } catch (Throwable t) {
              System.out.println("Exception "+t);
    public static URL createURL(String pFileName) throws MalformedURLException {
    URL url = null;
    try {
    url = new URL(pFileName);
    } catch (MalformedURLException ex) {
    File f = new File(pFileName);
    String path = f.getAbsolutePath();
    String fs = System.getProperty("file.separator");
    System.out.println(" path of file : "+path +"separator " +fs);
    if (fs.length() == 1) {
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    System.out.println("path is : "+path);
    // Try again, if this throws an exception we just raise it up
    url = new URL(path);
    } // End catch block
    return url;
    } // end method create URL
    public static void main (String args[]) {
         ReadNodes mXML = new ReadNodes();
         mXML.read();
    The XML file that I am using is
    <?xml version = "1.0"?>
    <DOCUMENT>
    <LANGUAGE_TRANS>
    <TRANSLATION>
    <CODE>3</CODE>
    <VALUE>Please select a number</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>5</CODE>
    <VALUE>Patni</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>6</CODE>
    <VALUE>Status Messages</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>7</CODE>
    <VALUE>Progress</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>8</CODE>
    <VALUE>Create Data Files...</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>9</CODE>
    <VALUE>OK</VALUE>
    </TRANSLATION>
    </LANGUAGE_TRANS>
    </DOCUMENT>

    because what you want is not the node value of CODE but the node value of the text nodes into it!
    assuming only one text node into it, try this:
    System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getFirstChild().getNodeValue());

  • I need for a simple example of  reading a xml file using jdom

    Hello
    I have been looking for a simple example that uses Jdom to read am xml file and use the information for anything( ), and I just can't find one.since I'm just beggining to understand how things work, I need a good example.thanks
    here is just a simple cod for example:
    <xmlMy>
         <table>
              <item name="first" value="123" createdDate="1/1/90"/>
              <item name="second" value="456" createdDate="1/4/96"/>
         </table>
         <server>
              <property name="port" value="12345"/>
              <property name="maxClients" value="3"/>
         </server>
    </xmlMy>Dave

    Hi,
            FileInputStream fileInputStream = null;
            try {
                fileInputStream = new FileInputStream("my_xml_file.xml");
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } finally{
                if (fileInputStream == null) return;
            SAXBuilder saxBuilder = new SAXBuilder();
            saxBuilder.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
                    return new InputSource(new StringReader(""));
            Document document = null;
            try {
                document = saxBuilder.build(fileInputStream);
            } catch (JDOMException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (document == null) return;
            Element element = document.getRootElement();
            System.out.println(element.getName());
            System.out.println(element.getChild("table").getName());

  • Error while running the XML file using XML Publisher Desktop

    Hi All,
    We have successfully loaded the XML file using XML Publisher Desktop.But when we try to preview it using the PDF format we are getting the following error.
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\smanmadh\Desktop\ProductCompensationDT.xml
    FOProcessor setLocale: en-us
    java.lang.NullPointerException
         at oracle.apps.xdo.template.fo.area.PageNumber.formatString(PageNumber.java:104)
         at oracle.apps.xdo.template.fo.IDManager.registerId(IDManager.java:44)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageJoinSeq(AreaTree.java:1106)
         at oracle.apps.xdo.template.fo.area.AreaTree.incrementJoinSequenceIndex(AreaTree.java:219)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageDocument(AreaTree.java:1089)
         at oracle.apps.xdo.template.fo.area.AreaTree.forceOutput(AreaTree.java:471)
         at oracle.apps.xdo.template.fo.elements.FORoot.end(FORoot.java:58)
         at oracle.apps.xdo.template.fo.FOHandler.endElement(FOHandler.java:386)
         at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
         at oracle.apps.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:279)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:1022)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Any pointers will be of great help.
    Thanks in Advance
    Sudeep.


    I had a similar error which when I searched, came up with this thread.
    My issue was resolved after I discovered that my RTF template was not really RTF. It was sill in MS Word DOC format. This was discovered by reviewing two templates in NOTEPAD. The MS-DOC files have a lot of "special" characters in them. My RTF was not really RTF.
    After doing a SAVE AS - RTF format, then the preview worked as expected.
    Just Sharing...
    --Tim                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error while encrypting the xml file using asymmetric cipher...pls help

    i am encryption the xml file using asymmetric cyper....
    in one class , i am generating private key and public key using "RSA" algorithm..using 1024 byte initialization...
    it is generating properly...
    and after that in second class i am encrypting the xml file using "DESede" algorithm and i am using public key of above class..
    but i am getting exceptione :
    java.security.InvalidKeyException: Invalid key length: 162 bytes
    at com.sun.crypto.provider.DESedeCipher.engineGetKeySize(DashoA6275)
    at javax.crypto.Cipher.init(DashoA6275)
    at XmlEncryption.getEncryptedData(XmlEncryption.java:147)
    at XmlEncryption.encryptCompleteXmlFile(XmlEncryption.java:123)
    at demoXmlEncApp.simulateBookSellersEnd(demoXmlEncApp.java:72)
    at demoXmlEncApp.main(demoXmlEncApp.java:29)
    so, what is that ?
    i want to use RSA algo for key generatiion and DESede for cipher initialization .
    is there any site for where source code of xml file encryption using asymmetric cipher is available?
    pls, help me.....

    Sachin,
    What sabre150 is trying to explain to you, is that encrypting data (such as an XML file) is a 2-step process. In the first step, you generate a symmetric key (such as DES, 3DES, AES) and encrypt your file with this key (and the appropriate mode and padding).
    In order to ensure that your encrypted data cannot be decrypted by unauthorized individuals, you now need to protect the symmetric key. Encrypting your symmetric key with another symmetric key does not solve the problem, since you have a chain of symmetric keys that need to be encrypted into infinity.
    Cryptographers solve this problem by encrypting the symmetric key with an asymmetric key, such as as RSA. To perform this second step, you generate an RSA key-pair, encrypt the symmetric key you generated in step 1 with the Public key of the RSA key-pair, and give the recipient of the encrypted XML file, access to the Private key of the RSA key-pair as well as the encrypted symmetric key.
    The recipient, then uses the RSA Private key to decrypt the symmetric key first, and then uses the "plaintext" symmetric key to decrypt the XML file.
    What sabre150 was also attempting to explain to you, is the traditional way of transporting an encrypted "blob" that consists of data + symmetric key. With a modern key-management system, combining the two would be unnecessary.

  • Getting error while running the XML file using XML Publisher Desktop

    Hi all,
    We have successfully loaded the XML file using XML Publisher Desktop. But when we preview the same using PDF format we are getting the following error.
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\smanmadh\Desktop\ProductCompensationDT.xml
    FOProcessor setLocale: en-us
    java.lang.NullPointerException
         at oracle.apps.xdo.template.fo.area.PageNumber.formatString(PageNumber.java:104)
         at oracle.apps.xdo.template.fo.IDManager.registerId(IDManager.java:44)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageJoinSeq(AreaTree.java:1106)
         at oracle.apps.xdo.template.fo.area.AreaTree.incrementJoinSequenceIndex(AreaTree.java:219)
         at oracle.apps.xdo.template.fo.area.AreaTree.registerLastPageDocument(AreaTree.java:1089)
         at oracle.apps.xdo.template.fo.area.AreaTree.forceOutput(AreaTree.java:471)
         at oracle.apps.xdo.template.fo.elements.FORoot.end(FORoot.java:58)
         at oracle.apps.xdo.template.fo.FOHandler.endElement(FOHandler.java:386)
         at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:196)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1212)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
         at oracle.apps.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:279)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:1022)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Thanks in Advance.
    Sudeep.

    This is BI related. You will get a quicker answer from the BI Publisher forum
    BI Publisher

  • Reading an XML file using Java

    Dear all,
    Currently, I'm planning to write a java program that will read from an xml file. This is my XML file:
    <?xml version="1.0"?>
    <HUMIDITYMEASURE>
    <HUMIDITY>32.0</HUMIDITY>
    </HUMIDITYMEASURE>
    Now, here is my Java code:
    import java.io.*;
    class ReadAFile{
    public static void main(String[]args){
    try{
    File myFile=new File("XMLFile.xml");
    FileReader fileReader= new FileReader(myFile);
    BufferedReader reader = new BufferedReader(fileReader);
    String line = "null";
    while ((line = reader.readLine()) !=null){
    System.out.println(line);
    reader.close();
    catch(Exception ex){
    ex.printStackTrace();
    So far the program displays the content of the xml file (with the tags). However, my aim is to make the program display the values, not the tags. For example, in this case, i'd like my program to display the value '32.0' rather than:
    <?xml version="1.0"?>
    <HUMIDITYMEASURE>
    <HUMIDITY>32.0</HUMIDITY>
    </HUMIDITYMEASURE>
    Can anyone provide me with any advice as to how i can do this please? I tried using the tokenizer and split, but to be honest, they dont really work. If anybody has any suggestions, please reply if possible.
    Regards,

    I have found the solution to my task.
    Many thanks to those who have viewed/replied to my message.
    For those of you who may be wondering how the problem was solved, it is useful to refer to some documents relating to Java and XML (as combination).
    Imported packages such as:
    import java.io.File;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    and variations of import javax.xml were used.
    The use of Nodes and NodeLists I used to.
    Thanks again.
    p.s. More details on XML and Java are found on the Sun Website.
    Regards,
    Raheal

  • Reading large XML file using a file event generator and a JPD process

    I am using a FileEventGenerator and a JPD Subscription process to read a large XML file. The large XML file basically contains repeated XML elements. My understanding is that the file subscription method reads the whole file in memory which causes lots of problem for huge file size like 1MB. Is there a way to read the file size-wise or is there a way to read chunks of data from a large size file..or any other alternative. I would like to process the file in a loop iteration by iteration.

    Hitejain,
    Here are a couple of pointers you could try. One is that the file event generator has a pass by reference (filename) functionality which you could use so that you could do the following inside of your process.
    1) Read file name from the reference
    2) Move the file to a processed directory (so it doesn't get picked up again. Note: I don't know how the embedded archive methods of the file event generator plays with pass by reference.
    3) Open a stream to the file.
    4) Use a SAX or SAX - DOM combined approach to parse your XML while managing the memory usage inside of your process
    There is another possibility which might fit your needs and it is related to the RawData object that BEA provides. If I understand it correctly provides wrapping functionality around a stream object, but depending on your parsing methods might just postpone the problem.
    Hope this helps
    Chris Falling
    Stormforge Software

  • Problems with and tags while reading the xml file

    Hi
    I am using the xml files in my project. The project uses Tomcat, JMS. The project is divided into some components which communicate with each oher thru JMS. The component for which I am responsible gets a dcoument object from the JMS which is a processed xml of the following format (the processing is done by the DBMS_XMLGEN package of oracle)
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <filename>157_1000000001</filename>
    <querydata>
    <tabdata>
    <tabinfo>Tab-id3</tabinfo>
    <queryset>
    <query name="Fax">
    select a.ARLN_NAME,d.TICKETED_ORIGIN,d.TICKETED_DESTINATION, d.ENDORSEMENTS,to_char(d.DATE_OF_ISSUE,'DDMONYY') as DATE_OF_ISSUE ,d.EXCHANGE_DOC_TYPE,
                   d.PASSENGER_NAME,d.ORIG_ISS_AIRLINE,d.ORIG_DOC_NO,d.ORIG_PLACE_OF_ISSUE,
                   to_char(d.ORIG_DATE_OF_ISSUE,'DDMONYY'),d.ORIG_ISSUE_AGENT,d.CUR_OF_SALE,d.GROSS_FARE,d.EQUIV_CUR_OF_SALE,d.EQUIV_FARE,
                   d.PANDA_DEAL_CODE,d.ISI,d.reporting_date
                   from airline_master a,ticket_main d,ticket_conj e where d.doc_no = e.doc_no and d.iss_airline = e.iss_airline
                   and e.conj_doc_no = (select DOC_NO from TICKET_CONJ where CONJ_DOC_NO = 1000000001 and ISS_AIRLINE = 157)
                   and e.ISS_AIRLINE = 157 and d.iss_airline = a.ARLN_NUM_CODE
    </query>
    </queryset>
    </tabdata>
    </querydata>
    the function on my side is like this
    private void processMessage(ObjectMessage objmessage)
         Document XMLreqObject = (Document) objmessage.getObject();
         Element root = XMLreqObject.getRootElement();                
         String resultFilename = root.getChildText("filename");
         Element tabSet = root.getChild("querydata");//doesnt work
         ArrayList tabSetlist = new ArrayList(tabSet.getChildren ("tabdata"));//doesnt work
    The code commented with "doesnt work", is not working. What must be the problem ?
    Thanks in Advance
    Martin

    Okay. Your original example XML didn't include < or > which was rather confusing if that particular feature was supposed to be the cause of the problem. Also calling them "tags" was rather confusing since "tags" is the term for the things that come at the beginning and of an element, like this:<data>...</data>Anyway, I assume your theory is that documents that don't have < in a text element process correctly and documents that do have < in a text element get "stuck" in the parser? Well, from your original description the process appears to be:
    1. Create XML
    2. Parse it into a Document
    3. Send the Document via JMS
    4. Receive the Document via JMS
    5. Process it.
    And it's step 4 that is "stuck"? That would be my guess based on the code you posted.

  • Problem while reading from text file using JDeveloper 10.1.2

    Hi,
    I am using JDeveloper 10.1.2 for my application. In this, I have one requirement to read some data from a text file. For that, I created a test file and saved along with the java file folder. From there, I am trying to read this file but it says the file not found exception.
    Application is looking the file from another location. "F:\DevSuiteHome_1\jdev\system10.1.2.1.0.1913\oc4j-config"
    But, I want to read it from my home folder. How is it possible to read from that location?
    Regards,
    Joby Joseph

    HI,
    Check followings will useful
    How to read .txt file from adfLib jar at model layer using relative path
    Accessing physical/relative path from Bean

  • How to read the attribute of the xml file using jaxb

    Thanks,
    Buddy as i have a issue i have to read the xml file using jaxb and xml file contains this data and i have read the attribute like name , desc and action for a particular menu name pls tell the code how to do this it will be a great favour to me
    thanx in advance
    Rasool
    <contextmenu>
    <menu name='Lead' >
    <menuitem name='newlead' desc='New Lead' action='/leads.do?dispatch=insert' />
    <menuitem name='editlead' desc='Edit Lead' action='' />
    <menuitem name='leadinfo' desc='Lead Information' action='' />
    </menu>
    <menu name='Cases' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    <menu name='Contact' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    </contextmenu>

    What my program do is to get the encoding of XML files and convert them to UTF-8 encoding files, while I need this "encoding" information of the original XML document thus I can convert...
    After reading specifications and JDOM docs, the truth turns to be disappointed, no function is provided to get this information in JDOM level 2(the current released one), while it's promissed that this function will be provided in JDOM level API....
    Thanx all for your help and attention!!!

Maybe you are looking for

  • Can't burn

    Microsoft Windows Vista Professional (Build 5600) EMACHINES T6524 iTunes 7.0.2.16 CD Driver 2.0.6.1 CD Driver DLL 2.0.6.1 UpperFilters: GEARAspiWDM (2.0.6.1), IDE\DiskST3200021A_____________________________3.01___ Could not open CD handler, 5. Proble

  • ABAP Mapping in PI 7.1

    Hi I am looking for the ABAP mapping scenario, Can anyone send me the link Thanks PR

  • Lets make a fake Dreamveaver in flash

    i am making a swf that can edit anything as Dreamveaver.but some problems haven't been solved. 1.broswer.we need 2 select files 2 open & edit,i use flash.net.FileReference .but this function can only provide the name of the file ,not path.that means

  • Will this download open CR2 files on a CS4 program from a Canon 5D Mark III?

    I know that Cs4 will not support CR2 files from a New Mark III.  I need to fix this.  With the CC, will it allow me to open the CR2 files in PS CS4?

  • Has anyone seen the DVDs for either teched 04 or NW know

    Dear SDN,   Has any one ever previewed the DVDs for 1.   SAP NetWeaver™ Know-How DVD 2.   SAP  Tech ed 04 complete technology package I am interested in Technical information.  Does anyone think either of these are worth buying?