You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joe Chen <jo...@gmail.com> on 2007/05/01 22:31:17 UTC

Errors with @InjectState after upgrading to T4.1.2

Hi,
 I'm seeing some strange errors with the @InjectState after upgrading from
T4.0 to T4.1.2. The problem shows up only in Tomcat 5.5.

In our code, we have a component that declares:

@InjectState("playerInfo")
public abstract HashMap getPlayerInfo();

The code was working fine for months under T4.0.x.  Recently we decided to
migrate to T4.1.2, and it works under Jetty (using Jetty Eclipse plugin).
However, as soon as I deploy to Tomcat 5.5 and try to run the application, I
get the following error:

Caused by: java.lang.IllegalStateException: Cannot create a session
after the response has been committed
	at org.apache.catalina.connector.Request.doGetSession(Request.java:2214)
	at org.apache.catalina.connector.Request.getSession(Request.java:2024)
	at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831)
	at org.apache.tapestry.web.ServletWebRequest.getSession(ServletWebRequest.java:82)
	at $WebRequest_1124940e33a.getSession($WebRequest_1124940e33a.java)
	at $WebRequest_1124940e2ce.getSession($WebRequest_1124940e2ce.java)
	at org.apache.tapestry.engine.state.SessionScopeManager.getSession(SessionScopeManager.java:50)
	at org.apache.tapestry.engine.state.SessionScopeManager.get(SessionScopeManager.java:65)
	at $StateObjectPersistenceManager_1124940e469.get($StateObjectPersistenceManager_1124940e469.java)
	at org.apache.tapestry.engine.state.StateObjectManagerImpl.get(StateObjectManagerImpl.java:51)
	at org.apache.tapestry.engine.state.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:60)
	at $ApplicationStateManager_1124940e2ea.get($ApplicationStateManager_1124940e2ea.java)
	at $ApplicationStateManager_1124940e2eb.get($ApplicationStateManager_1124940e2eb.java)
	at $SkinTiles_9.getPlayerInfo($SkinTiles_9.java)


Did the InjectState code somehow change between 4.0.x and 4.1?  Any ideas on
how to fix the problem?

Thanks,
Joe

Re: Errors with @InjectState after upgrading to T4.1.2

Posted by Joe Chen <jo...@gmail.com>.
The @InjectState is declared inside of a component, and the injected state
object is referenced by the html code for that component during the
rendering of the page, inside a @Any component.

Html for component:

<li jwcid="skins@For" ... >
  <span onclick="prop:onClickJS" jwcid="@Any">
  </span>
</li>

Java for component:

@InjectState("playerInfo")
public abstract HashMap getPlayerInfo();

public String getOnClickJS() {
        return getSkinURL();
}

public String getSkinURL() {
        if (getPlayerInfo().contains("key"))
            return "...";
}

Once again this is happening only on 4.1.2 under Tomcat 5.5.  It works for
4.0 and 4.1.1 under Jetty and Tomcat.
The only other thing that might not be standard is the use of the
tapestry-prop library and the "prop:" syntax instead of "ognl:'.  But why
would it stop working in 4.1.2 but work in all previous versions of
Tapestry?

Here's the full stack trace:

Caused by: java.lang.IllegalStateException: Cannot create a session
after the response has been committed
	at org.apache.catalina.connector.Request.doGetSession(Request.java:2214)
	at org.apache.catalina.connector.Request.getSession(Request.java:2024)
	at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831)
	at org.apache.tapestry.web.ServletWebRequest.getSession(ServletWebRequest.java:82)
	at $WebRequest_112499919b5.getSession($WebRequest_112499919b5.java)
	at $WebRequest_11249991949.getSession($WebRequest_11249991949.java)
	at org.apache.tapestry.engine.state.SessionScopeManager.getSession(SessionScopeManager.java:50)
	at org.apache.tapestry.engine.state.SessionScopeManager.get(SessionScopeManager.java:65)
	at $StateObjectPersistenceManager_11249991ae4.get($StateObjectPersistenceManager_11249991ae4.java)
	at org.apache.tapestry.engine.state.StateObjectManagerImpl.get(StateObjectManagerImpl.java:51)
	at org.apache.tapestry.engine.state.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:60)
	at $ApplicationStateManager_11249991965.get($ApplicationStateManager_11249991965.java)
	at $ApplicationStateManager_11249991966.get($ApplicationStateManager_11249991966.java)
	at $SkinTiles_9.getPlayerInfo($SkinTiles_9.java)
	at com.webapp.skins.SkinTiles.getSkinURL(SkinTiles.java:172)
	at com.webapp.skins.SkinTiles.getOnClickJS(SkinTiles.java:378)
	at $$SkinTiles_9$access_onClickJS_11249991ab2.readProperty($$SkinTiles_9$access_onClickJS_11249991ab2.java)
	at com.javaforge.tapestry.prop.PropertyAccessorBinding.getObject(PropertyAccessorBinding.java:59)
	at org.apache.tapestry.AbstractComponent.renderInformalParameters(AbstractComponent.java:279)
	at org.apache.tapestry.components.Any.renderComponent(Any.java:42)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:526)
	at org.apache.tapestry.components.Any.renderComponent(Any.java:47)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:526)
	at org.apache.tapestry.components.ForBean.renderComponent(ForBean.java:181)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:526)
	at org.apache.tapestry.components.IfBean.renderComponent(IfBean.java:96)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:526)
	at org.apache.tapestry.components.Any.renderComponent(Any.java:47)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:107)
	at com.webapp.skins.SkinTiles.renderComponent(SkinTiles.java:147)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:526)
	at org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:39)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:526)
	at org.apache.tapestry.html.Body.renderComponent(Body.java:38)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:107)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:184)
	at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:107)
	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:713)
	at org.apache.tapestry.services.impl.DefaultResponseBuilder.render(DefaultResponseBuilder.java:182)
	at org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:237)
	at org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:397)


