Cannot parse xml from applet

I really hope that somebody can help me with this.....
I'm trying to simply parse an xml document into an applet so that the info can be used later on. I just need the tag, attribute and value.
So far, all that I can do is get the "access denied" java.util.propertypermission user.dir read error that I see tons of people complaining about. here's my code:
public StageInfo getNextStage() throws Exception
        handler = new GameXMLHandler(m_imageGiver, m_codeBase);
        spf = SAXParserFactory.newInstance();
        parser = spf.newSAXParser();
        parser.parse("Loader.xml", handler);
        return handler.getStageInfo();
    }is there a way to parse an xml file in an applet? everywhere I look, somebody is saying that it can be done, but never have they done it. I'm starting to think that there is something beyond my control that is stopping this from working. Please help!!!!

If I read your post correctly, your applet is trying to read xml file from the user's local drive? This must be done with a signed (trusted) applet. Otherwise normal run-of-the-mill applets can't access drives. Java security feature. You can use Frame, it can access local drives.

Similar Messages

  • Can't parse xml from applet using dom on linux on Netscape 7 using jre 1.4.

    Hi,
    I can't seem to parse xml from an applet on linux on Netscape 7 using the JRE 1.4.
    My code looks like the following:
    StringBufferInputStream is = new StringBufferInputStream("<foo></foo>");
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
    try
      builder = factory.newDocumentBuilder();
      domDocument = builder.parse(is); // this line creates an exception
    catch (Exception e)
      System.out.println(e);
    This code works fine from an applet on windows. On linux, the error message is:
    java.security.AccessControlException: access denied (java.util.PropertyPermission entityExpansionLimit read)
    I've tried both JRE 1.4.0_04 and 1.4.1_03
    Thanks!
    Q

    There's another posting about this same problem (platform unspecified), but the same error message. I was also having this problem (Windows 1.4.03) and swithced back to 1.4.01 and the problem went away. In the future, I may sign my applets to get a more generous security policy. But, I'm sure it'll be a lot of work (vs. a line of code somewhere).

  • Parsing XML from Socket input stream

    I create a sax parser to which I send the InputStream from the socket
    But my HandlerBase never gets the events. I get startDocument
    but that is it, I never get any other event.
    The code I have works just like expected when I make the InputStream
    come from a file. The only differeence I see is that when I file is used the
    InputStream is fully consumed while with the socket the InputStream
    is kept open (I MUST KEEP THE SOCKET OPEN ALL THE TIME). If the parser
    does not generate the events unless the InputStream is fully consumed,
    isn't that against the whole idea of SAX (sax event driven) .
    Has anyone been succesfull parsing XML from the InputStream of a socket?
    if yes how?
    I am using JAXP 1.0.1 but I can upgrade to JAXP 1.1.0
    which uses SAX 2.0
    Does anybody know if my needs can be met by JAXP 1.1.0?
    Thanks

    I did the same with client/server model.
    I have client program with SAX parser. Please try if you can make the server side. I was be able to write the program with help from this forum. Please search to see if you can get the forum from which I got help for this program.
    // JAXP packages
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    // JAVA packages
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class XMLSocketClient {
    final private static int buffSize = 1024*10;
    final private static int PORTNUM = 8888;
         final private static int threadSleepValue = 1000;
    private static void usage() {
    System.err.println("Usage: XMLSocketClient [-v] serverAddr");
    System.err.println(" -v = validation");
    System.exit(1);
    public static void main(String[] args) {
    String address = null;
    boolean validation = false;
    Socket socket = null;
    InputStreamReader isr_socket = null;
    BufferedReader br_socket = null;
    CharArrayReader car = null;
    BufferedReader br_car = null;
    char[] charBuff = new char[buffSize];
    int in_buff = 0;
    * Parse arguments of command options
    for (int i = 0; i < args.length; i++) {
    if (args.equals("-v")) {
    validation = true;
    } else {
    address = args[i];
    // Must be last arg
    if (i != args.length - 1) {
    usage();
    // Initialize the socket and streams
    try {
    socket = new Socket(address, PORTNUM);
    isr_socket = new InputStreamReader(socket.getInputStream());
    br_socket = new BufferedReader(isr_socket, buffSize);
    catch (IOException e) {
    System.err.println("Exception: couldn't create stream socket "
    + e.getMessage());
    System.exit(1);
    * Check whether the buffer has input.
    try {
    while (br_socket.ready() != true) {
                   try {
                        Thread.currentThread().sleep(threadSleepValue);     
                   catch (InterruptedException ie) {
              System.err.println("Interrupted error for sleep: "+ ie.getMessage());
                   System.exit(1);
    catch (IOException e) {
    System.err.println("I/O error for in.read(): "+ e.getMessage());
    System.exit(1);
    try {
    in_buff = br_socket.read(charBuff, 0, buffSize);
    System.out.println("in_buff = " + in_buff);
    System.out.println("charBuff length: " + charBuff.length);
    if (in_buff != -1) {
    System.out.println("End of file");
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    System.exit(1);
    System.out.println("reading XML file:");
    StringBuffer display = new StringBuffer();
    display.append(charBuff, 0, in_buff);
    System.out.println(display.toString());
    * Create BufferedReader from the charBuff
    * in order to put into XML parser.
    car = new CharArrayReader(charBuff, 0, in_buff); // these two lines have to be here.
    br_car = new BufferedReader(car);
    * Create a JAXP SAXParserFactory and configure it
    * This section is standard handling of XML document by SAX XML parser.
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setValidating(validation);
    XMLReader xmlReader = null;
    try {
    // Create a JAXP SAXParser
    SAXParser saxParser = spf.newSAXParser();
    // Get the encapsulated SAX XMLReader
    xmlReader = saxParser.getXMLReader();
    } catch (Exception ex) {
    System.err.println(ex);
    System.exit(1);
    // Set the ContentHandler of the XMLReader
    xmlReader.setContentHandler(new MyXMLHandler());
    // Set an ErrorHandler before parsing
    xmlReader.setErrorHandler(new MyErrorHandler(System.err));
    try {
    * Tell the XMLReader to parse the XML document
    xmlReader.parse(new InputSource(br_car));
    } catch (SAXException se) {
    System.err.println(se.getMessage());
    System.exit(1);
    } catch (IOException ioe) {
    System.err.println(ioe);
    System.exit(1);
    * Clearance of i/o functions after parsing.
    try {
    br_socket.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    try {
    socket.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    try {
    br_car.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    * The XML handler used by this program
    class MyXMLHandler extends DefaultHandler {
    // A Hashtable with tag names as keys and Integers as values
    private Hashtable tags;
    // Parser calls this once at the beginning of a document
    public void startDocument() throws SAXException {
    System.out.println("startDocument()");
    tags = new Hashtable();
    // Parser calls this for each element in a document
    public void startElement(String namespaceURI, String localName,
    String rawName, Attributes atts)
    throws SAXException
    String key = localName;
    Object value = tags.get(key);
    System.out.println("startElement()");
    System.out.println("namespaceURI: " + namespaceURI);
    System.out.println("localName: " + localName);
    System.out.println("rawName: " + rawName);
    if (value == null) {
    // Add a new entry
    tags.put(key, new Integer(1));
    } else {
    // Get the current count and increment it
    int count = ((Integer)value).intValue();
    count++;
    tags.put(key, new Integer(count));
    // Parser calls this once after parsing a document
    public void endDocument() throws SAXException {
    Enumeration e = tags.keys();
    System.out.println("endDocument()");
    while (e.hasMoreElements()) {
    String tag = (String)e.nextElement();
    int count = ((Integer)tags.get(tag)).intValue();
    System.out.println("Tag <" + tag + "> occurs " + count
    + " times");
    * Error handler of XML parser to report errors and warnings
    * This is standard handling.
    class MyErrorHandler implements ErrorHandler {
    /** Error handler output goes here */
    private PrintStream out;
    MyErrorHandler(PrintStream out) {
    this.out = out;
    * Returns a string describing parse exception details
    private String getParseExceptionInfo(SAXParseException spe) {
    String systemId = spe.getSystemId();
    if (systemId == null) {
    systemId = "null";
    String info = "URI=" + systemId +
    " Line=" + spe.getLineNumber() +
    ": " + spe.getMessage();
    return info;
    * The following methods are standard SAX ErrorHandler methods.
    * See SAX documentation for more info.
    public void warning(SAXParseException spe) throws SAXException {
    out.println("Warning: " + getParseExceptionInfo(spe));
    public void error(SAXParseException spe) throws SAXException {
    String message = "Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    public void fatalError(SAXParseException spe) throws SAXException {
    String message = "Fatal Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);

  • Parse XML from CLOB field

    How can I parse XML from CLOB field? I need to replace or delete the node from XML document and update the database with new XML. I am using Oracle 9i release 2.
    Here is the XML. In this XML if section1 and section2 exists then I need to delete the section1 node. If section2 doesn't exist, replace section1 with section2 node.
    <Document ID='2' TypeID='2'>
    <Body>
    <Page Name='Page1'>
    <Sec ID='section1' Title='Section 1' GroupID='' />
    <Sec ID='section2' Title='Section 2' GroupID='' />
    </Page>
    </Body>
    </Document>
    Please help.. Thank you..

    In 9.2, you are limited into your options. Have a look into, among others, updateXML. Updating tp 10gR2 will give you more options to succeed.

  • How to use DOMParser from an Applet / Or, how to parse XML from an Applet?

    Hey,
    As stating in the subject line, I wonder how to do it without getting an �Access Denied� error.
    I would like to parse a XML file that has external DTD pointing to a SYSTEM location. Yes, I can change it to a public location. However, in either way, I have problems to use DOMBuilder to parse the xml file. The application always throws the security exception.
    I tried to use the DOMParser from org.apache.xerces.parsers to parse the xml file. I set the DOMParser to ignore parsing the external DTD, and use the DOMParser.parse(InputSource) to parse the xml file from a giving URL. However, I get null of the result document.
    Does anyone know how to parse the XML from an Applet? Or, does anyone know how to use the DOMParser from an Applet?
    Thank you very much,

    If the document resides on the local filesystem, you will need to sign a CAB or JAR for the applet to circumvent the sandbox's security restrictions. There are dozens of posts on how to do this. Basically, that will turn the applet into an application, from a Java security perspective.
    - Saish
    "My karma ran over your dogma." - Anon

  • Read XML from applet

    Hi there,
    I would like to read XML data from Applet,
    first of all is it possible?
    If yes then how and will I require any extra pugin other than Java Plug-in?
    Thanks

    Sure you can, as long as the applet has permissions to read the xml file. If it is in the same directory as the applet it should be ok.
    There is no need for an extra plugin. Here's a starting point:
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(<some stream>);
    Element data = doc.getDocumentElement();
    NodeList dbChildren = db.getChildNodes();

  • Xerces - Parse XML from String

    I am trying to parse an xml string using Xerces.
    I have the following code:
    String xml = <segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0"  pointIndex="0" meters="122" seconds="11"  distance="0.1 mi"  time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b>
    </segment>
    <segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment>
    <segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment>
    <segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment>
    <segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment>
    <segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment>;
    XMLReader reader = new SAXParser();
    reader.setContentHandler(new Handler());
    reader.parse(xml);I am getting the followoing error:
    org.xml.sax.SAXParseException: File "<segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0" pointIndex="0" meters="122" seconds="11" distance="0.1 mi" time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b></segment><segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment><segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment><segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment><segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment><segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment></segments>" not found.
         at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1219)
         at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:501)
         at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1139)
         at com.shiftyeyes.xmlTest.main(xmlTest.java:34)
    Exception in thread "main" anyone know how I can fix this? Thanks!!

    reader.parse(new InputSource(new StringReader(xml)));

  • Parsing XML from a session bean

    Hi,
    I am trying to use a Sax parser for parsing xml received from a back end
    legacy system. The code is executed from a Session bean.
    Debugging learned me that the parse() method on the parser hangs the
    container without any error or exception trace. The code works fine outside
    a container.
    All help will be highly appreciated.
    Kurt

    I found out that the InputStream implementation used parsing source inside
    the container is different
    then from the one outside (other type of VM of course!). The Weblogic
    implementation blocks at the end of
    the stream, while the normal SUN JDK 1.3 returns. This is not a bug, the bug
    I found is in my proxy that allows
    the connection to the backend. This proxy allows HTTP connections, and I
    parse the XML received over HTTP.
    Regards,
    Kurt
    "Todd Karakashian" <[email protected]> wrote in message
    news:[email protected]..
    That's seems odd. Perhaps there is something going on in your document
    handler code that triggers a hang in the environment of the server.
    When you see the hang, instruct the VM to give you a thread dump (type
    control-<break> on Windows, <control>-\ (backslash) on UNIX in the
    window in which the server is running; the results are dumped to
    stderr). That will show what every thread in the server is doing. If you
    email or post the thread dump, I will take a look at it and see if I can
    see what is going on. Also, let us know which platform, VM, parser, and
    WebLogic version you are using.
    Regards,
    -Todd
    Kurt Quirijnen wrote:
    Hi,
    I am trying to use a Sax parser for parsing xml received from a back end
    legacy system. The code is executed from a Session bean.
    Debugging learned me that the parse() method on the parser hangs the
    container without any error or exception trace. The code works fine
    outside
    a container.
    All help will be highly appreciated.
    Kurt--
    Todd Karakashian
    BEA Systems, Inc.
    [email protected]

  • Servlet cannot receive message from applet after sent message to applet

    In my Applet-Servlet communication, my servlet can not receive message from the applet after the servlet sent message to the applet. It will throw java.io.EOFException: Expecting code
    Can someone tell me what is wrong?
    ==============
    This is relevant code on applet side:
    String inMsg = "";
    try {
    _owner.textArea.append("run start...please wait......\n");
    String location = "http://111.111.11.111:8080/mdo/servlet/BLServlet";
    URL servletURL = new URL(location);
    URLConnection servletConnection = servletURL.openConnection();
         _owner.textArea.append("URL = "+location+"\n");
    servletConnection.setDoOutput(true);
    servletConnection.setDoInput(true);
    servletConnection.setUseCaches(false);
    servletConnection.setDefaultUseCaches(false);
    servletConnection.setRequestProperty("Content-Type", "application/octet-stream");
    _owner.textArea.append("servlet connection: \n  "+servletConnection.toString()+"\n");
    outputToServlet = new ObjectOutputStream(servletConnection.getOutputStream());
    _owner.textArea.append("output to servelt:  "+outputToServlet.toString()+"\n");
    _owner.textArea.append("Send msg: Register\n");
    outputToServlet.writeObject("Register");
    _owner.textArea.append("Sent. \n");
    outputToServlet.flush();
    _owner.textArea.append("Flush. \n");
    try {
    Thread.sleep(3000);
    } catch (InterruptedException exc) {
    _owner.textArea.append("Cannot Sleep.\n");
    return;
    inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
    _owner.textArea.append("input from servlet:   "+inputFromServlet.toString()+"\n");
    Object inMessage = new Object();
    inMessage = (Object) inputFromServlet.readObject();
    inMsg = inMessage.toString();
    _owner.textArea.append("Receive: "+inMsg+"\n");
    _owner.textArea.append("output-to-servelt:  "+outputToServlet.toString()+"\n");
    _owner.textArea.append("input-from-servlet: "+inputFromServlet.toString()+"\n");
    _owner.textArea.append("Send msg: Hello\n");
    outputToServlet.writeObject("Hello");
    _owner.textArea.append("Sent. \n");
    outputToServlet.flush();
    _owner.textArea.append("Flush. \n");
    try {
    Thread.sleep(3000);
    } catch (InterruptedException exc) {
    _owner.textArea.append("Cannot Sleep.\n");
    return;
    _owner.textArea.append("output-to-servelt:  "+outputToServlet.toString()+"\n");
    _owner.textArea.append("input-from-servlet: "+inputFromServlet.toString()+"\n");
    inMessage = new Object();
    inMessage = (Object) inputFromServlet.readObject();
    inMsg = inMessage.toString();
    _owner.textArea.append("Receive: "+inMsg+"\n");
    _owner.textArea.append("End of run\n");
    } catch (Exception e) {
    _owner.textArea.append("Exception:  "+e.toString()+"\n");
    Code on Servlet side:
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String inMsg;
    try {
    textArea.append("start of main\n");
    inputFromApplet = new ObjectInputStream(request.getInputStream());
    inMsg = (String) inputFromApplet.readObject();
    textArea.append(" - BLServlet - from Applet: "+inMsg+"\n");
    if (inMsg.equals("Register")) {
    outMsg = "Register Accept";
    } else {
    outMsg = "MISTAKE2";
    textArea.append("output message: "+outMsg+"\n");
    outputToApplet = new ObjectOutputStream(response.getOutputStream());
    textArea.append("object output stream: "+outputToApplet.toString()+"\n");
    outputToApplet.writeObject(outMsg);
    outputToApplet.flush();
    try {
    Thread.sleep(3000);
    } catch (InterruptedException exc) {
    return;
    inMsg = (String) inputFromApplet.readObject();//Throw java.io.EOFException: Expecting code
    textArea.append(" - BLServlet - from Applet: "+inMsg+"\n");
    inputFromApplet.close();
    if (inMsg.equals("Hello")) {
    outMsg = "Hello! How are you!";
    else {
    outMsg = "MISTAKE3";
    textArea.append("output message: "+outMsg+"\n");
    outputToApplet.writeObject(outMsg);
    outputToApplet.flush();
    } catch (Exception exc) {
    textArea.append("Exception: "+exc.toString()+"\n");
    return;
    } // end of try/catch
    } // end of doPost method

    I have the same problem. I'm trying to send an ImageIcon through an ObjectOutputStream from an Applet to a Servlet. Here is my code:
    URL url = new URL(getCodeBase(),"/License/SnapshotServlet");
    URLConnection con = url.openConnection();
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type", "application/x-java-serialized-object");
    OutputStream os = con.getOutputStream();
    BufferedOutputStream bos = new BufferedOutputStream(os);
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.writeObject(icon);
    oos.flush();
    oos.close();
    Here is my error:
    [5/6/02 17:41:31:312 CDT] 7f8b8205 SystemOut     U service() called
    java.io.EOFException
    at java.io.DataInputStream.readFully(DataInputStream.java:168)
    at java.io.ObjectInputStream.readFully(ObjectInputStream.java:2076)
    at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1085)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:380)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:242)
    at javax.swing.ImageIcon.readObject(ImageIcon.java:373)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2219)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1416)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:392)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:242)
    at dps.license.webcam.SnapshotServlet.doPost(SnapshotServlet.java:39)
    at dps.license.webcam.SnapshotServlet.service(SnapshotServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
    at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)
    at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297)
    at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)
    at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
    at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
    at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:523)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:282)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:112)
    at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:91)
    at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:184)
    at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
    at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
    at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:125)
    at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
    at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)[5/6/02 17:41:31:859 CDT] 7f8b8205 SystemOut     U saving image...
    [5/6/02 17:41:31:859 CDT] 7f8b8205 SystemOut     U ERROR: Image is null!
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
    at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)
    Does anyone have any idea what is going on here?

  • Parsing xml from forms6i,can anyone please help me

    Can anyone please help me.I need to parse a xml file from a directory.The parsing should help me in giving a structure for two things.
    1) i should be able to read the nodes( values between the tags) and display the values at my front-end textboxex
    2) whenever the user changes the front-end content it should change the corresponding value in the xml node.
    when it is finished i should be able to save the structure back as a xml file.This file is actually a blob object in the oracle database and is it wise to convert it into a file in dos directory and parse it from there or use oracle utilities from form6i and parse it from oracle utilities.
    Please if someone can find help on this ,it would really help me.

    No the password isn't your apple id password.
    You encrypted your backup with a password, if you don't remember the password, then i'm sorry you won't be able to use it.

  • Cannot parse data from xml

    I am trying to obtain strings from a xml file:
    I tried the following:
    var url:URLRequest = new URLRequest("blog.xml");
    var xml:XML;
    var rss:URLLoader = new URLLoader();
    rss.load(url);
    rss.addEventListener(Event.COMPLETE, readRss);
    function readRss(e:Event):void{
           xml = XML(rss.data);
           txt_field.text=xml.entry[1].author.name;
    but had no results. TypeError: Error #1010:...
    I tried tracing xml and that worked fine.
    The xml structure seems to be too complex
    var blogList:XMLList = xml.children(); //returns a more simple xml structure but still no success in parsing parts of the xml such as "title" or "author".
    Any suggestions would be greatly appreciated.
    Thanks

    Hi Kglad,
    thank you for helping me with this post and all the previous threads.
    for accessing entry[1].title, i tried:
    xml..ns::entry[0].title // but didn´t really work.
    I also tried to retrieve all the items under "entry" with:
       var ns:Namespace=xmlData.namespace();
       var MSGCounter:int = 1;
       for each (var item:XML in xmlData..ns)
        txt_field.appendText("Post "+MSGCounter++ +"\n")
        txt_field.appendText("------------------------------------------------------------------- -----\n");
        txt_field.appendText(item.entry.title.toString());
        txt_field.appendText("\n");
        txt_field.appendText("\n");
        txt_field.appendText(item.entry.content.toString());
        txt_field.appendText("\n ");
        txt_field.appendText("\n ");
        txt_field.appendText(item.entry.author.name.toString());
        txt_field.appendText("\n\n");
    but had no success.

  • Cannot parse XML file... It's not there!

    I am having a difficult time getting entitlements going. When I delete all entitlements
    from the EBCC, I can synch fine. When I create one, even a dummy one w/ no rules
    in it, I cannot synch properly.
    In my Oracle 8.1.7 database I notice that the entitlements table is referenceing
    an "AD.xml" file that is no where on my computer. However, the parse error gets
    thrown while trying to parse "http://www.bea.com/servers/p13n/xsd/rules/core/2.1.1".
    This does not exist in this directory. Also notice how there is no file extension.
    Does anyone have any idea where these files reside?
    Thanks,
    Sam

    a file named with a dot (.) as the first character is treated as an invisable file.
    https://discussions.apple.com/message/15369590#15369590
    https://discussions.apple.com/search.jspa?peopleEnabled=true&userID=&containerTy pe=&container=&spotlight=false&q=make+invisible+file+visible

  • Urgent : Need help in parsing XML from Sharepoint and save it into DB

    Hi ,
    I am Sharepoint guy and a newbie in Oracle . PL/SQL
    I am using UTL_DBWS Package to call a Sharepoint WebService " and was sucessfull , Now the xml has to be parsed and stored into a Table. I am facing the issue as the XML has a different namesoace and normal XPATH query is not working
    Below is the XML and need help in parsing it
    declare
    responsexml sys.XMLTYPE;
    testparsexml sys.XMLTYPE;
    begin
    responsexml := sys.XMLTYPE('<GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <GetListItemsResult>
    <listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data ItemCount="2">
    <z:row ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Test Title 1" ows_ID="1" ows_owshiddenversion="1" ows_UniqueId="1;#{9C45D54E-150E-4509-B59A-DB5A1B97E034}" ows_FSObjType="1;#0" ows_Created="2009-09-12 17:13:16" ows_FileRef="1;#Lists/Tasks/1_.000"/>
    <z:row ows_MetaInfo="2;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Testing Tasks" ows_ID="2" ows_owshiddenversion="1" ows_UniqueId="2;#{8942E211-460B-422A-B1AD-1347F062114A}" ows_FSObjType="2;#0" ows_Created="2010-02-14 16:44:40" ows_FileRef="2;#Lists/Tasks/2_.000"/>
    </rs:data>
    </listitems>
    </GetListItemsResult>
    </GetListItemsResponse>');
    testparsexml := responsexml.extract('/GetListItemsResponse/GetListItemsResult/listitems/rs:data/z:row/@ows_Title');
    DBMS_OUTPUT.PUT_LINE(testparsexml.extract('/').getstringval());
    end;
    The issue is with rs:data , z:row nodes.... please suggest how to handle these kind of namespaces in Oracle
    I need the parse the attribute "ows_Title" and save it into a DB
    this script would generate "Error occured in XML Parsing"
    Help is appriciated, thanks for looking

    SQL> SELECT *
      FROM XMLTABLE (
              xmlnamespaces ('http://schemas.microsoft.com/sharepoint/soap/' as "soap",
                             '#RowsetSchema' AS "z"
              'for $i in //soap:*//z:row return $i'
              PASSING xmltype (
                         '<GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <GetListItemsResult>
    <listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data ItemCount="2">
    <z:row ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Test Title 1" ows_ID="1" ows_owshiddenversion="1" ows_UniqueId="1;#{9C45D54E-150E-4509-B59A-DB5A1B97E034}" ows_FSObjType="1;#0" ows_Created="2009-09-12 17:13:16" ows_FileRef="1;#Lists/Tasks/1_.000"/>
    <z:row ows_MetaInfo="2;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Testing Tasks" ows_ID="2" ows_owshiddenversion="1" ows_UniqueId="2;#{8942E211-460B-422A-B1AD-1347F062114A}" ows_FSObjType="2;#0" ows_Created="2010-02-14 16:44:40" ows_FileRef="2;#Lists/Tasks/2_.000"/>
    </rs:data>
    </listitems>
    </GetListItemsResult>
    </GetListItemsResponse>')
    columns ows_MetaInfo varchar2(20) path '@ows_MetaInfo',
             ows_Title varchar2(20) path '@ows_Title',
             ows__ModerationStatus varchar2(20) path '@ows__ModerationStatus'
    OWS_METAINFO         OWS_TITLE            OWS__MODERATIONSTATUS
    1;#                  Test Title 1         0                   
    2;#                  Testing Tasks        0                   
    2 rows selected.

  • Parsing XML from a socket that does not close

    Hi -
    I've seen similar questions to this already posted, but either they did not really apply to my situation or they were not answered.
    I have to read messages from a server and process them individually, but the protocol does not indicate the message length or give any sort of terminating character. You only know you have a complete message because it will be a well formed XML fragment. To complicate matters more, there could be extra binary data preceding each XML message. I must stress that I did not write this server, and I have no influence over the protocol at all, so while I certainly agree that this is not such a good protocol, changing it is not an option.
    I'm hoping that there is a reasonable way to deal with this with an existing parser. Ironically, I don't really need to parse the XML at all, I just need to know when the current message is over but the only indication I get is that it will be the end of an XML fragment.
    I do have the ability to strip off the non-XML binary data, so if there is some way that I can give the stream to a SAX (or other) parser when I know XML is coming and have it inform me when tags begin and end, or ideally inform me when it is done a complete XML fragment, that would be perfect. I'm aware of how to do this using SAX normally, but it seems that it will not function correctly when there is no EOF or other indication that the document has ended.
    The best algorithm I have come up with (and it's pretty cheesy) is:
    1. Start with a string buffer.
    2. Append data from the socket to the buffer one byte at a time.
    3. Keep checking if there is a '<' character that is not followed by '?' or '!'. (ie - don't concern myself with the special XML elements that don't close with '/>' or </tagName>. I keep them in the buffer to pass on when I'm done though.)
    4. When I get my first tag with <tagName> I make note of what this tag is and increment a counter. If the tag is self closing, then I'm done.
    5. Anytime I see this tag I increment the counter.
    6. Anytime I see </tagName> I decrement the counter. If the counter = 0, I am done.
    7. I pass on the entire message, preceding binary data, special XML tags and the fragment to the module that actually processes it.
    This has a few problems. I'll have to go out of my way to support multiple character encodings, I'll have to be careful to catch all the special XML tags, and its quite CPU intensive to be interested in every single character that comes down the pipe (but I suppose this is not avoidable). Also, I just don't like to re-invent the wheel because I'm likely to make an error that a well established parser would not make.
    Does anyone have any suggestions for this, or know of a parser that will deal with fragments using streams that don't close?
    Thanks!

    The parser expects to read to the end of the stream. If you closed the stream right after you wrote to it, I bet it would work. You wouldn't want to close the stream though would you? Try sending the string using a DataOuputStream and calling DataOutputStream.writeUTF(String) on the client side. Then, on the server side call String str = in.readUTF() (where 'in' is a DataInputStream). Then wrap the string in a StringReader and give the StringReader to the parser as it's input source.

  • Parsing XML from a String

    I have a servlet, this recieves an XML file from the client as a file input type from a html form. This XML is wrapped up in http headers and stuff. I parse the input stream from the client's http request to get a string containing the xml. This is fine.
    How do I now build an XML document from this string? The DocumentBuilder will take in files and InputStreams but I can't find anything that helps me?
    The only solution I've come up with is to write out the string to a temp file and then parse it back into a Document.
    Any ideas anyone?????

    Document doc = documentBuilder.parse(new InputSource(new StringReader(yourXMLString)));
    voila!

Maybe you are looking for

  • Any best practise to archive PO's which does not have corresponding invoice

    Hello,          As part of initial implementation and conversion, We have a lot of PO's / LTA created but their corresponding invoices were never converted into SAP from legacy system.  SAP archiving program tags those as not business complete as the

  • How do I keep format when copying a table to keynote? paste and match style does not keep format

    how do I keep format when copying a table to keynote? paste and match style does not keep format

  • Listener registration

    Hello, I'm using Sun's Application Server. Go Sun! I declared a ServletContextListener in the deployment descriptor. When I GET requested the servlet, the server responded w/ a 404. Did I miss something?

  • Update of Distribution Status

    Dear Experts, I’m working on SRM 5.0 Server 5.5. The problem I’m facing is that when I try to re-process the Idoc from SRM to the Back-end that failed before, on the back-end the contract is correctly updated but on SRM the status of the distribution

  • Iphone 4 ..i tried everything

    i tried everything.. in imac error 2001 or 2006 on windows-base error 21.. unplug everything again and again.. 10 seconds 30 sec homebutton + the other buton sound averything ..my iphone is dead.. it shows the icon with the usb and itunes or the silv