[infinispan-issues] [JBoss JIRA] (ISPN-1921) Non-existing jGroups config file gives unclear exception
Jens Rantil (JIRA)
jira-events at lists.jboss.org
Fri Mar 16 08:30:47 EDT 2012
Jens Rantil created ISPN-1921:
---------------------------------
Summary: Non-existing jGroups config file gives unclear exception
Key: ISPN-1921
URL: https://issues.jboss.org/browse/ISPN-1921
Project: Infinispan
Issue Type: Enhancement
Components: Configuration, Core API
Affects Versions: 5.1.2.FINAL
Reporter: Jens Rantil
Assignee: Manik Surtani
Priority: Minor
Took me a long to figure this out, so I'm creating an issue for it.
When initializing an EmbeddedCacheManager with a transport (jGroups) configuration file that does not exist the following exception is eventually given:
at org.infinispan.factories.GlobalComponentRegistry.start(GlobalComponentRegistry.java:222)
at org.infinispan.manager.DefaultCacheManager.wireCache(DefaultCacheManager.java:654)
at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:619)
at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:516)
at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:489)
[...]
Caused by: org.infinispan.CacheException: Unable to invoke method public void org.infinispan.remoting.transport.jgroups.JGroupsTransport.start() on object
at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:238)
at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:882)
at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:637)
at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:626)
at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:530)
at org.infinispan.factories.GlobalComponentRegistry.start(GlobalComponentRegistry.java:200)
... 38 more
Caused by: org.infinispan.CacheException: java.lang.NullPointerException: the specifed protocol stack configuration was null
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.buildChannel(JGroupsTransport.java:333)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.initChannel(JGroupsTransport.java:252)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.initChannelAndRPCDispatcher(JGroupsTransport.java:292)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.start(JGroupsTransport.java:170)
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:597)
at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:236)
... 43 more
Caused by: java.lang.NullPointerException: the specifed protocol stack configuration was null
at org.jgroups.conf.ConfiguratorFactory.checkForNullConfiguration(ConfiguratorFactory.java:228)
at org.jgroups.conf.ConfiguratorFactory.getStackConfigurator(ConfiguratorFactory.java:60)
at org.jgroups.JChannel.<init>(JChannel.java:136)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.buildChannel(JGroupsTransport.java:330)
... 51 more
I guess the reason why the exception is given first when DefaultCacheManager.getCache(...) is called, is because it is initialized lazily. Sadly, this goes against "Fail early" and it would be useful if the file could not be read at configuration time.
Also, if the file cannot be found/read there should a be a separate Exception thrown for this that states that fact.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list