RE: [Hibernate] Complex class loaders hierarchy

2005-06-14 Thread Max Andersen
Title: [Hibernate] Complex class loaders hierarchy







cant see your attachement (at netcafe ,), but im quite sure this is 
not the right solution to this *eclipse* problem ,)

And I cant recall having this issue when installing own 
classloader.

you should go to eclipse and look for the bug talking about buddy 
classloading which can handle
this via eclipse classloader madness.

max



From: 
[EMAIL PROTECTED] on behalf of Ivan S. 
DubrovSent: Tue 14-06-2005 17:00To: 
hibernate-devel@lists.sourceforge.netSubject: [Hibernate] Complex 
class loaders hierarchy

Hello,I've trying to use Hibernate in the environment 
with complex classloaders hierarchy (Eclipse plugin). During my experiments I've 
found the following problem. In order to proxy generation (via cglib) to work it 
is required that HibernateProxy is visible from the classloader that loads mine 
entities (since CGLib Enhancer by default uses superclass 
classloader).But in mine environment this is not true, since I do not 
want to make plugin with entities to depend on the plugin with Hibernate jar (so 
hibernate classes are not visible from the classloader that loads 
entities).To make Hibernate see my entities I set my own thread context 
classloader that "sees" both Hibernate jars and enities. So what I want is to 
make Enhancer use this classloader when generating proxy too.I propose 
the following modification to the CGLIBLazyInitializer:First, try 
generate proxy with default classloaders (superclass classloader). If it fails, 
try to generate proxy with Enhancer classloader set to the current thread 
context classloader. I think, this will be consistent with current 
implementation, since it already uses thread context classloader to load 
entities (so why not to use this classloader for proxy generation 
too?).I've attached a simple patch for this issue that shows the 
idea.




Fw: RE: [Hibernate] Complex class loaders hierarchy

2005-06-14 Thread Ivan S. Dubrov
 
cant see your attachement (at netcafe ,), but im quite sure this is not the 
right solution to this *eclipse* problem ,)
 
And I cant recall having this issue when installing own classloader.
 
you should go to eclipse and look for the bug talking about buddy classloading 
which can handle
this via eclipse classloader madness.
 
max

No. This is not bug. I understand all Eclipse classloaders madness. This is 
feature :) 

I'll try to describe it again. I do not want make my entity classes see 
hibernate jar's (because I want to support pluggable persistence layers, for 
example via Hibernate or via JDBC, etc). Saying it another way, classloader of 
mine entity classes do not see hibernate classes - I just _want_ it to be this 
way. But when Hibernate generates proxy factory, it uses default Enhancer 
create method, look at the snippet:

return (Factory) Enhancer.create(
(interfaces.length==1) ?
persistentClass : null,
interfaces,
NULL_METHOD_INTERCEPTOR
);

If you look into the Enhancer source code, you'll see that if classloader was 
not set explicitly it uses superclass (the class that will be used as 
superclass for generated proxy) classloader. And the superclass in this case is 
mine entity class. So CGLib tries to generate proxy using my entity 
classloader. But interfaces array contains HibernateProxy interface, and this 
is class from Hibernate jar, so it is not seen from my entity classloader (this 
is by desire). So CGLib fails to generate proxy (with an exception of 
ClassNotFoundException).

That's the problem. I've solved it very simple - in case of 
CodeGenerationException thrown from the Enhancer.create(), I call Enhancer 
again, but with classloader explicitly set to the 
Thread.currentThread().getContextClassLoader(). I think this is OK, since 
ReflectHelper already uses thread context classloader to load entities (that's 
why my entity is loaded by the Hibernate successfully, despite the fact that it 
is in the different classloader than Hibernate itself). 

I think the current behaviour of Hibernate is inconsistent - it can load entity 
classes from unrelated classloader (using the thread context classloader), but 
it fails to generate proxies for them (since it requires classloader of entity 
classes to see HibernateProxy class).

The better way, of course, will be the ability to pass Hibernate classloader 
that will be used both for loading entity and generating proxy for it.



---
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61 plasma display: http://www.necitguy.com/?r=20
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Websphere 5.1 and Oracle 9x XA

2005-06-14 Thread Shankar Srinivasan
Hi,
  We are using hibernate to develop our application. Everything
seems to work fine when I run it on WebSphere and SQLServer. But I'm
getting the following exception when using the oracle datasource.

[6/14/05 11:17:56:417 PDT] 37074a26 MCWrapper E J2CA0081E: Method
cleanup failed while trying to execute method cleanup on
ManagedConnection
[EMAIL PROTECTED] from
resource PostXDB. Caught exception: com.ibm.ws.exception.WsException:
DSRA0080E: An exception was received by the Data Store Adapter. See
original exception message: Cannot call 'cleanup' on a
ManagedConnection while it is still in a transaction..

