You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Mylonas <ch...@mrvoip.com.au> on 2013/02/20 05:49:36 UTC

3 days of ValueEncoder-ing, no coercion found

Hi Tapestry List, long time no hear...

How do you make tapestry spit out what encoder/coercions are supported.  My
encoder doesn't seem to be getting registered

I am writing an app and have had to use a ValueEncoder.  I don't know where
I am going wrong, I've written them before...and for the past 3 days get
the same stupid coercion message.

My understanding is
1.  Write encoder that implements ValueEncoder
2.  Contribute to value encoders
3.  encoder="myNewEncoder" in the tapestry component to use where no
coercions come out-of-the-box

I have tried two alternatives and would like to know where I've gone wrong
in either please.

1.  Using Igor's Tapestry 5 book, I wrote a class called
LibraryEventEncoder and placed it in an uncontrolled package, it implements
ValueEncoder.

package au.com.mrvoip.t5app.encoders ;

public class LibraryEventEncoder implements ValueEncoder<LibraryEvent> {

    private LibraryEventFacadeLocal _libraryEventService;

    public LibraryEventEncoder(LibraryEventFacadeLocal libraryService) {
        this._libraryEventService = libraryService;

    }

    @Override
    public String toClient(LibraryEvent v) {
        return String.valueOf(v.getId());
    }

    @Override
    public LibraryEvent toValue(String id) {
        return _libraryEventService.find(Long.valueOf(id));
    }
}


AppModule receives this addition


    @Contribute(ValueEncoderSource.class)
    public static void provideEncoders(MappedConfiguration<Class,
ValueEncoderFactory>configuration, final LibraryEventFacadeLocal lqmefl){
        System.out.println("CHRIS THIS HAS BEEN CONTRIBUTED";
        ValueEncoderFactory<LibraryEvent> factory = new
ValueEncoderFactory<LibraryEvent>(){
            public ValueEncoder<LibraryEvent> create(Class<LibraryEvent>
clazz){
                return new LibraryEventEncoder(lqmefl);
            }
        };

        configuration.add(LibraryEvent.class, factory);
    }


My page class uses a simple grid and the template follows

    @EJB
    private LibraryEventFacadeLocal libraryService;
    @Property
    private LibraryEvent lmevent;

    @Property
    private LibraryEventEncoder libeventEncoder = new LibraryEventEncoder();

    public List<LibraryEvent> getLMEvents() {

        return libraryService.getMostRecentDistinct("2720101"); //returns a
short list (3-10 results usually)
    }

    public ValueEncoder<LibraryQueueMemberEvent> getLibEventEncoder(){
        return libEventEncoder  ;
    }



    <t:grid source="lmevents" encoder="libEventEncoder" row="lmevent"
rowsPerPage="50" >
            <p:empty>
              <p>There are no lmevents to display; you can add some
manually when the link is made.</p>
            </p:empty>
        </t:grid>




And the alternate way which appears to be popular - some private inner
class as a replacement, as well as something like this directly in the get
method.

    public LibraryEventEncoder getLibEventEncoder() {
        return new LibraryEventEncoder(lmService) {
            public String toClient(LibraryEvent value) {
                return String.valueOf(value.getId());
            }

            public LibraryEvent toValue(String clientValue) {
                LibraryEvent e =
libEventService.find(Long.valueOf(clientValue));
                if (String.valueOf(e.getId()).equals(clientValue)) {
                    return e;
                }
                return null;
            }
        };
    }


But all the time I'm getting a problem with coercion of String to
LibraryEvent even with the System.out.println message being spat out of
logs that this encoder is being contributed (or at least i think it is)


Any pointers would be helpful
Chris

Re: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
Thanks for the pointers Taha - interesting that those ValueEncoders have
slightly different behaviours depending 
Let me get some traces with a smaller sample project to try and help my
cause.

It's my first tapestry project in nearly a year!



--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720112.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: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
Noted the use of DefaultProvider where grid's is optional.
And yes, I remember reading a million times not to do what I posted - thanks
for highlighting that!



--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720119.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: 3 days of ValueEncoder-ing, no coercion found

Posted by Taha Siddiqi <ta...@gmail.com>.
Hi Chris

You have not shared the trace so I can't help you much but there are certain things I thought might help in general.

Contributing a ValueEncoder to a ValueEncoderSource only helps in components which use the ComponentDefaultProvider#defaultValueEncoder e.g. Select, Palette etc. For a Grid component, encoder is an optional parameter and does not use a default implementation. Thus in your case it is not in use.

As Thiago has pointed out a million times, NEVER EVER initialize a field inline in a component/page use setupRender()/onActivate()

Remember these are not solution to your problem, just suggestions. For a solution please share the full stack-trace :)

regards
Taha

On Feb 20, 2013, at 10:19 AM, Chris Mylonas wrote:

