wood burning stoves 2.0
The moose likes Web Services and the fly likes Exception when calling a webservice with typemapping from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Exception when calling a webservice with typemapping from a servlet" Watch "Exception when calling a webservice with typemapping from a servlet" New topic

Exception when calling a webservice with typemapping from a servlet

Vijaishanker bala
Ranch Hand

Joined: Sep 08, 2005
Posts: 82

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.



When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." <br />Linus Torvalds
I agree. Here's the link: http://aspose.com/file-tools
subject: Exception when calling a webservice with typemapping from a servlet