You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jacob Bergoo <ja...@gmail.com> on 2008/03/25 02:53:34 UTC

T5: Problems with Tapestry5-Acegi

Hi All, 
I have a problem when I try to integrat the Tapestry5-Acegi project into my
application.
I copied the code from the example application from tapestry5=acegi projects
website and when I tried to run it I got this exception:

20:44:55.150 INFO   [main]
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:209)
>09> Root WebApplicationContext: initialization completed in 4104 ms
[ERROR] ApplicationInitializer Construction of service
ApplicationInitializer failed: Error invoking service builder method
org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
invoking service contribution method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
java.lang.RuntimeException: Error invoking service builder method
org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
invoking service contribution method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:88)
	at
org.apache.tapestry.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29)
	at
org.apache.tapestry.ioc.internal.LifecycleWrappedServiceCreator.createObject(LifecycleWrappedServiceCreator.java:54)
	at
org.apache.tapestry.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:51)
	at
org.apache.tapestry.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:61)
	at
org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:66)
	at
$ApplicationInitializer_118e39c0518._delegate($ApplicationInitializer_118e39c0518.java)
	at
$ApplicationInitializer_118e39c0518.initializeApplication($ApplicationInitializer_118e39c0518.java)
	at
org.apache.tapestry.services.TapestryModule$14.initializeApplication(TapestryModule.java:964)
	at
$ServletApplicationInitializer_118e39c04fc.initializeApplication($ServletApplicationInitializer_118e39c04fc.java)
	at org.apache.tapestry.TapestryFilter.init(TapestryFilter.java:85)
	at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
	at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:310)
	at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:509)
	at org.mortbay.util.Container.start(Container.java:72)
	at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
	at org.mortbay.util.Container.start(Container.java:72)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
	at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
Caused by: java.lang.RuntimeException: Error invoking service contribution
method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:107)
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.contribute(ContributionDefImpl.java:62)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.addToOrderedConfiguration(RegistryImpl.java:501)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getOrderedConfiguration(RegistryImpl.java:367)
	at
org.apache.tapestry.ioc.internal.ServiceResourcesImpl.getOrderedConfiguration(ServiceResourcesImpl.java:88)
	at
org.apache.tapestry.ioc.internal.AbstractServiceCreator.addOrderedConfigurationParameter(AbstractServiceCreator.java:131)
	at
org.apache.tapestry.ioc.internal.AbstractServiceCreator.getParameterDefaultsWithConfiguration(AbstractServiceCreator.java:112)
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.getParameterDefaultsWithConfigurations(ServiceBuilderMethodInvoker.java:47)
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:68)
	... 19 more
Caused by: java.lang.RuntimeException: No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:517)
	at
org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46)
	at
$MasterObjectProvider_118e39c04fd.provide($MasterObjectProvider_118e39c04fd.java)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:621)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:675)
	at
org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:50)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValue(InternalUtils.java:209)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:239)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersForMethod(InternalUtils.java:218)
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:90)
	... 27 more
[WARN] ThreadedServer Failed to start: SocketListener0@0.0.0.0:80
org.mortbay.util.MultiException[java.lang.RuntimeException: Exception
constructing service 'ApplicationInitializer': Error invoking service
builder method org.apache.tapestry.services.TapestryModule.build(Logger,
List) (at TapestryModule.java:895) (for service 'ApplicationInitializer'):
Error invoking service contribution method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session., java.net.BindException: Address already in use:
JVM_Bind]
	at org.mortbay.http.HttpServer.doStart(HttpServer.java:686)
	at org.mortbay.util.Container.start(Container.java:72)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
	at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
java.lang.RuntimeException: Exception constructing service
'ApplicationInitializer': Error invoking service builder method
org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
invoking service contribution method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:76)
	at
$ApplicationInitializer_118e39c0518._delegate($ApplicationInitializer_118e39c0518.java)
	at
$ApplicationInitializer_118e39c0518.initializeApplication($ApplicationInitializer_118e39c0518.java)
	at
org.apache.tapestry.services.TapestryModule$14.initializeApplication(TapestryModule.java:964)
	at
$ServletApplicationInitializer_118e39c04fc.initializeApplication($ServletApplicationInitializer_118e39c04fc.java)
	at org.apache.tapestry.TapestryFilter.init(TapestryFilter.java:85)
	at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
	at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:310)
	at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:509)
	at org.mortbay.util.Container.start(Container.java:72)
	at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
	at org.mortbay.util.Container.start(Container.java:72)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
	at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
Caused by: java.lang.RuntimeException: Error invoking service builder method
org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
invoking service contribution method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:88)
	at
org.apache.tapestry.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29)
	at
org.apache.tapestry.ioc.internal.LifecycleWrappedServiceCreator.createObject(LifecycleWrappedServiceCreator.java:54)
	at
org.apache.tapestry.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:51)
	at
org.apache.tapestry.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:61)
	at
org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:66)
	... 14 more
Caused by: java.lang.RuntimeException: Error invoking service contribution
method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:107)
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.contribute(ContributionDefImpl.java:62)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.addToOrderedConfiguration(RegistryImpl.java:501)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getOrderedConfiguration(RegistryImpl.java:367)
	at
org.apache.tapestry.ioc.internal.ServiceResourcesImpl.getOrderedConfiguration(ServiceResourcesImpl.java:88)
	at
