Skip to Content
0
Former Member
Jan 19, 2006 at 05:49 PM

XML parsing using Commons Digester in Netweaver

106 Views

Hi,

I am trying to parse an XML file using commons-digester and on parsing I get SAPClassNotFoundException for the class file "com.rim.eselling.web.navigation.NavigationRule" that i defined in the mapping-rules.xml for the digester. The test runs fine locally as a java application but throws this exception when running on a web environment??

Any idea why its unable to load the class file "com.rim.eselling.web.navigation.NavigationRule"?

<b>

SAPClassNotFoundException

inNegativeCache= true

</b>

with message saying:

<i>

com.rim.eselling.web.navigation.NavigationRule

Found in negative cache

-


Loader Info -


ClassLoader name: [library:apache.org~jakartaCommon]

Parent loader name: [Frame ClassLoader]

No references !

Resources:

F:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\apache.org~jakartaCommon\commons-collections-3.1.jar

F:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\apache.org~jakartaCommon\commons-lang-2.1.jar

F:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\apache.org~jakartaCommon\commons-beanutils-1.7.0.jar

F:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\apache.org~jakartaCommon\commons-digester-1.7.jar

F:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\apache.org~jakartaCommon\commons-discovery-0.2.jar

F:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\apache.org~jakartaCommon\commons-logging-1.0.4.jar

Loading model: {parent,local,references}

-


</i>

<b>Digester rules file is defined as under:</b>

<digester-rules>
  <pattern value="navigation/navigation-rule">
    <object-create-rule classname="<b>com.rim.eselling.web.navigation.NavigationRule</b>"/>
    <set-next-rule methodname="add" paramtype="java.lang.Object"/>
    <set-properties-rule/>
    <bean-property-setter-rule pattern="logged-in" propertyname="loggedIn"/>
    <bean-property-setter-rule pattern="account-just-created" propertyname="accountJustCreated"/>
    <bean-property-setter-rule pattern="role" propertyname="role"/>
    <bean-property-setter-rule pattern="from-url" propertyname="fromURL"/>
    <bean-property-setter-rule pattern="error" propertyname="error"/>
    <bean-property-setter-rule pattern="nav-code" propertyname="navCode"/>
    <bean-property-setter-rule pattern="user-action" propertyname="userAction"/>
    <bean-property-setter-rule pattern="current-page" propertyname="currentPage"/>
    <bean-property-setter-rule pattern="next-page" propertyname="nextPage"/>
  </pattern>
</digester-rules>

<b>Error causing code:</b>

URL rules = NavigationHandler.class.getResource(MAPPING_RULES_FILE_NAME);
Digester digester = DigesterLoader.createDigester(rules);

// Push empty List onto Digester's Stack
navRules = new ArrayList();
digester.push( navRules );

digester.setValidating(true);

// Parse the XML document
InputStream xmlfile = NavigationHandler.class.getResourceAsStream(XML_FILE_NAME);
navRules = (ArrayList)digester.parse(xmlfile);<b><---------- ERROR</b>