File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Axis2 - Hibernate problem: cannot handle large pojo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2 - Hibernate problem: cannot handle large pojo" Watch "Axis2 - Hibernate problem: cannot handle large pojo" New topic

Axis2 - Hibernate problem: cannot handle large pojo

Syed Ali

Joined: Oct 08, 2008
Posts: 29
I am building a webservice in eclipse using Axis2-1.4. the webservice works fine if the POJO is at a certain number of fields, but if i increase
the number of fields in my POJO, it kills my eclipse while i am testing and running my webservice in Eclipse.
I tried my webservice with 40 fields in my POJO , the webservice works perfectly excellent but when i increased the
number of fields in my POJO to 95 then my webservice kills the eclipse. There fore even when I generate the client and call the client it gives
java Memory heap error. As we know the webserrvice only use Array and cannot handle List, there for I convert the ArrayList returned
by the hibernate to an array before sending it back to webservice. The following is the code

========== Hibernate DAO code called by the web service ============================
public PositionView[] getPositionList() throws DataAccessException {

HibernateUtil util = new HibernateUtil();
Session session = util.getSessionFactory().getCurrentSession();
ArrayList<PositionView> resultList = (ArrayList<PositionView>) session.createQuery("from PositionView").list();
PositionView[] dataArray = (PositionView[]) resultList.toArray(new PositionView[resultList.size()]);

return dataArray;


========================= the following code is the webservice getting data from the DAO ================

public PositionView[] getData() {

private PositionView[] dataArray;

RiskDao rd = new RiskDAOImpl();
dataArray = rd.getPositionList();
return dataArray;

Please help me this is an urgent requirement. client need a Large POJOwith 100 fields to be passed from the webservice
but for some reason axis2-eclipse cannot handle large POJO and gives a Java Memory Heap Error and kills the Ecliipse while
testing and running the webservice in eclipse....... I tried every thing increasing heap size in Tomcat but nothing seems to help.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

Please void posting in uppercase; read this for more information.

I have removed the all-uppercase from your subject.

[Asking smart questions] [About Bear] [Books by Bear]
Syed Ali

Joined: Oct 08, 2008
Posts: 29
please help me with the above problem , is very urgent production issue...... thanks
I agree. Here's the link:
subject: Axis2 - Hibernate problem: cannot handle large pojo
It's not a secret anymore!