> Hi Tapestry List, long time no hear...
> 
> How do you make tapestry spit out what encoder/coercions are supported.  My
> encoder doesn't seem to be getting registered
> 
> I am writing an app and have had to use a ValueEncoder.  I don't know where
> I am going wrong, I've written them before...and for the past 3 days get
> the same stupid coercion message.
> 
> My understanding is
> 1.  Write encoder that implements ValueEncoder
> 2.  Contribute to value encoders
> 3.  encoder="myNewEncoder" in the tapestry component to use where no
> coercions come out-of-the-box
> 
> I have tried two alternatives and would like to know where I've gone wrong
> in either please.
> 
> 1.  Using Igor's Tapestry 5 book, I wrote a class called
> LibraryEventEncoder and placed it in an uncontrolled package, it implements
> ValueEncoder.
> 
> package au.com.mrvoip.t5app.encoders ;
> 
> public class LibraryEventEncoder implements ValueEncoder<LibraryEvent> {
> 
>    private LibraryEventFacadeLocal _libraryEventService;
> 
>    public LibraryEventEncoder(LibraryEventFacadeLocal libraryService) {
>        this._libraryEventService = libraryService;
> 
>    }
> 
>    @Override
>    public String toClient(LibraryEvent v) {
>        return String.valueOf(v.getId());
>    }
> 
>    @Override
>    public LibraryEvent toValue(String id) {
>        return _libraryEventService.find(Long.valueOf(id));
>    }
> }
> 
> 
> AppModule receives this addition
> 
> 
>    @Contribute(ValueEncoderSource.class)
>    public static void provideEncoders(MappedConfiguration<Class,
> ValueEncoderFactory>configuration, final LibraryEventFacadeLocal lqmefl){
>        System.out.println("CHRIS THIS HAS BEEN CONTRIBUTED";
>        ValueEncoderFactory<LibraryEvent> factory = new
> ValueEncoderFactory<LibraryEvent>(){
>            public ValueEncoder<LibraryEvent> create(Class<LibraryEvent>
> clazz){
>                return new LibraryEventEncoder(lqmefl);
>            }
>        };
> 
>        configuration.add(LibraryEvent.class, factory);
>    }
> 
> 
> My page class uses a simple grid and the template follows
> 
>    @EJB
>    private LibraryEventFacadeLocal libraryService;
>    @Property
>    private LibraryEvent lmevent;
> 
>    @Property
>    private LibraryEventEncoder libeventEncoder = new LibraryEventEncoder();
> 
>    public List<LibraryEvent> getLMEvents() {
> 
>        return libraryService.getMostRecentDistinct("2720101"); //returns a
> short list (3-10 results usually)
>    }
> 
>    public ValueEncoder<LibraryQueueMemberEvent> getLibEventEncoder(){
>        return libEventEncoder  ;
>    }
> 
> 
> 
>    <t:grid source="lmevents" encoder="libEventEncoder" row="lmevent"
> rowsPerPage="50" >
>            <p:empty>
>              <p>There are no lmevents to display; you can add some
> manually when the link is made.</p>
>            </p:empty>
>        </t:grid>
> 
> 
> 
> 
> And the alternate way which appears to be popular - some private inner
> class as a replacement, as well as something like this directly in the get
> method.
> 
>    public LibraryEventEncoder getLibEventEncoder() {
>        return new LibraryEventEncoder(lmService) {
>            public String toClient(LibraryEvent value) {
>                return String.valueOf(value.getId());
>            }
> 
>            public LibraryEvent toValue(String clientValue) {
>                LibraryEvent e =
> libEventService.find(Long.valueOf(clientValue));
>                if (String.valueOf(e.getId()).equals(clientValue)) {
>                    return e;
>                }
>                return null;
>            }
>        };
>    }
> 
> 
> But all the time I'm getting a problem with coercion of String to
> LibraryEvent even with the System.out.println message being spat out of
> logs that this encoder is being contributed (or at least i think it is)
> 
> 
> Any pointers would be helpful
> Chris


Re: 3 days of ValueEncoder-ing, no coercion found

Posted by Chris Mylonas <ch...@mrvoip.com.au>.
Excuse me, the contribute method in the previous email was not the one used
for coercion errors.

It should have looked like this


    public static void contributeValueEncoderSource(
            MappedConfiguration<Class<LibraryEvent>,
ValueEncoderFactory<LibraryEvent>> configuration) {
        configuration.addInstance(LibraryEvent.class, LibraryEncoder.class);
    }


and with this one I just implemented the method required for implementing
the ValueEncoderFactory on my encoder.




On Wed, Feb 20, 2013 at 3:49 PM, Chris Mylonas <ch...@mrvoip.com.au> wrote:

> Hi Tapestry List, long time no hear...
>
> How do you make tapestry spit out what encoder/coercions are supported.
> My encoder doesn't seem to be getting registered
>
> I am writing an app and have had to use a ValueEncoder.  I don't know
> where I am going wrong, I've written them before...and for the past 3 days
> get the same stupid coercion message.
>
> My understanding is
> 1.  Write encoder that implements ValueEncoder
> 2.  Contribute to value encoders
> 3.  encoder="myNewEncoder" in the tapestry component to use where no
> coercions come out-of-the-box
>
> I have tried two alternatives and would like to know where I've gone wrong
> in either please.
>
> 1.  Using Igor's Tapestry 5 book, I wrote a class called
> LibraryEventEncoder and placed it in an uncontrolled package, it implements
> ValueEncoder.
>
> package au.com.mrvoip.t5app.encoders ;
>
> public class LibraryEventEncoder implements ValueEncoder<LibraryEvent> {
>
>     private LibraryEventFacadeLocal _libraryEventService;
>
>     public LibraryEventEncoder(LibraryEventFacadeLocal libraryService) {
>         this._libraryEventService = libraryService;
>
>     }
>
>     @Override
>     public String toClient(LibraryEvent v) {
>         return String.valueOf(v.getId());
>     }
>
>     @Override
>     public LibraryEvent toValue(String id) {
>         return _libraryEventService.find(Long.valueOf(id));
>     }
> }
>
>
> AppModule receives this addition
>
>
>     @Contribute(ValueEncoderSource.class)
>     public static void provideEncoders(MappedConfiguration<Class,
> ValueEncoderFactory>configuration, final LibraryEventFacadeLocal lqmefl){
>         System.out.println("CHRIS THIS HAS BEEN CONTRIBUTED";
>         ValueEncoderFactory<LibraryEvent> factory = new
> ValueEncoderFactory<LibraryEvent>(){
>             public ValueEncoder<LibraryEvent> create(Class<LibraryEvent>
> clazz){
>                 return new LibraryEventEncoder(lqmefl);
>             }
>         };
>
>         configuration.add(LibraryEvent.class, factory);
>     }
>
>
> My page class uses a simple grid and the template follows
>
>     @EJB
>     private LibraryEventFacadeLocal libraryService;
>     @Property
>     private LibraryEvent lmevent;
>
>     @Property
>     private LibraryEventEncoder libeventEncoder = new
> LibraryEventEncoder();
>
>     public List<LibraryEvent> getLMEvents() {
>
>         return libraryService.getMostRecentDistinct("2720101"); //returns
> a short list (3-10 results usually)
>     }
>
>     public ValueEncoder<LibraryQueueMemberEvent> getLibEventEncoder(){
>         return libEventEncoder  ;
>     }
>
>
>
>     <t:grid source="lmevents" encoder="libEventEncoder" row="lmevent"
> rowsPerPage="50" >
>             <p:empty>
>               <p>There are no lmevents to display; you can add some
> manually when the link is made.</p>
>             </p:empty>
>         </t:grid>
>
>
>
>
> And the alternate way which appears to be popular - some private inner
> class as a replacement, as well as something like this directly in the get
> method.
>
>     public LibraryEventEncoder getLibEventEncoder() {
>         return new LibraryEventEncoder(lmService) {
>             public String toClient(LibraryEvent value) {
>                 return String.valueOf(value.getId());
>             }
>
>             public LibraryEvent toValue(String clientValue) {
>                 LibraryEvent e =
> libEventService.find(Long.valueOf(clientValue));
>                 if (String.valueOf(e.getId()).equals(clientValue)) {
>                     return e;
>                 }
>                 return null;
>             }
>         };
>     }
>
>
> But all the time I'm getting a problem with coercion of String to
> LibraryEvent even with the System.out.println message being spat out of
> logs that this encoder is being contributed (or at least i think it is)
>
>
> Any pointers would be helpful
> Chris
>
>


-- 

-- sent from web mail --

Re: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
nabble ate my template, hopefully the raw tag works.







--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720131.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: 3 days of ValueEncoder-ing, no coercion found

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 26 Feb 2013 00:45:51 -0300, mvchris <ch...@mrvoip.com.au> wrote:

> Oh maaaaaan.....  what an idiot.  That's a lesson in reading the stack  
> trace carefully. Bad programmer.

It's normal to overlook stuff sometimes . . . :)

> On looking back at the last message, line 31 just had a loop
>
> qmEvents.get(i).getClass.getCanonicalName();
>
> funnily enough as you suspected, the class name was not a
> LibraryQueueMemberEvent.  It was a String from the database query return,
> which is what I was checking for before I came to the list,  
> half-gone-mad..

Damn, I forgot about that possibility. You may have a scalar query, so it  
returns a String and not an entity object.

> Thiago, I am sorry to have wasted your time in the end as it was not a
> tapestry error.

Don't worry. I prefer the feeling of having successfully helped someone. ;)

> Noted, re nabble and eating stuff.  I just stopped using a dedicated  
> desktop mail user agent

Gmail and Yahoo are nice and stuff but I still prefer an e-mail client.  
The Opera's built-in one is quite good and has an integrated RSS reader.

> and nabble seems like a good tool for browsing.  Might have to re-work  
> that workflow because I remember reading stripped
> posts...frustrating thoughts...ah the karma

Nabble is good for browsing (I use it for reading and searching old  
stuff), not for posting. :)

-- 
Thiago H. de Paula Figueiredo

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


Re: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
Oh maaaaaan.....  what an idiot.  That's a lesson in reading the stack trace
carefully.  Bad programmer.

On looking back at the last message, line 31 just had a loop

qmEvents.get(i).getClass.getCanonicalName();

funnily enough as you suspected, the class name was not a
LibraryQueueMemberEvent.  It was a String from the database query return,
which is what I was checking for before I came to the list, half-gone-mad..

Thiago, I am sorry to have wasted your time in the end as it was not a
tapestry error.


Noted, re nabble and eating stuff.  I just stopped using a dedicated desktop
mail user agent and nabble seems like a good tool for browsing.  Might have
to re-work that workflow because I remember reading stripped
posts...frustrating thoughts...ah the karma

Kind Regards,
Chris



--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720226.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: 3 days of ValueEncoder-ing, no coercion found

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 22 Feb 2013 17:17:10 -0300, mvchris <ch...@mrvoip.com.au> wrote:

> Hi Thiago,

Hi!

> However, since tidying up and gaining a better understanding, the no
> coercion exception only appears on a grid - I made all my pages as  
> similar as possible for this problem since the start of the week to nut  
> it out - so my question is - how do i know my ValueEncoder is registered  
> with tapestry or is passed to the grid - since it clearly exists and has  
> been contribtued?

No every component gets a ValueEncoder automatically from  
ValueEncoderSource. Even for the ones who do, there may be situations in  
which ValueEncoderSource isn't enough.

> It's as though tapestry can't find it with the grid....and I'm passing  
> it.

Contributing a ValueEncoder to ValueEncoderSource and passing one through  
a parameter are very different things and maybe you're thinking otherwise.  
When I ask you if you passed a ValueEncoder to a component, I'm asking  
about explicitly using the parameter, not contributing to  
ValueEncoderSource.

> Now with the loop component:
> Same page class as the last message posted, with this template below,  
> yields cannot cast exception that follows.

Where's the exception? It seems Nabble ate it. By the way, guys, please  
avoid using Nabble.

> So has my ValueEncoder created the coercion between  
> String<->LibraryQueueMemberEvent ?

No. ValueEncoderSource returns a TypeCoercer-backed ValueEncoder when no  
contributed one is found for the type.

> Yet java can't cast between the two for a weird reason?

Cast anything that isn't a String to a String? This isn't expected in  
Java, a statically typed language, at all.

> In one hand (a grid) my value encoder is not recognised, and in the  
> other (a loop) the coercion has been recognised but at some other level  
> java can't
> cast between the two?

For the third or else time, have you checked the actual type of the  
objects returned by your persistence provider? They may be subclasses of  
your entities.

> With regards to the persistence provider, in this case EclipseLink in
> Glassfish - I have no idea about returning a subclass.
>
> The session bean method is

Nabble ate it again. :( Anyway, it wouldn't help. You need to get the list  
and print the class name.

Please print the result of getClass().getName() for each of the

> Are you saying you've seen Hibernate return a subclass of
> LibraryQueueMemberEvent -

Yes.

> and how do you overcome that sort of behaviour?

Explicitly providing a ValueEncoder (i.e through the encoder parameter  
parameter). I guess you're relying too much on contributions to  
ValueEncoderSource even when it's clearly not working.

-- 
Thiago H. de Paula Figueiredo

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


Re: 3 days of ValueEncoder-ing, no coercion found

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
Oops, now looking again at your post, now in Nabble, I've noticed  
something:

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast  
to  
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent
         at  
org.opencsta.eventviewer.pages.admin2.AgentStatusList.SetupRender(AgentStatusList.java:31)

What's in line 31 of AgentStatusList.SetupRender()? Full method source,  
please. Without looking at the source yet, it seems this isn't related to  
Tapestry.

-- 
Thiago H. de Paula Figueiredo

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


Re: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
Hi Thiago,

Thanks for the response, I wasn't aware the Loop/Grid thing was a big issue
- with either template it had been the same, passing the ValueEncoder.

However, since tidying up and gaining a better understanding, the no
coercion exception only appears on a grid - I made all my pages as similar
as possible for this problem since the start of the week to nut it out - so
my question is - how do i know my ValueEncoder is registered with tapestry
or is passed to the grid - since it clearly exists and has been contribtued? 
It's as though tapestry can't find it with the grid....and I'm passing it.


Now with the loop component:
Same page class as the last message posted, with this template below, yields
cannot cast exception that follows.
So has my ValueEncoder created the coercion between
String<->LibraryQueueMemberEvent ?
Yet java can't cast between the two for a weird reason?

In one hand (a grid) my value encoder is not recognised, and in the other (a
loop) the coercion has been recognised but at some other level java can't
cast between the two?









With regards to the persistence provider, in this case EclipseLink in
Glassfish - I have no idea about returning a subclass.

The session bean method is



Are you saying you've seen Hibernate return a subclass of
LibraryQueueMemberEvent - and how do you overcome that sort of behaviour?

Thanks for your frustrated reply. I _really_ appreciate your eyeballs on
this thread despite what appears my chopping and changing between Loop/Grid.

Chris



--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720175.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: 3 days of ValueEncoder-ing, no coercion found

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 22 Feb 2013 06:09:42 -0300, mvchris <ch...@mrvoip.com.au> wrote:

> Happy Friday Tapestry Users,

Hi!

> I've been stuck on this all week and really can't move because it's the  
> last part of my app :(

I don't understand this thread. Really. We've noticed the problem is in a  
Loop. Now you post a template with only a Grid. I've suggested you to  
explicitly pass the ValueEncoder to the Loop's encoder parameter. I said  
it may be a problem with your persistence provider could have been  
returning entity subclasses in some cases. No response from you for both  
questions.

-- 
Thiago H. de Paula Figueiredo

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


Re: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
Happy Friday Tapestry Users,

I've been stuck on this all week and really can't move because it's the last
part of my app :(
Then I'm done!!  But tapestry is not making it easy to finish.

My ValueEncoder is not getting recognised.

Here's a good summary of it.

1.  I use similar (if not the exact same) Object -> T5 Page -> T5 Template 
structure between 3 types of objects.

My objects are
  a)  CTIConfigurator
  b)  RTQProbe
  c)  LibraryQueueMemberEvent

And it works for a list of objects when all values in the DB are fetched
from business layer.  No need for a value encoder for the grid component on
these.

The page class looks like this for all of these types


And template



And this works.

I then use the same thing for a different object.  Using the grid for all
results and it works.


My problem exists when I fetch from the business layer a subset of all
objects of this type, and I get the coercion exception.  I don't know why
because it is still a list of objects.


So I make a ValueEncoder for LibraryQueueMemberEvent




And my AppModule has this added to use my ValueEncoder.


It is my only contributedValueEncoder.

I'm still getting a coercion exception on a subset of all
LibraryQueueMemberEvent objects, which are returned from EJB as a list.

The ValueEncoder is declared in the page and template, but somehow not
recognised.

The template


And the page class



There are no typos, I've gone over it with a fine toothed comb.
Help required :(
Thanks
Chris



--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720165.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: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
I took it out when doing my side-project testing.

The findAll() works without a ValueEncoder, yet the other query does not.
Here is a ValueEncoder I have used but no luck.

Why does findAll() work without a value encoder and the other one doesn't?
This part seems irregular.



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.opencsta.eventviewer.encoders;

import javax.ejb.EJB;
import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.services.ValueEncoderFactory;
import
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent;
import
org.opencsta.ctiserver.library.asterisk.managerevents.session.LibraryQueueMemberEventFacadeLocal;

/**
 *
 * @author chrismylonas
 */
public class LibraryQueueMemberEventEncoder implements
ValueEncoder<LibraryQueueMemberEvent>,
ValueEncoderFactory<LibraryQueueMemberEvent> {

    private LibraryQueueMemberEventFacadeLocal _libraryQueueMemberService;

    public LibraryQueueMemberEventEncoder(LibraryQueueMemberEventFacadeLocal
qmService) {
        this._libraryQueueMemberService = qmService;

    }

    @Override
    public String toClient(LibraryQueueMemberEvent v) {
        return String.valueOf(v.getId());
    }

    @Override
    public LibraryQueueMemberEvent toValue(String id) {
        return _libraryQueueMemberService.find(Long.valueOf(id));
    }

    @Override
    public ValueEncoder<LibraryQueueMemberEvent>
create(Class<LibraryQueueMemberEvent> type) {
        ;//
    }
}




--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720135.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: 3 days of ValueEncoder-ing, no coercion found

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 20 Feb 2013 18:25:28 -0300, mvchris <ch...@mrvoip.com.au> wrote:

> Hi Thiago et al,
>
> Sure can, what follows is the template, page class, session bean,
> implementation and entity with named queries.

You didn't explicitly provided a ValueEncoder to your source. Could you  
please try that?

-- 
Thiago H. de Paula Figueiredo

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


Re: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
Hi Thiago et al,

Sure can, what follows is the template, page class, session bean,
implementation and entity with named queries.
I discovered this behaviour when I ripped this stuff out into a side project
and made a mock list of objects to display...and it worked.  Note that there
are no complex types in the entity, all just String/Integer/Boolean.

No value encoder.
findAll() works.  Returns 132 objects in List.
getMostRecentDistinctByQueue() does not.  Returns 3 objects in List.



I've refactored from LibraryEvent to LibraryQueueMemberEvent overnight as I
work on other parts of the app.
Same exception(s)...


Here is AgentStatusList.tml using a loop

<html t:type="layout" title="About EventViewer"
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">

    <p>About EventViewer application ...</p>


    

        	id
        	status
        	membership
        	location
        	queue
    
    <t:loop source="qmevents"  value="qmevent">
    

        	${qmevent.id}
        	${qmevent.status}
        	${qmevent.membership}
        	${qmevent.location}
        	${qmevent.queue}
    
    </t:loop>

</html>


And here is the page class

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.opencsta.eventviewer.pages;

import java.util.List;
import javax.ejb.EJB;
import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.annotations.Property;
import
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent;
import
org.opencsta.ctiserver.library.asterisk.managerevents.session.LibraryQueueMemberEventFacadeLocal;
import org.opencsta.eventviewer.encoders.LibraryQueueMemberEventEncoder;

/**
 *
 * @author chrismylonas
 */
public class AgentStatusList {

    @EJB
    private LibraryQueueMemberEventFacadeLocal queueMemberService;
    
    @Property
    private LibraryQueueMemberEvent qmevent;
    
//    @Property
//    private LibraryQueueMemberEventEncoder lqmeEncoder ;

    public List<LibraryQueueMemberEvent> getQMEvents() {      
        List<LibraryQueueMemberEvent> a =
queueMemberService.getMostRecentDistinctByQueue("2720102");
        System.out.println("MYLO THE SIZE OF QMEVENTS IS " + a.size() );
        return a;
    }
        
}


This is using the Jumpstart method of getting the @EJB annotation to work. 
I have had success in using Lenny's Flowlogix library, I'm not at the stage
to incorporate it into my workflow for this project.



Here is the @Local session bean interface
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.opencsta.ctiserver.library.asterisk.managerevents.session;

import java.util.List;
import javax.ejb.Local;
import
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent;

/**
 *
 * @author chrismylonas
 */
@Local
public interface LibraryQueueMemberEventFacadeLocal {

    void create(LibraryQueueMemberEvent libraryQueueMemberEvent);

    void edit(LibraryQueueMemberEvent libraryQueueMemberEvent);

    void remove(LibraryQueueMemberEvent libraryQueueMemberEvent);

    LibraryQueueMemberEvent find(Object id);

    List<LibraryQueueMemberEvent> findAll();

    List<LibraryQueueMemberEvent> findRange(int[] range);

    int count();

    public LibraryQueueMemberEvent getMostRecentByQueueNumberAndMember(
            String queueNumber, String qMember);

    public List<LibraryQueueMemberEvent> getMostRecentDistinctByQueue(String
queueNumber);
}


And the implementing class

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.opencsta.ctiserver.library.asterisk.managerevents.session;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent;

/**
 *
 * @author chrismylonas
 */
@Stateless
public class LibraryQueueMemberEventFacade extends
AbstractFacade<LibraryQueueMemberEvent> implements
LibraryQueueMemberEventFacadeLocal {

    @PersistenceContext(unitName = "InfrastructureEM")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public LibraryQueueMemberEventFacade() {
        super(LibraryQueueMemberEvent.class);
    }

    @Override
    public LibraryQueueMemberEvent
getMostRecentByQueueNumberAndMember(String queueNumber, String qMember) {
        Query query =
getEntityManager().createNamedQuery(LibraryQueueMemberEvent.QUERY_GETLATESTBYQNUMANDAGENT);
        query.setMaxResults(1);
        query.setParameter(LibraryQueueMemberEvent.QUERY_PARAMETER_QNUM,
queueNumber);
        query.setParameter(LibraryQueueMemberEvent.QUERY_PARAMETER_QMEM,
qMember);
        return (LibraryQueueMemberEvent) query.getSingleResult();
    }
    
    @Override
    public List<LibraryQueueMemberEvent> getMostRecentDistinctByQueue(String
queueNumber){
        Query query =
getEntityManager().createNamedQuery(LibraryQueueMemberEvent.QUERY_GETDISTINCTLOCATION);
        //query.setMaxResults(50);
       
query.setParameter(LibraryQueueMemberEvent.QUERY_PARAMETER_QNUMDISTINCT,
queueNumber);
        return (List<LibraryQueueMemberEvent>) query.getResultList();
    }
}



With the @Entity (note the named queries)

/*
 *  Copyright 2004-2006 Stefan Reuter
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package org.opencsta.ctiserver.library.asterisk.managerevents.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryResponseEvent;

/**
 * A QueueMemberEvent is triggered in response to a QueueStatusAction and
 * contains information about a member of a queue. <p> It is implemented in
 * <code>apps/app_queue.c</code>
 *
 * @see org.asteriskjava.manager.action.QueueStatusAction
 * @author srt
 * @version $Id$
 */
@Entity
@Table(name = "LIBRARYQUEUEMEMBEREVENT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Libraryqueuememberevent.findAll", query = "SELECT l
FROM LibraryQueueMemberEvent l"),
    @NamedQuery(name = "Libraryqueuememberevent.findById", query = "SELECT l
FROM LibraryQueueMemberEvent l WHERE l.id = :id"),
    @NamedQuery(name = "Libraryqueuememberevent.findByQueue", query =
"SELECT l FROM LibraryQueueMemberEvent l WHERE l.queue = :queue"),
    @NamedQuery(name =
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.QUERY_GETLATESTBYQNUMANDAGENT,
query = "SELECT q FROM LibraryQueueMemberEvent q WHERE q.queue = :qnum AND
q.name = :qmem ORDER BY q.id DESC"),
    @NamedQuery(name =
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.QUERY_GETDISTINCTLOCATION,
query = "SELECT DISTINCT q.name FROM LibraryQueueMemberEvent q WHERE q.queue
= :qnumdistinct ORDER BY q.id DESC"),
    @NamedQuery(name = "Libraryqueuememberevent.findByStatus", query =
"SELECT l FROM LibraryQueueMemberEvent l WHERE l.status = :status")})
public class LibraryQueueMemberEvent extends LibraryResponseEvent implements
Serializable {

    private static final long serialVersionUID = 1L;
    public static final String QUERY_PARAMETER_QNUM = "qnum";
        public static final String QUERY_PARAMETER_QNUMDISTINCT =
"qnumdistinct";
    public static final String QUERY_PARAMETER_QMEM = "qmem";
    public static final String QUERY_GETLATESTBYQNUMANDAGENT =
"org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.QUERY_GETLATESTBYQNUMANDAGENT";
    public static final String QUERY_GETDISTINCTLOCATION =
"org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.QUERY_GETDISTINCTLOCATION";
    public static final int AST_DEVICE_UNKNOWN = 0;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * Queue member is available.
     */
    public static final int AST_DEVICE_NOT_INUSE = 1;
    public static final int AST_DEVICE_INUSE = 2;
    public static final int AST_DEVICE_BUSY = 3;
    public static final int AST_DEVICE_INVALID = 4;
    public static final int AST_DEVICE_UNAVAILABLE = 5;
    public static final int AST_DEVICE_RINGING = 6;
    public static final int AST_DEVICE_RINGINUSE = 7;
    public static final int AST_DEVICE_ONHOLD = 8;
    public static final String MEMBERSHIP_STATIC = "static";
    public static final String MEMBERSHIP_DYNAMIC = "dynamic";
    /**
     * Serializable version identifier.
     */
    private String queue;
    private String location;
    private String membership;
    private String name;
    private Integer penalty;
    private Integer callsTaken;
    private Long lastCall;
    private Integer status;
    private Boolean paused;

    public LibraryQueueMemberEvent() {
    }

    /**
     * @param source
     */
    public LibraryQueueMemberEvent(Object source) {
        super(source);
    }

    /**
     * Returns the name of the queue.
     *
     * @return the name of the queue.
     */
    public String getQueue() {
        return queue;
    }

    /**
     * Sets the name of the queue.
     *
     * @param queue the name of the queue.
     */
    public void setQueue(String queue) {
        this.queue = queue;
    }

    /**
     * Returns the name of the member's interface. <p> E.g. the channel name
or
     * agent group (for example "Agent/
     *
     * @1").
     *
     * @return the name of the member's interface.
     */
    public String getLocation() {
        return location;
    }

    /**
     * Sets the name of the member's interface.
     *
     * @param location the name of the member's interface.
     */
    public void setLocation(String location) {
        this.location = location;
    }

    /**
     * Returns if this member has been dynamically added by the QueueAdd
command
     * (in the dialplan or via the Manager API) or if this member is has
been
     * statically defined in
     * <code>queues.conf</code>.
     *
     * @return "dynamic" if the added member is a dynamic queue member,
"static"
     * if the added member is a static queue member.
     */
    public String getMembership() {
        return membership;
    }

    /**
     * Convenience method that checks whether this member has been
statically
     * defined in
     * <code>queues.conf</code>.
     *
     * @return <code>true</code> if this member has been statically defined
in
     * <code>queues.conf</code>, <code>false</code> otherwise.
     * @since 0.3
     */
    public boolean isStatic() {
        return MEMBERSHIP_STATIC.equals(membership);
    }

    /**
     * Convenience method that checks whether this member has been
dynamically
     * added by the QueueAdd command.
     *
     * @return <code>true</code> if this member has been dynamically added
by
     * the QueueAdd command, <code>false</code> otherwise.
     * @since 0.3
     */
    public boolean isDynamic() {
        return MEMBERSHIP_DYNAMIC.equals(membership);
    }

    /**
     * Sets if this member has been dynamically or statically added.
     *
     * @param membership "dynamic" if the added member is a dynamic queue
     * member, "static" if the added member is a static queue member.
     */
    public void setMembership(String membership) {
        this.membership = membership;
    }

    /**
     * Returns the penalty for the added member. When calls are distributed
     * members with higher penalties are considered last.
     *
     * @return the penalty for the added member.
     */
    public Integer getPenalty() {
        return penalty;
    }

    /**
     * Sets the penalty for this member.
     *
     * @param penalty the penalty for this member.
     */
    public void setPenalty(Integer penalty) {
        this.penalty = penalty;
    }

    /**
     * Returns the number of calls answered by the member.
     *
     * @return the number of calls answered by the member.
     */
    public Integer getCallsTaken() {
        return callsTaken;
    }

    /**
     * Sets the number of calls answered by the added member.
     *
     * @param callsTaken the number of calls answered by the added member.
     */
    public void setCallsTaken(Integer callsTaken) {
        this.callsTaken = callsTaken;
    }

    /**
     * Returns the time the last successful call answered by the added
member
     * was hungup.
     *
     * @return the time (in seconds since 01/01/1970) the last successful
call
     * answered by the added member was hungup.
     */
    public Long getLastCall() {
        return lastCall;
    }

    /**
     * Sets the time the last successful call answered by this member was
     * hungup.
     *
     * @param lastCall the time (in seconds since 01/01/1970) the last
     * successful call answered by the added member was hungup.
     */
    public void setLastCall(Long lastCall) {
        this.lastCall = lastCall;
    }

    /**
     * Returns the status of this queue member. <p> Available since Asterisk
1.2
     * <p> Valid status codes are: <dl> <dt>AST_DEVICE_UNKNOWN (0)</dt>
     * <dd>Device valid but unknown channel state</dd>
<dt>AST_DEVICE_NOT_INUSE
     * (1)</dt> <dd>Device is not used</dd> <dt>AST_DEVICE_INUSE (2)</dt>
     * <dd>Device is in use</dd> <dt>AST_DEVICE_BUSY (3)</dt> <dd>Device is
     * Busy</dd> <dt>AST_DEVICE_INVALID (4)</dt> <dd>Device is invalid</dd>
     * <dt>AST_DEVICE_UNAVAILABLE (5)</dt> <dd>Device is unavaiable</dd>
     * <dt>AST_DEVICE_RINGING (6)</dt> <dd>Device is ringing</dd>
     * <dt>AST_DEVICE_RINGINUSE (7)</dt> <dd>Device is ringing and in
use</dd>
     * <dt>AST_DEVICE_ONHOLD (8)</dt> <dd>Device is on hold</dd>
     *
     * </dl>
     *
     * @return the status of this queue member or <code>null</code> if this
     * attribute is not supported by your version of Asterisk.
     * @since 0.2
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * Sets the status of this queue member.
     *
     * @param status the status of this queue member
     * @since 0.2
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * Is this queue member paused (not accepting calls)? <p> Available
since
     * Asterisk 1.2.
     *
     * @return <code>Boolean.TRUE</code> if this member has been paused,
     * <code>Boolean.FALSE</code> if not or <code>null</code> if pausing is
not
     * supported by your version of Asterisk.
     * @since 0.2
     */
    public Boolean getPaused() {
        return paused;
    }

    /**
     * Sets if this member has been paused.
     *
     * @since 0.2
     */
    public void setPaused(Boolean paused) {
        this.paused = paused;
    }

    /**
     * Returns the name of the member.
     *
     * @return the name of the member supplied for logging when the member
is
     * added
     * @since 1.0.0
     */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * Returns the name of the member.
     *
     * @return the name of the member supplied for logging when the member
is
     * added
     * @deprecated since 1.0.0. Use {@link #getName()} instead.
     */
    @Deprecated
    public String getMemberName() {
        return name;
    }

    // Renamed to "name" in Asterisk 1.6
    public void setMemberName(String memberName) {
        this.name = memberName;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }
}

The entity extends another class which is @MappedSuperType.  The named
queries do not query any of the supertype's fields.


With full exception trace for the loop component.

[#|2013-02-20T23:47:48.276+1100|SEVERE|glassfish3.1.2|tapestry.render.org.opencsta.eventviewer.pages.AgentStatusList|_ThreadID=112;_ThreadName=Thread-2;|Render
queue error in BeginRender[AgentStatusList:loop]: Failure writing parameter
'value' of component AgentStatusList:loop: Could not find a coercion from
type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.                                                                                
org.apache.tapestry5.ioc.internal.util.TapestryException: Failure writing
parameter 'value' of component AgentStatusList:loop: Could not find a
coercion from type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.
[at classpath:org/opencsta/eventviewer/pages/AgentStatusList.tml, line 15]                               
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:153)                                                                                                                         
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.render(ComponentPageElementImpl.java:209)                                                                                                                      
        at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)                                
        at
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)                    
        at $PageRenderQueue_2c7f342cb38e7.render(Unknown Source)                                                              
        at $PageRenderQueue_2c7f342cb38e6.render(Unknown Source)                                                              
        at
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)     
        at
org.apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.java:1980)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1964)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1946)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1931)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1917)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1899)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1880)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at $MarkupRenderer_2c7f342cb38e5.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:47)     
        at $PageMarkupRenderer_2c7f342cb38e3.renderPageMarkup(Unknown
Source)                                                 
        at
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:67)                                                                                                                             
        at $PageResponseRenderer_2c7f342cb3898.renderPageResponse(Unknown
Source)                                             
        at
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:64)   
        at
