Xml parsing using dom4j
I have some XML in String format, and I want to use the DocumentHelper.parseText() method on that string to parse it to Document format.
I use it and it doesn't say anything about an error, however when I try to get "getelementroot()" and "getattributevalue" it gives me null.
The XML looks like this:
<Response status="1">
<ERROR code="1">Offer is not available. </ERROR>
<OFFER_ID>fPSC00010_PKG</OFFER_ID>
</Response>
I want to get the value of "status", i.e 1 in this case. So I do something like this:
Element e = doc.getRootElement();
String s = e.attributeValue("Status");
Have I misunderstood something or what?
Well I am not 100% sure why your code is causing a problem. I used dom4j 1 year ago.
But I can give you my code snippet, the difference there to your snippet is that I first retrieved an Iterator over the Root element. And as I think the root element in your case is not the "Response" element it is more like a pointer to the start of the document. I am sorry for my vague explanation,it's too long age.
But I am sure that you can use my example for your need effectively.
public XMLMetaReader( String fileName )
Document document = null;
try
SAXReader reader = new SAXReader( true );
document = reader.read( fileName );
root = document.getRootElement();
createDBTree();
catch ( DocumentException e )
e.printStackTrace();
public Map getSourceTables()
return sourceTables;
/** Return all tables which are set in the currently connected Database. */
private void createDBTree() throws DocumentException
for ( Iterator iterator0 = root.elementIterator( "database" ); iterator0.hasNext(); )
Element databaseNode = ( Element ) iterator0.next();
database = databaseNode.attributeValue( "ID" );
// iterate through child elements of root with element name "table"
for ( Iterator iterator = databaseNode.elementIterator( "table" ); iterator.hasNext(); )
Element tableNode = ( Element ) iterator.next();
Table table = new Table( tableNode.attributeValue( "ID" ) );
sourceTables.put( tableNode.attributeValue( "ID" ), table );
// iterate through child elements of root with element name "field"
for ( Iterator iterator2 = tableNode.elementIterator( "field" ); iterator2.hasNext(); )
Element fieldNode = ( Element ) iterator2.next();
Field field = new Field( fieldNode.attributeValue( "ID" ) );
field.setOriginalDomain( fieldNode.attributeValue( "datatype" ) );
if ( fieldNode.attributeValue( "default" ) != null )
String fieldValue = fieldNode.attributeValue( "default" );
if ( ( fieldValue ).equalsIgnoreCase( "NULL" ) )
field.setIsOriginalNullable( true );
else if ( ( fieldValue ).equalsIgnoreCase( "NOT NULL" ) )
field.setIsOriginalNullable( false );
else
field.setOriginalDefault( fieldValue );
table.addField( field );
for ( Iterator iterator2 = tableNode.elementIterator( "primarykey" ); iterator2.hasNext(); )
Element primaryNode = ( Element ) iterator2.next();
for ( Iterator iterator3 = primaryNode.elementIterator( "key" ); iterator3.hasNext(); )
Element keyNode = ( Element ) iterator3.next();
table.addPrimaryKey( keyNode.attributeValue( "field" ) );
Field primaryField = table.getField( keyNode.attributeValue( "field" ) );
primaryField.setIsOriginalPrimary( true );
for ( Iterator iterator2 = tableNode.elementIterator( "foreignkey" ); iterator2.hasNext(); )
Element foreignNode = ( Element ) iterator2.next();
ForeignKey foreignKey = new ForeignKey();
for ( Iterator iterator3 = foreignNode.elementIterator( "key" ); iterator3.hasNext(); )
Element keyNode = ( Element ) iterator3.next();
foreignKey.setOnField( keyNode.attributeValue( "field" ) );
System.out.println( keyNode.attributeValue( "field" ) );
foreignKey.setReferencedTable( keyNode.attributeValue( "references" ) );
System.out.println( keyNode.attributeValue( "references" ) );
for ( Iterator iterator3 = foreignNode.elementIterator( "onupdate" ); iterator3.hasNext(); )
Element onUpdateNode = ( Element ) iterator3.next();
foreignKey.setOnUpdate( onUpdateNode.attributeValue( "action" ) );
for ( Iterator iterator3 = foreignNode.elementIterator( "ondelete" ); iterator3.hasNext(); )
Element onDeleteNode = ( Element ) iterator3.next();
foreignKey.setOnDelete( onDeleteNode.attributeValue( "action" ) );
table.addForeignKey( foreignKey );
for ( Iterator iterator2 = tableNode.elementIterator( "index" ); iterator2.hasNext(); )
Element indexNode = ( Element ) iterator2.next();
Index index = new Index( indexNode.attributeValue( "name" ) );
index.setIsUNIQUE( ( indexNode.attributeValue( "unique" ) ).equalsIgnoreCase( "true" ) );
index.setIsDESC( ( indexNode.attributeValue( "ASC" ) ).equalsIgnoreCase( "true" ) );
/* index.setTable( tableNode.attributeValue( "ID" ) ); */
for ( Iterator iterator3 = indexNode.elementIterator( "indexfield" ); iterator3.hasNext(); )
Element indexFieldElement = ( Element )iterator3.next();
int position = Integer.parseInt( indexFieldElement.attributeValue( "position" ) );
index.addField( indexFieldElement.attributeValue( "field" ), ( short ) position );
table.addIndex( index );
for ( Iterator iterator2 = tableNode.elementIterator( "uniqueclause" ); iterator2.hasNext(); )
Element uniqueNode = ( Element ) iterator2.next();
UniqueConstraint uniqueConstraint = new UniqueConstraint();
for ( Iterator iterator3 = tableNode.elementIterator( "uniquefield" ); iterator3.hasNext(); )
Element uniqueFieldNode = ( Element ) iterator3.next();
uniqueConstraint.addField( uniqueFieldNode.attributeValue( "field" ) );
}Hope it helps.
Best regards
Tarik
Similar Messages
-
i am using
org.xml.sax.helpers.DefaultHandler api for parsing xml file ,while parsing i am getting exception sometimes ,
i am using code below to parse the element and then store it to vectore
parser truncate the charaacters sometimes like parsing string
" NJ-HealthCare " i am getting only " NJ-HealthCare " and remaing characters are added in new element
public void characters(char ch[], int start, int length) {
try{
ElementVal="";
System.out.println(" start "+start+" ength :: "+length);
String ElementVal = new String(ch,start,length);
v.addElement( ElementVal );
}catch(Exception ex){
System.out.println("Exception in vector::"+ex);
System.out.println(""+ex.getMessage());
ex.printStackTrace();
}This is an FAQ in the XML forum. The characters() method is not required to give you an entire text node all at once. The parser is free to split up the text node and call characters() several times if it likes. Your program will have to account for that possibility.
-
Hi,
SOAP messages are xml messages. I knwo that the SOAP messages are processed before invoking the web service. what parser is used to process the SOAP message at the service side. Is it a DOM parser or a SAX parser?? Is there a way we can set the server to use a DOM Parser...?????
Regards,
Kartik.I apologize, here is more details
{code}
CREATE TABLE XMLTEMPTBL
PARAM NVARCHAR2(30 BYTE),
PARAMORDERSEQ NUMBER(3)
XML format:
<?xml version="1.0"?>
<ROWSET>
<ROW>
<PARAM1>abc</PARAM1>
</ROW>
<ROW>
<PARAM2>def</PARAM2>
</ROW>
<ROW>
<PARAM3>ghi</PARAM3>
</ROW>
<ROW>
<PARAM4>jkl</PARAM4>
</ROW>
</ROWSET>
PROCEDURE insertparams (p_xmldoc IN CLOB)
IS
insctx DBMS_XMLSTORE.ctxtype;
ROWS NUMBER;
BEGIN
/*inserting insdoc into a temp table*/
insctx := DBMS_XMLSTORE.newcontext ('xmlTempTbl');
ROWS := DBMS_XMLSTORE.insertxml (insctx, p_xmldoc);
DBMS_XMLSTORE.closecontext (insctx);
END;
I want to insert into table this way:
select * from xmltemptb;
PARAM PARAMORDERSEQ
abc 1
def 2
ghi 3
jkl 4
{code}
My procedure is not 100% correct (but it gives an idea what code I am using to load into table), but I want to ensure the xml rows are loaded into the table in the same sequence. -
XML parser used in Oracle...DOM or SAX?
Hi,
My db version:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Question:
I get an XML feed and load it into a temporary table T1.
My requirement is to load it in the exact sequence as I get the rows in xml and also populate a column in the temporary table as a sequence like 1 2 3 corresponding to the rows in the xml
When I do load the xml, it gets loaded in same order the xml feed is sent. So no worries.
But while I was researching I came to know that Oracle could use either DOM or SAX parser. If it uses SAX, then the order is maintained as in XML. But if DOM is used, the order wont be maintained.
Please let me know, how I can ensure that the xml order is maintained as it is while loading into temp table.I apologize, here is more details
{code}
CREATE TABLE XMLTEMPTBL
PARAM NVARCHAR2(30 BYTE),
PARAMORDERSEQ NUMBER(3)
XML format:
<?xml version="1.0"?>
<ROWSET>
<ROW>
<PARAM1>abc</PARAM1>
</ROW>
<ROW>
<PARAM2>def</PARAM2>
</ROW>
<ROW>
<PARAM3>ghi</PARAM3>
</ROW>
<ROW>
<PARAM4>jkl</PARAM4>
</ROW>
</ROWSET>
PROCEDURE insertparams (p_xmldoc IN CLOB)
IS
insctx DBMS_XMLSTORE.ctxtype;
ROWS NUMBER;
BEGIN
/*inserting insdoc into a temp table*/
insctx := DBMS_XMLSTORE.newcontext ('xmlTempTbl');
ROWS := DBMS_XMLSTORE.insertxml (insctx, p_xmldoc);
DBMS_XMLSTORE.closecontext (insctx);
END;
I want to insert into table this way:
select * from xmltemptb;
PARAM PARAMORDERSEQ
abc 1
def 2
ghi 3
jkl 4
{code}
My procedure is not 100% correct (but it gives an idea what code I am using to load into table), but I want to ensure the xml rows are loaded into the table in the same sequence. -
Hi all,
I am new to XML. I have a text variables for example:
v_doc_text :=
'<emp>
<empno no="3">1</empno>
<fname>robert</fname>
<lname>smith</lname>
<sal>1000</sal>
<job>engineer</job>
</emp>';
I want to parse this xml and in pl/sql variable.
Please help me how to do it or please give me an example.
I appreciate the help.
Thx.Which version of the database are you running? Do you know whether it's got the XDK installed and enabled?
If you are new to XML you won't understand the difference between XMLSchema and DTD. But you need to understand the principles of XML before you leap into coding it. For instance, how do you know that text file is valid? You don't, because it has not been validated against either an XMLSchema nor a DTD.
The Oracle document is focussed on their bespoke implementation, and is not beginner-friendly. I suggest you start with this O'Reilly piece and then read about document validation.
And if you want a good, free lightweight XML editor I recommend XML Notepad which is a Microsoft beta product (not supported, beware of downloading strange .EXE etc).
Good luck, APC -
Creating a dynamic jtree using datas retrieved by dom in xml parsing
help me with code to create a dynamic jtree using data retrieved as nodes by xml parsing using dom
Ok, so you want to make a tree. To determine the data that appears in a tree, you have to make a custom tree model. The API for this is at :
http://java.sun.com/j2se/1.4.2/docs/api/
A tutorial for using trees is at :
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
I assume you are going to be using Nodes, since you are using XML. For this I might start with something like
class NodeTreeModel implements TreeModelI would then implement the 'getChildCount()' as the number of subnodes a node has, and the value of a tree node to the nodes value.
Hope that starts you off. -
Hi All,
While accessing the JPDK provider URL that is integrated with PeopleSoft application, I am getting the following error
500 Internal Server Error
java.lang.NoClassDefFoundError at oracle.xml.parser.v2.NonValidatingParser.(NonValidatingParser.java:172) at oracle.xml.parser.v2.XMLParser.(XMLParser.java:174) at oracle.xml.parser.v2.DOMParser.(DOMParser.java:92) at oracle.portal.utils.xml.v2.XMLUtil.getParser(Unknown Source) at oracle.portal.utils.xml.v2.XMLUtil.parseDocument(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.parseRegistry(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.getProviderDefinition(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.validate(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.validate(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.showTestPage(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.handleHttp(Unknown Source) 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:585) at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall(Unknown Source) at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64) at com.peoplesoft.pt.portlet.jpdk.provider.PSProviderFilter.doFilter(PSProviderFilter.java:78) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15) at com.peoplesoft.pt.portlet.logging.DynamicFilter.doFilter(DynamicFilter.java:83) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)
As our application uses AXIS to do WebServices, we have removed the default oracle xml shared library by using remove-inherited in orion-application.xml. In addition, we package our own xerces in our application ear file. It looks like PDK is looking for oracle xml parser resulting in the NoClassDefFoundError exception.
The above exception is thrown if I access the JDPK provider URL after accessing our application.
However, if I restart the OC4J and ccess the JPDK provider URL without accessing our application, I get the following error
500 Internal Server Error
oracle.classloader.util.AnnotatedLinkageError: class oracle.xml.parser.schema.XSDNode cannot access its superinterface oracle.xml.parser.schema.XSDComponent Invalid class: oracle.xml.parser.schema.XSDNode Loader: oracle.cache:10.1.3 Code-Source: /D:/Oracle/OAS101310/OracleAS_1/LIB/xschema.jar Configuration: (ignore manifest Class-Path) in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar Dependent class: oracle.xml.parser.v2.XMLNode Loader: PeopleSoft2.web.pspc:0.0.0 Code-Source: /D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar Configuration: WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib at oracle.classloader.PolicyClassLoader.findLocalClass (PolicyClassLoader.java:1462) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchPolicy$FindLocal.getClass (SearchPolicy.java:167) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchSequence.getClass (SearchSequence.java:119) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchPolicy.loadClass (SearchPolicy.java:645) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchPolicy$CheckSharedLibraries.getClass (SearchPolicy.java:396) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchSequence.getClass (SearchSequence.java:119) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1674) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06] at oracle.xml.parser.v2.XMLNode. (XMLNode.java:4123) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.xml.parser.v2.NonValidatingParser. (NonValidatingParser.java:172) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.xml.parser.v2.XMLParser. (XMLParser.java:174) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.xml.parser.v2.DOMParser. (DOMParser.java:92) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.utils.xml.v2.XMLUtil.getParser (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/ptlshare.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.utils.xml.v2.XMLUtil.parseDocument (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/ptlshare.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.provider.v2.http.DefaultProviderLoader.parseRegistry (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.provider.v2.http.DefaultProviderLoader.getProviderDefinition (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.provider.v2.http.DefaultProviderLoader.validate (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.validate (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.showTestPage (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.handleHttp (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) [unknown, by unknown] at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) [unknown, by unknown] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) [unknown, by unknown] at java.lang.reflect.Method.invoke (Method.java:585) [unknown, by unknown] at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.SOAPServlet.service (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at javax.servlet.http.HttpServlet.service (HttpServlet.java:856) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/servlet.jar (from (ignore manifest Class-Path) in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by api:1.4.0] at com.evermind.server.http.ResourceFilterChain.doFilter (ResourceFilterChain.java:64) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.peoplesoft.pt.portlet.jpdk.provider.PSProviderFilter.doFilter (PSProviderFilter.java:78) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/classes/ (from WEB-INF/classes/ in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\classes), by PeopleSoft2.web.pspc:0.0.0] at com.evermind.server.http.EvermindFilterChain.doFilter (EvermindFilterChain.java:15) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.peoplesoft.pt.portlet.logging.DynamicFilter.doFilter (DynamicFilter.java:83) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/classes/ (from WEB-INF/classes/ in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\classes), by PeopleSoft2.web.pspc:0.0.0] at com.evermind.server.http.ServletRequestDispatcher.invoke (ServletRequestDispatcher.java:619) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.ServletRequestDispatcher.forwardInternal (ServletRequestDispatcher.java:368) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.HttpRequestHandler.doProcessRequest (HttpRequestHandler.java:866) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.HttpRequestHandler.processRequest (HttpRequestHandler.java:448) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.AJPRequestHandler.run (AJPRequestHandler.java:302) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.AJPRequestHandler.run (AJPRequestHandler.java:190) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run (ServerSocketReadHandler.java:260) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket (ServerSocketAcceptHandler.java:239) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler.access$700 (ServerSocketAcceptHandler.java:34) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run (ServerSocketAcceptHandler.java:880) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run (ReleasableResourcePooledExecutor.java:303) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap:1.5.0_06]On further test, If I let the default oracle xml parser be loaded, then I do not get the the exception.
I have removed the following lines from orion-application.xml
<imported-shared-libraries>
<remove-inherited name="oracle.xml"/>
</imported-shared-libraries>
Now, If I access the JPDK provider URL
http://ple-fjunod.peoplesoft.com:9820/pspc/providers/psprovider/ps/EMPLOYEE
I get the excepted page
Congratulations! You have successfully reached your Provider's Test Page.
Recognizing Portlets...
Recognizing component versions...
ptlshare.jar version: 10.1.3.2.0
pdkjava.jar version: 10.1.3.2.0
Can someone please tell me that if I remove the inherited default oracle XML parser using remove-inherited tag in orion-application.xml, how do I make the JPDK use my own packaged xerces XML parser.
Thanks -
DOM XML Parser in Stateless Session Bean- Not able to generate Container
I am trying to do some XML Parsing using a DOM Parser in a Stateless Session Bean. I am importing org.apache.xerces.parsers.DOMParser and trying the following statement DOMParser parser = new DOMParser();
Even though I am able to compile and generate the initial jar file. When I try to generate the container using the Weblogic Deployer GUI tool, the process keeps on going(I mean that I see the small window saying Container Generating working) and it never stops.
Any suggestions are welcome.Many thanks ksaks for replying.
Actually day before yesterday we were able to do something like this. But then I kept this thread open only to see if experts have some good way of doing this.
What I mean is if this way is industry standards in terms of design and does it follow the most popular way how experts do it?
I am asking this as WebProjects have webcontent/web-inf directory wherein we put those xsds and property files, but we do not have anything like this in an EJB project. so was just wondering if this is the correct way of doing it or not.
I am still following this approach because I had to proceed further in my development. Confirmation would erase any other doubts on this.
Hope you find time to reply.
Kind Regards,
user2205
Edited by: user2205 on Nov 10, 2008 11:43 PM -
Xsl processor and xml parser?
Hello,
Can someone tell me wich is the xsl processor and the xml parser used by Livecycle ES? And their versions?
Thank youXML Parser parses the text representation of an XML 1.0-compliant document to make the document's information set -- elements, attributes, text, comments, processing instructions, namespace declarations -- available for access to a comptuter program.
Without a parser, a program cannot make heads or tails of the tree of information contained in your tags.
An XSL Processor is a program that takes an XML Document as input, along with an XSLT transformation definition (also known as a stylesheet), and effects the transformation of the source document as instructed by the stylesheet. This might mean transforming:
<ROWSET>
<ROW>
<ENAME>Steve</ENAME>
</ROW>
</ROWSET>
into
<human-resources>
<employee name="Steve"/>
</human-resources>
or alternatively into:
<html>
<body>
<b>Steve</b>
</body>
</html>
In both cases, the source XML document
is the same, but when transformed by
one stylesheet, it might become
the <human-resources> XML document.
When transformed by another stylesheet,
it can become pretty HTML.
To put the two terms in context, an XSL processor uses an XML parser to read the source XML document and to read the XSL transformation definition (aka stylesheet) -- since it, too, is an XML document -- and then it proceeds to transform the source into the target. -
Xml parser configuration prooblem
Hi
The application I am running is trying to use the Following XML parser
"org/apache/xerces/framework/XMLParser" . BUT i get a NoClassDefFoundError
when i run it. I tam not sure which jar i have to use.
Please can u suggest me ...
1 > HOW to change the Default XML parser used by an application ...
a > BY modifying some File provided by SUN for eg .
b > BY adding JVM parameter before running app.
2> List of Jars which contain this Class
Basically i know that XML parser used by an APP can be changed .
Please can u suggest a solution using point 1a ) or 1b
Thanks
sbelurAccording to the javadocs
http://xml.apache.org/xerces2-j/javadocs/xerces2/index.html
you want to use this:
org.apache.xerces.parsers.XMLParser
I suggest you study Xerces some more, or check out the examples that you get with the source package. -
Oracle XML Parser validation against XML Sxhema
Hi,
I am developing a program in C++ on Unix, that does parsing on an XML document. For parsing I am using "Oracle XML Parser" [using DOM API]. My question is, Can Oracle XML Parser validate xml document against an XML Schema file also? I have read in many tutorials that it can validate against DTD. Please clarify my question as early as possible?
Regards,
Raghuram.Hi Kulkarni,
I think you are trying to retrieve the text of the parent element of book. For example if this is the xml element
<bookdetails>
<book>Harry Potter</book>
<author>JK Rowling</author>
<price>34.55</price>
</book>
</bookdetails>
You must be trying to retrieving the text of bookdetails.
Check XMLNode.getNodeName() to retrieve the name of the node.
To get 'Harry Potter' as output you need to traverse till book and then use XMLNode.getText()
You can check the 'getQuestions()' method in Survey Sample
to know how to tranverse to any element of an XML using Java.
The Survey Sample is located at
http://otn.oracle.com/sample_code/tech/xml/survey/content.html
Download the sample and unjar it. The location of Analyser.java is
SurveySample\code\Survey\src\oracle\otnsamples\survey\business\Analyser.java
Have a look at it.
Regards,
Anupama
http://otn.oracle.com/sample_code/content.html -
Which XML parser for WLS6.1
I heard BEA's Scott Dietzen at JDJEdge (
http://www.sys-con.com/jdjedge/tv4.cfm ) say that the XML parser used by
WebLogic's web services stack is native (not java). Question - which parser
is it? BEA's own work? Or xp? or...?
do I care?I think you may have misinterpreted the meaning of "native" ;-)
WLS 6.1 comes with a Java-based, SAX Parser built by BEA engineers. It is included
in the client.jar file created during the Web service assembly process. It is
JAXP-complaint, and definitely Java.
Regards,
Mike Wooten
"dc" <[email protected]> wrote:
I heard BEA's Scott Dietzen at JDJEdge (
http://www.sys-con.com/jdjedge/tv4.cfm ) say that the XML parser used
by
WebLogic's web services stack is native (not java). Question - which
parser
is it? BEA's own work? Or xp? or...?
do I care? -
What is the meaning of main and stream factory in XML parsing?
What is the exact meaning (i.e. concept) of main and stream factory in XML parsing?
[I am aware of steps involved in XML parsing using iXML library..|http://help.sap.com/saphelp_nw04/helpdata/en/86/8280cf12d511d5991b00508b6b8b11/content.htm], so pls dont explain these steps again.. I have been searching in internet for concepts of these factories, but could not get them anywhere..Tipos Pools
TYPE-POOLS: ixml.
CLASS cl_ixml DEFINITION LOAD.
TYPES: BEGIN OF xml_node_type,
node TYPE char50,
vlnode TYPE string,
END OF xml_node_type,
BEGIN OF xml_line_type,
data(256) TYPE x,
END OF xml_line_type.
Tabelas Internas
DATA: ti_xml_node TYPE TABLE OF xml_node_type.
Variáveis TYPE REF
*Type REF para utilizar no XML
DATA: ixml_type TYPE REF TO if_ixml,
streamfactory_type TYPE REF TO if_ixml_stream_factory,
ostream_type TYPE REF TO if_ixml_ostream,
istream_type TYPE REF TO if_ixml_istream,
parser_type TYPE REF TO if_ixml_parser,
renderer_type TYPE REF TO if_ixml_renderer,
document_type TYPE REF TO if_ixml_document,
encoding_type TYPE REF TO if_ixml_encoding,
node_type TYPE REF TO if_ixml_node,
element_dtrans_type TYPE REF TO if_ixml_element,
element_xml_in_type TYPE REF TO if_ixml_element,
element_roteiros_type TYPE REF TO if_ixml_element,
element_roteiro_type TYPE REF TO if_ixml_element,
element_vias_type TYPE REF TO if_ixml_element,
element_via_type TYPE REF TO if_ixml_element,
element_dummy_type TYPE REF TO if_ixml_element,
gw_xml_node TYPE TABLE OF xml_node_type,
gw_xml_node_ret TYPE TABLE OF xml_node_type,
gw_xml_node_err TYPE TABLE OF xml_node_type,
gw_xml_node_xml TYPE TABLE OF xml_node_type,
gw_xml_table TYPE TABLE OF xml_line_type,
gw_xml_table2 TYPE TABLE OF xml_line_type,
gs_xml_node TYPE xml_node_type, "WA para leitura do xml
gs_xml_node_ret TYPE xml_node_type, "WA para leitura do xml retorno
gs_xml_node_err TYPE xml_node_type, "WA para leitura do xml erro
gs_xml_node_xml TYPE xml_node_type, "WA para leitura do xml info sucesso
gs_xml_table2 TYPE xml_line_type. "WA para importar xml
Variáveis do Programa
DATA: l_value TYPE string,
l_rc TYPE i,
l_xml_size TYPE i,
cod_cartaorepom TYPE char20 VALUE '123456789',
v_caminho_exp TYPE string VALUE 'C:TEMP',
v_salvaarquivo TYPE string,
v_nomearquivo TYPE string,
w_nodetext TYPE string,
v_roteiros TYPE string,
v_roteiro TYPE string,
v_roteiro_codigo TYPE string,
v_percurso_codigo TYPE string,
v_percurso_descricao TYPE string,
v_cidade_origem TYPE string,
v_estado_origem TYPE string,
v_cidade_destino TYPE string,
v_estado_destino TYPE string,
v_transporte_tipo TYPE string,
v_cartao_taxa TYPE string,
v_cobra_taxa TYPE string.
Constants
CONSTANTS: cc_39 TYPE string VALUE '39', " Numero 39.
cc_dt_trans TYPE string VALUE 'data_transfer'," document_type(name)
cc_metodo_cod TYPE string VALUE 'metodo_codigo'," document_type(name)
cc_xml_in TYPE string VALUE 'xml_in'," document_type(name)
cc_ct_tx_ativ TYPE string VALUE 'cartao_taxa_ativacao'," document_type(name)
cc_cartao TYPE string VALUE 'cartao', " Parâmetro Perform.
cc_xml TYPE string VALUE '.XML'," extenção
cc_bin TYPE char10 VALUE 'BIN'." filetype
START-OF-SELECTION.
PERFORM yf_inicia_criacao_xml USING cc_39.
element_roteiro_type = document_type->create_simple_element(
name = cc_ct_tx_ativ
parent = element_xml_in_type ).
PERFORM yf_dummy_roteiro USING cod_cartaorepom cc_cartao.
PERFORM yf_finaliza_xml.
PERFORM yf_exporta_xml USING v_caminho_exp.
PERFORM yf_convert_xml_to_itab TABLES gw_xml_node_ret
USING v_salvaarquivo.
END-OF-SELECTION.
*& Form yf_inicia_criacao_xml
text
-->VALUE(P_0783) text
FORM yf_inicia_criacao_xml USING value(p_0783).
DATA: s_encoding_type TYPE string VALUE 'ISO-8859-1'.
Cria o ixml factory
ixml_type = cl_ixml=>create( ).
*Cria o objeto com modelo
document_type = ixml_type->create_document( ).
*Cria o cabeçalho encoding="iso-8859-1"
encoding_type = ixml_type->create_encoding( byte_order = 0
character_set = s_encoding_type ).
*Cria o root "DATA_TRANSFER"
element_dtrans_type = document_type->create_simple_element(
name = cc_dt_trans
parent = document_type ).
*Cria o node "METODO_CODIGO" e preenche com um valor passado no L_VALUE
l_value = p_0783.
CONDENSE l_value.
element_dummy_type = document_type->create_simple_element(
name = cc_metodo_cod
value = l_value
parent = element_dtrans_type ).
*Cria o node "XML_IN"
element_xml_in_type = document_type->create_simple_element(
name = cc_xml_in
parent = element_dtrans_type ).
ENDFORM. " yf_inicia_criacao_xml
*& Form yf_dummy_roteiro
text
-->VALUE(P_0996) text
-->VALUE(P_0997) text
FORM yf_dummy_roteiro USING value(p_0996)
value(p_0997).
l_value = p_0996.
CONDENSE l_value.
element_dummy_type = document_type->create_simple_element(
name = p_0997
value = l_value
parent = element_roteiro_type ).
ENDFORM. " yf_dummy_roteiro
*& Form yf_finaliza_xml
text
FORM yf_finaliza_xml.
*Cria o stream factory
streamfactory_type = ixml_type->create_stream_factory( ).
*Conecta a internal table de XML com o stream factory
ostream_type = streamfactory_type->create_ostream_itable( table = gw_xml_table ).
CALL METHOD ostream_type->set_encoding
EXPORTING
encoding = encoding_type.
*Rendering the document
renderer_type = ixml_type->create_renderer( ostream = ostream_type
document = document_type ).
l_rc = renderer_type->render( ).
*Salva o documento XML
l_xml_size = ostream_type->get_num_written_raw( ).
ENDFORM. " yf_finaliza_xml
*& Form yf_exporta_xml
text
-->VALUE(P_0783) text
FORM yf_exporta_xml USING value(p_0783).
CONCATENATE cod_cartaorepom
sy-datum
sy-uzeit
cc_xml
INTO v_nomearquivo.
CONCATENATE p_0783
v_nomearquivo
INTO v_salvaarquivo.
TRANSLATE v_nomearquivo TO UPPER CASE.
*Exporta o XML
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = v_salvaarquivo
filetype = cc_bin
CHANGING
data_tab = gw_xml_table
EXCEPTIONS
OTHERS = 24.
IF sy-subrc = 0.
PERFORM yf_sapgui_progress_indicator USING cc_msg_xml_ok.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " yf_exporta_xml
*& Form yf_convert_xml_to_itab
text
-->P_GW_XML_NODE_RET text
-->P_FILENAME text
FORM yf_convert_xml_to_itab TABLES p_gw_xml_node_ret LIKE gw_xml_node
USING p_filename.
DATA l_count.
ixml_type = cl_ixml=>create( ).
Now Create Stream Factory
streamfactory_type = ixml_type->create_stream_factory( ).
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = p_filename
filetype = cc_bin
IMPORTING
filelength = l_xml_size
CHANGING
data_tab = gw_xml_table2
EXCEPTIONS
OTHERS = 19.
IF sy-subrc = 0.
istream_type = streamfactory_type->create_istream_itable( table = gw_xml_table2
size = l_xml_size ).
document_type = ixml_type->create_document( ).
parser_type = ixml_type->create_parser( stream_factory = streamfactory_type
istream = istream_type
document = document_type ).
IF parser_type->parse( ) NE 0.
IF parser_type->num_errors( ) NE 0.
l_count = parser_type->num_errors( ).
ENDIF.
ENDIF.
CALL METHOD istream_type->close( ).
CLEAR istream_type.
node_type = document_type.
PERFORM yf_get_data USING node_type.
p_gw_xml_node_ret[] = gw_xml_node[].
CLEAR gw_xml_node[].
ENDIF.
ENDFORM. " yf_convert_xml_to_itab
*& Form yf_get_data
text
-->VALUE(X_NODE) text
FORM yf_get_data USING value(x_node) TYPE REF TO if_ixml_node.
DATA: indent TYPE i.
DATA: ptext TYPE REF TO if_ixml_text.
DATA: string TYPE string.
DATA: temp_string(100).
CASE x_node->get_type( ).
WHEN if_ixml_node=>co_node_element.
string = x_node->get_name( ).
w_nodetext = string.
CLEAR string.
string = x_node->get_value( ).
IF NOT w_nodetext IS INITIAL OR
NOT string IS INITIAL.
gs_xml_node-node = w_nodetext.
gs_xml_node-vlnode = string.
IF NOT gs_xml_node-vlnode IS INITIAL.
APPEND gs_xml_node TO gw_xml_node.
CLEAR gs_xml_node.
ENDIF.
ENDIF.
ENDCASE.
Get the next child
x_node = x_node->get_first_child( ).
Recurse
WHILE NOT x_node IS INITIAL.
PERFORM yf_get_data USING x_node.
x_node = x_node->get_next( ).
ENDWHILE.
ENDFORM. "yf_get_data -
How can I use a 3rd party XML parser such as xerces with OC4J ?
Hi all tech experts,
I am using Oracle Application Server 10g Release 2 (10.1.2) and i have
installed Portal and Wireless and OracleAS Infrastructure on the same
computer.
i tried all the solutions on this thread
Use of Xerces Parser in out application with Oracle App Server 9.0.4
but still fighting.
I have also posted this query on OTN on following thread
How can I use a 3rd party XML parser such as xerces with OC4J?
but no reply....
Please help me on this issue.
Since OC4J is preconfigured to use the Oracle XML parser which is xmlparserv2.jar.
i have read the following article which states that
OC4J is preconfigured to use the Oracle XML parser. The Oracle XML parser is fully JAXP 1.1 compatible and will serve the needs of applications which require JAXP functionality. This approach does not require the download, installation, and configuration of additional XML parsers.
The Oracle XML parser (xmlparserv2.jar) is configured to load as a system level library of OC4J through it's inclusion as an entry in the Class-Path entry of the oc4j.jar Manifest.mf file. This results in the Oracle XML parser being used for all common deployment and packaging situations. You are not permitted to modify the Manifest.mf file of oc4j.jar.
It must be noted that configuring OC4J to run with any additional XML parser or JDBC library is not a supported configuration. We do know customers who have managed to successfully replace the system level XML parser and the Oracle JDBC drivers that ship with the product, but we do not support this type of configuration due to the possibility of unexpected system behavior and system errors that might occur from replacing the tested and certified libraries.
If you absolutely must use an additional XML parser such as xerces, then you have to start OC4J such that the xerces.jar file is loaded at a level above the OC4J system classpath. This can be accomplished using the -Xbootclasspath flag of the JRE.
i have also run the following command
java -Xbootclasspath/a:d:\xerces\xerces.jar -jar oc4j.jar
but no success.
How could i utilize my jar's like xerces.jar and xalan.jar for parsing instead of OC4J in-built parser ?
All reply will be highly appreciated.
Thnx in advance to all.
Neeraj Sidhaye
try_catch_finally @ Y !Hi Neeraj Sidhaye,
I am trying to deploy a sample xform application to the Oracle Application Server (10.1.3). However, I encountered the class loader issue that is similar to your stuation. I tried all the three solutions but the application is still use the Oracle xml paser class. I am wondering if you have any insight about this?
Thanks for your help.
Xingsheng Qian
iPass Inc.
Here is the error message I got.
Message:
java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
Stack Trace:
org.chiba.xml.xforms.exception.XFormsException: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.initModels(Unknown Source)
at org.chiba.xml.xforms.Container.init(Unknown Source)
at org.chiba.xml.xforms.ChibaBean.init(Unknown Source)
at org.chiba.adapter.servlet.ServletAdapter.init(ServletAdapter.java:153)
at org.chiba.adapter.servlet.ChibaServlet.doGet(ChibaServlet.java:303)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Instance.iterateModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.initializeModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.init(Unknown Source)
at org.chiba.xml.xforms.Initializer.initializeBindElements(Unknown Source)
at org.chiba.xml.xforms.Model.modelConstruct(Unknown Source)
at org.chiba.xml.xforms.Model.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(Unknown Source)
at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
... 18 more -
HOW TO: Use the XML parser in Oracle 8.1.7
I am trying to figure out how to use the xml parser provided in oracle 8.1.7. all i want to do is parse a xml report that is defined using a schema, and place the data into the proper tables. i am totally unfamiliar with the xml parser and how it works. i have done some reading on the subject, but seem to be getting some conflicting infromation about which utilites i need and how to invoke them. can someone please tell me what utilities i need, how to invoke them, and what i need to do to get a xml document to parse and insert to a table? I would greatly appreciate any help anybody could offer. thanks.
You can parse the XML Document with XML Parser and place the data into database using XSU(XML SQL Utility).
Both of these are included in XDK for Java at:
http://otn.oracle.com/tech/xml/xdk_java
The following document could also help:
Oracle9i XML Developer's Guide--XDK [PDF] at http://otn.oracle.com/tech/xml/doc.html
Maybe you are looking for
-
Price not getting displayed in next page
ok this is very simple, i don't know y it is not working i m calculating my price in shoppingcart.jsp and then i want to show it as hidden value in form.jsp, i m getting null in form.jsp <input type="hidden" name="textfield" value="<%=sum%>" />////i
-
Why am i able to use abstract methods id they aren't yet implemented?
For example, why i can use this [http://docs.oracle.com/javase/7/docs/api/java/nio/CharBuffer.html#slice] if this is abstract? Edited by: 947971 on 13-set-2012 10.38
-
Can I lock an ipod??
My sister let her husband take my nephews ipod that I bought him. They will not give it back and he says that his step dad even takes it to work. I changed his apple ID email and his password so they wont be able to add anything new to the ipod witho
-
Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?
My vendor has sent me a .sys file with functions accessing their hardware. Can i call these function from labview directly or do I have to wrapper the .sys with a dll?
-
The operating system is WINDOWS VISTA on my machine. I successfully installed Oracle 10 R2 10.2.0.3 and upgraded it to 10.2.0.4. I have the following issue after upgrading to 10.2.0.4: From the DOS command prompt as "Run as Administrator" and then di