cancel
Showing results for 
Search instead for 
Did you mean: 

Using the SAXBuilder outside a J2EE application

Former Member
0 Kudos

We are trying to use the SAXBuilder as part of a batch process. We had it working in a J2EE application, but are having issues in a Java DC.

We have used dcs of:

aii_util_misc.jar

aii_util_xml.jar

In the J2EE DC we had to add the following to the application-j2ee-engine.xml file for it to find everything correctly:

<reference reference-type="hard">

<reference-target provider-name="sap.com" target-type="library">com.sap.aii.util.xml</reference-target>

</reference>

<provider-name>sap.com</provider-name>

We need to use the same code in a batch process so I need to know what to do.

Here is a snipet from the code:

(xml is a String containing an XML document.)

import com.sap.aii.util.xml.jdom.SAXBuilder;

import com.sap.aii.util.xml.jdom.Document;

SAXBuilder builder;

Document document;

builder = new SAXBuilder();

document = builder.build(new ByteArrayInputStream(xml.getBytes()));

I am getting the following error messages when I try to build the document as shown above:

INFO: using default logging implementation

INFO: using logging implementation "AII Logging"

INFO: log configuration file "C:\Documents and Settings\jonesv\.dtc\2\DCs\fe.com\reg\custweb_stmt_summary_j\_comp\log.properties" could not be read

INFO: using default log configuration

#0 2:03:44 PM [main] WARNING com.sap.aii.util.prop.api.PropertySourceFactory: PropertySource not set!

Thrown:

java.lang.Throwable: dummy Throwable for stack trace

at com.sap.aii.util.prop.api.PropertySourceFactory.getPropertySource(PropertySourceFactory.java:39)

at com.sap.aii.util.misc.api.AIIProperties.sync(AIIProperties.java:340)

at com.sap.aii.util.misc.api.AIIProperties.<init>(AIIProperties.java:233)

at com.sap.aii.util.misc.api.AIIProperties.<clinit>(AIIProperties.java:219)

at com.sap.aii.util.xml.api.XMLServices.getParserFactory(XMLServices.java:137)

at com.sap.aii.util.xml.xdom.io.XDOMInputter.parse(XDOMInputter.java:122)

at com.sap.aii.util.xml.xdom.io.XDOMInputter.read(XDOMInputter.java:92)

at com.sap.aii.util.xml.jdom.SAXBuilder.build(SAXBuilder.java:60)

at com.firstenergycorp.ebpp.xfer.sap.statements.summary.jdom.StmtSummaryFileJdom.setData(StmtSummaryFileJdom.java:642)

at com.firstenergycorp.batch.process.BatchProcessLoadXmlFile.process(BatchProcessLoadXmlFile.java:209)

at com.firstenergycorp.ebpp.xfer.sap.statements.summary.jdom.RunStmtSummaryFileJdom.main(RunStmtSummaryFileJdom.java:68)

#1 2:03:44 PM [main] ERROR com.sap.aii.util.prop.api.PropertySourceFactory: reading default properties file "C:\Documents and Settings\jonesv\.dtc\2\DCs\fe.com\reg\custweb_stmt_summary_j\_comp\aii.properties" failed - FileNotFoundException: C:\Documents and Settings\jonesv\.dtc\2\DCs\fe.com\reg\custweb_stmt_summary_j\_comp\aii.properties (The system cannot find the file specified)

#2 2:03:44 PM [main] FATAL com.sap.aii.util.prop.api.PropertySourceFactory: no PropertySource available!

Thrown:

java.lang.Throwable: dummy Throwable for stack trace

at com.sap.aii.util.prop.api.PropertySourceFactory.getPropertySource(PropertySourceFactory.java:39)

at com.sap.aii.util.misc.api.AIIProperties.sync(AIIProperties.java:340)

at com.sap.aii.util.misc.api.AIIProperties.<init>(AIIProperties.java:233)

at com.sap.aii.util.misc.api.AIIProperties.<clinit>(AIIProperties.java:219)

at com.sap.aii.util.xml.api.XMLServices.getParserFactory(XMLServices.java:137)

at com.sap.aii.util.xml.xdom.io.XDOMInputter.parse(XDOMInputter.java:122)

at com.sap.aii.util.xml.xdom.io.XDOMInputter.read(XDOMInputter.java:92)

at com.sap.aii.util.xml.jdom.SAXBuilder.build(SAXBuilder.java:60)

at com.firstenergycorp.ebpp.xfer.sap.statements.summary.jdom.StmtSummaryFileJdom.setData(StmtSummaryFileJdom.java:642)

at com.firstenergycorp.batch.process.BatchProcessLoadXmlFile.process(BatchProcessLoadXmlFile.java:209)

at com.firstenergycorp.ebpp.xfer.sap.statements.summary.jdom.RunStmtSummaryFileJdom.main(RunStmtSummaryFileJdom.java:68)

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Jennifer,

But here is the answer: <b>FileNotFoundException: C:\Documents and Settings\jonesv\.dtc\2\DCs\fe.com\reg\custweb_stmt_summary_j\_comp\aii.properties (The system cannot find the file specified)

</b>. Create file aii.properties and put it to specified location. It can be just empty because XMLService can use default values, like

props.getProperty("com.sap.aii.util.xml.parserFactory", "com.sap.engine.lib.jaxp.SAXParserFactoryImpl");

. Don`t forget to add sapxmltoolkit.jar to classpath of your application.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Thanks, Maksim!

Sorry for the delay in responding and awarding points, we had moved on to something else and didn't have time to go back and test this until today, but it worked great!

-Jennifer

Answers (0)