Memcached configuration error

93 views
Skip to first unread message

sed

unread,
Jan 6, 2010, 11:28:58 AM1/6/10
to nhusers
I'm really struggling with an error I receive when unit testing with
Memcached configure for the second level cache

The stack output shows
--NullReferenceException
at Memcached.ClientLibrary.SockIOPool.Initialize()
at NHibernate.Caches.MemCache.MemCacheProvider.Start(IDictionary`2
properties)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg,
IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
C:\MyTrade\Mytrade.Core\Persistence\NHibernateSessionManager.cs
(23,0): at Mytrade.Core.Persistence.NHibernateSessionManager..ctor()
C:\MyTrade\Mytrade.Core\Persistence\NHibernateSessionManager.cs
(16,0): at Mytrade.Core.Persistence.NHibernateSessionManager..cctor()


Heres my entire configuration file. I don't see what can be wrong

<?xml version="1.0" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate" />
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
<section name="memcache"
type="NHibernate.Caches.MemCache.MemCacheSectionHandler,NHibernate.Caches.MemCache" /
>
</configSections>

<memcache>
<memcached host="192.168.1.6" port="11211" weight="1" />
</memcache>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="dialect">
Mytrade.Core.Persistence.Dialect, Mytrade.Core
</property>
<property name="connection.driver_class">
NHibernate.Driver.SqlClientDriver
</property>
<property name="connection.connection_string">
connectionstuff
</property>
<property
name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory,
NHibernate.ByteCode.LinFu</property>
<property
name="cache.provider_class">NHibernate.Caches.MemCache.MemCacheProvider,NHibernate.Caches.MemCache</
property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
</session-factory>
</hibernate-configuration>

<log4net>
<appender name="rollingFile"
type="log4net.Appender.RollingFileAppender,log4net" >
<param name="File" value="C:\new\log.txt" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value="yyyy.MM.dd" />
<param name="StaticLogFileName" value="true" />
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x]
&lt;%X{auth}&gt; - %m%n" />
</layout>
</appender>
<root>
<priority value="ALL" />
<appender-ref ref="rollingFile" />
</root>
<logger name="Memcached.ClientLibrary.SockIOPool">
<priority value="ALL" />
<appender-ref ref="rollingFile" />
</logger>
</log4net>
</configuration>


Does anyone have any ideas?

Message has been deleted

sed

unread,
Jan 6, 2010, 2:17:35 PM1/6/10
to nhusers
Nope. It still isn't working but if I stick the Hashtable provider in
there it works.

No clues anyone as to what I could have misconfigured?

sed

unread,
Jan 6, 2010, 4:34:49 PM1/6/10
to nhusers
I've moved everything to the app.config and no longer get the
NullReferenceException, yet it still does not use the Memcache server
and instead hits the database. Switching back to the Hashtable
provider does work.
Reply all
Reply to author
Forward
0 new messages