axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srinadh Karumuri <skaru...@bbn.com>
Subject RE: problem integrating the client in another web application: AxisServlet threw exception
Date Fri, 13 May 2005 14:18:38 GMT
Michael,

Thanks for your reply.

I just started calling the web service in the .jsp file.
Here is my client code from .jsp file:

<%
String endpoint =
"http://localhost:8080/bserv/services/EmployeeDataService";

String[] args = {"getEmployeeLateTSDataArray", "22624", "8524"};
String method = args[0];
String arg1 = args[1];;
String arg2 = args[2];;
Service service = new Service();
Call call = null;
QName qname = null;
Class cls = null;

qname = new QName("EmployeeLateTSArray", "EmployeeLateTSBean");
TypeMappingRegistry tmr = service.getTypeMappingRegistry();
TypeMapping tmlts = tmr.createTypeMapping();
try {
   tmlts.register(
     Class.forName("com.bbn.ws.EmployeeLateTSBean"),
     qname,
     new 
org.apache.axis.encoding.ser.BeanSerializerFactory(EmployeeLateTSBean.class,qname),
     new 
org.apache.axis.encoding.ser.BeanDeserializerFactory(EmployeeLateTSBean.class,qname));
   } catch (ClassNotFoundException e1) {
     e1.printStackTrace();
   }
tmr.register("http://schemas.xmlsoap.org/soap/encoding/", tmlts);

qname = new QName("EmployeeLateTSArray", "EmployeeLateTSBeanArray");
call = (Call) service.createCall();
call.setReturnType (qname);
try {
   call.setTargetEndpointAddress(new java.net.URL(endpoint));
} catch (MalformedURLException e2) {
   e2.printStackTrace();
}
call.setOperationName(method);
call.addParameter("admnum", XMLType.XSD_INTEGER, ParameterMode.IN);
call.addParameter("mgrnum", XMLType.XSD_INTEGER, ParameterMode.IN);
call.setReturnType(qname);
System.out.println("Called method: " + method + "(" + arg1 + "," + arg2 + ")");
EmployeeLateTSBean e[] = (EmployeeLateTSBean[])call.invoke(new Object[] { 
new Integer(arg1), new Integer(arg2) });
%>
<%= e[0].toString(); %>

I will look into using HttpClient as you suggested.

Thanks again,
Sri

At 05:47 PM 5/12/2005, Michael Oliver wrote:
>Sri,
>
>Its hard to tell what you are doing because we don't see any of the
>source, but I can tell you that I use commons HttpClient to access one
>servlet from another servlet all day long with no problems so you can at
>least know that should work.
>
>Michael Oliver
>CTO
>Alarius Systems LLC
>6800 E. Lake Mead Blvd, #1096
>Las Vegas, NV 89156
>Phone:(702)643-7425
>Fax:(702)974-0341
>*Note new email changed from oliverm@matrix-media.com
>
>-----Original Message-----
>From: Srinadh Karumuri [mailto:skarumur@bbn.com]
>Sent: Thursday, May 12, 2005 1:11 PM
>To: axis-user@ws.apache.org
>Subject: problem integrating the client in another web application:
>AxisServlet threw exception
>
>Well,
>
>Now it's scary.
>
>I wrote test client code and my services work quite well. Now I am
>trying
>to call these services from my web application which is residing on the
>same Tomcat and getting the following exception.
>
>Can anyone direct/guide me? If this doesn't work then I will have to
>dump
>the Axis altogether and go to plan B which I am reluctant to do.
>
>Thanks for any help,
>-Sri
>
>2005-05-12 15:42:28 StandardWrapperValve[AxisServlet]: Servlet.service()
>
>for servlet AxisServlet threw exception
>javax.servlet.ServletException: Servlet execution threw an exception
>         at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>tionFilterChain.java:222)
>         at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>erChain.java:146)
>         at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
>e.java:209)
>         at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
>nvokeNext(StandardPipeline.java:596)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
>33)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
>         at
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
>e.java:144)
>         at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
>nvokeNext(StandardPipeline.java:596)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
>33)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
>         at
>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:235
>8)
>         at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>:133)
>         at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
>nvokeNext(StandardPipeline.java:596)
>         at
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
>lve.java:118)
>         at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
>nvokeNext(StandardPipeline.java:594)
>         at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
>:116)
>         at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
>nvokeNext(StandardPipeline.java:594)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
>33)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
>         at
>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
>java:127)
>         at
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
>nvokeNext(StandardPipeline.java:596)
>         at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
>33)
>         at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
>         at
>org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
>         at
>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:79
>9)
>         at
>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
>onnection(Http11Protocol.java:705)
>         at
>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:57
>7)
>         at
>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
>.java:683)
>         at java.lang.Thread.run(Thread.java:534)
>----- Root Cause -----
>java.lang.LinkageError: loader constraints violated when linking
>javax/xml/soap/SOAPMessage class
>         at
>org.apache.axis.transport.http.AxisServlet.createMessageContext(AxisServ
>let.java:1041)
>         at
>org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:799)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
>         at
>org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.j
>ava:339)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
>         at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>tionFilterChain.java:200)
>         at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>erChain.java:146)
>         at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
>e.java:209)

Mime
View raw message