You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ted Steen <te...@gmail.com> on 2005/08/17 10:49:34 UTC

Listener "redirecting" to new page --> Exception

I'm trying to activate a new page if some condition is true within an
listener, but
i get an Exception (outside of tapestry!) when doing so.

--- snipplet from MainPage.java ---
@InjectPage("main/AddEntry")
public abstract AddEntry getAddEntryPage();

public IPage doAddEntry() {
  AddEntry addEntryPage = null;
  if(getAmount() != 0) {
    Entry entry = new Entry(getDate(), getComment(), getAmount(),
getSelectedCategory(), null, getUser().getID());
    addEntryPage = getAddEntryPage();
    addEntryPage.setEntry(entry);
  }

  setError("You must provide an amount");
  return addEntryPage;
}
--- snipplet from MainPage.java [END] ---

--- AddEntry.java ---

public abstract class AddEntry extends PengBasePage {
	public abstract void setEntry(Entry entry);
}

--- AddEntry.java [END]

Now, if i uncomment "addEntryPage.setEntry(entry);" line it works, but then I
don't get my entry into the AddEntry.java page, which is the whole idea.


This is the Exception I get (note that it is not handled by tapestry!)
javax.servlet.ServletException: Unable to construct service
tapestry.describe.DescribableStrategy: Unable to construct
configuration tapestry.describe.DescribableStrategies: Error at
jar:file:/C:/Program/Apache Software Foundation/Tomcat
5.5/shared/lib/tapestry-portlet-4.0-beta-4.jar!/META-INF/hivemodule.xml,
line 297, column 105: Unable to process attribute class (of element
strategy): Unable to convert type 'javax.portlet.PortletSession' to a
Java class, either as is, or in package org.apache.tapestry.portlet.
...

-- 
/ted

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


Re: Listener "redirecting" to new page --> Exception

Posted by Howard Lewis Ship <hl...@gmail.com>.
My initial diagnosis would be:

Remove the tapestry-portlet JAR from the classpath, unless you are
deploying a Portlet!

However, just having the JAR on the classpath should not cause this
kind of problem; please add a bug to JIRA and I'll make sure that you
can run with the portlet JAR on the classpath, even outside of a
portlet container.

On 8/17/05, Ted Steen <te...@gmail.com> wrote:
> I'm trying to activate a new page if some condition is true within an
> listener, but
> i get an Exception (outside of tapestry!) when doing so.
> 
> --- snipplet from MainPage.java ---
> @InjectPage("main/AddEntry")
> public abstract AddEntry getAddEntryPage();
> 
> public IPage doAddEntry() {
>   AddEntry addEntryPage = null;
>   if(getAmount() != 0) {
>     Entry entry = new Entry(getDate(), getComment(), getAmount(),
> getSelectedCategory(), null, getUser().getID());
>     addEntryPage = getAddEntryPage();
>     addEntryPage.setEntry(entry);
>   }
> 
>   setError("You must provide an amount");
>   return addEntryPage;
> }
> --- snipplet from MainPage.java [END] ---
> 
> --- AddEntry.java ---
> 
> public abstract class AddEntry extends PengBasePage {
>         public abstract void setEntry(Entry entry);
> }
> 
> --- AddEntry.java [END]
> 
> Now, if i uncomment "addEntryPage.setEntry(entry);" line it works, but then I
> don't get my entry into the AddEntry.java page, which is the whole idea.
> 
> 
> This is the Exception I get (note that it is not handled by tapestry!)
> javax.servlet.ServletException: Unable to construct service
> tapestry.describe.DescribableStrategy: Unable to construct
> configuration tapestry.describe.DescribableStrategies: Error at
> jar:file:/C:/Program/Apache Software Foundation/Tomcat
> 5.5/shared/lib/tapestry-portlet-4.0-beta-4.jar!/META-INF/hivemodule.xml,
> line 297, column 105: Unable to process attribute class (of element
> strategy): Unable to convert type 'javax.portlet.PortletSession' to a
> Java class, either as is, or in package org.apache.tapestry.portlet.
> ...
> 
> --
> /ted
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: Listener "redirecting" to new page --> Exception

Posted by Kevin Menard <km...@servprise.com>.
Ted Steen wrote:

> This is the Exception I get (note that it is not handled by tapestry!)
> javax.servlet.ServletException: Unable to construct service
> tapestry.describe.DescribableStrategy: Unable to construct
> configuration tapestry.describe.DescribableStrategies: Error at
> jar:file:/C:/Program/Apache Software Foundation/Tomcat
> 5.5/shared/lib/tapestry-portlet-4.0-beta-4.jar!/META-INF/hivemodule.xml,
> line 297, column 105: Unable to process attribute class (of element
> strategy): Unable to convert type 'javax.portlet.PortletSession' to a
> Java class, either as is, or in package org.apache.tapestry.portlet.

If you're running in Tomcat, you don't need the portlet JAR.  It appears
as though its presence on the classpath is causing you trouble.  Try
removing it and see what happens.

-- 
Kevin

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


Re: Listener "redirecting" to new page --> Exception

Posted by Ted Steen <te...@gmail.com>.
Sorry, I should mention two things;

the setError() should be in the else part of the if statement.
and PengBasePage is derived from BasePage.

I was a little quick posting my question...

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