Org.xml.sax, Interface ContentHandler
Hi all,
In the above interface, we have startElement method. The API says:
"This event allows up to three name components for each element:
the Namespace URI;
the local name; and
the qualified (prefixed) name.
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default). "
Can sb. please tell me:
- what does it mean when it says: "namespaces property is true and when it's false"?
- what's the difference bet. the local name; and the qualified (prefixed) name?
Thank you all. Any help is greatly appreciated.
For the first part, I think thiere is a type in the API, and it should read "feature" not "property", In the code you would have something likeparser.setFeature("http://xml.org/sax/features/namespaces", true);
[/code[
I got this from http://xml.apache.org/xerces2-j/features.html
As for local vs. qualified name - it escapes me for the moment
Similar Messages
-
Org.xml.sax.SAXParseException with XML Report Publish
Anyone see the following error in XML Report Publisher? This happened after I ran Employee W2 XML Interface and ran XML Report Publisher for the output of the PDF output.
--XDOException
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.apps.xdo.common.xml.XSLT10gR1.invokeParse(XSLT10gR1.java:570)
at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:235)
at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:182)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1665)
at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:975)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5936)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3459)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3548)
at oracle.apps.xdo.oa.cp.JCP4XMLPublisher.runProgram(JCP4XMLPublisher.java:684)
at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
Caused by: org.xml.sax.SAXParseException: <Line 268, Column 6>: XML-20109: (Fatal Error) PI with the name 'xml' can occur only in the beginning of the document.
at oracle.xdo.parser.v2.XMLError.flushErrorHandler(XMLError.java:441)
at oracle.xdo.parser.v2.XMLError.flushErrors1(XMLError.java:303)
at oracle.xdo.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:305)
at oracle.xdo.parser.v2.XMLParser.parse(XMLParser.java:289)
... 17 more
Thanks.We are going to user Employee W-2 PDF.
-
Hi,
I,'m using c.tld tag libraries from Yakarta in order to use c:if functions.
When I use non-unicode characters in my JSP pages, it crashes:
java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected
the page: "org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x80)
was found in the CDATA section., "
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:124)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:353)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:211)
at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:149)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:521)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:351)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
How can I force it to use ISO-8859-1? All my tries haven't work. What should I
do? The c.tld libraries and jars are taken from JDK 1.4.1_02
Hi Stefan,
This is my source xml in moni..
xmlns:prx="urn:sap.com:proxy:ECP:/1SAI/TAS5BFDF495190544E4B506:701:2008/06/06">
<SiteId>0080</SiteId>
<UCC>42027519 91029010015</UCC>
My interface is SAP(Proxy) to Database(Synchronous).
SAP (PROXY) --> PI --> DATABASE ( Synchronous Communication )
Let me know if u need any information from my side...
Thanks for ur help...
Thanks,
Siva.. -
Hi,
I am running Jdeveloper 9.0.3.1 and using embedded OC4J.
Getting following error when trying to run the application. Please help me if you can.
Thanks
Tareq
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:90)
at net.sundog.struts.ActionFinderPlugIn.parseHtmlFiles(ActionFinderPlugIn.java:76)
at net.sundog.struts.ActionFinderPlugIn.searchDirectory(ActionFinderPlugIn.java:64)
at net.sundog.struts.ActionFinderPlugIn.init(ActionFinderPlugIn.java:50)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1156)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpApplication.loadServlet(HttpApplication.java:1956)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpApplication.findServlet(HttpApplication.java:4355)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2750)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:617)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)try to look on xml.apache.org for this error. There should be some pages describing how and why setup this property.
Basically, these properties defines factories for javax extensions. javax defines interfaces and providers than supply implementations, so for example you can use different XML parsers implementations (we use Xalan for one OC4J container and original ORACLE parser for other). To bind this together they use some defined mechanism like setting system property of including special manifest file etc. (I don't know about details)
Myrra -
XML parsing - org.xml.sax.driver not specified
I am attempmtping to parse my first XML document and get the following excpetion when running my prog.
org.xml.sax.SAXException: System property org.xml.sax.driver not specified.
I am following the examples in the O'Reilly Java and XML book but suspect I am missing something obvious.
This is the offending line of code:
XMLReader xr = XMLReaderFactory.createXMLReader();
Any help will be appreciated.You need to set a property for your class that invokes your SAX handler. This is the property you need to set
org.xml.sax.driver=???
Where ??? is the name of the package where your SAXparser lives.
for example, my sax driver is in:
org.xml.sax.driver=org.apache.xerces.parsers.SAXParser
(see code below)
Also, a sweet reference is Elliot Rusty Harold's "XML processing with Java", which answered all the practical questions I had -- really! And is free, online.
http://www.ibiblio.org/xml/books/xmljava/chapters/index.html
This is the code for main() where my xml handler is invoked
try
{ SpiderHandler spiderHandler = new SpiderHandler(testSpider);
XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setContentHandler(spiderHandler);
for (int i=4; i<args.length; i++)
{ FileReader xmlScript = new FileReader(args);
System.out.println("Input file number "+i+" named "+args[i]);
// org.xml.sax.XMLReader.parse(InputSource) interface
// see org.xml.sax.InputSource class
reader.parse(new InputSource(xmlScript));
catch(Exception e)
{ System.out.println("Error encountered in parsing from main(). \n");
e.printStackTrace();
Luck to you! XML is a joy. -
System property org.xml.sax.driver not specified
I'm getting the error:
System property org.xml.sax.driver not specified
How do I set this property? Why doesn't it find the default?
I'm using WL6.0
Imports:
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
Code Snippet:
try
File stylesheet = new File("LaborDistHours.xsl");
LaborDistHours ldh = new LaborDistHours("1041410011",
"01-feb-2000", "30-mar-2000");
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader reportXML = new StringReader( ldh.getReportXML() );
document = builder.parse(new InputSource( reportXML ));
TransformerFactory tFactory = TransformerFactory.newInstance();
StreamSource stylesource = new StreamSource(stylesheet);
Transformer transformer = tFactory.newTransformer(stylesource);
//error occurs here
DOMSource source = new DOMSource(document);
StringWriter reportXLST = new StringWriter();
StreamResult result = new StreamResult(reportXLST);
transformer.transform(source, result);
Steven Ford ([email protected])
"...That we here highly resolve that these dead shall not have died in
vain - that this nation, under God, shall have a new birth of Freedom - and
that Government of the people, by the people and for the people shall not
perish from the earth." Abraham Lincolntry to look on xml.apache.org for this error. There should be some pages describing how and why setup this property.
Basically, these properties defines factories for javax extensions. javax defines interfaces and providers than supply implementations, so for example you can use different XML parsers implementations (we use Xalan for one OC4J container and original ORACLE parser for other). To bind this together they use some defined mechanism like setting system property of including special manifest file etc. (I don't know about details)
Myrra -
How to get the position of a tag in XML,when i am using the org.xml.sax
Hi,
I am able to parse a xml document.I want to get the position of a tag in the document.So that by keeping that as reference, i can access other tags.Plz help me.I am using org.xml.sax API.Hello Friends
After research , I could also find another way to check the existence of a node .We can even use CHOOSE to check the existence.
<xsl:choose>
<xsl:when test="(/mynode)">
your action if the mynode is found
</xsl:when>
<xsl:otherwise>
action if mynode is not found
</xsl:otherwise>
</xsl:choose>
Thanks.
Wishes
Richa -
Org.xml.sax error content not allowed in prolog
Hi,
I am running Jetty 6.x on SUSE and there is a webapp called pyjasper i am trying to run on it. the context maps fine and it displays the content however, when i use the applet in the webapp to create a report (.jasper) it gives me a org.xml.sax Parse exception: content not allowed in prolog.
A little part of the error is pasted below:
generating report /tmp/pyJasper/compiled-reports/6390c37d0ea810c7fae3e647c2f86817.jasper
Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.commons.digester.Digester.parse(Digester.java:1647)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:239)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
2010-03-04 09:15:59.073::WARN: /pyJasper/jasper.py
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:214)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
I am guessing this is some sort of an error in xml parsing. I found couple of solutions on sun java forums but none of them worked for me. Right now I am trying to figure out whether this is being caused by the applet or the java itself.
Apparently other people who use this applet do not have a problem and they have the exact same files as me. So I am not sure what exactly is causing tihs problem. Bit of a noob.
Any help would be greatly appreciated.
THANK YOU VERY MUCH!!!! :)Hi thanks you very much for the reply.
In my message I forgot to mention that I edited my prologs to "<?xml version = "1.0" encoding = "UTF-8"?>" and the jetty.xml that has the server configuration has:
<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
I apologize for the clarity of my message. I meant to say that I was wondering whether the problem is with the xm files that java has, or the xml files that are in the pyjasper package that I downloaded?
I also checked for byte order mark using hex editor to see if those six characters were in front of my xml files. None of the files in the pyjasper package had the BOM so that solution did not work.
Is there something wrong with the above xml prolog?
I have been reading tons of different posts and stuf trying to figure this out for the past month but juts cannot seem to get it to work.
Thanks. -
this is an error I get, i tried everything to solve it, please help
org.xml.sax.SAXParseException: com.sun.xml.parser/P-067
at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
at com.sun.xml.parser.Parser.fatal(Parser.java:2805)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:493)
at com.sun.xml.parser.Parser.parse(Parser.java:284)
at ParseXML.readFile(ParseXML.java:56)
at ParseXML.getXMLData(ParseXML.java:40)Googling I get this....
P-067 = Document root element is missing. -
hi
using tomcat 4
and jdf1.5
i am getting bellow error
org.xml.sax.SAXParseException: Document root element "taglib", must match DOCTYPE root "null".Check your web.xml once again.
-
Org.xml.sax.SAXParseException: Content is not allowed in prolog.
Hi All,
Currently i m doing some practice on JSTL and following few examples from this link http://java.sun.com/developer/technicalArticles/javaserverpages/faster/
while doing xml-ex1.jsp
This is xml-ex1.jsp code
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<html>
<head>
<title>JSTL Support for XML</title>
</head>
<body bgcolor="#FFFFCC">
<h3>Books Info:</h3>
<c:set var="xmltext">
<books>
<book>
<title>Book Title A</title>
<author>A. B. C.</author>
<price>17.95</price>
</book>
<book>
<title>Book Title B</title>
<author>X. Y. Z.</author>
<price>24.99</price>
</book>
</books>
</c:set>
<x:parse xml="${xmltext}" var="output"/>
<b>The title of the first book is</b>:
<x:out select="$output/books/book[1]/title"/>
<br>
<b>The price of the second book</b>:
<x:out select="$output/books/book[2]/price"/>
</body>
</html>
While running jsp page i m getting follwing error
SEVERE: Servlet.service() for servlet jsp threw exception
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227)
at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193)
at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199)
at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206)
at org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138)
at org.apache.jsp.jsp.xml_002dex1_jsp._jspx_meth_x_parse_0(org.apache.jsp.jsp.xml_002dex1_jsp:152)
at org.apache.jsp.jsp.xml_002dex1_jsp._jspService(org.apache.jsp.jsp.xml_002dex1_jsp:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
NOTE :- I m using Tomcat 5.5.14 .
Please help me out how to resolve this problem
Thanks & Regards
Rupesh KumarFrom what I understand, it has nothing to do with your JSP and all to do with the XML it's supposed to parse. It sounds malformed. Check the first tag.
-
Org.xml.sax.SAXException: Deserializing parameter
Hi,
I am trying to consume a webservice using axis. I am using Spring to call the webservice. When i am doing this i am able to get a response XML, but unfortunately there was an error stating deserializing of the object is failed.
Here are my logger statements.
**DEBUG 12:29:52,099 [TP-Processor23] org.apache.axis.transport.http.HTTPSender - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><counterResponse xmlns="http://www.example.org/vantage/"><checkBox xmlns="">true</checkBox><terms xmlns="">oh my god... check box is clicked ..</terms></counterResponse></soapenv:Body></soapenv:Envelope>** DEBUG 12:29:52,105 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(exit00)
DEBUG 12:29:52,110 [TP-Processor23] org.apache.axis.transport.http.HTTPSender - Exit: HTTPDispatchHandler::invoke
DEBUG 12:29:52,115 [TP-Processor23] org.apache.axis.SimpleChain - Exit: SimpleChain::invoke
DEBUG 12:29:52,120 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(semanticCheck00)
DEBUG 12:29:52,126 [TP-Processor23] org.apache.axis.handlers.soap.MustUnderstandChecker - Doing SOAP semantic checks...
DEBUG 12:29:52,131 [TP-Processor23] org.apache.axis.SOAPPart - Enter: SOAPPart::getAsSOAPEnvelope()
DEBUG 12:29:52,136 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(currForm)
DEBUG 12:29:52,141 [TP-Processor23] org.apache.axis.SOAPPart - current form is FORM_SOAPENVELOPE
DEBUG 12:29:52,147 [TP-Processor23] org.apache.axis.client.AxisClient - Exit: AxisClient::invoke
DEBUG 12:29:52,152 [TP-Processor23] org.apache.axis.SOAPPart - Enter: SOAPPart::getAsSOAPEnvelope()
DEBUG 12:29:52,157 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(currForm)
DEBUG 12:29:52,162 [TP-Processor23] org.apache.axis.SOAPPart - current form is FORM_SOAPENVELOPE
DEBUG 12:29:52,167 [TP-Processor23] org.apache.axis.client.Call - Exit: Call::invoke()
DEBUG 12:29:52,171 [TP-Processor23] org.apache.axis.SOAPPart - Enter: SOAPPart::getAsSOAPEnvelope()
DEBUG 12:29:52,176 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(currForm)
DEBUG 12:29:52,181 [TP-Processor23] org.apache.axis.SOAPPart - current form is FORM_SOAPENVELOPE
DEBUG 12:29:52,191 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(pushHandler00)
DEBUG 12:29:52,197 [TP-Processor23] org.apache.axis.encoding.DeserializationContext - Pushing handler org.apache.axis.message.RPCHandler@f81d1c
DEBUG 12:29:52,201 [TP-Processor23] org.apache.axis.encoding.DeserializationContext - Enter: DeserializationContext::startPrefixMapping(, http://www.example.org/vantage/)
DEBUG 12:29:52,206 [TP-Processor23] org.apache.axis.utils.NSStack - NSPush (32)
DEBUG 12:29:52,211 [TP-Processor23] org.apache.axis.utils.NSStack - NSPush (32)
DEBUG 12:29:52,215 [TP-Processor23] org.apache.axis.encoding.DeserializationContext - Exit: DeserializationContext::startPrefixMapping()
DEBUG 12:29:52,220 [TP-Processor23] org.apache.axis.encoding.DeserializationContext - Enter: DeserializationContext::startElement(http://www.example.org/vantage/, counterResponse)
DEBUG 12:29:52,225 [TP-Processor23] org.apache.axis.message.RPCHandler - Enter: RPCHandler.onStartChild()
DEBUG 12:29:52,231 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(typeFromAttr00)
DEBUG 12:29:52,236 [TP-Processor23] org.apache.axis.message.RPCHandler - Type from attributes is: null
DEBUG 12:29:52,245 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(noDeser01)
DEBUG 12:29:52,250 [TP-Processor23] org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(exception00)
ERROR 12:29:52,255 [TP-Processor23] org.apache.axis.client.Call - Exception:
org.xml.sax.SAXException: Deserializing parameter 'counterResponse': could not find deserializer for type {http://www.example.org/vantage/}counterResponse
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:277)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
Any small help is most appreciated.If you have not specified an external WSDL file in your webservice where the arguments (with their types are defined) then you cannot use the type="any" in your webservice arguments.
If you want to use an external WSDL and define the argument types there you can do this by adding wsdlfile="nameOfExternal.wsdl" style="document" to your cfcomponent tag. -
Hi All,
I created a following program using "GetReportDefintion" method provided by BI Publisher Web Services
package bip_webservices;
import com.oracle.xmlns.oxp.service.PublicReportService.ItemData;
import com.oracle.xmlns.oxp.service.PublicReportService.ReportRequest;
import com.oracle.xmlns.oxp.service.PublicReportService.ReportResponse;
import com.oracle.xmlns.oxp.service.PublicReportService.ParamNameValue;
import com.oracle.xmlns.oxp.service.PublicReportService.ReportDefinition;
import com.oracle.xmlns.oxp.service.PublicReportService.ScheduleRequest;
import com.oracle.xmlns.oxp.service.PublicReportService.DeliveryRequest;
import com.oracle.xmlns.oxp.service.PublicReportService.EMailDeliveryOption;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.rmi.RemoteException;
import java.util.Calendar;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import java.net.URL;
public class BIP_GetReportDefinition {
public static void main(String[] args) throws ServiceException, MalformedURLException, RemoteException{
try{
final String bipEndpoint = "http://localhost:9704/xmlpserver/services/PublicReportService?wsdl";
final String bipNamespace = "http://xmlns.oracle.com/oxp/service/PublicReportService";
final String xdofile = "/MyReports/SummaryCustomerReport/SummaryCustomerReport.xdo";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(bipEndpoint));
System.out.println("BEGIN TESTING getReportDefinition");
// register the ReportDefinition class
QName reportDef = new QName(bipNamespace, "ReportDefinition");
call.registerTypeMapping(ReportDefinition.class, reportDef,
BeanSerializerFactory.class, BeanDeserializerFactory.class);
// register the ParamNameValue class
QName nmvals = new QName(bipNamespace, "ParamNameValue");
call.registerTypeMapping(ParamNameValue.class, nmvals, BeanSerializerFactory.class, BeanDeserializerFactory.class);
call.setOperationName(new QName(bipNamespace, "getReportDefinition"));
call.addParameter("reportAbsolutePath", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("userID", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("password", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnClass(ReportDefinition.class);
// issue the request
ReportDefinition reportDefn = (ReportDefinition) call.invoke(
new Object[] { xdofile, "Administrator", "Administrator"});
System.out.println("Report Definition Returns with \n Default Output Format = " + reportDefn.getDefaultOutputFormat());
ParamNameValue params [] = reportDefn.getReportParameterNameValues();
if (params != null) {
for (int i = 0; i < params.length; i++) {
System.out.print("Parameter " + params.getName() + ":");
if (params[i].getValues() != null) {
for (int j = 0; j < params[i].getValues().length; j++)
System.out.print(" " + params[i].getValues()[j]);
} else
System.out.print(" null");
System.out.println(" - multiple values? " + params[i].isMultiValuesAllowed());
System.out.println("END TESTING getReportDefinition");
}catch(Exception e){
e.printStackTrace();
I am getting following exception message. Anyone has any ideas what could be the mistake ?
SEVERE: Exception:
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
{http://xml.apache.org/axis/}hostname:mildh0228
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2470)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
... 3 moreThanks for giving this problem a look.
-SookieHi Sookie,
I found the problem is with couple of child parameters are not registered the deserializer. There're couple of additional classes needs to be registerd.
// register the TemplateLabelValue class
QName templateval = new QName(bipNamespace, "TemplateFormatLabelValue");
Class cls = TemplateFormatLabelValue.class;
call.registerTypeMapping(cls, templateval, BeanSerializerFactory.class, BeanDeserializerFactory.class);
// register the TemplateLabelValues class
QName templatevals = new QName(bipNamespace, "TemplateFormatsLabelValues");
cls = TemplateFormatsLabelValues.class;
call.registerTypeMapping(cls, templatevals, BeanSerializerFactory.class, BeanDeserializerFactory.class);
Could you please give it a try?
Thanks.
Yang -
Hi
I've written a Java web service using WLW7.0.1. I now want to test it using SOAP
RPC from a Java client. Having written the client, I get a "org.xml.sax.SAXParseException:
Missing whitespace before SYSTEM literal URI" exception when I run it.
Has anyone else come across this exception, or am I missing something glaringly
obvious?!!!
Thanks
TimHi Tim,
Could you post the entire traceback?
Also, you might try the verify utility against the WSDL just as a check:
http://webservice.bea.com/wsdlVerify.zip
You are using clientgen to build the client?
HTHs,
Bruce
Tim Dickson wrote:
>
Hi
I've written a Java web service using WLW7.0.1. I now want to test it using SOAP
RPC from a Java client. Having written the client, I get a "org.xml.sax.SAXParseException:
Missing whitespace before SYSTEM literal URI" exception when I run it.
Has anyone else come across this exception, or am I missing something glaringly
obvious?!!!
Thanks
Tim -
Org.xml.sax.SAXException: Error:General Schema Error
I am getting the error below. Any clues/workarounds? I am
using WL 6.1.
Thanks in advance,
Eva
The following files are below:
Validate.java
BMDefaultHandler.java
validate.xml
validate.xsd
org.xml.sax.SAXException: Error:General Schema Error: Grammar with uri:http://schemas.xmlsoap.org/soap/envelope/
, can not be
found; schema namespace maybe wrong:
Xerces supports schemas from the "http://www.w3.org/2001/XMLSchema" namespace
or
the instance document's namespace may not match the targetNamespace of the schema.
at
com.bluemartini.xml.BMDefaultHandler.error(BMDefaultHandler.java:32)
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1249)
at
org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLEr
ror(XMLValidator.java:1821)
at
org.apache.xerces.validators.common.XMLValidator.validateElementAndAttr
ibutes(XMLValidator.java:3232)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVa
lidator.java:1229)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentS
canner.java:1806)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
ch(XMLDocumentScanner.java:949)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentSca
nner.java:381)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.ja
va:195)
at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:191)
at com.bluemartini.test.Validate.main(Validate.java:32)
===Validate.java
package com.bluemartini.test;
import java.io.*;
import org.w3c.dom.*;
import com.bluemartini.xml.*;
// JAXP imports
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
* Sample test case.
* Eva Flora
public class Validate {
public static void main(String[] argv) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setAttribute("http://xml.org/sax/features/validation", Boolean.TRUE);
factory.setAttribute("http://apache.org/xml/features/validation/schema",
Boolean.TRUE);
DocumentBuilder builder = factory.newDocumentBuilder();
BMDefaultHandler bmErrorHandler = new BMDefaultHandler();
builder.setErrorHandler(bmErrorHandler);
File temp = new File("validate.xml");
Document doc = builder.parse(temp);
} catch (Exception e) {
e.printStackTrace();
===BMDefaultHandler.java
package com.bluemartini.xml;
import com.bluemartini.dna.*;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.*;
public class BMDefaultHandler extends
DefaultHandler
public BMDefaultHandler()
public void warning(SAXParseException spe)
throws SAXException
System.out.println("Warning: " + spe.getMessage());
public void error(SAXParseException spe)
throws SAXException
throw new SAXException("Error:" + spe.getMessage());
public void fatalError(SAXParseException spe)
throws SAXException
throw new SAXException("Fatal Error: " + spe.getMessage());
===validate.xml
<?xml version="1.0" encoding="UTF-8"?>
<soapns:Envelope xmlns:soapns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns:test="http://www.test.com"
xsi:noNamespaceSchemaLocation="validate.xsd">
<soapns:Header/>
<soapns:Body>
<test:GWSMapRequestMessage>
</test:GWSMapRequestMessage>
</soapns:Body>
</soapns:Envelope>
===validate.xsd
<schema xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="GWSMapRequestMessage" type="TestType"/>
<complexType name="TestType">
</complexType>
</schema>I am getting the error below. Any clues/workarounds? I am
using WL 6.1.
Thanks in advance,
Eva
The following files are below:
Validate.java
BMDefaultHandler.java
validate.xml
validate.xsd
org.xml.sax.SAXException: Error:General Schema Error: Grammar with uri:http://schemas.xmlsoap.org/soap/envelope/
, can not be
found; schema namespace maybe wrong:
Xerces supports schemas from the "http://www.w3.org/2001/XMLSchema" namespace
or
the instance document's namespace may not match the targetNamespace of the schema.
at
com.bluemartini.xml.BMDefaultHandler.error(BMDefaultHandler.java:32)
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1249)
at
org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLEr
ror(XMLValidator.java:1821)
at
org.apache.xerces.validators.common.XMLValidator.validateElementAndAttr
ibutes(XMLValidator.java:3232)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVa
lidator.java:1229)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentS
canner.java:1806)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
ch(XMLDocumentScanner.java:949)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentSca
nner.java:381)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.ja
va:195)
at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:191)
at com.bluemartini.test.Validate.main(Validate.java:32)
===Validate.java
package com.bluemartini.test;
import java.io.*;
import org.w3c.dom.*;
import com.bluemartini.xml.*;
// JAXP imports
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
* Sample test case.
* Eva Flora
public class Validate {
public static void main(String[] argv) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setAttribute("http://xml.org/sax/features/validation", Boolean.TRUE);
factory.setAttribute("http://apache.org/xml/features/validation/schema",
Boolean.TRUE);
DocumentBuilder builder = factory.newDocumentBuilder();
BMDefaultHandler bmErrorHandler = new BMDefaultHandler();
builder.setErrorHandler(bmErrorHandler);
File temp = new File("validate.xml");
Document doc = builder.parse(temp);
} catch (Exception e) {
e.printStackTrace();
===BMDefaultHandler.java
package com.bluemartini.xml;
import com.bluemartini.dna.*;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.*;
public class BMDefaultHandler extends
DefaultHandler
public BMDefaultHandler()
public void warning(SAXParseException spe)
throws SAXException
System.out.println("Warning: " + spe.getMessage());
public void error(SAXParseException spe)
throws SAXException
throw new SAXException("Error:" + spe.getMessage());
public void fatalError(SAXParseException spe)
throws SAXException
throw new SAXException("Fatal Error: " + spe.getMessage());
===validate.xml
<?xml version="1.0" encoding="UTF-8"?>
<soapns:Envelope xmlns:soapns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns:test="http://www.test.com"
xsi:noNamespaceSchemaLocation="validate.xsd">
<soapns:Header/>
<soapns:Body>
<test:GWSMapRequestMessage>
</test:GWSMapRequestMessage>
</soapns:Body>
</soapns:Envelope>
===validate.xsd
<schema xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="GWSMapRequestMessage" type="TestType"/>
<complexType name="TestType">
</complexType>
</schema>
Maybe you are looking for
-
How can I trigger mousover menus?
Some web pages have popup menus that show when you put the mouse over them. On the built-in Android browser, these menus can be accessed by touching them and then moving your finger slightly to the side. This action doesn't work on the Firefox Androi
-
Why is the newest version of Palm's Desktop software for Windows XP & Vista have such small type size? It's at least 2 pts. smaller than my older version and very hard to read. Is there a setting somewhere that I can't find which allows users to cu
-
Release procedure with out classification
HI, AJIT SINGH HERE, after making proper settings in the 'release procedure with out classification', when i try to create a puchase requisation by ME51N to test the working of release procedure ,i'm not getting check boxes of approval levels. please
-
Unable to Preserve Users & Network Settings
I am trying to go back to Tiger from Leopard on my iMac G4 (17" 1 GHz). However, when I choose Archive and Install, the option to Preserve Users & Network settings is dimmed out and I cannot select it. First time I have encountered this. Any ideas as
-
Report showing milestones due for billing
a company handles many projects simultaneously. Let's say 100 projects.The overall controller wants to look at the milestones of all the projects due for biiling so as to help him understand cash flow situation. Where to find or configure such kind o