org.apache.tapestry.ioc.internal.AbstractServiceCreator.addOrderedConfigurationParameter(AbstractServiceCreator.java:131)
	at
org.apache.tapestry.ioc.internal.AbstractServiceCreator.getParameterDefaultsWithConfiguration(AbstractServiceCreator.java:112)
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.getParameterDefaultsWithConfigurations(ServiceBuilderMethodInvoker.java:47)
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:68)
	... 19 more
Caused by: java.lang.RuntimeException: No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:517)
	at
org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46)
	at
$MasterObjectProvider_118e39c04fd.provide($MasterObjectProvider_118e39c04fd.java)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:621)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:675)
	at
org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:50)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValue(InternalUtils.java:209)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:239)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersForMethod(InternalUtils.java:218)
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:90)
	... 27 more
java.net.BindException: Address already in use: JVM_Bind
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.PlainSocketImpl.bind(Unknown Source)
	at java.net.ServerSocket.bind(Unknown Source)
	at java.net.ServerSocket.<init>(Unknown Source)
	at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:391)
	at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:477)
	at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:503)
	at org.mortbay.http.SocketListener.start(SocketListener.java:204)
	at org.mortbay.http.HttpServer.doStart(HttpServer.java:716)
	at org.mortbay.util.Container.start(Container.java:72)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
	at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
java.lang.RuntimeException: Exception constructing service
'ApplicationInitializer': Error invoking service builder method
org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
invoking service contribution method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:76)
	at
$ApplicationInitializer_118e39c0518._delegate($ApplicationInitializer_118e39c0518.java)
	at
$ApplicationInitializer_118e39c0518.initializeApplication($ApplicationInitializer_118e39c0518.java)
	at
org.apache.tapestry.services.TapestryModule$14.initializeApplication(TapestryModule.java:964)
	at
$ServletApplicationInitializer_118e39c04fc.initializeApplication($ServletApplicationInitializer_118e39c04fc.java)
	at org.apache.tapestry.TapestryFilter.init(TapestryFilter.java:85)
	at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
	at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:310)
	at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:509)
	at org.mortbay.util.Container.start(Container.java:72)
	at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
	at org.mortbay.util.Container.start(Container.java:72)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
	at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
Caused by: java.lang.RuntimeException: Error invoking service builder method
org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
invoking service contribution method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:88)
	at
org.apache.tapestry.ioc.internal.SingletonServiceLifecycle.createService(SingletonServiceLifecycle.java:29)
	at
org.apache.tapestry.ioc.internal.LifecycleWrappedServiceCreator.createObject(LifecycleWrappedServiceCreator.java:54)
	at
org.apache.tapestry.ioc.internal.InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:51)
	at
org.apache.tapestry.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:61)
	at
org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:66)
	... 14 more
Caused by: java.lang.RuntimeException: Error invoking service contribution
method
com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(OrderedConfiguration,
PasswordEncoder, SaltSource, Session): No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:107)
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.contribute(ContributionDefImpl.java:62)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.addToOrderedConfiguration(RegistryImpl.java:501)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getOrderedConfiguration(RegistryImpl.java:367)
	at
org.apache.tapestry.ioc.internal.ServiceResourcesImpl.getOrderedConfiguration(ServiceResourcesImpl.java:88)
	at
org.apache.tapestry.ioc.internal.AbstractServiceCreator.addOrderedConfigurationParameter(AbstractServiceCreator.java:131)
	at
org.apache.tapestry.ioc.internal.AbstractServiceCreator.getParameterDefaultsWithConfiguration(AbstractServiceCreator.java:112)
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.getParameterDefaultsWithConfigurations(ServiceBuilderMethodInvoker.java:47)
	at
org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(ServiceBuilderMethodInvoker.java:68)
	... 19 more
Caused by: java.lang.RuntimeException: No service implements the interface
org.hibernate.Session.
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:517)
	at
org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46)
	at
$MasterObjectProvider_118e39c04fd.provide($MasterObjectProvider_118e39c04fd.java)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:621)
	at
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:675)
	at
org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:50)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValue(InternalUtils.java:209)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:239)
	at
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersForMethod(InternalUtils.java:218)
	at
org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:90)
	... 27 more
java.net.BindException: Address already in use: JVM_Bind
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.PlainSocketImpl.bind(Unknown Source)
	at java.net.ServerSocket.bind(Unknown Source)
	at java.net.ServerSocket.<init>(Unknown Source)
	at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:391)
	at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:477)
	at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:503)
	at org.mortbay.http.SocketListener.start(SocketListener.java:204)
	at org.mortbay.http.HttpServer.doStart(HttpServer.java:716)
	at org.mortbay.util.Container.start(Container.java:72)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
	at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)

he problem seems to be in this method:
    public static void
contributeApplicationInitializer(OrderedConfiguration<ApplicationInitializerFilter>
configuration,
            final PasswordEncoder passwordEncoder, final SaltSource
saltSource, final Session session) {
        configuration.add("UserInitializer", new
UserInitializerImpl(passwordEncoder, saltSource, session));
    }

but I don't understand the error because i is the same code as in the
example...

Any Idears anyone?

Thanks for the help,
Jacob
-- 
View this message in context: http://www.nabble.com/T5%3A-Problems-with-Tapestry5-Acegi-tp16266687p16266687.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: Problems with Tapestry5-Acegi

