-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: It Hangs . . .
PostPosted: Mon Apr 13, 2009 3:14 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
Hello,
i have Hibernate Configuration as follows:
Code:





if i call function
getPersonById(Long id){ //it fetches obj of person from DB
System.out.println("retrive by id called");
return (EntityType) getHibernateTemplate().get(getPersistentClass(), id);
}

Here Generics is used and HibernateDAO is used these function is called form Spring Bean all thing are configured right....

all works fine...for 3 calls when i call the same function 4th time it hangs the server(Glassfish V3)
and when i stop the server it gives me following exception

Code:
INFO: DBCP borrowObject failed: null
SEVERE: java.lang.NullPointerException
javax.faces.el.EvaluationException: java.lang.NullPointerException
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
        at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
        at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
        at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:337)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
        at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
        at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
        at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
        at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:460)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
        at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
        at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
        at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
        at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
        at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
        at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
Caused by: java.lang.NullPointerException
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:788)
        at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:117)
        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:110)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
        at org.hibernate.loader.Loader.doQuery(Loader.java:673)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
        at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)
        at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
        at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
        at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
        at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
        at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
        at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:477)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
        at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:471)
        at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:465)
        at org.argus.webpanditji.panditJiDAO.hibernate.BaseAbstractDao.getById(BaseAbstractDao.java:83)
        at org.argus.webpanditji.panditJiDAO.hibernate.PersonImpl.getPersonById(PersonImpl.java:26)
        at org.argus.panditji.PanditjiServices.Functions.getBoyGirlInfo(Functions.java:1494)
        at org.argus.panditji.PanditjiServices.AuspWedding.CompAuspDays(AuspWedding.java:126)
        at org.argus.webpanditji.beans.PanchServiceBean.SubmitAuspWedding(PanchServiceBean.java:584)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
        ... 51 more
WARNING: #{PanchServiceBean.SubmitAuspWedding}: java.lang.NullPointerException
javax.faces.FacesException: #{PanchServiceBean.SubmitAuspWedding}: java.lang.NullPointerException
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
        at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
        at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
        at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:337)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
        at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
        at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
        at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
        at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:460)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
        at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
        at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
        at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
        at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
        at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
        at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
        ... 50 more
Caused by: java.lang.NullPointerException
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:788)
        at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:117)
        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:110)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
        at org.hibernate.loader.Loader.doQuery(Loader.java:673)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
        at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)
        at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
        at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
        at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
        at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
        at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
        at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:477)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
        at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:471)
        at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:465)
        at org.argus.webpanditji.panditJiDAO.hibernate.BaseAbstractDao.getById(BaseAbstractDao.java:83)
        at org.argus.webpanditji.panditJiDAO.hibernate.PersonImpl.getPersonById(PersonImpl.java:26)
        at org.argus.panditji.PanditjiServices.Functions.getBoyGirlInfo(Functions.java:1494)
        at org.argus.panditji.PanditjiServices.AuspWedding.CompAuspDays(AuspWedding.java:126)
        at org.argus.webpanditji.beans.PanchServiceBean.SubmitAuspWedding(PanchServiceBean.java:584)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
        ... 51 more
SEVERE: JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /TemplateClients/AuspiciousDayWedding.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1f7857f]
SEVERE: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
java.lang.ThreadDeath
        at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1344)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:154)
        at org.apache.log4j.Category.forcedLog(Category.java:388)
        at org.apache.log4j.Category.log(Category.java:853)
        at org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:257)
        at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:181)
        at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
        at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
        at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
        at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:460)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
        at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
        at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
        at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
        at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
        at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
        at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
INFO: classLoader = WebappClassLoader
  delegate: true
  repositories:
    WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1bb6a69


Top
 Profile  
 
 Post subject: configuration