org.apache.tapestry5.services.TapestryModule$37.handle(TapestryModule.java:2208)                                   
        at $PageRenderRequestHandler_2c7f342cb389a.handle(Unknown Source)                                                     
        at $PageRenderRequestHandler_2c7f342cb3894.handle(Unknown Source)                                                     
        at
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)                                                                                                             
        at
org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)          
        at $ComponentRequestHandler_2c7f342cb3895.handlePageRender(Unknown
Source)                                            
        at $ComponentRequestHandler_2c7f342cb3867.handlePageRender(Unknown
Source)                                            
        at
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)                 
        at $Dispatcher_2c7f342cb386a.dispatch(Unknown Source)                                                                 
        at $Dispatcher_2c7f342cb3864.dispatch(Unknown Source)                                                                 
        at
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:302)             
        at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)                      
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)                                    
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)                                    
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)                        
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.opencsta.eventviewer.services.AppModule$1.service(AppModule.java:91)                                           
        at $RequestFilter_2c7f342cb385f.service(Unknown Source)                                                               
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:105)              
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:95)               
        at
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)                       
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119)               
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at $RequestHandler_2c7f342cb3858.service(Unknown Source)                                                              
        at
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)  
        at
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)                                          
        at $HttpServletRequestHandler_2c7f342cb385a.service(Unknown Source)                                                   
        at
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)                      
        at $HttpServletRequestFilter_2c7f342cb3856.service(Unknown Source)                                                    
        at $HttpServletRequestHandler_2c7f342cb385a.service(Unknown Source)                                                   
        at
org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)                                    
        at $HttpServletRequestHandler_2c7f342cb385a.service(Unknown Source)                                                   
        at $HttpServletRequestHandler_2c7f342cb3855.service(Unknown Source)                                                   
        at
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)                                              
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)                  
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                          
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)                                
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)                                
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)                                      
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)                                        
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)                                      
        at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)                                      
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)                                        
        at
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)                 
        at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)                              
        at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)                                           
        at
com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)                                               
        at
com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)                                                
        at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)                                 
        at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)                          
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)                                        
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)                                         
        at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)                                          
        at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)                                  
        at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)                                      
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)                                                               
        at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)                                 
        at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)                                    
        at java.lang.Thread.run(Thread.java:722)                                                                              
Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Failure
writing parameter 'value' of component AgentStatusList:loop: Could not find
a coercion from type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.
[at classpath:org/opencsta/eventviewer/pages/AgentStatusList.tml, line 15]                    
        at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.writeToBinding(ParameterWorker.java:301)               
        at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.set(ParameterWorker.java:245)                          
        at
org.apache.tapestry5.corelib.components.Loop.conduit_set_value(Loop.java)                                          
        at org.apache.tapestry5.corelib.components.Loop.begin(Loop.java:386)                                                  
        at
org.apache.tapestry5.corelib.components.Loop.beginRender(Loop.java)                                                
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:202)                                                                                                             
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)                                                                                                                         
        ... 89 more                                                                                                           
Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Could not
find a coercion from type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.                                           
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.findOrCreateCoercion(TypeCoercerImpl.java:316)          
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.access$000(TypeCoercerImpl.java:33)                     
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.getCoercion(TypeCoercerImpl.java:89)     
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:67)          
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:146)                        
        at $TypeCoercer_2c7f342cb3837.coerce(Unknown Source)                                                                  
        at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.writeToBinding(ParameterWorker.java:296)               
        ... 95 more                                                                                                           
