Hi
Group,
I am trying to access webservice through the PDK. For that , I have created a portal service so that other iViews ( Portal Component) can use.
Following is the set up of my environment ...
PDK : tomcat_pdk_5_0_5_0.zip
JDK : 1.13
Tomcat : 3.3.1a
Development Environment : Eclipse 2.1.1
The axis api allows you to publish web services as well as allows you to consume web services.The reason for using axis is that I already have the web service client part written and running under weblogic for some other application. I want to migrate the same code ( only web service invocation part since it is generic enough) to PDK and use to render some iViews by using the portal service.
I have turned on full debug under axis so that I can where exactly it is throwing an exception. The exception is raised beacause it cannot find a SAX Parser in the classpath. I already have included the xerces.jar file in the .par portal service file. I have included in the .par file all the
.jar file which is required since I am also running the same under weblogic. The question is , Is the xerces.jar (in .par portal service) in the classpath or Is there an older version of SAX parser in the class path or Is there a different way to include third pary .jar files in PDK ????
One more thing, the exception is raised after the web service has been called properly and data is also returned since I can see the response XML being written to the axis client log file. The exception is raised when axis client tries to get an SAX parser for parsing the web service response xml.
The Exception is ...
java.lang.NoSuchMethodError
at org.apache.axis.utils.XMLUtils.getSAXParser(XMLUtils.java:247)
at org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializa
tionContextImpl.java:229)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:546)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:377)
at org.apache.axis.client.Call.invokeEngine(Call.java:2132)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1851)
at org.apache.axis.client.Call.invoke(Call.java:1777)
at org.apache.axis.client.Call.invoke(Call.java:1315)
at localhost.CooperLightingRosettaNetProductSearchServiceSoapBindingStub
.getProductSearch(CooperLightingRosettaNetProductSearchServiceSoapBindingStub.ja
va:673)
at com.cooperindustries.customerfirst.businesslogic.division.lighting.ad
apter.productsearch.CFCLProductSearchStrategy.performSearch(CFCLProductSearchStr
ategy.java:97)
at com.cooperindustries.customerfirst.businesslogic.division.lighting.ad
apter.productsearch.CFCLProductSearchStrategy.searchProduct(CFCLProductSearchStr
ategy.java:65)
at com.cooperindustries.customerfirst.businesslogic.division.lighting.ad
apter.CFCLAdapterImpl.searchProduct(CFCLAdapterImpl.java:86)
at com.cooperindustries.customerfirst.ui.ProductSearch$ProductSearchDynP
age.searchProduct(ProductSearch.java:143)
at com.cooperindustries.customerfirst.ui.ProductSearch$ProductSearchDynP
age.onSendButtonClicked(ProductSearch.java:119)
at java.lang.reflect.Method.invoke(Native Method)
at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:
153)
at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.j
ava:95)
at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(Pag
eProcessorComponent.java:139)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(A
bstractPortalComponent.java:127)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalCompone
nt(PortalRequestManager.java:291)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(P
ortalRequestManager.java:198)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(P
ortalComponentResponse.java:231)
at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:475)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalCompone
nt(PortalRequestManager.java:291)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(P
ortalRequestManager.java:198)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(P
ortalRequestManager.java:483)
at com.sapportals.portal.prt.portalconnection.sapnative.DelegatedPlugIn.
handleRequest(DelegatedPlugIn.java:725)
at com.sapportals.portal.prt.portalconnection.sapnative.PortalPlugIn.han
dleRequest(PortalPlugIn.java:132)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.ja
va:635)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java
:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:4
85)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833
)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(
Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:516)
at java.lang.Thread.run(Thread.java:484)
Please HELP !!!
Thanks
Bhabesh Patel
After doing some more research , I found the following ...
One class in axis client, org.apache.axis.utils.XMLUtils has the following code get an SAX parser ...
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.SAXParser;
import java.lang.reflect.Method;
////
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
parser.getXMLReader(); <<==== Causes Exception !!
////
The exact class name at run time are ...
SAXParserFactory : org.apache.xerces.jaxp.SAXParserFactoryImpl
SAXParser : class org.apache.xerces.jaxp.SAXParserImpl
Both are from xerces.jar file. So the question is why getXMLReader() method is missing. I added the following code to figure the methods available at run time ...
int k = parser.getClass().getMethods().length;
for ( int i=0 ; i < k ; i++)
{
Method method = (Method)parser.getClass().getMethods();
log( "SAXParser Method : " + method.getName() );
}
and the log had the following methods ...
Method Name : hashCode
Method Name : wait
Method Name : wait
Method Name : wait
Method Name : getClass
Method Name : equals
Method Name : toString
Method Name : notify
Method Name : notifyAll
Method Name : parse
Method Name : parse
Method Name : parse
Method Name : parse
Method Name : getParser
Method Name : isNamespaceAware
Method Name : isValidating
The method list does not have getXMLReader() method. So, how do I make sure my xerces.jar file is included since it has the method ( xerces version 2.0.2) ?? What version of xerces is included in the PDK if it exist somewhere since I cannot find it ??
Thanks
Bhabesh Patel
Add a comment