On Fri, 12 Oct 2012 01:01:36 -0300, Ken in Nashua
wrote:
Here is Home.JAVA snippet
public class Home
{
/**
* Component
*/
@Property
private Class collectiontype;
@Property
private Integer itemsPerPage = new Integer("50");
Don't initialize fields in their dec
Thanks Cezary... all good points to note.
Sometimes I just like blabbin...
Have a great weekend !
Java's garbage collector never sets any normal reference to null. It is a
fundamental property of JVM.
This sentence
'in this case the GC was a little late in erasing what was released
across the request cycle'
is not true.
Your problem was not related to the garbage collector at all.
'colle
yeah... the pointer to the collection wasnt null... it looked like a legitimate
allocated collection with a hiberate entity in it.
But as soon as i attempted to reference the collection in the event handler...
boom... NPE
a numega type bounds checker would flush something like this out by flood
hm...I am not sure what you are looking at with the debug, but the pointer to
the collection should be null regardless of the objects actual state
(whether or not it has been garbage collected).
It is as everyone has described to you, once page is rendered everything is
set to null and when you h
Are you saying... that...
I maintain a collection on a single initial rendering... I get away with it by
loading my collection in setuprender... this works fine and I can see my
hibernate entity on my display after the gallery is rendered.
On a subsequent event (lastPage)... your claim is that
As Cezary said, there are two requests involved in this exception.
1. Request to draw the page initially
2. Request to fire the "lastPage" event
Tapestry does NOT maintain state between Request 1 and Request 2 (unless you
explicitly tell it to via @Persist). In this case, you should not use
@Pers
if it means anything here is the last stack trace... but it looks the same
127.0.0.1 - - [12/Oct/2012:15:17:56 +] "GET
/tynamo/blob/adminlayout/1/header HTTP/1.1" 200 223753
"http://localhost:8080/Home"; "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0)
Gecko/20100101 Firefox/15.0.1"
[INFO]
Well i got rid of Integer usage with this variable itemsPerPage within the page
and component as well as any initializations and modeled initialization in the
setuprender
Gallery.JAVA
@SetupRender
public void setupRender()
{
itemsPerPage = 50;
try
{
It does not matter that you it is loaded in setupRender(). Rending events
happen only during page rendering. Your exception happens during a separate
HTTP request for event handling (see request URL in your logs). Such events
do not trigger page rendering in Tapestry 5. So setupRender() is not
exec
Guys, I appreciate the help...
is it possible collection is getting clobbered in between somewhere the event ?
I mean I walked thru debugger and logged a statement too and saw with my eyes
that collection is loaded and allocated and established in
@SetupRender
public void setupRender()
On Fri, Oct 12, 2012 at 4:01 PM, Ken in Nashua wrote:
>
> Thanks Cezary,
>
> collection is an allocated collection housing a single hibernate entity.
> my login page comes up
> i get authenticated
> it launches the Home.ml and Layout.tml
> and my Gallery.tml gets rendered for the very first time
NB. When you fire an event on a component, the component rendering lifecycle
is NOT fired. Anything configured in setupRender() and beginRender() etc
will be null (unless using @Persist). Only your @Parameter values will be
populated. You may need to have a common method that you call in
setupRende
Thanks Cezary,
collection is an allocated collection housing a single hibernate entity.
my login page comes up
i get authenticated
it launches the Home.ml and Layout.tml
and my Gallery.tml gets rendered for the very first time
I can see the hibernate entity on the screen... the photo is rendered
Ah, OK. Missed that.
However by judging source code from other emails, it is clear that
@Parameter for itemsPerPage was used in 'Galery' component, not on
Home.java.
But I guess it is to be confused by incomplete examples.
Best regards,
Cezary
On Fri, Oct 12, 2012 at 2:42 PM, Robert Zeigler wrot
On Oct 12, 2012, at 10/126:33 AM , Cezary Biernacki wrote:
> On Fri, Oct 12, 2012 at 6:29 AM, Robert Zeigler > wrote:
>
>> Since itemsPerPage is a property of a page, the @Parameter bit won't work.
>>
>
> That is not true. @Property just adds get and setter, and @Parameter can be
> a property.
Hi,
Have you really confirmed that collection is not null? E.g. by actually
debugging that code or putting a logging statement? I strongly believe it
is null, because you set it only on SetupRender event, and rendering events
when page is not rendered.
Cezary
On Fri, Oct 12, 2012 at 6:29 AM, Robert Zeigler wrote:
> Since itemsPerPage is a property of a page, the @Parameter bit won't work.
>
That is not true. @Property just adds get and setter, and @Parameter can be
a property. Tapestry standard components often have parameters that are
also propertie
i commented out the whole contents of the handler... and it ran ok...
so it has to do with the variable itemsPerPage
hoping it will thresh out tomorrow... or today
have to get some sleep...
ciao
here is the latest...
a component event exception is being triggered to the HOME.TML
so for some reason HOME.TML or HOME.JAVA is not able to handle this somehow.
An unexpected application exception has
occurred.org.apache.tapestry5.ioc.internal.OperationExceptionlocationcontext:Home.tml,
line
Ok here is my actual GALLERY template and code...
dont get too lost... its still in-play... and messy
trust me I am a clean guy... and hopin this will be cleaned up soon
http://www.w3.org/TR/html4/strict.dtd";>
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
xmlns:p="tapestry:parameter"
Here is my HOME template and java
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
xmlns:p="tapestry:parameter">
${message:org.hibernatesecurity.welcome}
Thanks for tryin guys...
the initialization attempts had no effect
127.0.0.1 - - [12/Oct/2012:04:45:35 +] "GET
/assets/1.0-SNAPSHOT-1350017091525/tynamo-0.3.0/themes/tapestryskin/breadcrumbs.jpg
HTTP/1.1" 200 349
"http://localhost:8080/assets/1.0-SNAPSHOT-1350017091525/tynamo-0.3.0/them
Thanks Bob... i will try your solution...
hold on
yeah... it didnt work
@Property
@Parameter(value="50", required = false, cache = false)
private Integer itemsPerPage;
I kept the integer type because in theory I shouldn't have to change it.
I can post the code in a bit... let me take another pass here...
127.0.0.1 - - [12/Oct/2
thanks Cezary... I will try that right now...
and if it fails code listings will be better submitted.
be right back
Since itemsPerPage is a property of a page, the @Parameter bit won't work.
Instead, try:
@Property
private int itemsPerPage
void setupRender() {
itemsPerPage=50;
}
Robert
On Oct 11, 2012, at 10/:25 PM , Cezary Biernacki wrote:
> You are giving us incomplete examples, so we can only guess
You are giving us incomplete examples, so we can only guess. However my
suspicion is that your declaration of default value itemsPerPage is bad.
Tapestry 5 does not like initialisation of private fields in components and
pages. Try:
@Parameter(value="50", required = false, cache = false)
p
thanks czar
yeah collestion is absolutely size = 1 and has a hibernate entity in it
In my Gallery.JAVA I tried the following...
removed @Property on itemsPerPage
and added
public Integer getItemsPerPage() {
return itemsPerPage;
}
and invoked it directly instead of attempting
Here is Home.JAVA snippet
public class Home
{
/**
* Component
*/
@Property
private Class collectiontype;
@Property
private Integer itemsPerPage = new Integer("50");
I am trying to figure out why there is a NPE with this itemsPerPage
its just a property in Home.*
Hi,
are you sure that 'collection' is not null?
Best regards,
Cezary
On Fri, Oct 12, 2012 at 5:27 AM, Ken in Nashua wrote:
>
> Folks,
>
> I am scratching my head about this code which generally was ok in T4...
> things seem fine but when i enter this handler BOOM
>
> My usage of the Math.min(.
31 matches
Mail list logo