Posted by Robin Helgelin <lo...@gmail.com>.
On Thu, Mar 27, 2008 at 7:34 PM, Jonathan Barker
<jo...@gmail.com> wrote:
>
>  This is currently listed on the TODO list:
>
>  http://www.localhost.nu/java/tapestry5-acegi/todo.html

There is initial support for secure methods in 1.0.4-SNAPSHOT
available from http://www.localhost.nu/java/mvn-snapshot.

I'm not using it, so I haven't been able to give it that much testing.

-- 
 regards,
 Robin

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


RE: T5: Problems with Tapestry5-Acegi

Posted by Jonathan Barker <jo...@gmail.com>.
This is currently listed on the TODO list:

http://www.localhost.nu/java/tapestry5-acegi/todo.html


> -----Original Message-----
> From: Jacob Bergoo [mailto:jacob.bergoo@gmail.com]
> Sent: Thursday, March 27, 2008 11:04 AM
> To: users@tapestry.apache.org
> Subject: Re: T5: Problems with Tapestry5-Acegi
> 
> 
> 
> Olle Hallin wrote:
> >
> > Add spring-web.jar or spring-webmvc.jar to your classpath.
> >
> > (Which one depends on which Spring version you use.
> > RequestUtils moved from spring-web.jar to spring-webmvc.jar in version
> > 2.5)
> >
> >
> > tapestry5-acegi does not bring it in automatically.
> >
> > HTH,
> > Olle
> >
> 
> Thanks Olle,
> I pulled in spring-webmvc and now it is working for using @Secure for a
> page, but @Secure for the method call in the example still doesn't work.
> Does that work at all in the Tapestry5-Acegi project? If that is so, do
> you
> have any idear why it doesn't work here?
> Thanks again,
> Jacob
> 
> --
> View this message in context: http://www.nabble.com/T5%3A-Problems-with-
> Tapestry5-Acegi-tp16266687p16325832.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: T5: Problems with Tapestry5-Acegi

Posted by Jacob Bergoo <ja...@gmail.com>.

Olle Hallin wrote:
> 
> Add spring-web.jar or spring-webmvc.jar to your classpath.
> 
> (Which one depends on which Spring version you use.
> RequestUtils moved from spring-web.jar to spring-webmvc.jar in version
> 2.5)
> 
> 
> tapestry5-acegi does not bring it in automatically.
> 
> HTH,
> Olle
> 

Thanks Olle, 
I pulled in spring-webmvc and now it is working for using @Secure for a
page, but @Secure for the method call in the example still doesn't work.
Does that work at all in the Tapestry5-Acegi project? If that is so, do you
have any idear why it doesn't work here?
Thanks again,
Jacob

-- 
View this message in context: http://www.nabble.com/T5%3A-Problems-with-Tapestry5-Acegi-tp16266687p16325832.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: Problems with Tapestry5-Acegi

Posted by Olle Hallin <ol...@gmail.com>.
Add spring-web.jar or spring-webmvc.jar to your classpath.

(Which one depends on which Spring version you use.
RequestUtils moved from spring-web.jar to spring-webmvc.jar in version 2.5)


tapestry5-acegi does not bring it in automatically.

HTH,
Olle


2008/3/27, Jacob Bergoo <ja...@gmail.com>:
>
>
> Hi again,
> thanks to your advice I have manage to come a few steps closer to a
> working
> solution. But now I get this exception:
>
> [WARN] ServletHandler Error for /j_acegi_security_check
> java.lang.NoClassDefFoundError: org/springframework/web/bind/RequestUtils
>         at
>
> org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.rememberMeRequested
> (TokenBasedRememberMeServices.java:360)
>         at
> org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.loginSuccess(
> TokenBasedRememberMeServices.java:366)
>         at
>
> $RememberMeServices_118ee374713.loginSuccess($RememberMeServices_118ee374713.java)
>         at
> org.acegisecurity.ui.AbstractProcessingFilter.successfulAuthentication(
> AbstractProcessingFilter.java:488)
>         at
> org.acegisecurity.ui.AbstractProcessingFilter.doFilter(
> AbstractProcessingFilter.java:266)
>         at
>
> nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper.service
> (HttpServletRequestFilterWrapper.java:52)
>         at
>
> $HttpServletRequestFilter_118ee37470b.service($HttpServletRequestFilter_118ee37470b.java)
>         at
>
> $HttpServletRequestHandler_118ee374711.service($HttpServletRequestHandler_118ee374711.java)
>         at
>
> nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper$1.doFilter
> (HttpServletRequestFilterWrapper.java:57)
>         at
> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(
> HttpSessionContextIntegrationFilter.java:249)
>         at
>
> nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper.service
> (HttpServletRequestFilterWrapper.java:52)
>         at
>
> $HttpServletRequestFilter_118ee37470a.service($HttpServletRequestFilter_118ee37470a.java)
>         at
>
> $HttpServletRequestHandler_118ee374711.service($HttpServletRequestHandler_118ee374711.java)
>         at
>
> $HttpServletRequestHandler_118ee374709.service($HttpServletRequestHandler_118ee374709.java)
>         at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java
> :168)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:821)
>         at
>
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> (OpenSessionInViewFilter.java:198)
>         at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(
> OncePerRequestFilter.java:75)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:821)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(
> WebApplicationHandler.java:471)
>         at org.mortbay.jetty.servlet.ServletHandler.handle(
> ServletHandler.java:568)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>         at
> org.mortbay.jetty.servlet.WebApplicationContext.handle(
> WebApplicationContext.java:633)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>         at org.mortbay.http.HttpConnection.service(HttpConnection.java
> :820)
>         at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java
> :986)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
>         at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>         at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> Caused by: java.lang.ClassNotFoundException:
> org.springframework.web.bind.RequestUtils
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>         ... 31 more
>
>   And on the web page it say:
> HTTP ERROR: 500
>
> org/springframework/web/bind/RequestUtils
>
> RequestURI=/j_acegi_security_check
>
> This is what I have done so far:
>
> In my AppModule.java:
>
> public static void contributeApplicationDefaults(
>                         MappedConfiguration<String, String> configuration)
> {
>
>         configuration.add("tapestry.supported-locales", "en");
>         configuration.add("acegi.loginform.url", "/loginPage");
>
>         configuration.add("acegi.password.salt", "");
>         configuration.add("acegi.accessDenied.url", "/SecurityException");
> }
>
>
> public static void contributeProviderManager(
>         OrderedConfiguration<AuthenticationProvider> configuration,
>         @InjectService("DaoAuthenticationProvider")
>
>         AuthenticationProvider daoAuthenticationProvider) {
>
>         configuration.add("daoAuthenticationProvider",
> daoAuthenticationProvider);
> }
>
> I have a UserDetailsServiceImpl like this:
> public class UserDetailsServiceImpl implements UserDetailsService {
>
>         /* PRIVATE MEMBERS */
>         private AppUserDao appUserDao;
>
>         /* DAO SETTERS */
>         public void setAppUserDao(AppUserDao appUserDao){
>                 this.appUserDao = appUserDao;
>         }
>
>         public UserDetails loadUserByUsername(String username) throws
> UsernameNotFoundException, DataAccessException {
>                 return new UserDetailsBean(appUserDao.findById(username));
>         }
> }
>
> I hoocked up this service using spring:
> <bean id="userDetailsService"
> class="com.bergoo.webshop.services.internal.UserDetailsServiceImpl">
>         <property name="appUserDao" ref="appUserDao"/>
> </bean>
>
> UserDetailsBean is the same as from the example for Tapestry5-Acegi
> project
> except that I added a constructor that take in my AppUser object and I
> added
> a new toString() method so I can see the content.
>
> GrantedAuthorityBean.java, Start.java, Start.tml, LoginPage.java,
> LoginPage.tml, Secure.java, Secure.tml are the same as in the example...
>
> I put a system.out.println() in the end of the constructor where I create
> the UserDetailsBean and this is what the sysout returns:
>
> UserDetailsBean {
>         username = jacob
>         password = jacob
>         accountNonExpired = true
>         passwordaccountNonLocked = true
>         credentialsNonExpired = true
>         enabled = true
>         grantedAuthorities {
>                 'ROLE_ADMIN'
>                 'ROLE_MANAGER'
>                 'ROLE_USER'
>         }
> }
>
> That means that The part where I access the database and gets the user
> information for the security check is working... but it looks like I get
> this exception when I am in the loginSuccess method....
>
> Does anybody have any idears on how to fix this exception?
> I have spring-web in my pom.xml...
>
> thanks in advance for any help, pointers...
>
> Jacob
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Problems-with-Tapestry5-Acegi-tp16266687p16321412.html
>
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
olle.hallin@hit.se
www.hit.se

RE: T5: Problems with Tapestry5-Acegi

Posted by Jacob Bergoo <ja...@gmail.com>.
Hi again,
thanks to your advice I have manage to come a few steps closer to a working
solution. But now I get this exception:

[WARN] ServletHandler Error for /j_acegi_security_check
java.lang.NoClassDefFoundError: org/springframework/web/bind/RequestUtils
	at
org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.rememberMeRequested(TokenBasedRememberMeServices.java:360)
	at
org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.loginSuccess(TokenBasedRememberMeServices.java:366)
	at
$RememberMeServices_118ee374713.loginSuccess($RememberMeServices_118ee374713.java)
	at
org.acegisecurity.ui.AbstractProcessingFilter.successfulAuthentication(AbstractProcessingFilter.java:488)
	at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:266)
	at
nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper.service(HttpServletRequestFilterWrapper.java:52)
	at
$HttpServletRequestFilter_118ee37470b.service($HttpServletRequestFilter_118ee37470b.java)
	at
$HttpServletRequestHandler_118ee374711.service($HttpServletRequestHandler_118ee374711.java)
	at
nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper$1.doFilter(HttpServletRequestFilterWrapper.java:57)
	at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
	at
nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper.service(HttpServletRequestFilterWrapper.java:52)
	at
$HttpServletRequestFilter_118ee37470a.service($HttpServletRequestFilter_118ee37470a.java)
	at
$HttpServletRequestHandler_118ee374711.service($HttpServletRequestHandler_118ee374711.java)
	at
$HttpServletRequestHandler_118ee374709.service($HttpServletRequestHandler_118ee374709.java)
	at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168)
	at
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
	at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
	at
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
	at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
	at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
	at org.mortbay.http.HttpServer.service(HttpServer.java:909)
	at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
	at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: java.lang.ClassNotFoundException:
org.springframework.web.bind.RequestUtils
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 31 more

 And on the web page it say:
HTTP ERROR: 500

org/springframework/web/bind/RequestUtils

RequestURI=/j_acegi_security_check

This is what I have done so far:

In my AppModule.java:
public static void contributeApplicationDefaults(
			MappedConfiguration<String, String> configuration) {
	configuration.add("tapestry.supported-locales", "en");
	configuration.add("acegi.loginform.url", "/loginPage");
        configuration.add("acegi.password.salt", "");
        configuration.add("acegi.accessDenied.url", "/SecurityException");
}

public static void contributeProviderManager(
	OrderedConfiguration<AuthenticationProvider> configuration,
	@InjectService("DaoAuthenticationProvider")
	AuthenticationProvider daoAuthenticationProvider) {

	configuration.add("daoAuthenticationProvider", daoAuthenticationProvider);
}

I have a UserDetailsServiceImpl like this:
public class UserDetailsServiceImpl implements UserDetailsService {
    
	/* PRIVATE MEMBERS */
	private AppUserDao appUserDao;

	/* DAO SETTERS */
	public void setAppUserDao(AppUserDao appUserDao){
		this.appUserDao = appUserDao;
	}
	
	public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException, DataAccessException {
		return new UserDetailsBean(appUserDao.findById(username));
	}
}

I hoocked up this service using spring:
<bean id="userDetailsService"
class="com.bergoo.webshop.services.internal.UserDetailsServiceImpl">
	<property name="appUserDao" ref="appUserDao"/>
</bean>	

UserDetailsBean is the same as from the example for Tapestry5-Acegi project
except that I added a constructor that take in my AppUser object and I added
a new toString() method so I can see the content.

GrantedAuthorityBean.java, Start.java, Start.tml, LoginPage.java,
LoginPage.tml, Secure.java, Secure.tml are the same as in the example...

I put a system.out.println() in the end of the constructor where I create
the UserDetailsBean and this is what the sysout returns:

UserDetailsBean {
	username = jacob
	password = jacob
	accountNonExpired = true
	passwordaccountNonLocked = true
	credentialsNonExpired = true
	enabled = true
	grantedAuthorities {
		'ROLE_ADMIN'
		'ROLE_MANAGER'
		'ROLE_USER'
	}
}

That means that The part where I access the database and gets the user
information for the security check is working... but it looks like I get
this exception when I am in the loginSuccess method.... 

Does anybody have any idears on how to fix this exception?
I have spring-web in my pom.xml...

thanks in advance for any help, pointers...

Jacob



-- 
View this message in context: http://www.nabble.com/T5%3A-Problems-with-Tapestry5-Acegi-tp16266687p16321412.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


RE: T5: Problems with Tapestry5-Acegi

Posted by Jonathan Barker <jo...@gmail.com>.
Jacob,


It's definitely possible.

I'm also using Spring, and Hibernate, but this time around, I'm using an
InMemoryDAO and LDAP (Active Directory) for authentication.

By comparing the configuration I did on a Spring-driven T4 Acegi integration
with the code in tapestry5-acegi, I finally started to understand both Acegi
and tapestry-ioc.

You might want to back away from the Hibernate DAO initially just to get the
basics running.  You can then either replace InMemoryDao or just add on your
own Hibernate DAO.

The in-memory dao gives something great for development, so here's what I
did with my AppModule:

1) clear the password salt by contributing to application defaults (easier
for development with the InMemoryDao:

    public static void contributeApplicationDefaults(
            MappedConfiguration<String, String> configuration)
    {
....
        configuration.add("acegi.loginform.url", "/login");
        configuration.add("acegi.password.salt", "");
        configuration.add("acegi.accessDenied.url", "/SecurityException");

    }

2) configure the InMemoryDaoImpl

    public final UserDetailsService buildInMemoryDaoImpl() throws Exception
{
    	InMemoryDaoImpl dao = new InMemoryDaoImpl();
    	Properties props = new Properties();
    	props.put("user","user,ROLE_USER");
    	props.put("supervisor","supervisor,ROLE_SUPERVISOR");
    	props.put("admin","admin,ROLE_ADMIN");
    	UserMap userMap = new UserMap();
    	UserMapEditor.addUsersFromProperties(userMap, props);
    	dao.setUserMap(userMap);
    	dao.afterPropertiesSet();
    	return dao;
    }

3) contribute a provider manager (I've left in my ldap stuff so you can see
how additional auth methods can be added -- just delete any mention of LDAP
below):

    public static void contributeProviderManager(
OrderedConfiguration<AuthenticationProvider> configuration,
@InjectService("DaoAuthenticationProvider") AuthenticationProvider
daoAuthenticationProvider, @InjectService("LdapAuthenticationProvider")
AuthenticationProvider ldapAuthenticationProvider){
 
configuration.add("daoAuthenticationProvider",daoAuthenticationProvider);
 
configuration.add("ldapAuthenticationProvider",ldapAuthenticationProvider);
    }



> -----Original Message-----
> From: Jacob Bergoo [mailto:jacob.bergoo@gmail.com]
> Sent: Monday, March 24, 2008 10:29 PM
> To: users@tapestry.apache.org
> Subject: RE: T5: Problems with Tapestry5-Acegi
> 
> 
> Thanks Jonathan for your quick answer...
> accually I am Using T5, Spring 2.5.1, Hibernate 3.2 so I am looking for a
> solution where I can Use the Acegi for the security and using the @Secure
> annotation for pages/methos... I have seen another wiki page that shows on
> how to set up the Acegi to work with Spring Application Context file, but
> it
> stated that it didn't work with @Secure annotations... so that means that
> all the configurations are done by mapping folder structures and page
> names
> with uer roles... I rather not do that....I want to be able so see on the
> pages I am working on what roles that are allowed for that page...
> 
> So Is there a way of making Tapestry5-Acegi project for my configuration
> or
> do I need to choose the less wanted solution?
> 
> Thanks again for your help,
> Jacob
> --
> View this message in context: http://www.nabble.com/T5%3A-Problems-with-
> Tapestry5-Acegi-tp16266687p16267063.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 2969 (20080324) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 2969 (20080324) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


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


