You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Robert Matthews <rm...@nakedobjects.org> on 2011/02/27 22:43:50 UTC
Configuration no longer available to FacetDecorator during initialisation
Guys
A few weeks ago I created a facet decorator to localize my object via a
wiki. I created a FacetDecorator that decorates the Named, DescribedAs
and Help facets. In the constructor I set up a couple of properties
using the IsisConfiguration object, accessed from IsisContext. This
worked fine.
This evening I've update the code and now it fails to get the
configuration object, and my system now won't start up.
Caused by:
org.apache.isis.core.commons.config.IsisConfigurationException: No
configuration available
at
org.apache.isis.core.runtime.context.IsisContext.getConfiguration(IsisContext.java:309)
at
com.planchaser.help.LocalizationDownloader.init(LocalizationDownloader.java:30)
at
com.planchaser.help.LocalizationFacetDecorator.<init>(LocalizationFacetDecorator.java:21)
at
com.planchaser.help.LocalizationInstaller.createDecorators(LocalizationInstaller.java:18)
at
org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createFacetDecorators(JavaReflectorInstaller.java:268)
at
org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createFacetDecorators(JavaReflectorInstaller.java:243)
at
org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createReflector(JavaReflectorInstaller.java:96)
at
org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createReflector(JavaReflectorInstaller.java:55)
at
org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.obtainReflector(IsisSystemUsingInstallers.java:295)
at
org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.createSessionFactory(IsisSystemUsingInstallers.java:122)
at
org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.doCreateSessionFactory(IsisSystemUsingInstallers.java:103)
at
org.apache.isis.core.runtime.system.IsisSystemAbstract.init(IsisSystemAbstract.java:124)
at
org.apache.isis.core.runtime.runner.IsisModule.provideIsisSystem(IsisModule.java:165)
... 55 more
What is the reason for the configuration object no longer being
available? Should the decorators have a initialization process?
Regards
Rob
Re: Configuration no longer available to FacetDecorator during initialisation
Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
Hi Robert,
I did re-arrange the order of initialisation in core.runtime.system
IsisSystemAbstract.java#Init()
Now:
showSplash(splashLoader);
sessionFactory = doCreateSessionFactory(deploymentType);
// temporarily make a configuration available
// REVIEW: would rather inject this, or perhaps even the
ConfigurationBuilder
IsisContext.setConfiguration(getConfiguration());
initContext(sessionFactory);
Was:
showSplash(splashLoader);
// temporarily make a configuration available
// REVIEW: would rather inject this, or perhaps even the
ConfigurationBuilder
IsisContext.setConfiguration(getConfiguration());
sessionFactory = doCreateSessionFactory(deploymentType);
initContext(sessionFactory);
In short, I moved "sessionFactory = ..." earlier. This was required as
the full context was not available during the Sql objectstore
initialisation.
Looks like this is causing your problem, since your issue is at line 124
in this file (.. doCreateSessionFactory). We need to find a solution that
solves both our problems...
Regards,
Kevin
On 27 Feb 2011 at 22:42, dan haywood wrote:
> Hi Rob,
>
> I know that Kevin made some changes relating to SQL object store a week or
> two back, as I recall it was to do with picking up configuration
> information. Not making accusations or anything, but I wonder if that had
> an unintended side-effect?
>
> Dan
>
>
>
>
> On 27 February 2011 21:43, Robert Matthews <rm...@nakedobjects.org>wrote:
>
> > Guys
> >
> > A few weeks ago I created a facet decorator to localize my object via a
> > wiki. I created a FacetDecorator that decorates the Named, DescribedAs and
> > Help facets. In the constructor I set up a couple of properties using the
> > IsisConfiguration object, accessed from IsisContext. This worked fine.
> >
> > This evening I've update the code and now it fails to get the configuration
> > object, and my system now won't start up.
> >
> > Caused by: org.apache.isis.core.commons.config.IsisConfigurationException:
> > No configuration available
> > at
> > org.apache.isis.core.runtime.context.IsisContext.getConfiguration(IsisContext.java:309)
> > at
> > com.planchaser.help.LocalizationDownloader.init(LocalizationDownloader.java:30)
> > at
> > com.planchaser.help.LocalizationFacetDecorator.<init>(LocalizationFacetDecorator.java:21)
> > at
> > com.planchaser.help.LocalizationInstaller.createDecorators(LocalizationInstaller.java:18)
> > at
> > org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createFacetDecorators(JavaReflectorInstaller.java:268)
> > at
> > org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createFacetDecorators(JavaReflectorInstaller.java:243)
> > at
> > org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createReflector(JavaReflectorInstaller.java:96)
> > at
> > org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createReflector(JavaReflectorInstaller.java:55)
> > at
> > org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.obtainReflector(IsisSystemUsingInstallers.java:295)
> > at
> > org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.createSessionFactory(IsisSystemUsingInstallers.java:122)
> > at
> > org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.doCreateSessionFactory(IsisSystemUsingInstallers.java:103)
> > at
> > org.apache.isis.core.runtime.system.IsisSystemAbstract.init(IsisSystemAbstract.java:124)
> > at
> > org.apache.isis.core.runtime.runner.IsisModule.provideIsisSystem(IsisModule.java:165)
> > ... 55 more
> >
> > What is the reason for the configuration object no longer being available?
> > Should the decorators have a initialization process?
> >
> > Regards
> > Rob
> >
> >
>
--
Kevin Meyer, PhD, Pr.Sci.Nat
KMZ P.O. Box 9822, Sharon Park, South Africa.
Tel: +27 11 363 2001 Cell: +27 83 346 3045
Re: Configuration no longer available to FacetDecorator during initialisation
Posted by dan haywood <da...@haywood-associates.co.uk>.
Hi Rob,
Hmm, dunno. Don't think I've done anything that intentionally would have
changed this behaviour. I did end up having to move
isis-registry.properties into a different package (still in core.runtime) to
deal with a classloading issue in the archetype project, but I don't think
that's related.
I know that Kevin made some changes relating to SQL object store a week or
two back, as I recall it was to do with picking up configuration
information. Not making accusations or anything, but I wonder if that had
an unintended side-effect?
Dan
On 27 February 2011 21:43, Robert Matthews <rm...@nakedobjects.org>wrote:
> Guys
>
> A few weeks ago I created a facet decorator to localize my object via a
> wiki. I created a FacetDecorator that decorates the Named, DescribedAs and
> Help facets. In the constructor I set up a couple of properties using the
> IsisConfiguration object, accessed from IsisContext. This worked fine.
>
> This evening I've update the code and now it fails to get the configuration
> object, and my system now won't start up.
>
> Caused by: org.apache.isis.core.commons.config.IsisConfigurationException:
> No configuration available
> at
> org.apache.isis.core.runtime.context.IsisContext.getConfiguration(IsisContext.java:309)
> at
> com.planchaser.help.LocalizationDownloader.init(LocalizationDownloader.java:30)
> at
> com.planchaser.help.LocalizationFacetDecorator.<init>(LocalizationFacetDecorator.java:21)
> at
> com.planchaser.help.LocalizationInstaller.createDecorators(LocalizationInstaller.java:18)
> at
> org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createFacetDecorators(JavaReflectorInstaller.java:268)
> at
> org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createFacetDecorators(JavaReflectorInstaller.java:243)
> at
> org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createReflector(JavaReflectorInstaller.java:96)
> at
> org.apache.isis.defaults.progmodel.JavaReflectorInstaller.createReflector(JavaReflectorInstaller.java:55)
> at
> org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.obtainReflector(IsisSystemUsingInstallers.java:295)
> at
> org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.createSessionFactory(IsisSystemUsingInstallers.java:122)
> at
> org.apache.isis.core.runtime.system.installers.IsisSystemUsingInstallers.doCreateSessionFactory(IsisSystemUsingInstallers.java:103)
> at
> org.apache.isis.core.runtime.system.IsisSystemAbstract.init(IsisSystemAbstract.java:124)
> at
> org.apache.isis.core.runtime.runner.IsisModule.provideIsisSystem(IsisModule.java:165)
> ... 55 more
>
> What is the reason for the configuration object no longer being available?
> Should the decorators have a initialization process?
>
> Regards
> Rob
>
>