You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bhorvat <ho...@gmail.com> on 2012/06/30 13:35:49 UTC

Breaking auto realding feature with embeded classes

So one of my favourite features is the fact that once I change some piece of
the code, I dont have to restart the application, all I have to do is let
auto reloading work its magic. Sadly I have found a way to break that
feature :(

I have a page that has a bunch of block, so in order to keep things simple I
am using the embeded Enum class to map which block should be displayed.
However once I change something I get the following exception


com.bomahabo.flow.tapestry.pages.Scenes$ShotView cannot be cast to
com.bomahabo.flow.tapestry.pages.Scenes$ShotView

I take it that I can move the embeded class outside and that it wont cause
the problems but since this class is only used in here I would like to keep
it there. Any suggestion about this? Also if someone from dev team is
reading this, are you aware of this problem.

Cheers

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201.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: Breaking auto realding feature with embeded classes

Posted by bhorvat <ho...@gmail.com>.
Thanks for help I will do as you suggest 

cheers

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201p5714208.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: Breaking auto realding feature with embeded classes

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Alas no. All classes inside those packages (and sub packages) are
transformed (re-loaded) by T5. I either stick it in the "services"
package or create a separate package called "util" or "entity".

com.myapp.components
com.myapp.pages
com.myapp.services <-- here
com.myapp.entities  <-- or here
com.myapp.util        <-- or here

Steve.



On 30 June 2012 20:22, bhorvat <ho...@gmail.com> wrote:
> I see, well that makes sense. Can I place that class then inside a components
> page, or better yet components subpackage?
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201p5714206.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: Breaking auto realding feature with embeded classes

Posted by bhorvat <ho...@gmail.com>.
I see, well that makes sense. Can I place that class then inside a components
page, or better yet components subpackage?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201p5714206.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: Breaking auto realding feature with embeded classes

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Correct, the Enum class has to reside outside of the special packages.

Otherwise, as observed, once the Enum class is reloaded, it's a
totally different class, incompatible with any previous references. T5
cannot replace these references as a) they're not injected b) may be
used in non-T5 classes.

Steve.

On 30 June 2012 19:35, bhorvat <ho...@gmail.com> wrote:
> So one of my favourite features is the fact that once I change some piece of
> the code, I dont have to restart the application, all I have to do is let
> auto reloading work its magic. Sadly I have found a way to break that
> feature :(
>
> I have a page that has a bunch of block, so in order to keep things simple I
> am using the embeded Enum class to map which block should be displayed.
> However once I change something I get the following exception
>
>
> com.bomahabo.flow.tapestry.pages.Scenes$ShotView cannot be cast to
> com.bomahabo.flow.tapestry.pages.Scenes$ShotView
>
> I take it that I can move the embeded class outside and that it wont cause
> the problems but since this class is only used in here I would like to keep
> it there. Any suggestion about this? Also if someone from dev team is
> reading this, are you aware of this problem.
>
> Cheers
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201.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: Breaking auto realding feature with embeded classes

Posted by bhorvat <ho...@gmail.com>.
and the error 

Render queue error in SetupRender[Scenes]:
com.bomahabo.flow.tapestry.pages.Scenes$ShotView cannot be cast to
com.bomahabo.flow.tapestry.pages.Scenes$ShotView

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201p5714211.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: Breaking auto realding feature with embeded classes

Posted by bhorvat <ho...@gmail.com>.
Hi here is the stack trace

com.bomahabo.flow.tapestry.pages.Scenes.conduit_get_selectedShotView(Scenes.java)
com.bomahabo.flow.tapestry.pages.Scenes.initialize(Scenes.java:222)
com.bomahabo.flow.tapestry.pages.Scenes.advised$setupRender_14e72704c1a9(Scenes.java)
com.bomahabo.flow.tapestry.pages.Scenes$Invocation_setupRender_14e72704c1a8.proceedToAdvisedMethod(Unknown
Source)
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:84)
org.apache.tapestry5.internal.transform.ImportWorker$7.advise(ImportWorker.java:214)
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
org.apache.tapestry5.internal.transform.ImportWorker$7.advise(ImportWorker.java:214)
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
org.got5.tapestry5.jquery.services.ImportJQueryUIWorker$2.advise(ImportJQueryUIWorker.java:97)
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
com.bomahabo.flow.tapestry.pages.Scenes.setupRender(Scenes.java)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:174)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:181)
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
org.apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.java:1979)
org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1963)
org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1945)
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1930)
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1916)
org.got5.tapestry5.jquery.services.js.JSModule$1.renderMarkup(JSModule.java:40)
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1898)
org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1879)
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:47)
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:67)
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:64)
org.apache.tapestry5.services.TapestryModule$37.handle(TapestryModule.java:2207)
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)
org.tynamo.security.SecurityComponentRequestFilter.handlePageRender(SecurityComponentRequestFilter.java:50)
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:302)
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:105)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:95)
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119)
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
org.tynamo.security.services.impl.SecurityConfiguration$2.call(SecurityConfiguration.java:106)
org.tynamo.security.services.impl.SecurityConfiguration$2.call(SecurityConfiguration.java:104)
org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
org.tynamo.security.services.impl.SecurityConfiguration.service(SecurityConfiguration.java:104)
org.got5.tapestry5.jquery.services.AjaxUploadServletRequestFilter.service(AjaxUploadServletRequestFilter.java:26)
org.tynamo.resteasy.ResteasyRequestFilter.service(ResteasyRequestFilter.java:100)
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Breaking-auto-realding-feature-with-embeded-classes-tp5714201p5714210.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: Breaking auto realding feature with embeded classes

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sat, 30 Jun 2012 08:35:49 -0300, bhorvat <ho...@gmail.com>  
wrote:

> I have a page that has a bunch of block, so in order to keep things  
> simple I
> am using the embeded Enum class to map which block should be displayed.
> However once I change something I get the following exception
> com.bomahabo.flow.tapestry.pages.Scenes$ShotView cannot be cast to
> com.bomahabo.flow.tapestry.pages.Scenes$ShotView

This is actually expected. Anything that isn't a page (including nested  
classes, unless they're used only inside the page and instances of it not  
passed to other classes) shouldn't be inside the pages package. Make your  
enum class a top-level one and put it outside the Tapestry controlled  
packages.

Could you please provide the complete stack trace?

-- 
Thiago H. de Paula Figueiredo

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