Joe




On 5/1/07, Jesse Kuhnert <jk...@gmail.com> wrote:
>
> I'm not sure, there seems to be some missing information. I find it hard
> to
> believe that having a single @InjectState method alone would cause that
> error.
>
> Where are you messing with the data that was injected?
>
> On 5/1/07, Joe Chen <jo...@gmail.com> wrote:
> >
> > Some more information about this issue - I downgraded to 4.1.1 and the
> > problem went away, so it seems like this is an issue that was introduced
> > in
> > 4.1.2.
> >
> > Should I file a bug on this?
> >
> > Joe
> >
> > On 5/1/07, Joe Chen <jo...@gmail.com> wrote:
> > >
> > > Hi,
> > >  I'm seeing some strange errors with the @InjectState after upgrading
> > from
> > > T4.0 to T4.1.2. The problem shows up only in Tomcat 5.5.
> > >
> > > In our code, we have a component that declares:
> > >
> > > @InjectState("playerInfo")
> > > public abstract HashMap getPlayerInfo();
> > >
> > > The code was working fine for months under T4.0.x.  Recently we
> decided
> > to
> > > migrate to T4.1.2, and it works under Jetty (using Jetty Eclipse
> > plugin).
> > > However, as soon as I deploy to Tomcat 5.5 and try to run the
> > application,
> > > I get the following error:
> > >
> > > Caused by: java.lang.IllegalStateException: Cannot create a session
> > after the response has been committed
> > >       at
> > > org.apache.catalina.connector.Request.doGetSession(Request.java:2214)
> > >       at org.apache.catalina.connector.Request.getSession(Request.java
> > :2024)
> > >       at org.apache.catalina.connector.RequestFacade.getSession(
> > RequestFacade.java
> > > :831)
> > >       at org.apache.tapestry.web.ServletWebRequest.getSession(
> > ServletWebRequest.java:82)
> > >       at
> > $WebRequest_1124940e33a.getSession($WebRequest_1124940e33a.java)
> > >       at
> > $WebRequest_1124940e2ce.getSession($WebRequest_1124940e2ce.java)
> > >
> > >       at
> org.apache.tapestry.engine.state.SessionScopeManager.getSession
> > (SessionScopeManager.java:50)
> > >       at org.apache.tapestry.engine.state.SessionScopeManager.get(
> > SessionScopeManager.java:65)
> > >       at
> >
> $StateObjectPersistenceManager_1124940e469.get($StateObjectPersistenceManager_1124940e469.java)
> > >
> > >       at org.apache.tapestry.engine.state.StateObjectManagerImpl.get(
> > StateObjectManagerImpl.java:51)
> > >       at
> > org.apache.tapestry.engine.state.ApplicationStateManagerImpl.get(
> > ApplicationStateManagerImpl.java:60)
> > >       at
> >
> $ApplicationStateManager_1124940e2ea.get($ApplicationStateManager_1124940e2ea.java)
> > >
> > >       at
> >
> $ApplicationStateManager_1124940e2eb.get($ApplicationStateManager_1124940e2eb.java)
> > >       at $SkinTiles_9.getPlayerInfo($SkinTiles_9.java)
> > >
> > >
> > > Did the InjectState code somehow change between 4.0.x and 4.1 ?  Any
> > ideas
> > > on how to fix the problem?
> > >
> > > Thanks,
> > > Joe
> > >
> >
>
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>

Re: Errors with @InjectState after upgrading to T4.1.2

Posted by Jesse Kuhnert <jk...@gmail.com>.
I'm not sure, there seems to be some missing information. I find it hard to
believe that having a single @InjectState method alone would cause that
error.

Where are you messing with the data that was injected?

