XML Parsing in Weblogic

Hi all,
Am releatively new to weblogic and am migrating my web app from the tomcat container to weblogic 9.2
I use a XerxesImpl jar to parse my XML using a DOMParser and I dont want to use any libraries provided by weblogic atleast now!!
It always gives the SAXParserException, but the same bit of code works fine with the tomcat container.
I have also checked for the well-formedness of the xml and the xml and the dtd looks fine.
Any inputs on this would help!
Thnx
Cyrus

The solution to this being that ---
1. Whenever using the local jar file for any XML parsing such as XerxesImpl.jar the weblogic provided services may try to override it and hence must be added on to the classpath before the ap[plication is deployed.
2.Also that somtimes the pageContext.getServletContext() returns a null and hence some other means mustbe found to find the corresponding xml file.(probably loading it as an initparam)
3. Also make sure that your xml matches the dtd declarations since atomcat container doesnt validate this but the weblogic container.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Xml parsing in weblogic 6.0: can't build tree

    Environment: weblogic 6.0
    Using: xalan.jar, jaxp.jar and crimson.jar.
    (but probably conflicting with other parsers included in weblogic??)
    I have a component that reads xml file working on weblogic 5.1. When
    migrated to 6.0, it seems it starts reading but doesnt build the whole
    tree (it just reads the root node).I seems that its parsing the xml
    file as its returning node name and number of children, but
    it doesnt go further reading other nodes.
    We placed in classpath our parser specific jars before weblogic's jars
    also.
    We have double-checked our source xml and dtd, and added an XML
    Registry in weblogic's console
    We dont know what xalan version this component uses. (1.X or 2.0.d6)
    Is there any problem with xalan versions or xml registration in
    weblogic?
    Please--- HELP.. :) thanks so much in advance..

    Please post this to the XML newsgroup.
    -- Rob
    seguia wrote:
    Environment: weblogic 6.0
    Using: xalan.jar, jaxp.jar and crimson.jar.
    (but probably conflicting with other parsers included in weblogic??)
    I have a component that reads xml file working on weblogic 5.1. When
    migrated to 6.0, it seems it starts reading but doesnt build the whole
    tree (it just reads the root node).I seems that its parsing the xml
    file as its returning node name and number of children, but
    it doesnt go further reading other nodes.
    We placed in classpath our parser specific jars before weblogic's jars
    also.
    We have double-checked our source xml and dtd, and added an XML
    Registry in weblogic's console
    We dont know what xalan version this component uses. (1.X or 2.0.d6)
    Is there any problem with xalan versions or xml registration in
    weblogic?
    Please--- HELP.. :) thanks so much in advance..

  • XML Parser on UTF8

    The project I am working with is involves with UTF8 chars (ie. japanese,chinese) stored in XML file. I tried to test and use the sample XML Parser on Weblogic 7 by putting Japanese character on order.xml and ran the OrderParser.jsp then I got weird characters instead of the Japanese word.
    I saved the xml file on utf8 coding and changed the OrderParser.jsp encoding tag=utf8 too.
    If anybody can help, I appreciated much.
    Nick

    Nick,
    What progam and on what plateform are you making the xml file ?
    What is the plateform for the Weblogic ?
    If Unix, have you checked the LOCALE values ?
    Thanks for the reply,
    Nohmenn
    "Nick" <[email protected]> a écrit dans le message de news:
    [email protected]..
    The project I am working with is involves with UTF8 chars (ie.japanese,chinese) stored in XML file. I tried to test and use the sample XML
    Parser on Weblogic 7 by putting Japanese character on order.xml and ran the
    OrderParser.jsp then I got weird characters instead of the Japanese word.
    >
    I saved the xml file on utf8 coding and changed the OrderParser.jspencoding tag=utf8 too.
    >
    If anybody can help, I appreciated much.
    Nick

  • NullPointerException is weblogic xml parser

    We are using weblogic server 8.1 SP4 on HP Tru64.
    A NullPointerException is happening when parsing documents. I tried to find the source code however could not match the source version with the line numbers. Is this a problem in the message? Or a bug in the parser?
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:notificationOfApprovalResponse xmlns:ns0="http://www.auspost.com.au/elms/xml/notificationofapproval/response" elmsMailingStatementId="775507" pricingStatementNumber="0070922517">
    <notificationOfApprovalStatus>
    <code>S</code>
    <extendedCode>233</extendedCode>
    <description>ORDER_HEADER_IN has been processed successfully VBAKKOM </description>
    </notificationOfApprovalStatus>
    </ns0:notificationOfApprovalResponse>
    java.lang.NullPointerException
    at weblogic.apache.xerces.util.XMLAttributesImpl.getName(XMLAttributesImpl.java:261)
    at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:428)
    at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:877)
    at weblogic.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:569)
    at weblogic.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:727)
    at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:759)
    at weblogic.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:957)
    at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1544)
    at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
    at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
    at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
    at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
    at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
    at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
    at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
    at com.bea.xbean.store.Root$SaxLoader.load(Root.java:776)
    at com.bea.xbean.store.Root.loadXml(Root.java:1077)
    at com.bea.xbean.store.Root.loadXml(Root.java:1069)
    at com.bea.xbean.store.Root.loadXml(Root.java:1089)
    at com.bea.xbean.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:241)
    at au.com.auspost.elms.xml.notificationofapproval.response.NotificationOfApprovalResponseDocument$Factory.parse(Unknown Source)

    WLS 6.1 is not yet certifed with JDK 1.4.
    Venki wrote:
    Hi,
    Does weblogic ships it's own XML parser.
    We tried parsing an XML document using JDK1.4(default XML parser) it all worked
    well, but after deploying in weblogic container, the document didn't parse correctly.
    We are using Weblogic 6.1 sp2.
    Our weblogic runs on JDK1.4 so the JVM is same it's only the different parser
    i guess.
    Any comments , help thanx !
    Venki--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Weblogic  XML Parser ?

    Hi,
    Does weblogic ships it's own XML parser.
    We tried parsing an XML document using JDK1.4(default XML parser) it all worked
    well, but after deploying in weblogic container, the document didn't parse correctly.
    We are using Weblogic 6.1 sp2.
    Our weblogic runs on JDK1.4 so the JVM is same it's only the different parser
    i guess.
    Any comments , help thanx !
    Venki

    WLS 6.1 is not yet certifed with JDK 1.4.
    Venki wrote:
    Hi,
    Does weblogic ships it's own XML parser.
    We tried parsing an XML document using JDK1.4(default XML parser) it all worked
    well, but after deploying in weblogic container, the document didn't parse correctly.
    We are using Weblogic 6.1 sp2.
    Our weblogic runs on JDK1.4 so the JVM is same it's only the different parser
    i guess.
    Any comments , help thanx !
    Venki--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • WebLogic's High-Performance XML parser

    I understand that 6.1's high performance XML parser is the replacement of 6.0's
    custom generated parser. Per the documentation, I need to set SAXParserFactory
    to weblogic.xml.babel.jaxp.SAXParserFactoryImpl, but I couldn't find weblogic/xml/babel/jaxp/SAXParserFactoryImpl
    in either weblogic.jar or xmlx.jar. There are bunch of weblogicx/xml/babel/* in
    xmlx.jar.
    When I call JAXP code, I got this error:
    javax.xml.parsers.FactoryConfigurationError: Failed to find SAXParserFactory.
    weblogic.xml.babel.jaxp.SAXParserFactoryImpl
    javax.xml.parsers.FactoryConfigurationError: Failed to find SAXParserFactory.
    weblogic.xml.babel.jaxp.SAXParserFactoryImpl
    Am I missing something, or the 6.1 beta download forget to include the *.babel.jaxp.*
    stuff?
    Jim Zhou.

    Jim,
    Please don't use System.setProperty() in any server code. This was intended
    as an example only. I think the XMLReaderFactory is not specified in
    JAXP1.1.
    Thanks,
    Chris
    "Chris Fry" <[email protected]> wrote in message
    news:[email protected]...
    Jim,
    Here is a code fragment to acess the parser:
    System.setProperty("javax.xml.parsers.SAXParserFactory","weblogic.xml.babel.
    jaxp.SAXParserFactoryImpl");
    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser parser = factory.newSAXParser();
    parser.parse("yourfile.xml",defaultHandler);
    "Jim Zhou" <[email protected]> wrote in message
    news:[email protected]...
    I just found out that XML Registry setting on SAXParserFactory does notapply to
    XMLReaderFactory() and XMLReader:
    XMLReader parser = XMLReaderFactory.createXMLReader();
    I have to use SAXParserFactory to get High Performance Parser kicked in:
    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser parser = factory.newSAXParser();
    Is this the right behavior? Thanks for the help.
    Jim Zhou.
    "Jim Zhou" <[email protected]> wrote:
    Chris,
    Thanks for the reply. It still doesn't work. I think the problem is
    that weblogic.jar
    and xmlx.jar both does not have eihter
    "weblogicx.xml.babel.jaxp.SAXParserFactoryImpl"
    or "weblogic.xml.babel.jaxp.SAXParserFactoryImpl". So the current Beta
    download
    forgot to include the above classes. I might try download Beta again
    to see if
    any difference.
    Regards,
    Jim Zhou.
    "Chris Fry" <[email protected]> wrote:
    Jim,
    This is a mismatch between our beta and the final place that the
    parser
    will
    live in the release, you should be able to get the parser by setting
    the
    SAXParserFactory to weblogicx.xml.babel.jaxp.SAXParserFactoryImpl (it
    will
    be weblogic.xml.babel.jaxp.SAXParserFactoryImpl in the final release).
    A couple notes:
    The parser only handles standalone documents, with no entityreferences
    and
    is optimized for small to midsize documents (IE soap and wsdl type
    documents).
    Pleas let me know if you can get it to work.
    Chris
    "Jim Zhou" <[email protected]> wrote in message
    news:[email protected]...
    I understand that 6.1's high performance XML parser is the
    replacement
    of
    6.0's
    custom generated parser. Per the documentation, I need to setSAXParserFactory
    to weblogic.xml.babel.jaxp.SAXParserFactoryImpl, but I couldn't findweblogic/xml/babel/jaxp/SAXParserFactoryImpl
    in either weblogic.jar or xmlx.jar. There are bunch ofweblogicx/xml/babel/* in
    xmlx.jar.
    When I call JAXP code, I got this error:
    javax.xml.parsers.FactoryConfigurationError: Failed to findSAXParserFactory.
    weblogic.xml.babel.jaxp.SAXParserFactoryImpl
    javax.xml.parsers.FactoryConfigurationError: Failed to findSAXParserFactory.
    weblogic.xml.babel.jaxp.SAXParserFactoryImpl
    Am I missing something, or the 6.1 beta download forget to includethe
    *.babel.jaxp.*
    stuff?
    Jim Zhou.

  • Weblogic 6.1 and xml parser empty elements

    FYI, It looks like Weblogic changed there xml parser in the transition from
    6.0sp2 to 6.1. Example : The empty Extra Info Class produced and error,
    because it is empty. Where in 6.0sp2 it did not produce and error:
    <taglib>
    <tag>
    <name>indexProperty</name>
    <info>
    some info..
    </info>
    <tagclass>com.pssg.jsp.tags.IndexPropertyTag</tagclass>
    <teiclass></teiclass>
    </tag>
    </taglib>
    ####<Aug 20, 2001 12:20:52 PM PDT> <Info> <HTTP> <devlwebejb1> <camserver>
    <ExecuteThread: '14' for queue: 'default'> <> <> <101047>
    <[WebAppServletContext(7008653,cam,/cam)] resolved taglib uri '/pssglibtags'
    to taglib-location /WEB-INF/tlds/pssgtaglib.tld:>
    ####<Aug 20, 2001 12:20:53 PM PDT> <Info> <HTTP> <devlwebejb1> <camserver>
    <ExecuteThread: '14' for queue: 'default'> <> <> <101160> <Deployment
    descriptor is malformed, check against the DTD:
    org.xml.sax.SAXParseException: The content of element type "tag" must match
    "(name,tagclass,teiclass?,bodycontent?,info?,attribute*)"..>
    ####<Aug 20, 2001 12:20:53 PM PDT> <Error> <HTTP> <devlwebejb1> <camserver>
    <ExecuteThread: '14' for queue: 'default'> <> <> <101020>
    <[WebAppServletContext(7008653,cam,/cam)] Servlet failed with Exception>
    weblogic.servlet.jsp.JspException: (line 1): Error in using tag library
    uri='/pssglibtags' prefix='pssglibtag': For tag 'indexProperty', cannot load
    extra info class ''
    at
    weblogic.servlet.jsp.StandardTagLib.tld_jspException(StandardTagLib.java:901
    -Scot

    hi,
    there are two versions of ldap supported in wls6.1 , ldapv1 and ldavp2
    ldap v1 only has the functionality of listing groups.
    but where ldapv2 doesn't have that functionality,
    by looking at your config , it seems you are using ldap v2..
    if u need that functionality u can use ldapv1.
    thanks
    kiran
    "Bert Cliche" <[email protected]> wrote in message
    news:[email protected]..
    Per a proof of concept, I am having trouble getting WL6.1 to see
    group members as defined in iPlanet LDAP. I can see the groups,
    but modifies to create groups only create them in the local DB.
    Created users also only get placed in the local DB. I can bind
    for searches as Directory Manager via ldapsearch and run queries,
    and the DS gateway works fine. I can dump the LDIF file and the
    entries look fine.
    I copied and modified the template for the Netscape server and
    have the realm setup per the GUI.
    For sanity, everything is very generic as:
    the Root DN is "o=test.org"
    and my "Configuration" part from the config.xml looks like:
    server.authprotocol=simple;
    server.host=localhost;
    membership.filter=(&(uniquemember=%M)(objectclass=groupofuniquenames));
    server.port=390;
    group.dn=o=test.org;
    group.filter=(&(cn=%g)(objectclass=groupofuniquenames));
    server.principal=cn=Directory Manager;
    user.dn=o=test.org;
    server.groupiscontext=false;
    user.filter=(&(uid=%u))
    I added the "authprotocol" as a guess. Note that the server is
    running on port 390, this is not a typo.
    Any ideas what is going wrong?

  • XML Parsing Error: no element found Location:Line Number 1, Column 1:

    Hi,
    i have a servlet code in which i am using bouncy castle encryption algorithm , if i tried to run that servlet on embeded weblogic server than my servlet works fine without error.
    but if i deploy same Servlet code on SOA domain console than i get following error.
    XML Parsing Error: no element found
    Location: http://localhost:7001/Encryption-PGPEncrypt-context-root/pgpservlet
    Line Number 1, Column 1:
    Please help me friends...

    Hi Chandra,
    Based on my research, the error message is only generated by FireFox when the render page is blank in Internet. For some reason, .NET generates a response type of "application/xml" when it creates an empty page. Firefox parses the file as XML and finding
    no root element, spits out the error message.
    Also, based on your description, the other sites are opened correctly, the issue only happened in Central Administration(CA). This means the SharePoint services are working fine.
    Since this issue only occurred in the CA, it might be due the application pool for the CA is corrupted. Please try to restart the application pool for the CA to resove the issue:
    1. Open Internet Information Service(IIS)
    2. List the application pools
    3. Select the application pool used for the CA
    4. Stop it, and then start it again.
    Note, if the application pool is running in Classic mode, please change it to be Integrated mode.
    Additionally, I found a similar thread, which may help you too:
    http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/824d7dda-db03-452b-99c4-531c5c576396
    If you have any more questions, please feel free to ask.
    Thanks,
    Jin Chen
    Jin Chen - MSFT

  • Oracle.xml.parser.v2.SAXParser error

    I'm reposting this error that I recently received one more time before removing the XML transforms from my Java projects and doing them in .NET.
    Code that was working fine suddenly getting a transform error using JDeveloper.
    Get the following:
    javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser).
         at weblogic.servlet.jsp.PageContextImpl.handlePageException(PageContextImpl.java:417)
    Seems that
    <!--
    <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <h1>Project Weekly Hours Worked</h1>
    <table>
    <c:import url="HoursWorked.xml" var="xmlHoursWorked" charEncoding="windows-1252"/>
    <c:import url="./HoursWorked3.xsl" var="xslt" charEncoding="windows-1252"/>
    <x:transform xml="${xmlHoursWorked}" xslt="${xslt}" />
    </table>
    -->
    will not transform XML to HTML via XSL in JSP anymore.
    If I run the XSL i get the HTML results I expected in an HTML test page.
    So I know the XML and XSL is sound.
    XSL and DOM parsing in Java/Oracle was a major pain in the ass in the first place and now this.
    Well I've spent hours going through Oralce/Java documentation on XML, DOM and XSL transforms.
    All that time spent and still so unstable. I don't think I was ever able to really get what I wanted
    which was to transform my XML document to HTML, update via JSP and have the XML document
    be updated and ready to view in a summary page. The XML document changes were never really
    available unless I closed the app and restarted. So all in all a failure of capabilities compared to my
    use of XML in .NET.
    So........
    Me thinks it will be a good idea to take out the transforms and have my JSP use a script to invoke a
    method in a class that extracts it from a message. Just have PL/SQL interface with XML and do the
    transform or serialize thing there.
    I don't want to give up on XML but I'm tired of trying to jam a square peg into a round hole
    with Java and JDeveloper.
    Brian

    We don't support file references ("cv1_0.dtd"). Only url type references
    are supported, of the form:
    @ <!DOCTYPE cv1 SYSTEM "http://www.oracle.com/public/cv1_0.dtd>
    Note that the url should be accessible to the world without the need to authenticate.
    you could put your dtd in the "public" area in your iFS system.
    Thanks,
    Sirisha
    null

  • XML Parser Exception in Install of AIA 11.1.1.5 on SOA 11.1.1.5

    I am attempting to install AIA Foundation Pack on a SOA domain and continually encounter an XML parsing exception error as the installer is attempting to install WSM security policies. Here are the key details:
    AIA version = 11.1.1.5
    SOA Suite = 11.1.1.5
    WebLogic = 10.3.5
    Operating System = Fedora14 (a home lab machine but I don't think this is an OS issue)
    The error is encountered about 17 minutes into the lengthy process. Just before the error appears in the installation log, the following message appears indicating roughly what step is being performed:
    [zip] Building zip: /opt/oraclemw/aia11115/aia_instances/dev1/tmp/aia_security_policies.zip
    The core error messages are:
    [exec] SEVERE: WSM-01605 XML parser exception
    [exec] oracle.xml.parser.v2.XMLParseException: Expected 'EOF'.
    [exec] at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:323)
    The python modules being executed by the WLST scripting tool at the time of the failure are:
    [exec] Problem invoking WLST - Traceback (innermost last):
    [exec] File "/opt/oraclemw/aia11115/Infrastructure/Install/AID/lib/py/importpolicy.py", line 29, in ?
    [exec] File "/opt/oraclemw/oracle_common/common/wlst/wsmManage.py", line 719, in importRepository
    [exec] File "/opt/oraclemw/oracle_common/common/wlst/lib/ora_util.py", line 51, in raiseScriptingException
    [exec] OracleScriptingException: None
    Finally, the outer XML files being used as input for the deployer that seems to be running at the time are:
    /opt/oraclemw/aia11115/Infrastructure/Install/AID/AIAExecuteDriver.xml
    with references to lines 221 and 64.
    The problem occurs whether I try to use Java JDK 16.0.20 or JRockit R28.2.0 as the JRE when running the AIA installer. (The WebLogic domain is configured to use JRockit).
    Any suggestions? Is there a library conflict being picked up between different releases of XercesImpl? I would hope there isn't actually a bad XML file in the AIA artifacts or WSM (Web Service Management) policies being deployed.

    HI
    How this issue was resolved? Please explain in detail. I am facing the same issue.
    Regards
    Arun

  • XML Parsing in a Schedule Job (OIM 11g R1)

    Hi,
    I am writing a lookup recon - schedule task in OIM 11g R1 to connect to a webservice and get the lookup attribute values. Now, I am able to fetch the values in a xml format. I am facing an issue while trying to parse the xml values (tried both as a string and from a file).
    I have tried using both the SAX and the DOM parser. PFA the snippet for the DOM Parser:
                        DocumentBuilderFactory builderFactory =
                            DocumentBuilderFactory.newInstance();
                        DocumentBuilder builder = null;
                        try {
                            builder = builderFactory.newDocumentBuilder();
                        } catch (ParserConfigurationException e) {
                            e.printStackTrace();
                        org.w3c.dom.Document doc =
                            (org.w3c.dom.Document)builder.parse(file);
                        System.out.println("Parsed the xml");
                        org.w3c.dom.NodeList nodes =
                            doc.getElementsByTagName("entry");
                        System.out.println("Total Profiles fetched:: " +
                                           nodes.getLength());
    This is giving the nodes.getLength() as 0. Though the code runs fine in the Java Client (directly from eclipse)
    The snippet for the SAX method is :
                SAXParserFactory factory = SAXParserFactory.newInstance();
                SAXParser saxParser = factory.newSAXParser();
                DefaultHandler handler = new DefaultHandler() {
                    boolean bfname = false;
                    boolean blname = false;
                    boolean bnname = false;
                    boolean bsalary = false;
                    public void startElement(String uri, String localName,
                                             String qName,
                                             Attributes attributes) throws SAXException {
                        //   System.out.println("Start Element :" + qName);
                        if (qName.equalsIgnoreCase("d:Name")) {
                            blname = true;
                    public void endElement(String uri, String localName,
                                           String qName) throws SAXException {
                        //     System.out.println("End Element :" + qName);
                    public void characters(char[] ch, int start,
                                           int length) throws SAXException {
                        if (blname) {
                            System.out.println("d:Name : " +
                                               new String(ch, start, length));
                            blname = false;
                           saxParser.parse("home/oracle/UserProfiles.xml", handler);
    This is throwing a java.net.malformedurlexception: no protocol: /home/oracle/userprofiles.xml exception. I tried to pass it as "file://home/oracle/UserProfiles.xml" but then is gives a
    java.net.ConnectException: Connection refused Even this code is running fine in the Java Client when ran directly. It seems there is some weblogic configurations I am missing for the XML parsing?
    Please do help, if anyone has faced any issues parsing an xml in a Schedule job. Will highly appreciate your inputs.
    Thanks,
    Anuj.  

    Hi,
    I am writing a lookup recon - schedule task in OIM 11g R1 to connect to a webservice and get the lookup attribute values. Now, I am able to fetch the values in a xml format. I am facing an issue while trying to parse the xml values (tried both as a string and from a file).
    I have tried using both the SAX and the DOM parser. PFA the snippet for the DOM Parser:
                        DocumentBuilderFactory builderFactory =
                            DocumentBuilderFactory.newInstance();
                        DocumentBuilder builder = null;
                        try {
                            builder = builderFactory.newDocumentBuilder();
                        } catch (ParserConfigurationException e) {
                            e.printStackTrace();
                        org.w3c.dom.Document doc =
                            (org.w3c.dom.Document)builder.parse(file);
                        System.out.println("Parsed the xml");
                        org.w3c.dom.NodeList nodes =
                            doc.getElementsByTagName("entry");
                        System.out.println("Total Profiles fetched:: " +
                                           nodes.getLength());
    This is giving the nodes.getLength() as 0. Though the code runs fine in the Java Client (directly from eclipse)
    The snippet for the SAX method is :
                SAXParserFactory factory = SAXParserFactory.newInstance();
                SAXParser saxParser = factory.newSAXParser();
                DefaultHandler handler = new DefaultHandler() {
                    boolean bfname = false;
                    boolean blname = false;
                    boolean bnname = false;
                    boolean bsalary = false;
                    public void startElement(String uri, String localName,
                                             String qName,
                                             Attributes attributes) throws SAXException {
                        //   System.out.println("Start Element :" + qName);
                        if (qName.equalsIgnoreCase("d:Name")) {
                            blname = true;
                    public void endElement(String uri, String localName,
                                           String qName) throws SAXException {
                        //     System.out.println("End Element :" + qName);
                    public void characters(char[] ch, int start,
                                           int length) throws SAXException {
                        if (blname) {
                            System.out.println("d:Name : " +
                                               new String(ch, start, length));
                            blname = false;
                           saxParser.parse("home/oracle/UserProfiles.xml", handler);
    This is throwing a java.net.malformedurlexception: no protocol: /home/oracle/userprofiles.xml exception. I tried to pass it as "file://home/oracle/UserProfiles.xml" but then is gives a
    java.net.ConnectException: Connection refused Even this code is running fine in the Java Client when ran directly. It seems there is some weblogic configurations I am missing for the XML parsing?
    Please do help, if anyone has faced any issues parsing an xml in a Schedule job. Will highly appreciate your inputs.
    Thanks,
    Anuj.  

  • Parsing in Weblogic/jsp doesn't work; application-mode (command-line) works

    Hello-
    Parsing my XML file in Weblogic/jsp doesn't work, whereas it works
    in application-mode... (albeit on two different machines)
    Here are the parameters:
    server1:
    weblogic 6.0
    win2k server
    jre1.3
    my personal machine:
    ***no weblogic***
    win2k server
    jre1.3
    When I run my code as an application (command-line style) on my machine,
    parsing in my xml file works fine, and I can do a root.toString() and it
    dumps out the entire xml file, as desired.
    However, running my code inside weblogic (on server1) in JSP, parsing in
    my file and doing a root.toString() results in the following: [dmui: null]
    (where dmui is my root)
    (even though i'm running it on two different machines, i'm positive its the
    same code (the servers share a mapped drive)...
    So, I think its probably because I'm using a different parser, as
    specified by weblogic? There are no exceptions being thrown. Here's my
    (abbreviated) code, which is called either command line style or in a JSP:
    // Imports
    import org.w3c.dom.*;
    import org.w3c.dom.Document;
    import javax.xml.parsers.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    DocumentBuilderFactory docBuilderFactory =
    DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    mDocument = docBuilder.parse (inFile);
    myRoot.toString()
    -END
    Doing a System.getProperty("javax.xml.parsers.DocumentBuilderFactory")
    results in:
    server1 (weblogic/jsp):
    "weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
    my machine (application-mode):
    null
    Does anyone have any ideas about how to get this work? Do I try to set it
    up so that they both use the same parser? Do I change the Weblogic parser?
    If so, to what? And how?
    Am I even close?
    Any help would be appreciated..
    Thanks, Clint
    "[email protected]" <[email protected]> wrote in message
    news:[email protected]...
    No problem, glad you got it worked out :)
    ~Ryan U.
    Jennifer wrote in message <[email protected]>...
    I completely missed setting the property(:-o), foolish mistake. That wasit. Thanks.
    "j.upton" <[email protected]> wrote:
    Jennifer,
    Personally I would get rid of import com.sun.xml.parser.* and use xerces
    which comes with WLS 6.0 now, unless like I said earlier you have a need
    to
    use the sun parser :) Try something like this with your code --I've put
    things to watch for as comments in the code.
    import javax.xml.parsers.*;
    import org.xml.sax.SAXException;
    import org.w3c.dom.*;
    import java.io.FileInputStream;
    public class BasicDOM {
    public BasicDOM (String xmlFile) {
    try{
    FileInputStream inStream;
    Document document;
    /*You must specify a parser for jaxp. You can in a simple view
    think
    of this as being analogous to a driver used by JDBC or JNDI. If you are
    using this in the context of a servlet or JSP and have set an XML
    registry
    with the console this happens automatically. You can also invoke it in
    the
    context of an application on the command line using the -D switch. */
    System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
    >>>
    "weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
    // create a document factory
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    // specify validating or non-validating parser
    dbf.setValidating(true);
    // obtain a factory
    DocumentBuilder db = dbf.newDocumentBuilder();
    // create a document from the factory
    inStream = new FileInputStream(xmlFile);
    document = db.parse(inStream);
    }//try
    catch (Exception e)
    System.out.println("Unexpected exception reading document!"
    +e);
    System.exit (0);
    }//catch
    }//BasicDom
    // Main Method
    public static void main (String[] args) {
    if (args.length < 1)
    System.exit(1); file://or you can be more verbose
    new BasicDOM(args[0]);
    }//class
    =============================================
    That will give you a basic DOM you can manipulate and parse it fromthere.
    BTW this code
    compiled and ran on WLS 6.0 under Windows 2000.
    Let me know if this helped or you still are having trouble.
    ~Ryan U.
    "Jennifer" <[email protected]> wrote in message
    news:[email protected]...
    Actually I included com.sun.xml.parser.* as one last febble attempt toget
    it working.
    And as for source code, I included the code. If I just put that oneline
    of code
    in, including the imports, it fails giving me an error listed above inthe
    subject
    line. Here is the code again:
    package examples.xml.http;
    import javax.xml.parsers.*;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.w3c.dom.*;
    import java.util.*;
    import java.net.*;
    import org.xml.sax.*;
    import java.io.*;
    public class BasicDOM {
    static Document document;
    public BasicDOM (String xmlFile) {
    try {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    } catch (FactoryConfigurationError e){
    System.err.println(e.getException());
    e.printStackTrace();
    // Main Method
    public static void main (String[] args) {
    BasicDOM basicDOM = new BasicDOM (args[0]);

    Hi, Rob
    Does it work in WL9.2?
    It seems I do it exactly as the explained at http://edocs.bea.com/wls/docs81/programming/classloading.html - and it fails :o(.
    I try to run my app.ear with WL9.2 There are 2 components in it: webapp and mdb. The webapp/WEB-INF contains weblogic.xml:
    <weblogic-web-app>
    <container-descriptor>     
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    </weblogic-web-app>
    Mdb is expected to run in the same mode, i.e. to prefer the webapp/WEB-INF/*.jar over the parent Weblogic classloader. To do so I add the weblogic-application.xml to the app.ear!/META-INF:
    <weblogic-application>
    <classloader-structure>
    <module-ref>
    <!-- reminder: this webapp contains
    prefer-web-inf-classes -->
    <module-uri>webapp</module-uri>
    </module-ref>
    <classloader-structure>
    <module-ref>
    <module-uri>mdb.jar</module-uri>
    </module-ref>
    </classloader-structure>
    </classloader-structure>
    </weblogic-application>
    Now, when classloader-structure specified, both webabb and mdb prefer the weblogic root loader as if prefer-web-inf-classes not defined at all.

  • Abstract Method Error and XML Parsing

    I am using wl6sp1. I am parsing an XML file from within the
    servlet using jaxp1.1 and crimson.
    Following is code:
    1- SAXParserFactory spf = SAXParserFactory.newInstance();
    2- sp = spf.newSAXParser();
    3- xr = sp.getXMLReader();
    4- xr.setContentHandler(new ParseXML());
    5- xr.parse( new InputSource("Example3.xml"));
    This program works fine when execute from command line but in servlet on line
    3 it says:
    "Abstract Method Error"
    I have created XML Registry to use Crimson as XML parser rather than default.
    I think somehow wl is still using jaxp1.0 which is built in
    support in wlsp1.
    Whats wrong with the code...or what configuration i am missing???

    I'm assuming you have already put crimson.jar first in the classpath for the java
    command you use to start WebLogic. If so, have you tried putting the servlet in
    a .war file with the crimson.jar in its' WEB-INF/lib directory?
    Regards,
    Mike Wooten
    "anyz" <[email protected]> wrote:
    >
    I am using wl6sp1. I am parsing an XML file from within the
    servlet using jaxp1.1 and crimson.
    Following is code:
    1- SAXParserFactory spf = SAXParserFactory.newInstance();
    2- sp = spf.newSAXParser();
    3- xr = sp.getXMLReader();
    4- xr.setContentHandler(new ParseXML());
    5- xr.parse( new InputSource("Example3.xml"));
    This program works fine when execute from command line but in servlet
    on line
    3 it says:
    "Abstract Method Error"
    I have created XML Registry to use Crimson as XML parser rather than
    default.
    I think somehow wl is still using jaxp1.0 which is built in
    support in wlsp1.
    Whats wrong with the code...or what configuration i am missing???

  • Problem with com.sun.xml.parser.Parser

    Hi ,
    I am using weblogic 6.01.
    In my ejb class, I am parsing a String to create XmlDocument.
    I created xml registry in weblogic server.
    In my weblogic server's xml registry,
    I have com.sun.xml.parser.DocumentBuilderFactoryImpl as
    DocumentBuilderFactory
    and com.sun.xml.parser.Parser as parser.
    I am using jaxp 1.1 for all my xml related processing. All required jars are
    in the classpath.
    following is my code
    protected Document createDocument ( String a_sXmlDocument )
    try
    ByteArrayInputStream baInputStream = new ByteArrayInputStream
    (a_sXmlDocument.getBytes ());
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Document xmlDocument = builder.parse (baInputStream);
    return xmlDocument ;
    catch (
    I get following exception at builder.parse ( baInputStream )
    Can't find bundle for base name com.sun.xml.parser.resources.Messages,
    locale en
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:516)
    at com.sun.xml.parser.Parser.parse(Parser.java:284)
    at
    com.sun.xml.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java
    :95)
    at
    weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuild
    er.java:98)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:78)
    at
    com.datamap.arch.datamap.BasicTransportableDelegate.createDocument(Ba
    I would appreciate if anyone could help in this exception.
    Thank you,
    Mahendra

    Hi ,
    I am using weblogic 6.01.
    In my ejb class, I am parsing a String to create XmlDocument.
    I created xml registry in weblogic server.
    In my weblogic server's xml registry,
    I have com.sun.xml.parser.DocumentBuilderFactoryImpl as
    DocumentBuilderFactory
    and com.sun.xml.parser.Parser as parser.
    I am using jaxp 1.1 for all my xml related processing. All required jars are
    in the classpath.
    following is my code
    protected Document createDocument ( String a_sXmlDocument )
    try
    ByteArrayInputStream baInputStream = new ByteArrayInputStream
    (a_sXmlDocument.getBytes ());
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Document xmlDocument = builder.parse (baInputStream);
    return xmlDocument ;
    catch (
    I get following exception at builder.parse ( baInputStream )
    Can't find bundle for base name com.sun.xml.parser.resources.Messages,
    locale en
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:516)
    at com.sun.xml.parser.Parser.parse(Parser.java:284)
    at
    com.sun.xml.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java
    :95)
    at
    weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuild
    er.java:98)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:78)
    at
    com.datamap.arch.datamap.BasicTransportableDelegate.createDocument(Ba
    I would appreciate if anyone could help in this exception.
    Thank you,
    Mahendra

  • XML Parsing Error: no element found

    Hi,
    I'm working with BIPublisher 11g and I'm having the following error, this error occurred when I'm in the report and try to get the XML :
    XML Parsing Error: no element found
    Location: http://172.16.10.46:9704/xmlpserver/servlet/xdo
    Line Number 4, Column 1:
    And this is the DataEngine log I got:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <debugLog>
    - <msg time="2010-09-29T13:49:03.619+13:00" comp_id="bi_server1" type="NOTIFICATION" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>ReportModelContextImpl- Invoking dataengine dataprocessor..</txt>
    </msg>
    - <msg time="2010-09-29T13:49:03.817+13:00" comp_id="bi_server1" type="WARNING" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>java.lang.NullPointerException at oracle.xdo.dataengine.perf.StringPoolList.cleanup(StringPoolList.java:55) at oracle.xdo.dataengine.XMLPGEN.cleanup(XMLPGEN.java:1729) at oracle.xdo.dataengine.XMLPGEN.writeXMLDataStructure(XMLPGEN.java:220) at oracle.xdo.dataengine.XMLPGEN.processDataSet(XMLPGEN.java:1390) at oracle.xdo.dataengine.XMLPGEN.processMergedDataSet(XMLPGEN.java:1203) at oracle.xdo.dataengine.DataProcessor.processData(DataProcessor.java:365) at oracle.xdo.servlet.dataengine.DataProcessor.processData(DataProcessor.java:402) at oracle.xdo.servlet.dataengine.DataProcessor.processData(DataProcessor.java:389) at oracle.xdo.online.data.ClassicDataProcessor.process(ClassicDataProcessor.java:157) at oracle.xdo.servlet.ReportModelContextImpl.getReportXMLData(ReportModelContextImpl.java:188) at oracle.xdo.servlet.CoreProcessor.process(CoreProcessor.java:301) at oracle.xdo.servlet.CoreProcessor.generateDocument(CoreProcessor.java:87) at oracle.xdo.servlet.ReportImpl.renderBodyHTTP(ReportImpl.java:1038) at oracle.xdo.servlet.ReportImpl.renderReportBodyHTTP(ReportImpl.java:603) at oracle.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:440) at oracle.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:419) at oracle.xdo.servlet.XDOServlet.doGet(XDOServlet.java:235) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.xdo.servlet.metadata.track.MostRecentFilter.doFilter(MostRecentFilter.java:64) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:116) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.xdo.servlet.init.InitCheckingFilter.doFilter(InitCheckingFilter.java:63) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)</txt>
    </msg>
    - <msg time="2010-09-29T13:49:03.818+13:00" comp_id="bi_server1" type="NOTIFICATION" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>Data Generation Completed...</txt>
    </msg>
    - <msg time="2010-09-29T13:49:03.818+13:00" comp_id="bi_server1" type="NOTIFICATION" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>Total Data Generation Time 0.0 seconds</txt>
    </msg>
    </debugLog>
    Any suggestions.
    Thanks,

    Hi,
    I am getting the same error.
    Do we have a fix for this? The query was working fine until recently. But has started failing now with dataengine log same as above.
    Is there any solution?
    Thanks,
    Divya
    Edited by: 900143 on May 29, 2012 2:03 AM

Maybe you are looking for

  • Tiling Marks in Illustrator- PLEASE HELP

    Hi, I'm trying to tile a large graphic in Illustrator CS4. Printing it is fine. It tiles fine. The problem is getting marks on each page so I can put the thing together properly. I'm working with many sheets so I need some sort of reference for the t

  • When printing from Illustrator the document prints Black instead of Blue

    Computer is Windows 7 x64 running adobe CS6.  The printer is a HP laserjet 3800dn the driver for the printer is PCL5 but it does the same thing printing with the Postscript driver.  We have a navy blue color that prints out black for some reason. In

  • Insert a PDF as an icon in another PDF (like in Word)

    Hi, Normally in large proposals that I prepare in MS WORD, I insert PDF attachements as icons. When a reader click in the icon a PDF opens. (attached a related screen shot) Unfortunately when I convert to PDF those "files / icons" are just images.  I

  • Network Question: How Do I See the Macs from the PC?

    I'm a PC-to-Mac switcher. I'm trying to move all my activites to the Mac platform, so at the moment I'm sort've one foot in each world. One problem I have encountered is transferring files from the PC to the Macs over my network. When I'm on the Mac,

  • Cannot Update Vault in Aperture 2

    Today I started getting an error (actually 6 of them, all the same) when I try to update my vault. I am told "Aperture has detected a problem with the vault "Aperture Vault". You need to remove this vault and create a new one." When I try to update t