Project

General

Profile

Task #7743

Improve error message shown when specified data source is not available

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam 8 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Database:
n/a

Description

When we specify that repository should use data source which is not available (or not configured), there is an error being thrown which does not mention that data source is missing. Instead it suggests that bean was not initialized due to unknown error.

=====================
Could not initialize bean repository (class: class
tigase.update.db.UpdateStatsSDRepoBean), skipping injection of this bean
RootCause:
  -> tigase.kernel.KernelException: Unknown bean 'instance'.
     [tigase.kernel.core.Kernel.getInstance(Kernel.java:301)]
=====================


2018-06-13 16:23:59.348 [qtp993343057-57]  Kernel.injectDependencies()
         CONFIG:   Could not initialize bean repository (class: class
tigase.update.db.UpdateStatsSDRepoBean), skipping injection of this bean
tigase.kernel.KernelException: Unknown bean 'instance'.
       at tigase.kernel.core.Kernel.getInstance(Kernel.java:301)
       at
tigase.db.beans.SDRepositoryBean.initialize(SDRepositoryBean.java:119)
       at tigase.kernel.core.Kernel.initBean(Kernel.java:139)
       at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:1213)
       at tigase.kernel.core.Kernel.injectDependency(Kernel.java:821)
       at
tigase.kernel.core.Kernel$DelayedDependenciesInjection.inject(Kernel.java:1489)
       at
tigase.kernel.core.Kernel.finishDependecyDelayedInjection(Kernel.java:537)
       at tigase.kernel.core.Kernel.initBean(Kernel.java:131)
       at tigase.kernel.core.Kernel.getInstance(Kernel.java:938)
       at tigase.kernel.core.Kernel.getInstance(Kernel.java:274)
       at tigase.kernel.core.Kernel$getInstance$0.call(Unknown Source)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
       at
tigase.http.modules.rest.HandlersLoader.loadHandler(HandlersLoader.groovy:48)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
       at
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
       at
tigase.http.modules.rest.HandlersLoader$_loadHandlers_closure1.doCall(HandlersLoader.groovy:64)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)

It would be better to inform a user about missing data source and name of the data source which cannot be found.

Associated revisions

Revision 9cffc809 (diff)
Added by Andrzej Wójcik IoT 1 CloudTigaseTeam 8 months ago

#7743: improved error reporting on missing data source

History

#1 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam 8 months ago

Issue originally reported by %wojtek by email.

#2 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam 8 months ago

  • Status changed from New to In QA
  • Assignee changed from Andrzej Wójcik to Wojciech Kapcia
  • % Done changed from 0 to 100

I've improved error being reported. Now you will have something like this:

=====================
Could not initialize bean default (class: class tigase.pubsub.repository.PubSubDAOPool$PubSubDAOConfigBean), skipping injection of this bean
RootCause:
   -> java.lang.RuntimeException: There is no data source named 'test2'
      [tigase.db.beans.MDRepositoryBean$MDRepositoryConfigBean.initialize(MDRepositoryBean.java:337)]
=====================

and from that it is clear that there is a data source named test2 which is missing and it was used in the configuration of the PubSubDAO.

#3 Updated by Wojciech Kapcia TigaseTeam 8 months ago

  • Status changed from In QA to Closed

Also available in: Atom PDF