On 5/1/07, Joe Chen <jo...@gmail.com> wrote:
>
> Some more information about this issue - I downgraded to 4.1.1 and the
> problem went away, so it seems like this is an issue that was introduced
> in
> 4.1.2.
>
> Should I file a bug on this?
>
> Joe
>
> On 5/1/07, Joe Chen <jo...@gmail.com> wrote:
> >
> > Hi,
> >  I'm seeing some strange errors with the @InjectState after upgrading
> from
> > T4.0 to T4.1.2. The problem shows up only in Tomcat 5.5.
> >
> > In our code, we have a component that declares:
> >
> > @InjectState("playerInfo")
> > public abstract HashMap getPlayerInfo();
> >
> > The code was working fine for months under T4.0.x.  Recently we decided
> to
> > migrate to T4.1.2, and it works under Jetty (using Jetty Eclipse
> plugin).
> > However, as soon as I deploy to Tomcat 5.5 and try to run the
> application,
> > I get the following error:
> >
> > Caused by: java.lang.IllegalStateException: Cannot create a session
> after the response has been committed
> >       at
> > org.apache.catalina.connector.Request.doGetSession(Request.java:2214)
> >       at org.apache.catalina.connector.Request.getSession(Request.java
> :2024)
> >       at org.apache.catalina.connector.RequestFacade.getSession(
> RequestFacade.java
> > :831)
> >       at org.apache.tapestry.web.ServletWebRequest.getSession(
> ServletWebRequest.java:82)
> >       at
> $WebRequest_1124940e33a.getSession($WebRequest_1124940e33a.java)
> >       at
> $WebRequest_1124940e2ce.getSession($WebRequest_1124940e2ce.java)
> >
> >       at org.apache.tapestry.engine.state.SessionScopeManager.getSession
> (SessionScopeManager.java:50)
> >       at org.apache.tapestry.engine.state.SessionScopeManager.get(
> SessionScopeManager.java:65)
> >       at
> $StateObjectPersistenceManager_1124940e469.get($StateObjectPersistenceManager_1124940e469.java)
> >
> >       at org.apache.tapestry.engine.state.StateObjectManagerImpl.get(
> StateObjectManagerImpl.java:51)
> >       at
> org.apache.tapestry.engine.state.ApplicationStateManagerImpl.get(
> ApplicationStateManagerImpl.java:60)
> >       at
> $ApplicationStateManager_1124940e2ea.get($ApplicationStateManager_1124940e2ea.java)
> >
> >       at
> $ApplicationStateManager_1124940e2eb.get($ApplicationStateManager_1124940e2eb.java)
> >       at $SkinTiles_9.getPlayerInfo($SkinTiles_9.java)
> >
> >
> > Did the InjectState code somehow change between 4.0.x and 4.1 ?  Any
> ideas
> > on how to fix the problem?
> >
> > Thanks,
> > Joe
> >
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Re: Errors with @InjectState after upgrading to T4.1.2

Posted by Joe Chen <jo...@gmail.com>.
Some more information about this issue - I downgraded to 4.1.1 and the
problem went away, so it seems like this is an issue that was introduced in
4.1.2.

Should I file a bug on this?

Joe

On 5/1/07, Joe Chen <jo...@gmail.com> wrote:
>
> Hi,
>  I'm seeing some strange errors with the @InjectState after upgrading from
> T4.0 to T4.1.2. The problem shows up only in Tomcat 5.5.
>
> In our code, we have a component that declares:
>
> @InjectState("playerInfo")
> public abstract HashMap getPlayerInfo();
>
> The code was working fine for months under T4.0.x.  Recently we decided to
> migrate to T4.1.2, and it works under Jetty (using Jetty Eclipse plugin).
> However, as soon as I deploy to Tomcat 5.5 and try to run the application,
> I get the following error:
>
> Caused by: java.lang.IllegalStateException: Cannot create a session after the response has been committed
> 	at
> org.apache.catalina.connector.Request.doGetSession(Request.java:2214)
> 	at org.apache.catalina.connector.Request.getSession(Request.java:2024)
> 	at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java
> :831)
> 	at org.apache.tapestry.web.ServletWebRequest.getSession(ServletWebRequest.java:82)
> 	at $WebRequest_1124940e33a.getSession($WebRequest_1124940e33a.java)
> 	at $WebRequest_1124940e2ce.getSession($WebRequest_1124940e2ce.java)
>
> 	at org.apache.tapestry.engine.state.SessionScopeManager.getSession(SessionScopeManager.java:50)
> 	at org.apache.tapestry.engine.state.SessionScopeManager.get(SessionScopeManager.java:65)
> 	at $StateObjectPersistenceManager_1124940e469.get($StateObjectPersistenceManager_1124940e469.java)
>
> 	at org.apache.tapestry.engine.state.StateObjectManagerImpl.get(StateObjectManagerImpl.java:51)
> 	at org.apache.tapestry.engine.state.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:60)
> 	at $ApplicationStateManager_1124940e2ea.get($ApplicationStateManager_1124940e2ea.java)
>
> 	at $ApplicationStateManager_1124940e2eb.get($ApplicationStateManager_1124940e2eb.java)
> 	at $SkinTiles_9.getPlayerInfo($SkinTiles_9.java)
>
>
> Did the InjectState code somehow change between 4.0.x and 4.1 ?  Any ideas
> on how to fix the problem?
>
> Thanks,
> Joe
>