Bug 809060 - Getting CNFE: org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory when using jdbc cache store
Summary: Getting CNFE: org.infinispan.loaders.jdbc.connectionfactory.ManagedConnection...
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: unspecified
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 6.0.0
Assignee: Tristan Tarrant
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-02 11:23 UTC by Martin Gencur
Modified: 2018-09-12 22:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
As a result of a race condition between the server module and the Infinispan subsystem, a server configured with JDBC cache store may occasionally fail to start. The server either started as expected or failed to start. </para> <para> This occurred when the Memcached server attempted to obtain the memcachedCache before the Infinispan subsystem had a chance to start it (even in EAGER mode). As the server module was forcing its own classloader as TCCL, the cache could not find the necessary classes needed by the cache loaders. </para> <para> This behavior is now fixed and a server configured with the JDBC cache store no longer experiences and unexpected starting failures.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
Standalone.xml config (12.24 KB, text/xml)
2012-04-02 11:23 UTC, Martin Gencur
no flags Details

Description Martin Gencur 2012-04-02 11:23:43 UTC
Created attachment 574468 [details]
Standalone.xml config

Description of problem:

I'm not able to start a JDG server when jdbc cache store is configured but this happens only sometimes. Example of such error can be found here: https://hudson.qa.jboss.com/hudson/view/EDG6/view/EDG-REPORTS-FUNC/job/edg-60-jdbc-cache-stores-rhel6-jdk6/67/DATABASE=oracle11gR2,jdk=java16_default,label=dev88-rhel6-x86/testReport/junit/com.jboss.datagrid.test.cachestore.jdbc.stringbased/JdbcStringBasedCacheStorePassivationDisabledTest/testPreloadWithoutPurge/

I was able to reproduce it on my laptop after few attempts to start the JDG server. Attaching standalone.xml configuration...


How reproducible:

Start JDG with the attached config.

Comment 1 Tristan Tarrant 2012-04-03 08:17:20 UTC
Looks like it's getting the TCCL instead of the module classloader of the infinispan subsystem.
Investigating

Comment 2 Tristan Tarrant 2012-04-04 12:47:24 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
This happens very rarely when starting the server, and it cannot happen if the server started successfully. The solution is to restart the server.

Comment 3 Martin Gencur 2012-04-04 12:54:25 UTC
Solution? You mean workaround ? :-)

Comment 4 Misha H. Ali 2012-04-04 16:10:56 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-This happens very rarely when starting the server, and it cannot happen if the server started successfully. The solution is to restart the server.+A server configured with JDBC cache store may occasionally fail to start. If the server starts as expected, this configuration does not cause any problems. If the server fails to start, restarting the server resolves the problem.

Comment 5 Martin Gencur 2012-05-02 08:53:32 UTC
This problem still exists. An example can be found e.g. at https://hudson.qa.jboss.com/hudson/view/EDG6/view/EDG-REPORTS-FUNC/job/edg-60-jdbc-cache-stores-rhel6-jdk6/DATABASE=sybase155,jdk=java16_default,label=dev88-rhel6-x86/69/console, also happening with other databases in the same run.

Comment 6 Tristan Tarrant 2012-05-07 13:05:10 UTC
This was due to a race condition between the server module and the infinispan subsystem and it happened whenever the Memcached server (as it is the only server which does so) attempted to obtain the memcachedCache before the Infinispan subsystem had a chance to start it (even in EAGER mode).
As the server module was forcing its own classloader as TCCL, the cache could not find the necessary classes needed by the cache loaders.

Comment 7 Martin Gencur 2012-05-11 10:45:58 UTC
Verified with ER8. I'm not able to reproduce the bug anymore.

Comment 8 Misha H. Ali 2012-06-05 22:25:02 UTC
This bug is marked for inclusion in the JDG 6 GA Release Notes. Added notes based on c#6 about cause.

Comment 9 Misha H. Ali 2012-06-05 22:25:02 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,7 @@
-A server configured with JDBC cache store may occasionally fail to start. If the server starts as expected, this configuration does not cause any problems. If the server fails to start, restarting the server resolves the problem.+As a result of a race condition between the server module and the Infinispan subsystem, a server configured with JDBC cache store may occasionally fail to start. The server either started as expected or failed to start. 
+</para>
+<para>
+This occurred when the Memcached server attempted to obtain the memcachedCache before the Infinispan subsystem had a chance to start it (even in EAGER mode). As the server module was forcing its own classloader as TCCL, the cache could not find the necessary classes needed by the cache loaders.
+</para>
+<para>
+This behavior is now fixed and a server configured with the JDBC cache store no longer experiences and unexpected starting failures.


Note You need to log in before you can comment on or make changes to this bug.