|#]                                                                                                                           

[#|2013-02-20T23:47:48.278+1100|SEVERE|glassfish3.1.2|org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler|_ThreadID=112;_ThreadName=Thread-2;|Processing
of request failed with uncaught exception: Render queue error in
BeginRender[AgentStatusList:loop]: Failure writing parameter 'value' of
component AgentStatusList:loop: Could not find a coercion from type
java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.                    
org.apache.tapestry5.internal.services.RenderQueueException: Render queue
error in BeginRender[AgentStatusList:loop]: Failure writing parameter
'value' of component AgentStatusList:loop: Could not find a coercion from
type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.
[at classpath:org/opencsta/eventviewer/pages/AgentStatusList.tml, line 15]                                                                                                 
        at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:81)                                
        at
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)                    
        at $PageRenderQueue_2c7f342cb38e7.render(Unknown Source)                                                              
        at $PageRenderQueue_2c7f342cb38e6.render(Unknown Source)                                                              
        at
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)     
        at
org.apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.java:1980)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1964)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1946)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1931)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1917)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1899)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1880)                             
        at $MarkupRenderer_2c7f342cb38ea.renderMarkup(Unknown Source)                                                         
        at $MarkupRenderer_2c7f342cb38e5.renderMarkup(Unknown Source)                                                         
        at
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:47)     
        at $PageMarkupRenderer_2c7f342cb38e3.renderPageMarkup(Unknown
Source)                                                 
        at
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:67)                                                                                                                             
        at $PageResponseRenderer_2c7f342cb3898.renderPageResponse(Unknown
Source)                                             
        at
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:64)   
        at
org.apache.tapestry5.services.TapestryModule$37.handle(TapestryModule.java:2208)                                   
        at $PageRenderRequestHandler_2c7f342cb389a.handle(Unknown Source)                                                     
        at $PageRenderRequestHandler_2c7f342cb3894.handle(Unknown Source)                                                     
        at
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)                                                                                                             
        at
org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)          
        at $ComponentRequestHandler_2c7f342cb3895.handlePageRender(Unknown
Source)                                            
        at $ComponentRequestHandler_2c7f342cb3867.handlePageRender(Unknown
Source)                                            
        at
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)                 
        at $Dispatcher_2c7f342cb386a.dispatch(Unknown Source)                                                                 
        at $Dispatcher_2c7f342cb3864.dispatch(Unknown Source)                                                                 
        at
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:302)             
        at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)                      
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)                                    
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)                                    
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)                        
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.opencsta.eventviewer.services.AppModule$1.service(AppModule.java:91)                                           
        at $RequestFilter_2c7f342cb385f.service(Unknown Source)                                                               
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:105)              
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:95)               
        at
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)                       
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119)               
        at $RequestHandler_2c7f342cb3865.service(Unknown Source)                                                              
        at $RequestHandler_2c7f342cb3858.service(Unknown Source)                                                              
        at
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)  
        at
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)                                          
        at $HttpServletRequestHandler_2c7f342cb385a.service(Unknown Source)                                                   
        at
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)                      
        at $HttpServletRequestFilter_2c7f342cb3856.service(Unknown Source)                                                    
        at $HttpServletRequestHandler_2c7f342cb385a.service(Unknown Source)                                                   
        at
