• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception when calling a webservice with typemapping from a servlet

 
Vijaishanker bala
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my application, I am trying to call a webservice from a servlet.This setup has a typemapping which works fine,when I call it from a java program. I have bundled the required beans(for typemapping) as a .jar file and have placed it in the webapp's lib directory.When I get get the servlet to call the web service, I get the following exception,


org.xml.sax.SAXException: Unable to create JavaBean of type searchComponent.schema.ResultBean. Missing default constructor? Error was: java.lang.InstantiationException: searchComponent.schema.ResultBean.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
at org.apache.axis.client.Call.invoke(Call.java:2275)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at searchComponent.servlets.FacadeServlet.doGetResults(FacadeServlet.java:108)
at searchComponent.servlets.FacadeServlet.doPost(FacadeServlet.java:63)
at searchComponent.servlets.FacadeServlet.doGet(FacadeServlet.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.matrixone.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke


When in the beans,which I am typemapping,I use an empty constructor,it works fine, but all objects that should be obtained from the webservice are created as empty objects(which I think is because of the empty constructor)...In both the servlet and the simple java program, i do register the types with the following code



I dont understand how the java program works fine but not the servlet which is calling the same webservice.


ps: I am using Dynamic Invocation of webservices from both the servlet and the simple java program.

Thanks,

Vijai
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic