No object of type org.apache.tapestry5.services.javascript.JavaScriptSupport is available from the Environment.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

No object of type org.apache.tapestry5.services.javascript.JavaScriptSupport is available from the Environment.

jochenfrey
When I am trying to access "JavaScriptSupport" while handling an AJAX event, I seem to consistently get this exception (below).  The code works fine if I am not trying to access JavaScriptSupport within the request handler.

Oddly enough, the error message in the browser says that it's available (see below as well).

This seems to be related to http://tapestry.1045711.n5.nabble.com/T5-2-No-object-of-type-ClientBehaviorSupport-is-available-from-the-Environment-td2652953.html, but it looks like the approach for generating this may have changed in 5.3?

Thanks!
Jochen



org.apache.tapestry5.ioc.util.UnknownValueException
No object of type org.apache.tapestry5.services.javascript.JavaScriptSupport is available from the Environment.
availableValues
Environmentals:

org.apache.tapestry5.TrackableComponentEventCallback
org.apache.tapestry5.services.ComponentEventResultProcessor
org.apache.tapestry5.services.javascript.JavaScriptSupport
Filter stack frames Stack trace
org.apache.tapestry5.internal.services.EnvironmentImpl.peekRequired(EnvironmentImpl.java:88)
org.apache.tapestry5.internal.services.EnvironmentalShadowBuilderImpl$1$1.advise(EnvironmentalShadowBuilderImpl.java:62)
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
com.beckon.app.components.settings.org.OrgCategory.init(OrgCategory.java:91)
com.beckon.app.components.settings.org.OrgCategory.onAddSub(OrgCategory.java:107)
com.beckon.app.components.settings.org.OrgCategory.dispatchComponentEvent(OrgCategory.java)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:923)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1106)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3200(ComponentPageElementImpl.java:61)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1051)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1048)
org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1047)
org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:110)
org.apache.tapestry5.internal.services.ajax.AjaxFormUpdateFilter.handle(AjaxFormUpdateFilter.java:56)
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75)
org.apache.tapestry5.services.TapestryModule$40.handle(TapestryModule.java:2456)
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
com.beckon.app.services.ValidAccountFilter.handleComponentEvent(ValidAccountFilter.java:42)
com.beckon.app.services.PageProtectionFilter.handleComponentEvent(PageProtectionFilter.java:42)
org.apache.tapestry5.services.InitializeActivePageName.handleComponentEvent(InitializeActivePageName.java:39)
org.tynamo.security.SecurityComponentRequestFilter.handleComponentEvent(SecurityComponentRequestFilter.java:42)
org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46)
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:302)
com.beckon.app.services.AppModule$1.service(AppModule.java:154)
com.beckon.app.services.AppModule$2.service(AppModule.java:255)
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.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.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
org.got5.tapestry5.jquery.services.AjaxUploadServletRequestFilter.service(AjaxUploadServletRequestFilter.java:26)
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
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)







---
  [hidden email]
  +1.415.366.0450
  @jochen_frey

Reply | Threaded
Open this post in threaded view
|

Re: No object of type org.apache.tapestry5.services.javascript.JavaScriptSupport is available from the Environment.

jochenfrey
To answer my own question:

Because there is nothing that is getting rendered at that stage (during the event handler), there is no JavaScriptSupport available (because there's no place it could write to just yet).

Once the Ajax response is rendered, JavaScriptSupport is available.

Two helpful links for this:

- The solution to the problem (how to get Tapestry Initializer Calls into the Response): http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Trigger.html

- General information for how to deal with the Environment: http://comments.gmane.org/gmane.comp.java.tapestry.user/93303

J

On Mar 9, 2012, at 12:21 PM, Jochen Frey wrote:

> When I am trying to access "JavaScriptSupport" while handling an AJAX event, I seem to consistently get this exception (below).  The code works fine if I am not trying to access JavaScriptSupport within the request handler.
>
> Oddly enough, the error message in the browser says that it's available (see below as well).
>
> This seems to be related to http://tapestry.1045711.n5.nabble.com/T5-2-No-object-of-type-ClientBehaviorSupport-is-available-from-the-Environment-td2652953.html, but it looks like the approach for generating this may have changed in 5.3?
>
> Thanks!
> Jochen
>
>
>
> org.apache.tapestry5.ioc.util.UnknownValueException
> No object of type org.apache.tapestry5.services.javascript.JavaScriptSupport is available from the Environment.
> availableValues
> Environmentals:
>
> org.apache.tapestry5.TrackableComponentEventCallback
> org.apache.tapestry5.services.ComponentEventResultProcessor
> org.apache.tapestry5.services.javascript.JavaScriptSupport
> Filter stack frames Stack trace
> org.apache.tapestry5.internal.services.EnvironmentImpl.peekRequired(EnvironmentImpl.java:88)
> org.apache.tapestry5.internal.services.EnvironmentalShadowBuilderImpl$1$1.advise(EnvironmentalShadowBuilderImpl.java:62)
> org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
> com.beckon.app.components.settings.org.OrgCategory.init(OrgCategory.java:91)
> com.beckon.app.components.settings.org.OrgCategory.onAddSub(OrgCategory.java:107)
> com.beckon.app.components.settings.org.OrgCategory.dispatchComponentEvent(OrgCategory.java)
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:923)
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1106)
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3200(ComponentPageElementImpl.java:61)
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1051)
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1048)
> org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1047)
> org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:110)
> org.apache.tapestry5.internal.services.ajax.AjaxFormUpdateFilter.handle(AjaxFormUpdateFilter.java:56)
> org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
> org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75)
> org.apache.tapestry5.services.TapestryModule$40.handle(TapestryModule.java:2456)
> org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
> com.beckon.app.services.ValidAccountFilter.handleComponentEvent(ValidAccountFilter.java:42)
> com.beckon.app.services.PageProtectionFilter.handleComponentEvent(PageProtectionFilter.java:42)
> org.apache.tapestry5.services.InitializeActivePageName.handleComponentEvent(InitializeActivePageName.java:39)
> org.tynamo.security.SecurityComponentRequestFilter.handleComponentEvent(SecurityComponentRequestFilter.java:42)
> org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46)
> org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:302)
> com.beckon.app.services.AppModule$1.service(AppModule.java:154)
> com.beckon.app.services.AppModule$2.service(AppModule.java:255)
> 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.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.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
> org.got5.tapestry5.jquery.services.AjaxUploadServletRequestFilter.service(AjaxUploadServletRequestFilter.java:26)
> org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
> 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)
>
>
>
>
>
>
>
> ---
>   [hidden email]
>   +1.415.366.0450
>   @jochen_frey
>

---
  [hidden email]
  +1.415.366.0450
  @jochen_frey