-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate Exce..GenericJDBCException: Cannot open coonection
PostPosted: Wed Dec 30, 2009 2:04 am 
Newbie

Joined: Thu Dec 17, 2009 2:49 am
Posts: 3
Hello friends,

I am deploying my ear file using NetBeans 6.5.1,Jboss 5.0.1GA and hibernate.
But while running my application I am getting some exception..The details are given below....
Code:
15:45:24,015 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57c2c5:74f:4b39a9e5:810 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57c2c5:74f:4b39a9e5:810 status: ActionStatus.ABORT_ONLY >)
15:45:24,328 ERROR [STDERR] javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
15:45:24,328 ERROR [STDERR]         at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
15:45:24,328 ERROR [STDERR]         at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
15:45:24,328 ERROR [STDERR]         at cdac.nroa.sessions.CorporateElementsFacade.findCorpIdByElementId(CorporateElementsFacade.java:182)
15:45:24,328 ERROR [STDERR]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:45:24,828 ERROR [STDERR]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
15:45:24,828 ERROR [STDERR]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
15:45:24,828 ERROR [STDERR]         at java.lang.reflect.Method.invoke(Method.java:597)
15:45:24,828 ERROR [STDERR]         at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
15:45:24,828 ERROR [STDERR]         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
15:45:24,828 ERROR [STDERR]         at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
15:45:24,828 ERROR [STDERR]         at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
15:45:24,828 ERROR [STDERR]         at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
15:45:24,828 ERROR [STDERR]         at sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source)
15:45:24,828 ERROR [STDERR]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
15:45:24,828 ERROR [STDERR]         at java.lang.reflect.Method.invoke(Method.java:597)
15:45:24,828 ERROR [STDERR]         at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
15:45:24,828 ERROR [STDERR]         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:45:24,828 ERROR [STDERR]         at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
15:45:24,828 ERROR [STDERR]         at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_29597895.invoke(InvocationContextInterceptor_z_fillMethod_29597895.java)
15:45:24,828 ERROR [STDERR]         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:45:24,828 ERROR [STDERR]         at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
15:45:24,828 ERROR [STDERR]         at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_29597895.invoke(InvocationContextInterceptor_z_setup_29597895.java)


While debugging the code the error point is....
Code:
List<CorporateElements> corporateElements = em.createNamedQuery("CorporateElements.findByCorporateId").setParameter("corporateId",new BigDecimal(Long.toString(2))).getResultList();                 

What I understand is that while an entity want to connect with the database its throwing the above Exception..
There is no problem for a JSP to communicate with database using session bean....It running fine..
Please help me out to sort the problem..
My persistence.xml looks like this...
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="JRLDC-ejbPU" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:/jnrldc/mysql83</jta-data-source>
    <properties>
         <property name="hibernate.archive.autodetection" value="class"/>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
         <!--<property name="hibernate.hbm2ddl.auto" value="create-drop"/>-->
      </properties>
  </persistence-unit>
</persistence>


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

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.