You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Hvass <pe...@theru.in> on 2014/06/25 13:21:15 UTC

Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

Hi guys,

I've been away for a few months on a spelunking hiatus in the murky depths
of PHP so this might just be a really silly question! Apologies if it is!

I'm all set up running 5.4-beta-13 (tapestry-hibernate flavour) and
tapestry-security or at least I was until some time this morning.

Whenever I try to run my projects now I'm getting errors from
HibernateModule saying it can't find x or y Tapestry internal services
(i.e.: PersistentFieldManager, DashboardManager,
ClasspathAssetAliasManager, TemplateParser, AssetObjectProvider).

I try binding these manually in my AppModule and the errors go away. So it
looks like HibernateModule is executing before TapestryModule and I'm a
little bit stumped as to why.

Anyone experienced this before? Happening on Java 6 and 7, Jetty 6, 7 and 8.

Example of one of these error traces:
2014-06-25 14:16:13.727:WARN::Failed startup of context
java.lang.IllegalArgumentException: Contribution
org.apache.tapestry5.hibernate.modules.HibernateModule.provideHibernateDashboardTab(OrderedConfiguration)
(at HibernateModule.java:194) is for service 'interface
org.apache.tapestry5.services.dashboard.DashboardManager' qualified with
marker annotations [], which does not exist.
at
org.apache.tapestry5.ioc.internal.RegistryImpl.validateContributeDefs(RegistryImpl.java:241)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.<init>(RegistryImpl.java:200)
at org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:170)
at
org.apache.tapestry5.internal.TapestryAppInitializer.createRegistry(TapestryAppInitializer.java:199)
at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:103)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at runjettyrun.Bootstrap.main(Bootstrap.java:97)

Thanks!
Peter Hvass

Re: Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

Posted by Peter Hvass <pe...@theru.in>.
Hello all,

Thanks for your replies Thiago and Daniel!

Absolutely correct on Thiago's part though it isn't 5.3.x but 5.4-beta-3!
The culprit is Tynamo's tapestry-security in this case. I overlooked this
multiple times
while checking through my Maven Dependencies due to the 5.4-beta-13 and
5.4-beta-3 looking very similar down the list!

I've now excluded tapestry-security's explicit dependencies and everything
is ship shape.

Really a very big thank you for helping me suss out the problem here! Hope
you both have a great day!

Thanks,
Peter

On Wed, Jun 25, 2014 at 4:41 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Wed, 25 Jun 2014 09:00:23 -0300, Daniel Jue <te...@gmail.com> wrote:
>
>  My intuition says the same thing.  Try forcing a mvn clean or the
>> equivalent.
>>
>
> My intuition says something a little different: some library has a
> dependency on Tapestry 5.3.x, so it ends up in the classpath.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 25 Jun 2014 09:00:23 -0300, Daniel Jue <te...@gmail.com> wrote:

> My intuition says the same thing.  Try forcing a mvn clean or the
> equivalent.

My intuition says something a little different: some library has a  
dependency on Tapestry 5.3.x, so it ends up in the classpath.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

Posted by Daniel Jue <te...@gmail.com>.
My intuition says the same thing.  Try forcing a mvn clean or the
equivalent.
On Jun 25, 2014 7:57 AM, "Thiago H de Paula Figueiredo" <th...@gmail.com>
wrote:

> On Wed, 25 Jun 2014 08:46:45 -0300, Peter Hvass <pe...@theru.in> wrote:
>
>  Digging further I discovered RegistryBuilder and output during startup
>> looks like;
>>
>> [INFO] ioc.RegistryBuilder Adding module definition for class
>> org.apache.tapestry5.ioc.modules.TapestryIOCModule
>> [INFO] ioc.RegistryBuilder Adding module definition for class
>> org.apache.tapestry5.hibernate.modules.HibernateModule
>> [INFO] ioc.RegistryBuilder Adding module definition for class
>> org.apache.tapestry5.json.modules.JSONModule
>> [INFO] ioc.RegistryBuilder Adding module definition for class
>> org.apache.tapestry5.hibernate.modules.HibernateCoreModule
>> [INFO] ioc.RegistryBuilder Adding module definition for class
>> org.tynamo.security.services.SecurityModule
>> [INFO] ioc.RegistryBuilder Adding module definition for class
>> org.apache.tapestry5.modules.TapestryModule
>>
>
> Starting with Tapestry 5.4, some parts of TapestryModule were broken into
> other modules. Some of them are missing in the listing above, something
> which corroborates my guess that have more than one Tapestry version in
> your classpath.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 25 Jun 2014 08:46:45 -0300, Peter Hvass <pe...@theru.in> wrote:

> Digging further I discovered RegistryBuilder and output during startup
> looks like;
>
> [INFO] ioc.RegistryBuilder Adding module definition for class
> org.apache.tapestry5.ioc.modules.TapestryIOCModule
> [INFO] ioc.RegistryBuilder Adding module definition for class
> org.apache.tapestry5.hibernate.modules.HibernateModule
> [INFO] ioc.RegistryBuilder Adding module definition for class
> org.apache.tapestry5.json.modules.JSONModule
> [INFO] ioc.RegistryBuilder Adding module definition for class
> org.apache.tapestry5.hibernate.modules.HibernateCoreModule
> [INFO] ioc.RegistryBuilder Adding module definition for class
> org.tynamo.security.services.SecurityModule
> [INFO] ioc.RegistryBuilder Adding module definition for class
> org.apache.tapestry5.modules.TapestryModule

Starting with Tapestry 5.4, some parts of TapestryModule were broken into  
other modules. Some of them are missing in the listing above, something  
which corroborates my guess that have more than one Tapestry version in  
your classpath.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

Posted by Peter Hvass <pe...@theru.in>.
Digging further I discovered RegistryBuilder and output during startup
looks like;

[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.ioc.modules.TapestryIOCModule
[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.hibernate.modules.HibernateModule
[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.json.modules.JSONModule
[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.hibernate.modules.HibernateCoreModule
[INFO] ioc.RegistryBuilder Adding module definition for class
org.tynamo.security.services.SecurityModule
[INFO] ioc.RegistryBuilder Adding module definition for class
org.apache.tapestry5.modules.TapestryModule

Strikes me that this is really kind of the wrong order...

Now digging to find where this order might be defined.

Thanks,
Peter

*Peter Anders Hvass* - *http://theru.in <http://theru.in>*


On Wed, Jun 25, 2014 at 2:21 PM, Peter Hvass <pe...@theru.in> wrote:

> Hi guys,
>
> I've been away for a few months on a spelunking hiatus in the murky depths
> of PHP so this might just be a really silly question! Apologies if it is!
>
> I'm all set up running 5.4-beta-13 (tapestry-hibernate flavour) and
> tapestry-security or at least I was until some time this morning.
>
> Whenever I try to run my projects now I'm getting errors from
> HibernateModule saying it can't find x or y Tapestry internal services
> (i.e.: PersistentFieldManager, DashboardManager,
> ClasspathAssetAliasManager, TemplateParser, AssetObjectProvider).
>
> I try binding these manually in my AppModule and the errors go away. So it
> looks like HibernateModule is executing before TapestryModule and I'm a
> little bit stumped as to why.
>
> Anyone experienced this before? Happening on Java 6 and 7, Jetty 6, 7 and
> 8.
>
> Example of one of these error traces:
> 2014-06-25 14:16:13.727:WARN::Failed startup of context
> java.lang.IllegalArgumentException: Contribution
> org.apache.tapestry5.hibernate.modules.HibernateModule.provideHibernateDashboardTab(OrderedConfiguration)
> (at HibernateModule.java:194) is for service 'interface
> org.apache.tapestry5.services.dashboard.DashboardManager' qualified with
> marker annotations [], which does not exist.
>  at
> org.apache.tapestry5.ioc.internal.RegistryImpl.validateContributeDefs(RegistryImpl.java:241)
> at
> org.apache.tapestry5.ioc.internal.RegistryImpl.<init>(RegistryImpl.java:200)
>  at
> org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:170)
> at
> org.apache.tapestry5.internal.TapestryAppInitializer.createRegistry(TapestryAppInitializer.java:199)
>  at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:103)
> at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
>  at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> at
> org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)
>  at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
> at
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
>  at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
>  at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
>  at org.mortbay.jetty.Server.doStart(Server.java:224)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
>  at runjettyrun.Bootstrap.main(Bootstrap.java:97)
>
> Thanks!
> Peter Hvass
>

Re: Modules Executing in the Wrong Order? Service Bindings Not Around When Expected?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 25 Jun 2014 08:21:15 -0300, Peter Hvass <pe...@theru.in> wrote:

> Hi guys,

Hi!

> Whenever I try to run my projects now I'm getting errors from
> HibernateModule saying it can't find x or y Tapestry internal services
> (i.e.: PersistentFieldManager, DashboardManager,
> ClasspathAssetAliasManager, TemplateParser, AssetObjectProvider).

Weird. Are you sure you don't have mixed versions of Tapestry in your  
classpath? Like Tapestry 5.3.x and tapestry-hibernate 5.4-beta-x?

> I try binding these manually in my AppModule and the errors go away. So  
> it looks like HibernateModule is executing before TapestryModule and I'm  
> a
> little bit stumped as to why.

Tapestry-IoC is built in such a way that the ordering in which modules are  
loaded is irrelevant, so I think you're basing your conclusions on a wrong  
assumption.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org