org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)                                    
        at $HttpServletRequestHandler_2c7f342cb385a.service(Unknown Source)                                                   
        at $HttpServletRequestHandler_2c7f342cb3855.service(Unknown Source)                                                   
        at
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)                                              
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)                  
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                          
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)                                
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)                                
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)                                      
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)                                        
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)                                      
        at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)                                      
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)                                        
        at
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)                 
        at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)                              
        at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)                                           
        at
com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)                                               
        at
com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)                                                
        at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)                                 
        at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)                          
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)                                        
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)                                         
        at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)                                          
        at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)                                  
        at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)                                      
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)                                                               
        at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)                                 
        at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)                                    
        at java.lang.Thread.run(Thread.java:722)                                                                              
Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Failure
writing parameter 'value' of component AgentStatusList:loop: Could not find
a coercion from type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.
[at classpath:org/opencsta/eventviewer/pages/AgentStatusList.tml, line 15]                    
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:153)                                                                                                                         
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.render(ComponentPageElementImpl.java:209)                                                                                                                      
        at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)                                
        ... 87 more                                                                                                           
Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Failure
writing parameter 'value' of component AgentStatusList:loop: Could not find
a coercion from type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.
[at classpath:org/opencsta/eventviewer/pages/AgentStatusList.tml, line 15]                    
        at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.writeToBinding(ParameterWorker.java:301)               
        at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.set(ParameterWorker.java:245)                          
        at
