-->
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.  [ 9 posts ] 
Author Message
 Post subject: DeployedTreeCacheProvider doesn't work with 2.1.8
PostPosted: Mon Mar 28, 2005 3:19 pm 
Regular
Regular

Joined: Thu Aug 26, 2004 9:23 pm
Posts: 71
It appears that the DeployedTreeCacheProvider implements net.sf.hibernate.cache.CacheProvider for 2.1.7. However, it appears this interface has changed in 2.1.8. Is there an updated version of DeployedTreeCacheProvider anywhere?

Mike

Hibernate version: 2.1.8

Full stack trace of any exception that occurs:

12:17:08,753 WARN [ServiceController] Problem starting service jboss.har:service=am_data/HibernateFactory
java.lang.AbstractMethodError: org.jboss.hibernate.cache.DeployedTreeCacheProvider.start(Ljava/util/Properties;)V
at net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1133)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:804)
at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:583)
at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:551)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:911)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:911)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:413)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:310)
at org.jboss.Main.boot(Main.java:195)
at org.jboss.Main$1.run(Main.java:463)
at java.lang.Thread.run(Thread.java:595)

Name and version of the database you are using: PostgreSQL 8.0


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
For which JBoss version?

I have changes pending locally for jboss 4.0 that will update the DeployedTreeCacheProvider for a number of things, one of which is what you mention.

I am doing no code changes to 3.2.x


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:11 pm 
Regular
Regular

Joined: Thu Aug 26, 2004 9:23 pm
Posts: 71
I'm using 4.0.2 RC1. So if it's in 4.0.2 Final that will be great.

You can probably close the jira issue I created as well.

http://jira.jboss.com/jira/browse/HIBERNATE-10


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:15 pm 
Regular
Regular

Joined: Thu Aug 26, 2004 9:23 pm
Posts: 71
I have another issue pending ragarding JBossCache 1.2.1 and the DeployedTreeCacheProvider. Perhaps you've fixed that one already too?

http://jira.jboss.com/jira/browse/HIBERNATE-11

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
No it will not be in 4.0.2; I was told to hold off commiting my changes until after the release (since the other big thing is that it will upgrade the JBoss-Hibernate intg stuff from Hibernate2 to Hibernate3 ;)

It will, however, be committed immediately after the release is tagged.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
For http://jira.jboss.com/jira/browse/HIBERNATE-11, DeployedTreeCacheProvider now actually obtains the TreeCache via ObjectName and an MBeanServer lookup, rather than through JNDI.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:33 pm 
Regular
Regular

Joined: Thu Aug 26, 2004 9:23 pm
Posts: 71
Quote:
It will, however, be committed immediately after the release is tagged.


Ok well, 4.0.3 RC1 better come quick after 4.0.2 :)

Quote:
DeployedTreeCacheProvider now actually obtains the TreeCache via ObjectName and an MBeanServer lookup, rather than through JNDI.


Sounds good, as long as it works with JBossCache 1.2.1 then that will be fine with me.

If you have the rights you can close those 2 bugs out then.

Thanks,
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Well here is the new code. Just find all occurences of org.hibernate and replace with net.sf.hibernate...

Code:
/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.hibernate.cache;

import org.hibernate.cache.CacheProvider;
import org.hibernate.cache.Cache;
import org.hibernate.cache.CacheException;

import java.util.Properties;

import org.jboss.cache.TreeCache;
import org.jboss.cache.TreeCacheMBean;
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.tm.TxManager;
import org.jboss.logging.Logger;

import javax.management.ObjectName;
import javax.management.MBeanServer;

/**
* A Hibernate CacheProvider implementation which knows how to
* obtain a deployed JBossCache via its JMX ObjectName.
*
* @version <tt>$Revision: 1.3 $</tt>
* @author <a href="mailto:steve@hibernate.org">Steve Ebersole</a>
*/
public class DeployedTreeCacheProvider implements CacheProvider
{
   private static final Logger log = Logger.getLogger( DeployedTreeCacheProvider.class );

   public static final String OBJECT_NAME_PROP = "hibernate.treecache.objectName";
   public static final String DEFAULT_OBJECT_NAME = "jboss.cache:service=HibernateTreeCache";

   private TreeCache deployedTreeCache;

   public void start(Properties properties) throws CacheException
   {
      // Determine the TreeCache MBean ObjectName.
      String configObjectName = properties.getProperty( OBJECT_NAME_PROP, DEFAULT_OBJECT_NAME );
      ObjectName objectName;
      try
      {
         objectName = new ObjectName( configObjectName );
      }
      catch( Throwable t )
      {
         throw new CacheException( "Malformed TreeCache ObjectName");
      }

      TreeCacheMBean mbean;
      try
      {
         MBeanServer server = MBeanServerLocator.locateJBoss();
         mbean = (TreeCacheMBean) MBeanProxy.get(TreeCacheMBean.class, objectName, server);
      }
      catch( Throwable t )
      {
         log.warn( "Unable to locate TreeCache MBean under object name [" + configObjectName + "]", t );
         throw new CacheException( "Unable to locate TreeCache MBean under object name [" + configObjectName + "]" );
      }

      deployedTreeCache = mbean.getInstance();
   }

   public void stop()
   {
      deployedTreeCache = null;
   }

   public boolean isMinimalPutsEnabledByDefault()
   {
      return true;
   }

   /**
    * Called by Hibernate in order to build the given named cache "region".
    *
    * @param name The cache "region" name.
    * @param properties The configuration properties.
    * @return The constructed Cache wrapper around the jndi-deployed TreeCache.
    * @throws CacheException Generally indicates a problem locating the TreeCache.
    */
   public Cache buildCache(String name, Properties properties) throws CacheException
   {
      return new org.hibernate.cache.TreeCache( deployedTreeCache, name, TxManager.getInstance() );
   }

   public long nextTimestamp()
   {
      return System.currentTimeMillis() / 100;
   }
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 7:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
And yes, the TxManager.getInstance() call will go away ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.