RE: T5: Problems with Tapestry5-Acegi

Posted by Jacob Bergoo <ja...@gmail.com>.
Thanks Jonathan for your quick answer...
accually I am Using T5, Spring 2.5.1, Hibernate 3.2 so I am looking for a
solution where I can Use the Acegi for the security and using the @Secure
annotation for pages/methos... I have seen another wiki page that shows on
how to set up the Acegi to work with Spring Application Context file, but it
stated that it didn't work with @Secure annotations... so that means that
all the configurations are done by mapping folder structures and page names
with uer roles... I rather not do that....I want to be able so see on the
pages I am working on what roles that are allowed for that page...

So Is there a way of making Tapestry5-Acegi project for my configuration or
do I need to choose the less wanted solution?

Thanks again for your help,
Jacob
-- 
View this message in context: http://www.nabble.com/T5%3A-Problems-with-Tapestry5-Acegi-tp16266687p16267063.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


RE: T5: Problems with Tapestry5-Acegi

Posted by Jonathan Barker <jo...@gmail.com>.
The Tapestry5-Acegi project is set up to use Hibernate (hence the Session).
Tapestry-ioc is trying to inject the Session, but apparently you don't have
a Session service available.

Do you want to use a Hibernate-based DAO for authentication? Consider using
the tapestry-hibernate package.

Jonathan


