cancel
Showing results for 
Search instead for 
Did you mean: 

Problem displaying XML data on Iview

Former Member
0 Kudos
130

I am trying to parse an xml document using DOM parser and display the data on an iview.The development environment I have is SAP PDK 5.0.6 and tomcat version 3.3.1. I am able to run the java class parsing the xml file as a standalone program on eclipse.

But when I try to invoke the same java class from the iview, it is throwing the following error

"<b>java.lang.ClassCastException: org.apache.crimson.jaxp.DocumentBuilderFactoryImpl</b>".

The iview gets displayed without any problem, but due to the error thrown, I can't get any data to be displayed on the JSP page. This error is thrown on tomcat server window.

I have declared TOMCAT_HOME as an environment variable and set the path. I would greatly appreciate any help to resolve this issue.

Thanks,

Seema

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I've just seen your question. If you havent solved it by now, I could give you one (lots of text...).

Matthias

Former Member
0 Kudos

Hi,

Thank You for responding. I still haven't solved my problem. I would greatly appreciate if you could provide me with some ideas.

Thanks!

Seema

Former Member
0 Kudos

Hi,

the problem is that the xml parser framework needs a predefined xml parser implementation to work. This means the parserfactory you have to create should be directed which implementation of the parser it has to instantiate. The sense behind that is that you can use different or "personalized" parsers for your work. If you do not specify a parser implementation the default (crimson) parser is used. For any reason it will (sometimes at least) not work in ep5.

As described in:

"http://bis.wdf.sap.corp:1080/twiki/bin/view/Techdev/SAPXMLToolkit#Parsing_and_or_Transforming_thro"

which you should read, caus it explains in a more professional manner the whys and hows, the EP5.0.5 contains two parser libs (inqmyxml.jar and xml***.jar) with the needed EP-conform parsers that have to be used. So applying one of these implementations will lead you to success as it did for me.

In addition here is the correct syntax to use, depending on whether you decided for the SAX(2) or DOM(1) approach (I only tested the SAX version):

1. DocumentBuilderFactory db = new com.inqmy.lib.jaxp.DocumentBuilderFactoryImpl();

2. SAXParserFactory db = new com.inqmy.lib.jaxp.SAXParserFactoryImpl();

Perorating I want to excuse for any inaccuracies or even mistakes as I still consider myself as EP (PDK) unexperienced.

Hope you will overcome the adversities with this help.

Greets

Matthias

Former Member
0 Kudos

Hi Matthias,

Thank You so much for your reply..It sure did solve my problem:-)) Only thing is I also had to copy the inqmyxml.jar to the lib folder of my project after which I no longer got the classcast exception.

One more thing: I couldn't open the link which you provided. Any other place where I can find more info abt inqmyxml parser?

Thanks,

Seema

Former Member
0 Kudos

If you reference the inqmy service in your default profile you will not have to include it in the lib directory.

As for docs there are some included with the SAPJ2EE Engine but imho inqmyxml is hopelessly undocumented (I might have missed something though).

Regards

/Fredrik

Former Member
0 Kudos

Hi Seema,

was in vacation...

Yes, Frederik is right. If you use Eclipse, go the project properties (RMB on the project in the package explorer). Move to Service settings/general profile settings. Check the inqmy checkbox. So you can leave the inqmyxml.jar out of the project par file to keep it small. But for working in eclipse you need to mention it in the project properties "Java build path/libraries", otherwise the compiler wont find the imports at compile time.

Unfortunately I can not tell you another place for the link. You should be able to access it as long as you are SAP staff member. It describes among other things in detail the development of different Java and XML issues in SAP environment, especially the compatibility of xml parser and EP versions, what fits, what doesnt, which workaround exist and so on. Even EP6 doesnt support J1.4, so additional work is needed to get it working.

Greets

Matthias