at 
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.init(DataStoreAdapterException.java:217)
at 
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.init(DataStoreAdapterException.java:171)
at 
com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:209)
at 
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(WSRdbManagedConnectionImpl.java:2613)
at 
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManagedConnectionImpl.java:2320)
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java:1169)
at 
com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:326)
at 
com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1275)
at 
com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1678)
at 
com.ibm.ejs.j2c.ConnectionEventListener.connectionClosed(ConnectionEventListener.java:217)
at 
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processConnectionClosedEvent(WSRdbManagedConnectionImpl.java:1042)
at 
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.closeWrapper(WSJdbcConnection.java:561)
at 
com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:126)
at 
com.postx.websphere.hibernate.WSDataSourceConnectionProvider.closeConnection(WSDataSourceConnectionProvider.java:104)
at 
net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:103)
at 
net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1160)
at 
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:794)
at 
net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:163)
at 
net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:130)
at 
com.postx.hibernate.PxHibernateService.start(PxHibernateService.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at 
com.tivoli.jmx.DynamicMBeanSupport.invokeMethod(DynamicMBeanSupport.java:242)
at 
com.tivoli.jmx.DynamicMBeanSupport.invoke(DynamicMBeanSupport.java:166)
at 
com.tivoli.jmx.GenericMBeanSupport.invoke(GenericMBeanSupport.java:178)
at com.tivoli.jmx.MBeanAccess.invoke(MBeanAccess.java:113)
at com.tivoli.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:290)
at 
com.postx.startup.ServiceLauncherThread.run(ServiceLauncherThread.java:269)

Let me know if you have run into a similar problem.

Thanks

Shankar


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77alloc_id492op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] Websphere 5.1 and Oracle 9x XA

2005-06-14 Thread Gavin King
Please do NOT post things like this to the dev list!

Thanks.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Shankar Srinivasan
Sent: Tuesday, 14 June 2005 2:32 PM
To: hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] Websphere 5.1 and Oracle 9x XA

Hi,
  We are using hibernate to develop our application. Everything
seems to work fine when I run it on WebSphere and SQLServer. But I'm
getting the following exception when using the oracle datasource.

[6/14/05 11:17:56:417 PDT] 37074a26 MCWrapper E J2CA0081E: Method
cleanup failed while trying to execute method cleanup on
ManagedConnection
[EMAIL PROTECTED] from
resource PostXDB. Caught exception: com.ibm.ws.exception.WsException:
DSRA0080E: An exception was received by the Data Store Adapter. See
original exception message: Cannot call 'cleanup' on a
ManagedConnection while it is still in a transaction..

at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.init(DataSto
reAdapterException.java:217)
at
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.init(DataSto
reAdapterException.java:171)
at
com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(Adapter
Util.java:209)
at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(
WSRdbManagedConnectionImpl.java:2613)
at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManaged
ConnectionImpl.java:2320)
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java:1169)
at
com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java:326)
at
com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java:1275)
at
com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:1678)
at
com.ibm.ejs.j2c.ConnectionEventListener.connectionClosed(ConnectionEvent
Listener.java:217)
at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processConnectionClo
sedEvent(WSRdbManagedConnectionImpl.java:1042)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.closeWrapper(WSJdbcConnection
.java:561)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:126)
at
com.postx.websphere.hibernate.WSDataSourceConnectionProvider.closeConnec
tion(WSDataSourceConnectionProvider.java:104)
at
net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
103)
at
net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1160
)
at
net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:794)
at
net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateServi
ce.java:163)
at
net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:130)
at
com.postx.hibernate.PxHibernateService.start(PxHibernateService.java:142
)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at
com.tivoli.jmx.DynamicMBeanSupport.invokeMethod(DynamicMBeanSupport.java
:242)
at
com.tivoli.jmx.DynamicMBeanSupport.invoke(DynamicMBeanSupport.java:166)
at
com.tivoli.jmx.GenericMBeanSupport.invoke(GenericMBeanSupport.java:178)
at com.tivoli.jmx.MBeanAccess.invoke(MBeanAccess.java:113)
at
com.tivoli.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:290)
at
com.postx.startup.ServiceLauncherThread.run(ServiceLauncherThread.java:2
69)

Let me know if you have run into a similar problem.

Thanks

Shankar


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77alloc_id492op=ick
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77alloc_id492op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Wanted: Documentation maintainer

2005-06-14 Thread Christian Bauer
The Hibernate team is looking for a new member to help with the  
documentation process. This is mostly a maintenance and coordination  
job.


Responsibilities include:

- Organization of the Wiki Community Area on the hibernate.org website
- Coordination of the translator team (15 writers from all over the  
world)

- Working on the DocBook documentation build process
- Helping developers to write consistent docs
- Proof-reading and correction of English (master) documentation

This is good opportunity if you want to get more familiar with  
Hibernate and if you plan to study the documentation in detail.  
However, English should be your native language.


If you are interested in joining a successful open source project,  
drop me an email.




---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel