Re: Passing parameters to nested components

2011-08-16 Thread Marek Matus
Thanks for your response.

If I use PageAttached and PageDetached like this:

@PageAttached
void onPageAttached() {
environment.push(IPageParams.class, this.pageParams);
}

@PageDetached
void onPageDetached() {
environment.pop(IPageParams.class);
}

Then I receive this error message in nested component:

Render queue error in SetupRender[DashboardSubmitter:edit]: No object of
type com.test.data.*IPageParams *is available from the Environment.
Available types are com.test.data.*IPageParams*,
org.apache.tapestry5.RenderSupport,
org.apache.tapestry5.ValidationDecorator,
org.apache.tapestry5.internal.services.DocumentLinker,
org.apache.tapestry5.services.ClientBehaviorSupport,
org.apache.tapestry5.services.Heartbeat,
org.apache.tapestry5.services.javascript.JavaScriptSupport.

The requested class IPageParams is available but is not load from
enviromental. (I shuld note that I use tapestry 5.2.6.)

Thanks for your help.

Marek


2011/8/17 Thiago H. de Paula Figueiredo 

> On Tue, 16 Aug 2011 16:59:19 -0300, Marek Matus 
> wrote:
>
>  Hi,
>>
>
> Hi!
>
>  I have tried to use @PageAttached and @PageDettached functions which are
>> called for form submission too, but it doesn't work because (I think)
>> there is used different class loader and nested component doesn't load the
>> data
>> from environmental.
>>
>
> @PageAttached and @PageDettached events should work in your case. I'm
> sorry, but your explanation makes little sense. How have you declared your
> event handler methods?
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>


Passing parameters to nested components

2011-08-16 Thread Marek Matus
Hi,

I'm using Environmental to passing parameters to nested components. In my
page there is:

   @SetupRender
void onSetupRenderer() {
environment.push(IPageParams.class, this.pageParams);
}

@AfterRender
void afterRender()
{
environment.pop(IPageParams.class);
}

In my nested components is:

@Environmental
private IPageParams pageParams;

It works fine for page rendering but when a form is submitted then the
onSetupRenderer is not called and parameters are not passed to nested
component :-(.
I have tried to use @PageAttached and @PageDettached functions which are
called for form submission too, but it doesn't work because (I think) there
is used different class loader and nested component doesn't load the data
from environmental.

Could you advice me how to put parameters to environmental for page
rendering and form submitting?

Thanks,

Marek


Re: Problem deploying tapestry webapp

2011-02-23 Thread Marek Matus
I had similar problem - the problem was that the class loader cannot load
sax parser. I had to explicit define which sax parser should be loaded by
setting:

-Dorg.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser

Marek

2011/2/23 Ulrich Stärk 

> Can you give us some more information? What request was sent to the server,
> can you post some code
> (page/component class and template)?
>
> Uli
>
> On 23.02.2011 22:35, Andreas Deininger wrote:
> > Hi all,
> >
> > I just created a first tapestry webapp. I can run mvn tomcat:run
> > locally, and everything is fine. However, after running mvn package
> > and deploying the app to my server (apache tomat 6.0.10) I'm getting
> > the error listed below. Any idea what's wrong here?
> >
> > Thanks
> > Andreas
> >
> > Stacktrace:
> >
> > org.apache.tapestry5.ioc.internal.OperationException: -1
> >
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:102)
> >
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:69)
> >
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
> >
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
> >
> org.apache.tapestry5.internal.services.TemplateParserImpl.parseTemplate(TemplateParserImpl.java:57)
> >
> $TemplateParser_12e54598525.parseTemplate($TemplateParser_12e54598525.java)
> >
> org.apache.tapestry5.internal.services.ComponentTemplateSourceImpl.parseTemplate(ComponentTemplateSourceImpl.java:153)
> >
> org.apache.tapestry5.internal.services.ComponentTemplateSourceImpl.getTemplate(ComponentTemplateSourceImpl.java:136)
> >
> $ComponentTemplateSource_12e54598524.getTemplate($ComponentTemplateSource_12e54598524.java)
> >
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:226)
> >
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:219)
> >
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
> >
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
> >
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
> >
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:218)
> >
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:208)
> >
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:180)
> >
> org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:174)
> >
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
> >
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
> >
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
> >
> org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:173)
> >   $PageLoader_12e5459851b.loadPage($PageLoader_12e5459851b.java)
> >
> org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:81)
> >   $PageSource_12e5459851a.getPage($PageSource_12e5459851a.java)
> >
> org.apache.tapestry5.internal.services.NonPoolingRequestPageCacheImpl.get(NonPoolingRequestPageCacheImpl.java:74)
> >
> $RequestPageCache_12e54598519.get($RequestPageCache_12e54598519.java)
> >
> $RequestPageCache_12e54598513.get($RequestPageCache_12e54598513.java)
> >
> org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77)
> >
> $RequestExceptionHandler_12e545984f1.handleRequestException($RequestExceptionHandler_12e545984f1.java)
> >
> org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
> >
> $RequestHandler_12e545984f4.service($RequestHandler_12e545984f4.java)
> >
> org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:984)
> >
> $RequestHandler_12e545984f4.service($RequestHandler_12e545984f4.java)
> >
> org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:974)
> >
> $RequestHandler_12e545984f4.service($RequestHandler_12e545984f4.java)
> >
> org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
> >
> $RequestHandler_12e545984f4.service($RequestHandler_12e545984f4.java)
> >
> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
> >
> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:80)
> >
> org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
> >
> org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
> >
> $RequestHandler_12e545984f4.service($RequestHandler_12e545984f4.java)
> >
> $RequestHandler_12e54598

Re: Error after logout

2011-02-17 Thread Marek Matus
Thank you very much for your help!

Marek

2011/2/17 Kalle Korhonen 

> You are logging out the Subject, right? See this (from
>
> http://svn.codehaus.org/tynamo/trunk/tynamo-example-federatedaccounts/src/main/java/org/tynamo/examples/federatedaccounts/pages/Index.java
> ):
>Object onActionFromLogout() {
>// Need to call this explicitly to invoke onlogout handlers
> (for
> remember me etc.)
>SecurityUtils.getSubject().logout();
>try {
>// the session is already invalidated, but need to
> cause an
> exception since tapestry doesn't know about it
>// and you'll get a container exception message
> instead without
> this. Unfortunately, there's no way of
>// configuring Shiro to not invalidate sessions
> right now. See
> DefaultSecurityManager.logout()
>// There's a similar issues in Tapestry - Howard has
> fixed, but no
> in T5.2.x releases yet
>request.getSession(false).invalidate();
>} catch (Exception e) {
>}
>
>return this;
>}
>
> I don't have the Tapestry issue at hand. Perhaps try with 5.3-SNAPSHOT
> first without other changes if that's an option.
>
> Kalle
>
>
> On Thu, Feb 17, 2011 at 7:59 AM, Marek Matus 
> wrote:
> > Hi all,
> >
> > I have application with tomcat 7.0.4,  tapestry 5.2.4, tynamo security
> > 0.3.0. Sometimes after logout I receise this error - see bellow.
> > Could you give me advice what could be wrong?
> >
> > Thanks,
> >
> > Marek
> >
> > HTTP Status 500 -
> > --
> >
> > *type* Exception report
> >
> > *message*
> >
> > *description* *The server encountered an internal error () that prevented
> it
> > from fulfilling this request.*
> >
> > *exception*
> >
> > java.io.IOException: Filtered request failed.
> >
>  
> org.tynamo.security.filter.SecurityRequestFilter.service(SecurityRequestFilter.java:174)
> >
>  
> $HttpServletRequestFilter_12e33dd15c1.service($HttpServletRequestFilter_12e33dd15c1.java)
> >
>  
> $HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)
> >
>  
> org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:928)
> >
>  
> $HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)
> >
>  
> $HttpServletRequestHandler_12e33dd15bc.service($HttpServletRequestHandler_12e33dd15bc.java)
> >
>  com.b2bcentrum.mks.t5.services.MKSFilter.doFilter(MKSFilter.java:114)
> >
>  
> com.b2bcentrum.mks.t5.services.ServiceHolderFilter.doFilter(ServiceHolderFilter.java:58)
> >
> > *root cause*
> >
> > javax.servlet.ServletException: Filtered request failed.
> >
>  
> org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:294)
> >
>  
> org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:81)
> >
>  
> org.tynamo.security.filter.SecurityRequestFilter.service(SecurityRequestFilter.java:164)
> >
>  
> $HttpServletRequestFilter_12e33dd15c1.service($HttpServletRequestFilter_12e33dd15c1.java)
> >
>  
> $HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)
> >
>  
> org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:928)
> >
>  
> $HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)
> >
>  
> $HttpServletRequestHandler_12e33dd15bc.service($HttpServletRequestHandler_12e33dd15bc.java)
> >
>  com.b2bcentrum.mks.t5.services.MKSFilter.doFilter(MKSFilter.java:114)
> >
>  
> com.b2bcentrum.mks.t5.services.ServiceHolderFilter.doFilter(ServiceHolderFilter.java:58)
> >
> > *root cause*
> >
> > java.lang.IllegalStateException: removeAttribute: Session already
> invalidated
> >
>  
> org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1311)
> >
>  
> org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1286)
> >
>  
> org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1391)
> >
>  
> org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1362)
> >
>  
> org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:142)
> >
>  
> org.apac

Error after logout

2011-02-17 Thread Marek Matus
Hi all,

I have application with tomcat 7.0.4,  tapestry 5.2.4, tynamo security
0.3.0. Sometimes after logout I receise this error - see bellow.
Could you give me advice what could be wrong?

Thanks,

Marek

HTTP Status 500 -
--

*type* Exception report

*message*

*description* *The server encountered an internal error () that prevented it
from fulfilling this request.*

*exception*

java.io.IOException: Filtered request failed.

org.tynamo.security.filter.SecurityRequestFilter.service(SecurityRequestFilter.java:174)

$HttpServletRequestFilter_12e33dd15c1.service($HttpServletRequestFilter_12e33dd15c1.java)

$HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)

org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:928)

$HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)

$HttpServletRequestHandler_12e33dd15bc.service($HttpServletRequestHandler_12e33dd15bc.java)
com.b2bcentrum.mks.t5.services.MKSFilter.doFilter(MKSFilter.java:114)

com.b2bcentrum.mks.t5.services.ServiceHolderFilter.doFilter(ServiceHolderFilter.java:58)

*root cause*

javax.servlet.ServletException: Filtered request failed.

org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:294)

org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:81)

org.tynamo.security.filter.SecurityRequestFilter.service(SecurityRequestFilter.java:164)

$HttpServletRequestFilter_12e33dd15c1.service($HttpServletRequestFilter_12e33dd15c1.java)

$HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)

org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:928)

$HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)

$HttpServletRequestHandler_12e33dd15bc.service($HttpServletRequestHandler_12e33dd15bc.java)
com.b2bcentrum.mks.t5.services.MKSFilter.doFilter(MKSFilter.java:114)

com.b2bcentrum.mks.t5.services.ServiceHolderFilter.doFilter(ServiceHolderFilter.java:58)

*root cause*

java.lang.IllegalStateException: removeAttribute: Session already invalidated

org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1311)

org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1286)

org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1391)

org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1362)

org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:142)

org.apache.tapestry5.internal.services.SessionImpl.restoreDirtyObjects(SessionImpl.java:135)

org.apache.tapestry5.internal.services.RestoreDirtySessionObjects.requestDidComplete(RestoreDirtySessionObjects.java:38)

org.apache.tapestry5.internal.services.EndOfRequestEventHubImpl.fire(EndOfRequestEventHubImpl.java:40)

$EndOfRequestEventHub_12e33dd15a5.fire($EndOfRequestEventHub_12e33dd15a5.java)

org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:988)
$RequestHandler_12e33dd15d0.service($RequestHandler_12e33dd15d0.java)

org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:974)
$RequestHandler_12e33dd15d0.service($RequestHandler_12e33dd15d0.java)

org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
$RequestHandler_12e33dd15d0.service($RequestHandler_12e33dd15d0.java)

org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)

org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:80)

org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)

org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
$RequestHandler_12e33dd15d0.service($RequestHandler_12e33dd15d0.java)
$RequestHandler_12e33dd15c3.service($RequestHandler_12e33dd15c3.java)

org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:272)

org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)

$HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHandler_12e33dd15c5.java)

org.tynamo.resteasy.ResteasyRequestFilter.service(ResteasyRequestFilter.java:71)

$HttpServletRequestFilter_12e33dd15c0.service($HttpServletRequestFilter_12e33dd15c0.java)

$HttpServletRequestHandler_12e33dd15c5.service($HttpServletRequestHand