geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Denti <paolo.de...@gmail.com>
Subject Re: Problem at geronimo boot
Date Thu, 30 Aug 2007 11:57:49 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Verdana">Hi David, Kevan<br>
first of all, thanks. now it deploys !<br>
<br>
It looks that the transactionManager is correctly looked up but ... at
the first usage of the TM i get this error<br>
</font></font>
<pre>org.springframework.transaction.CannotCreateTransactionException: Could not open
Hibernate Session for transaction; nested exception is java.lang.IllegalArgumentException:
interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader

is it related with geronimo classloading issues ?

Paolo
</pre>
<br>
David Jencks wrote:
<blockquote cite="mid:1BE03DB1-5AB6-4A98-881C-F7F5BBF4B062@yahoo.com"
 type="cite">I'd recommend a slight change...
  <br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AbstractNameQuery query = new
AbstractNameQuery(TransactionManager.class.getName ());
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Set&lt;AbstractName&gt; names = kernel.listGBeans(query);
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (names.size() != 1) {
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
throw new IllegalStateException("Expected one
transaction manager, not " + names.size());
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AbstractName name = names.iterator().next();
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TransactionManager transMg = (TransactionManager)
kernel.getGBean(name);
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return (TransactionManager)transMg;
  <br>
  <br>
I don't think there's a good reason to use a proxy...
  <br>
  <br>
thanks
  <br>
david jencks
  <br>
  <br>
  <br>
On Aug 29, 2007, at 7:02 PM, Viet Nguyen wrote:
  <br>
  <br>
  <blockquote type="cite">Well I try your code Kevan, and I altered it
some to get this:
    <br>
    <br>
package org.hibernate.transaction;
    <br>
    <br>
import java.util.Iterator;
    <br>
import java.util.Properties;
    <br>
import java.util.Set;
    <br>
    <br>
import javax.transaction.TransactionManager ;
    <br>
import org.hibernate.HibernateException;
    <br>
import org.hibernate.transaction.TransactionManagerLookup;
    <br>
    <br>
import org.apache.geronimo.gbean.AbstractName;
    <br>
import org.apache.geronimo.gbean.AbstractNameQuery;
    <br>
import org.apache.geronimo.kernel.Kernel;
    <br>
import org.apache.geronimo.kernel.KernelRegistry;
    <br>
import org.apache.geronimo.kernel.proxy.ProxyManager;
    <br>
    <br>
public class GeronimoTransactionManagerLookup
    <br>
&nbsp;&nbsp;&nbsp; implements TransactionManagerLookup {
    <br>
    <br>
&nbsp;&nbsp; public static final String UserTransactionName =
"java:comp/UserTransaction";
    <br>
    <br>
&nbsp;&nbsp; public TransactionManager getTransactionManager(Properties props)
throws HibernateException {
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Kernel kernel = KernelRegistry.getSingleKernel();
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ProxyManager proxyManager = kernel.getProxyManager();
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AbstractNameQuery query = new
AbstractNameQuery(TransactionManager.class.getName ());
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Set names = kernel.listGBeans(query);
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AbstractName name = null;
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (Iterator it = names.iterator(); it.hasNext();)
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
name = (AbstractName) it.next();
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Object transMg = (Object) proxyManager.createProxy(name,
TransactionManager.class);
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return (TransactionManager)transMg;
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }catch (Exception e) {
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
e.printStackTrace();
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.out.println();
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
throw new HibernateException("Geronimo Transaction Manager
Lookup Failed", e);
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
    <br>
}
    <br>
    <br>
&nbsp;&nbsp; public String getUserTransactionName() {
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return UserTransactionName;
    <br>
&nbsp;&nbsp; }
    <br>
}
    <br>
    <br>
I tested it out and everything works on geronimo-jetty6-jee5-2.0.1
    <br>
    <br>
So I hope you can test it out Paolos.
    <br>
    <br>
Hope this works,
    <br>
Viet Nguyen
    <br>
  </blockquote>
  <br>
  <br>
</blockquote>
</body>
</html>

Mime
View raw message