org.apache.tapestry5.corelib.components.Loop.conduit_set_value(Loop.java)                                          
        at org.apache.tapestry5.corelib.components.Loop.begin(Loop.java:386)                                                  
        at
org.apache.tapestry5.corelib.components.Loop.beginRender(Loop.java)                                                
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:202)                                                                                                             
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.invoke(ComponentPageElementImpl.java:133)                                                                                                                         
        ... 89 more                                                                                                           
Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Could not
find a coercion from type java.lang.String to type
org.opencsta.ctiserver.library.asterisk.managerevents.model.LibraryQueueMemberEvent.                                           
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.findOrCreateCoercion(TypeCoercerImpl.java:316)          
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.access$000(TypeCoercerImpl.java:33)                     
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.getCoercion(TypeCoercerImpl.java:89)     
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:67)          
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:146)                        
        at $TypeCoercer_2c7f342cb3837.coerce(Unknown Source)                                                                  
        at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.writeToBinding(ParameterWorker.java:296)               
        ... 95 more                                                                                                           
|



--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720130.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: 3 days of ValueEncoder-ing, no coercion found

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 20 Feb 2013 09:54:15 -0300, mvchris <ch...@mrvoip.com.au> wrote:

> Whether I use a grid or a loop, my EJB findAll() method which returns all
> records - it displays the records without a problem.
> If I use my getDistinct() method, I get the no coercion error.

This may be related to the JPA implementation returning runtime-created  
subclasses of entity classes (in this case, LibraryEvent). I've seen  
Hibernate do that.

> org.apache.tapestry5.ioc.internal.util.TapestryException: Failure writing
> parameter 'value' of component AgentStatusList:loop: Could not find a
> coercion from type java.lang.String to type
> au.com.mrvoip.libt5.model.LibraryEvent. [at classpath:
> au/com/mrvoip/libt5/pages/AgentStatusList.tml, line 15]

You had posted a Grid, but in fact your exception is happening in a Loop.  
Could you post the part of the template that declares this Loop instance?

-- 
Thiago H. de Paula Figueiredo

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


Re: 3 days of ValueEncoder-ing, no coercion found

Posted by mvchris <ch...@mrvoip.com.au>.
OK - I have some peculiar repeatable behaviour... (no use of value encoder
for testing and my findAll() works but smaller subset of results, still
List<LibraryEvent> object used for source)


Whether I use a grid or a loop, my EJB findAll() method which returns all
records - it displays the records without a problem.
If I use my getDistinct() method, I get the no coercion error.

Both EJB  methods return List<LibraryEvent> objects.

The findAll() returns 132 in the list, whereas the getDistinct() returns 3.
When calling findAll(), everything works.  getDistinct() though, no
coercion.

Any thoughts?

Thanks a lot
Chris

Here is the top of the stacktrace, but it looks like a normal "can't find
coercion" message:

[#|2013-02-20T23:47:48.276+1100|SEVERE|glassfish3.1.2|tapestry.render.org.opencsta.eventviewer.pages.AgentStatusList|_ThreadID=112;_ThreadName=Thread-2;|Render
queue error in BeginRender[AgentStatusList:loop]: Failure writing parameter
'value' of component AgentStatusList:loop: Could not find a coercion from
type java.lang.String to type au.com.mrvoip.libt5.model.LibraryEvent. 
                                                                               
org.apache.tapestry5.ioc.internal.util.TapestryException: Failure writing
parameter 'value' of component AgentStatusList:loop: Could not find a
coercion from type java.lang.String to type
au.com.mrvoip.libt5.model.LibraryEvent. [at classpath:
au/com/mrvoip/libt5/pages/AgentStatusList.tml, line 15]          



--
View this message in context: http://tapestry.1045711.n5.nabble.com/3-days-of-ValueEncoder-ing-no-coercion-found-tp5720109p5720118.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: 3 days of ValueEncoder-ing, no coercion found

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 20 Feb 2013 01:49:36 -0300, Chris Mylonas <ch...@mrvoip.com.au>  
wrote:

> Hi Tapestry List, long time no hear...

Hi! Welcome back!

>     <t:grid source="lmevents" encoder="libEventEncoder" row="lmevent"
> rowsPerPage="50" >
>             <p:empty>
>               <p>There are no lmevents to display; you can add some
> manually when the link is made.</p>
>             </p:empty>
>         </t:grid>

Have you checked in the Tapestry error page exactly where in your template  
this happens? I guess it's not related to Grid. As Taha said, there are  
some components that need a ValueEncoder but don't get one automatically.

-- 
Thiago H. de Paula Figueiredo

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