PostPosted: Mon Apr 13, 2009 3:18 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.url">___</property>
        <property name="hibernate.connection.username">___</property>
        <property name="hibernate.connection.password">___</property>
        <property name="current_session_context_class">thread</property>
        <property name="hibernate.connection.pool_size">1</property>
        <property name="hibernate.c3p0.max_size">50</property>
        <property name="hibernate.c3p0.min_size">2</property>
        <property name="hibernate.c3p0.timeout">5000</property>
        <property name="hibernate.c3p0.max_statements">100</property>
        <property name="hibernate.c3p0.idle_test_period">3000</property>
        <property name="hibernate.c3p0.acquire_increment">2</property>
        <property name="hibernate.c3p0.validate">false</property>
        <mapping class="org.argus.webpanditji.PaditJiModel.City"/>
        <mapping class="org.argus.webpanditji.PaditJiModel.Country"/>
        <mapping class="org.argus.webpanditji.PaditJiModel.Person"/>
        <mapping class="org.argus.webpanditji.PaditJiModel.State"/>
    </session-factory>
</hibernate-configuration>


and Context.xml file

Code:
<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
       xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

    <bean class="org.apache.commons.dbcp.BasicDataSource"  id="dataSource">
        <property name="driverClassName">
            <value>oracle.jdbc.driver.OracleDriver</value>
        </property>
        <property name="url">
            <value>___</value>
        </property>
        <property name="username">
            <value>___</value>
        </property>
        <property name="password">
            <value>___</value>
        </property>
         
    </bean>
    <bean
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" id="sessionFactory">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="configLocation">

                <value>classpath:/hibernate.cfg.xml</value>

        </property>

       <property name="annotatedClasses">
           <list>
               <value>
                    org.argus.webpanditji.PaditJiModel.Country
               </value>
               <value>
                    org.argus.webpanditji.PaditJiModel.State
               </value>
               <value>
                    org.argus.webpanditji.PaditJiModel.City
               </value>
               <value>
                    org.argus.webpanditji.PaditJiModel.Person
               </value>
           </list>

           </property>


    </bean>
    <bean class="org.springframework.orm.hibernate3.HibernateTemplate" id="hibernateTemplate">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>
     <bean id="CountryImpl" class="org.argus.webpanditji.panditJiDAO.hibernate.CountryImpl">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

   <bean id="CityImpl" class="org.argus.webpanditji.panditJiDAO.hibernate.CityImpl">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

  <bean id="StateImpl" class="org.argus.webpanditji.panditJiDAO.hibernate.StateImpl">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

  <bean id="PersonImpl" class="org.argus.webpanditji.panditJiDAO.hibernate.PersonImpl">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

 
 
</beans>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 13, 2009 7:15 am 
Beginner
Beginner

Joined: Wed Oct 03, 2007 4:10 am
Posts: 46
Hi,

I don't understand why you configure the connection in two places.

But it seems that your application remains without connection and wait for one to be freed, so I advise you in a first place to make a standalone test case without running into web containter (tomcat..or else). It seems that the request in your application never ends so the connection never return in the pool.

For further help please post the web application descriptor (web.xml).

_________________
Alexandru BARBAT


Top
 Profile  
 
 Post subject: but
PostPosted: Mon Apr 13, 2009 8:25 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
it works fine for 3-4 times then it starts hanging...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 13, 2009 8:33 am 
Beginner
Beginner

Joined: Wed Oct 03, 2007 4:10 am
Posts: 46
I understand that. It seems it runs until you remain without connections in pool and then it hangs because your application doesn;t close connections from one reason or other.

So please (re)read my first reply and post your web.xml if you need further help.

_________________
Alexandru BARBAT


Top
 Profile  
 
 Post subject: web.xml
PostPosted: Mon Apr 13, 2009 8:33 am 
Beginner
Beginner

Joined: Fri Feb 20, 2009 2:19 am
Posts: 33
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <display-name>Archetype Created Web Application</display-name>
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
   
    <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
   
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>TemplateClients/forward.jsp</welcome-file>
    </welcome-file-list>
</web-app>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 13, 2009 9:21 am 
Beginner
Beginner

Joined: Wed Oct 03, 2007 4:10 am
Posts: 46
Try in PersonImpl
...
EntityType getPersonById(Long id){
getHibernateTemplate.setAlwaysUseNewSession(true);
return (EntityType) getHibernateTemplate().get(getPersistentClass(), id);
}


or

try to use this filter for opening/closing hibernate sessions

<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>

...


<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>

_________________
Alexandru BARBAT


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.