Hi Kalle, thank you for your quick response and pointer. I stopped on this testApp track and started focusing on defining a realm based a set of tables in an existing MySQL database and started making some progress. I'll also take a look at the Federated Accounts example.
Thanks, James On Sat, Mar 22, 2014 at 2:02 PM, Kalle Korhonen <kalle.o.korho...@gmail.com>wrote: > The embedded webapp is used for integration testing with > TapestrySecurityIntegrationTest. The easiest way to see the testapp is to > put a breakpoint in one of the tests, run the test and navigate to > localhost:8180. You could technically run the test app via run-jetty-run > but it's not a good example security configuration. I leave creating a > running configuration as a task for you but I bet in your logs, you have a > line similar to this: "Excluded > entry=.../personal/git-tynamo/tapestry-security/target/test-classes". > Perhaps https://github.com/tynamo/tynamo-example-federatedaccounts is a > better sample for usage of tapestry-security. > > Kalle > > > On Sat, Mar 22, 2014 at 8:52 AM, James Cen <cenja...@gmail.com> wrote: > > > Hi All, > > I am still relatively new to Tapestry but I have built simple things > > for proof-of-concept using Tapestry (the latest 5.4-beta-3). I am now > > looking at incorporating security requirements by leveraging the > > Tapestry-Security project (latest version 0.6.1-SNAPSHOT). I have it set > > up in Eclipse. When I run the built-in TestApp on Jetty, it starts > without > > "obvious" problems. But when I hit the URL > > http://localhost:8080/tapestry-security/index, it splats with the the > > following. > > > > It appears there is no defined realm - but looking at the AppModule > > (attached), there is one defined realm using the default realm defined by > > shiro-users.properties (attached). > > > > Going back to the startup console messages, I found this particular line > > warning that the AppModule is not found. > > > > Does explain the problem I am seeing? > > > > What needs to be done differently for me to get this TestApp to work? > > > > Thanks, > > > > James > > > > ***** Console startup messages ***** > > .............. > > [INFO] ioc.RegistryBuilder Adding module definition for class > > org.apache.tapestry5.modules.DashboardModule > > [WARN] tapestry5.TapestryFilter Application Module class > > org.tynamo.security.testapp.services.AppModule not found > <---------------- > > Problem(?) > > [DEBUG] SecurityModule.ClassInterceptorsCache Creating proxy for service > > ClassInterceptorsCache > > [INFO] TapestryModule.ComponentClassResolver Available pages (8): > > .............. > > > > ***** Error messages when hitting > > http://localhost:8080/tapestry-security/index ***** > > .............. > > HTTP ERROR 500 > > > > Problem accessing /tapestry-security/index. Reason: > > > > Error invoking constructor public > org.tynamo.security.services.TapestryRealmSecurityManager(org.tynamo.security.Authenticator,org.apache.shiro.mgt.SubjectFactory,org.apache.shiro.mgt.RememberMeManager,java.util.Collection): > Realms collection argument cannot be empty. > > > > Caused by: > > > > org.apache.tapestry5.ioc.internal.OperationException: Error invoking > constructor public > org.tynamo.security.services.TapestryRealmSecurityManager(org.tynamo.security.Authenticator,org.apache.shiro.mgt.SubjectFactory,org.apache.shiro.mgt.RememberMeManager,java.util.Collection): > Realms collection argument cannot be empty. > > at > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:180) > > at > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88) > > at > org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:89) > > at > org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1112) > > at > org.apache.tapestry5.ioc.internal.util.ConstructionPlan.createObject(ConstructionPlan.java:60) > > at > org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:61) > > at > org.apache.tapestry5.ioc.internal.ReloadableServiceImplementationObjectCreator.createInstance(ReloadableServiceImplementationObjectCreator.java:53) > > at > org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreator$1.invoke(AbstractReloadableObjectCreator.java:133) > > at > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:80) > > at > org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:89) > > at > org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1112) > > at > org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreator.createInstance(AbstractReloadableObjectCreator.java:127) > > at > org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreator.createObject(AbstractReloadableObjectCreator.java:119) > > at $WebSecurityManager_23b306c59f3.delegate(Unknown Source) > > at $WebSecurityManager_23b306c59f3.createSubject(Unknown Source) > > at $WebSecurityManager_23b306c59ef.createSubject(Unknown Source) > > at > org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846) > > at > org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:148) > > at > org.tynamo.security.services.impl.SecurityConfiguration.service(SecurityConfiguration.java:51) > > at $HttpServletRequestFilter_23b306c59ee.service(Unknown Source) > > at $HttpServletRequestFilter_23b306c59e7.service(Unknown Source) > > at $HttpServletRequestHandler_23b306c59ea.service(Unknown Source) > > at > org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:59) > > at $HttpServletRequestHandler_23b306c59ea.service(Unknown Source) > > at > org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) > > at $HttpServletRequestFilter_23b306c59e4.service(Unknown Source) > > at $HttpServletRequestHandler_23b306c59ea.service(Unknown Source) > > at > org.apache.tapestry5.modules.TapestryModule$1.service(TapestryModule.java:797) > > at $HttpServletRequestHandler_23b306c59ea.service(Unknown Source) > > at $HttpServletRequestHandler_23b306c59e3.service(Unknown Source) > > at > org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:166) > > at > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337) > > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484) > > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) > > at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) > > at > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233) > > at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065) > > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413) > > at > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192) > > at > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999) > > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) > > at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) > > at org.eclipse.jetty.server.Server.handle(Server.java:351) > > at > org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) > > at > org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) > > at > org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) > > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) > > at > org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) > > at > org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) > > at > org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) > > at > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) > > at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) > > at > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) > > at java.lang.Thread.run(Thread.java:744) > > Caused by: java.lang.RuntimeException: Error invoking constructor public > org.tynamo.security.services.TapestryRealmSecurityManager(org.tynamo.security.Authenticator,org.apache.shiro.mgt.SubjectFactory,org.apache.shiro.mgt.RememberMeManager,java.util.Collection): > Realms collection argument cannot be empty. > > at > org.apache.tapestry5.ioc.internal.util.ConstructorInvoker.invoke(ConstructorInvoker.java:58) > > at > org.apache.tapestry5.ioc.internal.util.LoggingInvokableWrapper.invoke(LoggingInvokableWrapper.java:42) > > at > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:80) > > ... 52 more > > Caused by: java.lang.IllegalArgumentException: Realms collection > argument cannot be empty. > > at > org.apache.shiro.mgt.RealmSecurityManager.setRealms(RealmSecurityManager.java:78) > > at > org.tynamo.security.services.TapestryRealmSecurityManager.<init>(TapestryRealmSecurityManager.java:31) > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) > > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > > at java.lang.reflect.Constructor.newInstance(Constructor.java:526) > > at > org.apache.tapestry5.ioc.internal.util.ConstructorInvoker.invoke(ConstructorInvoker.java:49) > > ... 54 more > > > > Caused by: > > ..................... > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > >