Using Stax XMLStreamReader on fragments?

Im trying to use XMLStreamReader to parse small XML fragments that are streamed from a server to a client.
Sometimes the fragments refer to namespaces that are defined outside the fragment and XMLStreamReader
throws an Exception:
*Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,18]*
Message: http://www.w3.org/TR/1999/REC-xml-names-19990114#ElementPrefixUnbound
Is there any way to define the namespaces and their prefixes programmatically? I dont want to disable validation.

To answer myself. Found out that I can disable namespace awarenes without disabling all validation:
     inputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.FALSE);Would still rather like to define the namespaces..

Similar Messages

  • StAX  XMLStreamReader  getTextCharacters() problem withj long strings

    Hi,
    I am reading long hexidecimal strings that are within elements in xml using StAX and with long hexidecimal strings I seem to be losing the end of these strings. I am creating XMLStreamReader and I tried using getText() and this was not returning anything but using getTextCharacters() seems to work until I get these long strings. Here is the code I am using for processing a CHARACTERS event:
    import javax.xml.stream.XMLInputFactory;
    import javax.xml.stream.XMLStreamConstants;
    import javax.xml.stream.XMLStreamException;
    import javax.xml.stream.XMLStreamReader;
    if(event == XMLStreamConstants.CHARACTERS){
    int start = reader.getTextStart();
    int length = reader.getTextLength();
    char[] textCharacters = reader.getTextCharacters();
    String text = (new String(textCharacters,start,length)).trim();
    int containsHexInt = text.indexOf("0x");
    if(currentElement.equals("attrid")){
    attributeIdString = text;
    }else if(currentElement.equals("symbol")){
    symbolString = text;
    }else if(currentElement.equals("value") && containsHexInt != -1){
    if(transactionsTimeStamp==null){ transactionsTimeStamp=DateUtil.getNowInAcFormat();
    if(staxCompoundsDocument == null){
    staxCompoundsDocument = new StAXCompoundsDocument(
    outputFileName, transactionsTimeStamp, exlusionFilePath );
    staxCompoundsDocument.outputDocumentHead();
    staxCompoundsDocument.addCompound(transTimeStamp,fileTrans,
    symbolString,attributeIdString, parseHex(text),state,userid);
    I am using jsr173_api.jar though I don't have the version number for this.
    If anyone could help me explain this it would be real help. I am guessing it may be down to using buffers under the covers for StAX but don't know exactly how this works.
    Thanks in advance
    Rob

    Thanks DrClap,
    that was the problem, having not worked with StAX before I didn't know it could behave like this :(
    So I had a look at the documentation and tried setting the IS_COALESCING property but it seems the implementation of StAX that we have doesn't support this :( and doesn't have the methods isCoalescing :( and I don't have enough influence to change that.
    So I have had to set up my looping through events like the following pseudo code :
    if event != CHARACTERS && stringBuffer.length > 0
    process characters
    make stringBuffer empty
    do some event processing
    if event == CHARACTERS
    add the characters to the string buffer
    If there is a better way of doing this I'd like to know but at least I have something that works at the moment.
    Thanks
    Rob

  • Creating XML from a POJO using StAX

    Hi Experts,
    I have a POJO and now want to create an XML which has the elements as that of the POJO using StAX.
    Can anybody please help me out.
    Thanks in advance.

    swati_pekam wrote:
    Yes I totally agree with you, had initially used JAXB....however client needs StAX to be used.. :(What? Why?
    Do you mean "client" as in "client side program"?
    In that case, the requirement is bullshit, because the receiving end of the XML doesn't know which technology is used to create it.
    Do you mean "client" as in "the people who pay me to do that"?
    In that case, the requirement is bullshit, because they should not force you to use tools that are not fit for the task ..
    Please clarify this requirement. Why exactly do you think (or does the client think) that you need to use StAX?

  • Help with simple XML reading example using StAX

    Please, could somebody help me with this issue?
    Or, could somebody point me to a comprehensive StAX tutorial?
    thanks!
    I have prepared a simple sample that looks like 'homework', but this newbie task is getting me crazy...
    I just want to store in the object Shop[] shopsArray; the next XML file, using StAX:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <shops>
        <shop>
             <name>Amazon</name>
            <code>AMZ</code>
            <url>www.amazon.com</url>
            <product>
                <book>
                    <name>Core JSF</name>
                    <code>cojsf</code>
                    <price>136</price>
                    <pages>333</pages>
                </book>
            </product>
            <product>
                <book>
                    <name>Java forr Dummies</name>
                    <code>jfd</code>
                    <price>68</price>
                    <pages>400</pages>
                </book>
            </product>
            <product>
                <video>
                    <name>Braveheart</name>
                    <code>brvh</code>
                    <price>15</price>
                    <duration>3h</duration>
                </video>
            </product>
        </shop>
         <!-- <shop>Other types of shops</shop> -->
    </shops>Having the related classes below:
    public class Shop {
         String name;
         String code;
         String url;
         Product[] productsArray;
    public class Product {
         String name;
         String code;
         String price;
    public class Book extends Product {
         String pages;
    public class Video extends Product {
         String duration;
    }

    [http://vtd-xml.sf.net|http://vtd-xml.sf.net] While I am not an expert on StAX, I think you may be interested in vtd-xml to simplify coding as it
    supports random access and XPath
    http://vtd-xml.sf.net

  • Using StAX with xslt transformations in the right way?

    Hi!
    What do I need to enable the stax functionality to transformations, and which transformer implementations is supporting this? (or is the implementation irrelevant)
    I have made the following to create a StaxSource, but is it enought?
    ---8<---
    private static XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        InputStream xmlInputStream = xmlUrl.openStream();
        XMLStreamReader xmlStreamReader = inputFactory.createXMLStreamReader( xmlInputStream );
        Source xmlSource = new StAXSource( xmlStreamReader );
    transformer.transform(xmlSource, new StreamResult(writer));
    ---8<---I'm using:
    org.apache.xalan.processor.TransformerFactoryImpland every thing seems to work very nice, but I'm not sure if I have done it in the right way and if it's something that I miss.
    If I understand it correct normal transformations is transforming the xml to a Dom-tree but with StAX it shouldn't and be more memory efficient.
    So anyone have any comments?
    /Per

    Indeed, as DrClap has already stated, using a StAXSource will not guarantee streaming. All of the mainstream XSLT processors build some sort of DOM structure internally because, in the general case, XSLT requires random access on the input document. The only exception to this is the identity transform, which in most processors is done in streaming fashion --i.e., without actually creating an intermediate structure.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Stitching/mergigng of xdps using document builder when fragments have been used in xdps.

    Hi,
    I am trying to merge xdps using document builder in LiveCycle workbench. Basiclly I am using the option "Dynamic stitching" in document builder to merge more then one xdps. So I am able to do it when my xdps are not having any fragments.
    But I am not able to get the merged xdp when fragments are there in my xdps.
    It is throwing some error.
    It says "XFA dynamic assembler failed to stitch a fragment".
    So can I specify the fragment path while merging these xdps.
    Please let me know the inputs on this. Or is there any other way to merge xdps which are having fragments.
    Thanks in advance,
    Ashish

    One probable reason is that the individual XDPs have incorrect fragment references. Have you checked out
    http://kb2.adobe.com/cps/521/cpsid_52158.html
    Any subtle mistakes in the path like a folder name specified twice in the path (as it was programmatically generated?), or an extra forward slash, etc.?
    Did you try to render these XDP forms (with fragments) individually using LiveCycle process orchestration/API?

  • Use javascript inside page fragment

    Im trying to use javascript code inside a page fragment with the tag
    af:resource
    But the second time the page reloads i got this error: "ReferenceError: funciona is not defined"
    <af:resource type="javascript">
          function funciona() {
              alert(123);
    </af:resource>
    Im using JDeveloper 12c

    The resource is added to the af:document component to be included when the document is rendered. The resource is only processed on the initial creation of the document.
    are you sure, af:resourse tag presence under af:document.?

  • Using Stax

    Hi everyone,
    I'm trying to find out if the J2 SDK supports Stax out of the box.
    So far it seems, that even Java 5 only supports DOM and SAX.
    Is this correct?
    Thanks in advance,
    Paulo Pinto

    Yes, I think StAX will become part of the Java platform in Java 6.0 (Mustang). WSDP 1.6 includes an EA implementation.

  • How to use same page fragment more than once in a page,

    Hi Gurus,
    How to use same page fragment more than once in a page. I have a complex page fragment which has lots of Bindings (Binding Property set with backingBean variables).
    I want to use the same page fragment multiple times on the same page with different tabs.
    I want different ApplicationModule Instance for the page fragment in different tabs.
    So I have created a Bounded Taskflow with pagefragments which has this complex pagefragment.
    I've dragged the taskflow to page and created regions.
    I'm able to execute the page successfully when I have only one region but fails if I have region more than once in the page.
    Can anyone help me how to resolve this issue.
    Web User Interface Developer's Guide for Oracle Application Development Framework: section 19-2 states we can have same pagefragment more than once in a page.
    Thanks,
    Satya

    java.lang.IllegalStateException: Duplicate component id: 'pt1:r1:0:t2:si5', first used in tag: 'com.sun.faces.taglib.jsf_core.SelectItemsTag'
    +id: j_id_id1
    type: javax.faces.component.UIViewRoot@1d23189
      +id: d1
       type: RichDocument[UIXFacesBeanImpl, id=d1]
        +id: j_id_id5
         type: HtmlScript[UIXFacesBeanImpl, id=j_id_id5]
          +id: j_id0
           type: javax.faces.component.html.HtmlOutputText@bc252
        +id: m1
         type: RichMessages[UINodeFacesBean, id=m1]
        +id: f1
         type: RichForm[UIXFacesBeanImpl, id=f1]
          +id: pt1
           type: RichPageTemplate[oracle.adf.view.rich.component.fragment.UIXInclude$ContextualFacesBeanWrapper@2a0cc, id=pt1]
            +id: ps1
             type: RichPanelSplitter[UIXFacesBeanImpl, id=ps1]
              +id: pt3
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1199)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag265(__projectrevenuern_jsff.java:12356)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag264(__projectrevenuern_jsff.java:12317)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag263(__projectrevenuern_jsff.java:12262)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag262(__projectrevenuern_jsff.java:12200)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag261(__projectrevenuern_jsff.java:12147)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag260(__projectrevenuern_jsff.java:12099)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag259(__projectrevenuern_jsff.java:12047)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag258(__projectrevenuern_jsff.java:11992)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag257(__projectrevenuern_jsff.java:11948)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag255(__projectrevenuern_jsff.java:11860)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag254(__projectrevenuern_jsff.java:11808)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag9(__projectrevenuern_jsff.java:510)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag8(__projectrevenuern_jsff.java:461)
         at jsp_servlet.__projectrevenuern_jsff._jspx___tag1(__projectrevenuern_jsff.java:149)
         at jsp_servlet.__projectrevenuern_jsff._jspService(__projectrevenuern_jsff.java:67)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
         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:292)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:499)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:429)
         at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:163)
         at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:184)
         at oracle.adfinternal.view.faces.taglib.region.IncludeTag.__include(IncludeTag.java:443)
         at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:153)
         at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:128)
         at oracle.adf.view.rich.component.fragment.UIXRegion.processRegion(UIXRegion.java:492)
         at oracle.adfinternal.view.faces.taglib.region.RegionTag.doStartTag(RegionTag.java:127)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag50(__projectrevenuepg_jspx.java:2392)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag49(__projectrevenuepg_jspx.java:2353)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag46(__projectrevenuepg_jspx.java:2209)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag45(__projectrevenuepg_jspx.java:2162)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag9(__projectrevenuepg_jspx.java:526)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag8(__projectrevenuepg_jspx.java:475)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag7(__projectrevenuepg_jspx.java:424)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag6(__projectrevenuepg_jspx.java:373)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag2(__projectrevenuepg_jspx.java:202)
         at jsp_servlet.__projectrevenuepg_jspx._jspx___tag1(__projectrevenuepg_jspx.java:144)
         at jsp_servlet.__projectrevenuepg_jspx._jspService(__projectrevenuepg_jspx.java:71)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
         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:292)
         at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:499)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:248)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
         at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:473)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:141)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:710)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:205)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         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:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         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:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = CAMIND1 TXID =  CONTEXTID =  TIMESTAMP = 1262712477691 
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 30000
    >
    <JMXWatchNotificationListener><handleNotification> failure creating incident from WLDF notification
    oracle.dfw.incident.IncidentCreationException: DFW-40116: failure creating incident
    Cause: DFW-40112: There was an error executing adrci commands; the following errors have been found "DIA-48415: Syntax error found in string [create home base=C:\\Documents and Settings\\tammineedis\\Application] at column [69]
    DIA-48447: The input path [C:\\Documents and Settings\\tammineedis\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr] does not contain any ADR homes
    DIA-48447: The input path [diag\ofm\defaultdomain\defaultserver] does not contain any ADR homes
    DIA-48494: ADR home is not set, the corresponding operation cannot be done
    Action: Ensure that command line tool "adrci" can be executed from the command line.
         at oracle.dfw.impl.incident.DiagnosticsDataExtractorImpl.createADRIncident(DiagnosticsDataExtractorImpl.java:708)
         at oracle.dfw.impl.incident.DiagnosticsDataExtractorImpl.createIncident(DiagnosticsDataExtractorImpl.java:246)
         at oracle.dfw.spi.weblogic.JMXWatchNotificationListener.handleNotification(JMXWatchNotificationListener.java:195)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor$ListenerWrapper.handleNotification(DefaultMBeanServerInterceptor.java:1732)
         at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:257)
         at javax.management.NotificationBroadcasterSupport$SendNotifJob.run(NotificationBroadcasterSupport.java:322)
         at javax.management.NotificationBroadcasterSupport$1.execute(NotificationBroadcasterSupport.java:307)
         at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:229)
         at weblogic.management.jmx.modelmbean.WLSModelMBean.sendNotification(WLSModelMBean.java:824)
         at weblogic.diagnostics.watch.JMXNotificationProducer.postJMXNotification(JMXNotificationProducer.java:79)
         at weblogic.diagnostics.watch.JMXNotificationProducer.sendNotification(JMXNotificationProducer.java:104)
         at com.bea.diagnostics.notifications.JMXNotificationService.send(JMXNotificationService.java:122)
         at weblogic.diagnostics.watch.JMXNotificationListener.processWatchNotification(JMXNotificationListener.java:103)
         at weblogic.diagnostics.watch.Watch.performNotifications(Watch.java:621)
         at weblogic.diagnostics.watch.Watch.evaluateLogRuleWatch(Watch.java:546)
         at weblogic.diagnostics.watch.WatchManager.evaluateLogEventRulesAsync(WatchManager.java:765)
         at weblogic.diagnostics.watch.WatchManager.run(WatchManager.java:525)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: oracle.dfw.common.DiagnosticsException: DFW-40112: failed to execute the adrci commands "create home base=C:\\Documents and Settings\\tammineedis\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr product_type=ofm product_id=defaultdomain instance_id=defaultserver
    set base C:\\Documents and Settings\\tammineedis\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr
    set homepath diag\ofm\defaultdomain\defaultserver
    create incident problem_key="BEA-101020 [HTTP]" error_facility="BEA" error_number=101020 error_message="null" create_time="2010-01-05 12:27:58.155 -05:00" ecid="0000INzXpbB7u1MLqMS4yY1BGrHn00000K"
    Cause: There was an error executing adrci commands; the following errors have been found "DIA-48415: Syntax error found in string [create home base=C:\\Documents and Settings\\tammineedis\\Application] at column [69]
    DIA-48447: The input path [C:\\Documents and Settings\\tammineedis\\Application Data\\JDeveloper\\system11.1.1.2.36.55.36\\DefaultDomain\\servers\\DefaultServer\\adr] does not contain any ADR homes
    DIA-48447: The input path [diag\ofm\defaultdomain\defaultserver] does not contain any ADR homes
    DIA-48494: ADR home is not set, the corresponding operation cannot be done
    Action: Ensure that command line tool "adrci" can be executed from the command line.
         at oracle.dfw.impl.incident.ADRHelper.invoke(ADRHelper.java:1052)
         at oracle.dfw.impl.incident.ADRHelper.createIncident(ADRHelper.java:786)
         at oracle.dfw.impl.incident.DiagnosticsDataExtractorImpl.createADRIncident(DiagnosticsDataExtractorImpl.java:688)
         ... 19 moreI get the above Error.
    I have checked the bindings and it has 2 instances of the taskflow.
    I have changed the backingbean scope to backingBean

  • Use of StAX

    I tried to use StAX to modify a big XML file and I used the example EventProducerConsumer to start, as it implemented the same process I needed.
    After some strange random failures I discovered that for big files you cannot use a FileInputStream to read the Xml file, as in the example (at leas in a Windows environment) . Using a FileReader I was able to process quickly a many big files (the dimension is limited only by the heap).
    I don't know if in this was already noticed, as the FileInputStream works fine for small/medium sized file. So, just in case ......
    Marco Pancotti

    I tried to use StAX to modify a big XML file and I used the example EventProducerConsumer to start, as it implemented the same process I needed.
    After some strange random failures I discovered that for big files you cannot use a FileInputStream to read the Xml file, as in the example (at leas in a Windows environment) . Using a FileReader I was able to process quickly a many big files (the dimension is limited only by the heap).
    I don't know if in this was already noticed, as the FileInputStream works fine for small/medium sized file. So, just in case ......
    Marco Pancotti

  • Read only part of a document with Stax

    Hi,
    I have some huge documents (~5GB) and I use Stax to read them.
    My problem: I want to load only a part of the document.
    I know the location that I should put the inputStream, so I skip half of the file.
    Then I push data using xmlReader.hasNext(). After the first iteration though, I get the exception ->
    javax.xml.stream.XMLStreamException: ParseError at [row,col]:[34,4]
    Message: The markup in the document following the root element must be well-formed.
    The original xml is like that:
    <root>
    <element id=1>
    </element>
    <element id=2>
    </element>
    <element id=3>
    </element>
    </root>And I pass to the xmlStreamReader
    <element id=2>
    </element>
    <element id=3>
    </element>So, I know why I get it. Because I include in the input stream only a part.
    When it tries to read the element with id=3 , it says not well formed document.
    which on one hand is correct, but on the other hand not important for me.
    any possible solutions? How to disable the check of xmlstream reader or I don't what.
    no, I cannot wrap a part of a 5Gb file to something else...That's not the point. It will be to slow...
    That why I want to skip so much data in first place, to make it quick.
    The problem is so annoying and a little bit stupid.
    A solution would be to write my own parser, instead of using the XMLStreamReader, but then again, this is stupid, dirty, and duplicate of efforts...
    -------part of the code--------
    FileInputStream inputStream = new FileInputStream(filename);
    inputStream.skip(skipBytes);
    xmlReader = xmlif.createXMLStreamReader(filename, inputStream);
            while (xmlReader.hasNext() && parsingComplete == false) {
                xmlReader.next();
                if (xmlReader.isStartElement()) {
                    parseStartElement(xmlReader);
                    continue;
            }Thanks for the help and any opinions.
    Andreas

    Following the tip about creating a new input stream, I've create a class that extends the FileInputStream, and now it works.
    Extending just the InputStream was really slow. (remember the documents are huge "string" files)
    The code:
    XMLInputFactory xmlif = XMLInputFactory.newInstance();
    xmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);
    RootElementAppenderFileInputStream skippedInputStream = new RootElementAppenderFileInputStream(file, skipBytes);
    xmlReader = xmlif.createXMLStreamReader(file.getAbsolutePath(), skippedInputStream);
    while (xmlReader.hasNext() && parsingComplete == false) {
        xmlReader.next();
        if (xmlReader.isStartElement()) {
            parseStartElement(xmlReader);
    public class RootElementAppenderFileInputStream extends FileInputStream {
        private ByteArrayInputStream rootElemStreamStart;
        private boolean readingRoot = true;
        public RootElementAppenderFileInputStream(File file, long skipBytes) throws FileNotFoundException, IOException {
            super(file);
            this.rootElemStreamStart = new ByteArrayInputStream("<O>".getBytes());
            this.skip(skipBytes);
        public int read() throws IOException {
            if (readingRoot) {
                int result = rootElemStreamStart.read();
                if (result == -1) {
                    readingRoot = false;
                } else {
                    return result;
            return super.read();
    }

  • StAX or SAX??

    Hi everybody,
    I�ve got an SOAP-Message stored in a byte-array data:
    // copy the data (SOAP) from udp packet
    byte[] data = new byte[packet.getLength()];
    System.arraycopy(packet.getData(), packet.getOffset(), data, 0, packet.getLength());Now I like to have the SOAP-Envelope of the SOAP-Message. Does it make more sense to use StAX or SAX for this job??? How would the solution (with the byte-array) be realized??
    Thanks for your help,
    Chris

    Ok, it works fine with StAX and xmlbeans:
    byte[] data = new byte[packet.getData().length];
    data = packet.getData();
    try {
        XmlObject xobj = Factory.parse(new String(data));
        XMLStreamReader xmlreader = XMLInputFactory.newInstance()
                             .createXMLStreamReader(xobj.newReader());
        StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
        SOAPEnvelope envelope = (SOAPEnvelope)   
                                             builder.getDocumentElement();
    } catch (Exception e) {
        e.printStackTrace();
    }Greetz,
    Chris

  • StAX parser does not handle UTF-8 byte order mark

    Hello,
    i am playing around with the reference implementaion of the StAX API using the XMLStreamReader.
    When i parse UTF-8 encoded xml files with the UTF-8 byte order mark i get the following exception when the method next() is called on the reader instance:
    javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,7]
    Message: processing instruction can not have PITarget with reserveld xml name
         at com.bea.xml.stream.MXParser.parsePI(MXParser.java:2734)
         at com.bea.xml.stream.MXParser.parseProlog(MXParser.java:1775)
         at com.bea.xml.stream.MXParser.nextImpl(MXParser.java:1717)
         at com.bea.xml.stream.MXParser.next(MXParser.java:1180)
    The XMLStreamReader is created on a FileInputStream.
    When parsing xml's without a byte order mark, parsing works without any problems.
    Any idea how to solve this problem, or is this an internal problem of the StAX implementation.
    Thanks for help.
    Jörg Eichhorn

    Issue related to handling the BOM were fixed as part of the 10g project which added NLS Support to the protocols. I just verified that an UTF8 file containing BOM is correctly processed via FTP in 10.1.0.2.0

  • XML StAX - How to extract text and elements?

    Hello,
    I'm using StAX to parse this XML document (heavily reduced):
    <?xml version="1.0" encoding="utf-8"?>
    <html>
      <head>
        <title>Foo</title>
      </head>
      <body>
        <p>loading ...</p>
      </body>
    </html>I need to extract the data between the <body> element i.e "<p>loading...</p>". My problem is that I can only find methods that extracts the text and not the elements. Is there an easy way to do this using the XMLStreamReader instance, or do I have to use another class?
    Thanks

    Thanks for your reply. But does that really mean that I have to create my own method, which will collect both text and elements information in a StringBuffer as I parse through the enclosing element? I just think it is strange that there isn't a convenient method to extract all data (text & elements) between one element.
    Something like this?:
    private void handleBody(XMLStreamReader parser,XMLEventAllocator allocator) throws XMLStreamException {
              StringBuffer body = new StringBuffer();               
              while(true){
                   String value = null;
                   parser.next();               
                   if (parser.getEventType() == XMLStreamConstants.START_ELEMENT){
                        String name = parser.getLocalName();
                        if (!name.equalsIgnoreCase("body")){
                             StartElement startElement = getXMLEvent(allocator,parser).asStartElement();                         
                             value = startElement.toString();
                   else if (parser.getEventType() == XMLStreamConstants.END_ELEMENT){
                        String name = parser.getLocalName();
                        if (name.equalsIgnoreCase("body")){
                             break;
                        else{                         
                             EndElement endElement = getXMLEvent(allocator,parser).asEndElement();                         
                             value = endElement.toString();
                   else if (parser.hasText()){                    
                        value = parser.getText();
                   if (value != null){
                        body.append(value);               
         }

  • StAX getTextCharacters error

    Hi I am reading long hexidecimal strings that are within elements in xml using StAX and with long hexidecimal strings I seem to be losing the end of these strings. I am creating XMLStreamReader and I tried using getText() and this was not returning anything but using getTextCharacters() seems to work until I get these long strings. Here is the code I am using for processing a CHARACTERS event:
    import javax.xml.stream.XMLInputFactory;
    import javax.xml.stream.XMLStreamConstants;
    import javax.xml.stream.XMLStreamException;
    import javax.xml.stream.XMLStreamReader;
    if(event == XMLStreamConstants.CHARACTERS){
    int start = reader.getTextStart();
    int length = reader.getTextLength();
    char[] textCharacters = reader.getTextCharacters();
    String text = (new String(textCharacters,start,length)).trim();          
    int containsHexInt = text.indexOf("0x");
    if(currentElement.equals("attrid")){
    attributeIdString = text;
    }else if(currentElement.equals("symbol")){
              symbolString = text;
    }else if(currentElement.equals("value") && containsHexInt != -1){
    if(transactionsTimeStamp==null){                transactionsTimeStamp=DateUtil.getNowInAcFormat();
    if(staxCompoundsDocument == null){
    staxCompoundsDocument = new StAXCompoundsDocument(
         outputFileName, transactionsTimeStamp, exlusionFilePath );     
    staxCompoundsDocument.outputDocumentHead();
    staxCompoundsDocument.addCompound(transTimeStamp,fileTrans,
    symbolString,attributeIdString, parseHex(text),state,userid);
    I am using jsr173_api.jar though I don't have the version number for this.
    If anyone could help me explain this it would be real help. I am guessing it may be down to using buffers under the covers for StAX but don't know exactly how this works.
    Thanks in advance
    Rob

    WE received the following error:
    ARP_STAX_121 invalid after applying patch FIN_PF.G.
    Metalink note 5209321 suggests workaround but the problem is we have got around 40 operating units, we need to do it manually for all of them. I am wondering is there any single script so that we can run it from the backend to resolve the issue.
    Do you get the same error in the doc when you compile the package? If yes, and you still need the script then you have to contact Oracle support for the fix.
    Thanks,
    Hussein

Maybe you are looking for

  • I would like to be able to open a new Window everytime and not a tab.

    Hello and thanks if you can help. I'm using 3.5 only because of the way latter versions place the new tab first under FILE, While in the older versions place it as your first choice. It's hard for some people to change, I one. I never open tabs I onl

  • RFC Server - Can't get to work

    I will prefice this by saying I am an ABAP developer with very little VB.Net experience.  Basically I am trying to write an application that will be called from SAP, perform a routine and return some values back to SAP.  In order to prepare for this

  • How to rearrange page search

    Hi, I have a PDF document where, on one PDF page, there is the equivalent of 4 pages.  In other words, PDF page 1 will contain 4 pages of a real book, PDF page 2 will contain the following 4, etc. If i search for page 2, for instance, PDF will send m

  • Best export setting for video taken with an iPhone 4?

    Whats the best way to do it and keep all the quality? Any presets i could have?

  • Data Integrator 12.1.0.0 java.lang.UnsatisfiedLinkError: Can't load Library

    Hi Experts, I'm having an issue running cmsCollector.cmd. I run it in the command prompt and am presented with the following error: java.lang.UnsatisfiedLinkError: Can't load Library %LINK_DIR%]BusinessObjects Enterprise 12.0\win32_x86\zlib.dll at ja