> -----Original Message-----
> From: Jacob Bergoo [mailto:jacob.bergoo@gmail.com]
> Sent: Monday, March 24, 2008 9:54 PM
> To: users@tapestry.apache.org
> Subject: T5: Problems with Tapestry5-Acegi
> 
> 
> Hi All,
> I have a problem when I try to integrat the Tapestry5-Acegi project into
> my
> application.
> I copied the code from the example application from tapestry5=acegi
> projects
> website and when I tried to run it I got this exception:
> 
> 20:44:55.150 INFO   [main]
> org.springframework.web.context.ContextLoader.initWebApplicationContext(Co
> ntextLoader.java:209)
> >09> Root WebApplicationContext: initialization completed in 4104 ms
> [ERROR] ApplicationInitializer Construction of service
> ApplicationInitializer failed: Error invoking service builder method
> org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
> TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
> invoking service contribution method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> java.lang.RuntimeException: Error invoking service builder method
> org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
> TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
> invoking service contribution method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(
> ServiceBuilderMethodInvoker.java:88)
> 	at
> org.apache.tapestry.ioc.internal.SingletonServiceLifecycle.createService(S
> ingletonServiceLifecycle.java:29)
> 	at
> org.apache.tapestry.ioc.internal.LifecycleWrappedServiceCreator.createObje
> ct(LifecycleWrappedServiceCreator.java:54)
> 	at
> org.apache.tapestry.ioc.internal.InterceptorStackBuilder.createObject(Inte
> rceptorStackBuilder.java:51)
> 	at
> org.apache.tapestry.ioc.internal.RecursiveServiceCreationCheckWrapper.crea
> teObject(RecursiveServiceCreationCheckWrapper.java:61)
> 	at
> org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createOb
> ject(JustInTimeObjectCreator.java:66)
> 	at
> $ApplicationInitializer_118e39c0518._delegate($ApplicationInitializer_118e
> 39c0518.java)
> 	at
> $ApplicationInitializer_118e39c0518.initializeApplication($ApplicationInit
> ializer_118e39c0518.java)
> 	at
> org.apache.tapestry.services.TapestryModule$14.initializeApplication(Tapes
> tryModule.java:964)
> 	at
> $ServletApplicationInitializer_118e39c04fc.initializeApplication($ServletA
> pplicationInitializer_118e39c04fc.java)
> 	at org.apache.tapestry.TapestryFilter.init(TapestryFilter.java:85)
> 	at
> org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
> 	at
> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAppl
> icationHandler.java:310)
> 	at
> org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationCont
> ext.java:509)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
> Caused by: java.lang.RuntimeException: Error invoking service contribution
> method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(Contribu
> tionDefImpl.java:107)
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.contribute(Contributi
> onDefImpl.java:62)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.addToOrderedConfiguration(Re
> gistryImpl.java:501)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getOrderedConfiguration(Regi
> stryImpl.java:367)
> 	at
> org.apache.tapestry.ioc.internal.ServiceResourcesImpl.getOrderedConfigurat
> ion(ServiceResourcesImpl.java:88)
> 	at
> org.apache.tapestry.ioc.internal.AbstractServiceCreator.addOrderedConfigur
> ationParameter(AbstractServiceCreator.java:131)
> 	at
> org.apache.tapestry.ioc.internal.AbstractServiceCreator.getParameterDefaul
> tsWithConfiguration(AbstractServiceCreator.java:112)
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.getParameterD
> efaultsWithConfigurations(ServiceBuilderMethodInvoker.java:47)
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(
> ServiceBuilderMethodInvoker.java:68)
> 	... 19 more
> Caused by: java.lang.RuntimeException: No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java
> :517)
> 	at
> org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide
> (MasterObjectProviderImpl.java:46)
> 	at
> $MasterObjectProvider_118e39c04fd.provide($MasterObjectProvider_118e39c04f
> d.java)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:
> 621)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:
> 675)
> 	at
> org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocator
> Impl.java:50)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValu
> e(InternalUtils.java:209)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(In
> ternalUtils.java:239)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersFor
> Method(InternalUtils.java:218)
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(Contribu
> tionDefImpl.java:90)
> 	... 27 more
> [WARN] ThreadedServer Failed to start: SocketListener0@0.0.0.0:80
> org.mortbay.util.MultiException[java.lang.RuntimeException: Exception
> constructing service 'ApplicationInitializer': Error invoking service
> builder method org.apache.tapestry.services.TapestryModule.build(Logger,
> List) (at TapestryModule.java:895) (for service 'ApplicationInitializer'):
> Error invoking service contribution method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session., java.net.BindException: Address already in use:
> JVM_Bind]
> 	at org.mortbay.http.HttpServer.doStart(HttpServer.java:686)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
> java.lang.RuntimeException: Exception constructing service
> 'ApplicationInitializer': Error invoking service builder method
> org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
> TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
> invoking service contribution method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createOb
> ject(JustInTimeObjectCreator.java:76)
> 	at
> $ApplicationInitializer_118e39c0518._delegate($ApplicationInitializer_118e
> 39c0518.java)
> 	at
> $ApplicationInitializer_118e39c0518.initializeApplication($ApplicationInit
> ializer_118e39c0518.java)
> 	at
> org.apache.tapestry.services.TapestryModule$14.initializeApplication(Tapes
> tryModule.java:964)
> 	at
> $ServletApplicationInitializer_118e39c04fc.initializeApplication($ServletA
> pplicationInitializer_118e39c04fc.java)
> 	at org.apache.tapestry.TapestryFilter.init(TapestryFilter.java:85)
> 	at
> org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
> 	at
> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAppl
> icationHandler.java:310)
> 	at
> org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationCont
> ext.java:509)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
> Caused by: java.lang.RuntimeException: Error invoking service builder
> method
> org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
> TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
> invoking service contribution method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(
> ServiceBuilderMethodInvoker.java:88)
> 	at
> org.apache.tapestry.ioc.internal.SingletonServiceLifecycle.createService(S
> ingletonServiceLifecycle.java:29)
> 	at
> org.apache.tapestry.ioc.internal.LifecycleWrappedServiceCreator.createObje
> ct(LifecycleWrappedServiceCreator.java:54)
> 	at
> org.apache.tapestry.ioc.internal.InterceptorStackBuilder.createObject(Inte
> rceptorStackBuilder.java:51)
> 	at
> org.apache.tapestry.ioc.internal.RecursiveServiceCreationCheckWrapper.crea
> teObject(RecursiveServiceCreationCheckWrapper.java:61)
> 	at
> org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createOb
> ject(JustInTimeObjectCreator.java:66)
> 	... 14 more
> Caused by: java.lang.RuntimeException: Error invoking service contribution
> method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(Contribu
> tionDefImpl.java:107)
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.contribute(Contributi
> onDefImpl.java:62)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.addToOrderedConfiguration(Re
> gistryImpl.java:501)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getOrderedConfiguration(Regi
> stryImpl.java:367)
> 	at
> org.apache.tapestry.ioc.internal.ServiceResourcesImpl.getOrderedConfigurat
> ion(ServiceResourcesImpl.java:88)
> 	at
> org.apache.tapestry.ioc.internal.AbstractServiceCreator.addOrderedConfigur
> ationParameter(AbstractServiceCreator.java:131)
> 	at
> org.apache.tapestry.ioc.internal.AbstractServiceCreator.getParameterDefaul
> tsWithConfiguration(AbstractServiceCreator.java:112)
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.getParameterD
> efaultsWithConfigurations(ServiceBuilderMethodInvoker.java:47)
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(
> ServiceBuilderMethodInvoker.java:68)
> 	... 19 more
> Caused by: java.lang.RuntimeException: No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java
> :517)
> 	at
> org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide
> (MasterObjectProviderImpl.java:46)
> 	at
> $MasterObjectProvider_118e39c04fd.provide($MasterObjectProvider_118e39c04f
> d.java)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:
> 621)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:
> 675)
> 	at
> org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocator
> Impl.java:50)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValu
> e(InternalUtils.java:209)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(In
> ternalUtils.java:239)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersFor
> Method(InternalUtils.java:218)
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(Contribu
> tionDefImpl.java:90)
> 	... 27 more
> java.net.BindException: Address already in use: JVM_Bind
> 	at java.net.PlainSocketImpl.socketBind(Native Method)
> 	at java.net.PlainSocketImpl.bind(Unknown Source)
> 	at java.net.ServerSocket.bind(Unknown Source)
> 	at java.net.ServerSocket.<init>(Unknown Source)
> 	at
> org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:391)
> 	at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:477)
> 	at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:503)
> 	at org.mortbay.http.SocketListener.start(SocketListener.java:204)
> 	at org.mortbay.http.HttpServer.doStart(HttpServer.java:716)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
> java.lang.RuntimeException: Exception constructing service
> 'ApplicationInitializer': Error invoking service builder method
> org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
> TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
> invoking service contribution method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createOb
> ject(JustInTimeObjectCreator.java:76)
> 	at
> $ApplicationInitializer_118e39c0518._delegate($ApplicationInitializer_118e
> 39c0518.java)
> 	at
> $ApplicationInitializer_118e39c0518.initializeApplication($ApplicationInit
> ializer_118e39c0518.java)
> 	at
> org.apache.tapestry.services.TapestryModule$14.initializeApplication(Tapes
> tryModule.java:964)
> 	at
> $ServletApplicationInitializer_118e39c04fc.initializeApplication($ServletA
> pplicationInitializer_118e39c04fc.java)
> 	at org.apache.tapestry.TapestryFilter.init(TapestryFilter.java:85)
> 	at
> org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
> 	at
> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAppl
> icationHandler.java:310)
> 	at
> org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationCont
> ext.java:509)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
> Caused by: java.lang.RuntimeException: Error invoking service builder
> method
> org.apache.tapestry.services.TapestryModule.build(Logger, List) (at
> TapestryModule.java:895) (for service 'ApplicationInitializer'): Error
> invoking service contribution method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(
> ServiceBuilderMethodInvoker.java:88)
> 	at
> org.apache.tapestry.ioc.internal.SingletonServiceLifecycle.createService(S
> ingletonServiceLifecycle.java:29)
> 	at
> org.apache.tapestry.ioc.internal.LifecycleWrappedServiceCreator.createObje
> ct(LifecycleWrappedServiceCreator.java:54)
> 	at
> org.apache.tapestry.ioc.internal.InterceptorStackBuilder.createObject(Inte
> rceptorStackBuilder.java:51)
> 	at
> org.apache.tapestry.ioc.internal.RecursiveServiceCreationCheckWrapper.crea
> teObject(RecursiveServiceCreationCheckWrapper.java:61)
> 	at
> org.apache.tapestry.ioc.internal.services.JustInTimeObjectCreator.createOb
> ject(JustInTimeObjectCreator.java:66)
> 	... 14 more
> Caused by: java.lang.RuntimeException: Error invoking service contribution
> method
> com.mycompany.webshop.services.AppModule.contributeApplicationInitializer(
> OrderedConfiguration,
> PasswordEncoder, SaltSource, Session): No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(Contribu
> tionDefImpl.java:107)
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.contribute(Contributi
> onDefImpl.java:62)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.addToOrderedConfiguration(Re
> gistryImpl.java:501)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getOrderedConfiguration(Regi
> stryImpl.java:367)
> 	at
> org.apache.tapestry.ioc.internal.ServiceResourcesImpl.getOrderedConfigurat
> ion(ServiceResourcesImpl.java:88)
> 	at
> org.apache.tapestry.ioc.internal.AbstractServiceCreator.addOrderedConfigur
> ationParameter(AbstractServiceCreator.java:131)
> 	at
> org.apache.tapestry.ioc.internal.AbstractServiceCreator.getParameterDefaul
> tsWithConfiguration(AbstractServiceCreator.java:112)
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.getParameterD
> efaultsWithConfigurations(ServiceBuilderMethodInvoker.java:47)
> 	at
> org.apache.tapestry.ioc.internal.ServiceBuilderMethodInvoker.createObject(
> ServiceBuilderMethodInvoker.java:68)
> 	... 19 more
> Caused by: java.lang.RuntimeException: No service implements the interface
> org.hibernate.Session.
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java
> :517)
> 	at
> org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide
> (MasterObjectProviderImpl.java:46)
> 	at
> $MasterObjectProvider_118e39c04fd.provide($MasterObjectProvider_118e39c04f
> d.java)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:
> 621)
> 	at
> org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:
> 675)
> 	at
> org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocator
> Impl.java:50)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValu
> e(InternalUtils.java:209)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(In
> ternalUtils.java:239)
> 	at
> org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersFor
> Method(InternalUtils.java:218)
> 	at
> org.apache.tapestry.ioc.internal.ContributionDefImpl.invokeMethod(Contribu
> tionDefImpl.java:90)
> 	... 27 more
> java.net.BindException: Address already in use: JVM_Bind
> 	at java.net.PlainSocketImpl.socketBind(Native Method)
> 	at java.net.PlainSocketImpl.bind(Unknown Source)
> 	at java.net.ServerSocket.bind(Unknown Source)
> 	at java.net.ServerSocket.<init>(Unknown Source)
> 	at
> org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:391)
> 	at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:477)
> 	at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:503)
> 	at org.mortbay.http.SocketListener.start(SocketListener.java:204)
> 	at org.mortbay.http.HttpServer.doStart(HttpServer.java:716)
> 	at org.mortbay.util.Container.start(Container.java:72)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
> 	at
> com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
> 
> he problem seems to be in this method:
>     public static void
> contributeApplicationInitializer(OrderedConfiguration<ApplicationInitializ
> erFilter>
> configuration,
>             final PasswordEncoder passwordEncoder, final SaltSource
> saltSource, final Session session) {
>         configuration.add("UserInitializer", new
> UserInitializerImpl(passwordEncoder, saltSource, session));
>     }
> 
> but I don't understand the error because i is the same code as in the
> example...
> 
> Any Idears anyone?
> 
> Thanks for the help,
> Jacob
> --
> View this message in context: http://www.nabble.com/T5%3A-Problems-with-
> Tapestry5-Acegi-tp16266687p16266687.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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