aspose file tools*
The moose likes Applets and the fly likes Applet Server communication for SAX Parser Delaying the process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Server communication for SAX Parser Delaying the process" Watch "Applet Server communication for SAX Parser Delaying the process" New topic
Author

Applet Server communication for SAX Parser Delaying the process

Shardul Vyawahare
Greenhorn

Joined: Dec 30, 2010
Posts: 8
Hi All,

I have written an Applet which is using the JOPNDOCUMENT library to create the document on client side. Whenever we are creating the instance of the ODSingleXMLDocument the applet is communicating with the server and causing the delay in creating the instance.

It is always communicating with server for every instance of Javax.xml.* package class .


Is SAX Parser is not the part of JVM or something ??? my applet is running in browser JVM.


My Code is as follows
<code>
public ODSingleXMLDocument createODSingleXMLDocumentTemplate(String path){
ODSingleXMLDocument template = null;
try {
DocumentGenerator.log("---------- BEFORE CREATING TEMPLATE INSTANCE "+path);
File templateFile = new File(path);
template = new ODPackage(templateFile).toSingle();
DocumentGenerator.log("---------- AFTER CREATING TEMPLATE INSTANCE "+path);
} catch (Exception e) {
DocumentGenerator.putError(e.getMessage());
e.printStackTrace();
}


return template;
}

</code>
The Printing log shows Following requests just to create the Instance....

2011-10-01 14:26:34:918 | Line :: 0 | Message :: ---------- BEFORE CREATING TEMPLATE INSTANCE C:/Program Files/Mozilla Firefox/documents/blankTemplate.odt
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.datatype.DatatypeFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.datatype.DatatypeFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.datatype.DatatypeFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.datatype.DatatypeFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Cache entry not found [url: [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.datatype.DatatypeFactory, version: null]
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.datatype.DatatypeFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.datatype.DatatypeFactory with cookie "dmLastSize=28; inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting http://[SERVER IP]/ with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Cache entry not found [url: [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory, version: null]
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "dmLastSize=28; inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting http://[SERVER IP]/ with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Cache entry not found [url: [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory, version: null]
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "dmLastSize=28; inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting http://[SERVER IP]/ with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Cache entry not found [url: [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory, version: null]
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "dmLastSize=28; inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting http://[SERVER IP]/ with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Cache entry not found [url: [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory, version: null]
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "dmLastSize=28; inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting http://[SERVER IP]/ with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Cache entry not found [url: [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory, version: null]
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/META-INF/services/javax.xml.parsers.SAXParserFactory with cookie "dmLastSize=28; inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/product.properties with proxy=DIRECT
network: Connecting http://[SERVER IP]/ with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/product.properties with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/product.properties with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/resource/1317458778000/product.properties with cookie "inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
network: Cache entry not found [url: [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/product.properties, version: null]
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/product.properties with proxy=DIRECT
network: Connecting [HTTPS>>>]//X.XXX.XXX.XXXX.XXXXX/apex/product.properties with cookie "dmLastSize=28; inst=APPU; sid=00DU0000000HdtM!AQsAQABPi3AmohIIvurvhdm9f99VWPMh3n9_Jm0A_9OUX82XUcu8wYy1.6AE2FTCFbf8NvNhkHtL8nP9uRA7KwUG6WSg9ImG; sid_Client=0000000QXL00000000HdtM; clientSrc=[CLIENT IP]"
2011-10-01 14:26:47:430 | Line :: 0 | Message :: ---------- AFTER CREATING TEMPLATE INSTANCE C:/Program Files/Mozilla Firefox/documents/blankTemplate.odt


Please help,


Thanks,
Shardul
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
Hi,

I have same problem with my applet. I have been looking for some clues a while but still no luck
Did you get managed to solve the issue?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18129
    
    8

The clues you are looking for are in the documentation for SAXParserFactory, specifically in the documentation for the newInstance() method.
Shardul Vyawahare
Greenhorn

Joined: Dec 30, 2010
Posts: 8
Yes I Solved the problem.

It is creating the SAXParserInstance Using SAXParserFactory. The SAXParserFactory is looking for property file name "javax.xml.parsers.SAXParserFactory" inside the MET-INF/services/ folder.

Create the property file with name "javax.xml.parsers.SAXParserFactory" and write the complete path of SAXParser. Cause exception is, it is looking for above property file and if not found the trying to get from server.

Note: Applet tries to read the resources from local dir if not found it try to download it from server.


Thanks,
Shardul



Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
Shardul Vyawahare wrote:Yes I Solved the problem.

It is creating the SAXParserInstance Using SAXParserFactory. The SAXParserFactory is looking for property file name "javax.xml.parsers.SAXParserFactory" inside the MET-INF/services/ folder.

Create the property file with name "javax.xml.parsers.SAXParserFactory" and write the complete path of SAXParser. Cause exception is, it is looking for above property file and if not found the trying to get from server.

Note: Applet tries to read the resources from local dir if not found it try to download it from server.


Thanks,
Shardul





Could you tell me how to do that exactly?
I want to put the properties file inside applet's Jar file, thus it will not try to download from server. Is it possible?
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
Paul Clapham wrote:The clues you are looking for are in the documentation for SAXParserFactory, specifically in the documentation for the newInstance() method.

Thanks, that's clear for me now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet Server communication for SAX Parser Delaying the process
 
Similar Threads
Axis - Applet performance issue
File Permission Error
java.io.FileNotFoundException:
ClassFormatError with an Applet?
Applet and XML Doc through a browser