Re: 3 days of ValueEncoder-ing, no coercion found
Oh maan. 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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 3 days of ValueEncoder-ing, no coercion found
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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Jumpstart - instantiate object comment
Hi T5 Users and Jumpstart Geoff, Whilst checking out some ValueEncoder stuff I just thought I'd ask seeing as it gets brought up a lot (Thiago/Taha) :) This example on jumpstart [1] has two ValueEncoder instantiated at the declaration of the field. As I understand this is a no-no and should be in either onActivate() or SetupRender(). Is this correct? Another example [2] doesn't use the @Property annotation and just instantiates the field if required on the getter - which would not raise any blood pressures... Have a good weekend! Kind Regards, Chris [1] http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/editablegridforupdate1 [2] http://jumpstart.doublenegative.com.au/jumpstart/examples/select/easyobject -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jumpstart-instantiate-object-comment-tp5720166.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: PersistenceConstants.FLASH cann't persist ListString langs
bit of a hack but can you put the list to a single string delimited by control chars or caret ^ prior to form submission then on rendering of 2nd page convert back from single string to list chris -- View this message in context: http://tapestry.1045711.n5.nabble.com/PersistenceConstants-FLASH-cann-t-persist-List-String-langs-tp5719462p5720167.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 3 days of ValueEncoder-ing, no coercion found
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 gridand 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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5, Jetty 9 + JSW
hi john, the network engineer in me asks if there is a firewall or some other impediment (like an OS level app-watching daemon that prevents programs from opening ports etc.)? is your request reaching the server if you run a network trace (like wireshark) chris -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-Jetty-9-JSW-tp5720173p5720176.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 3 days of ValueEncoder-ing, no coercion found
OK - I have some peculiar repeatable behaviour... (no use of value encoder for testing and my findAll() works but smaller subset of results, still ListLibraryEvent 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 ListLibraryEvent 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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 3 days of ValueEncoder-ing, no coercion found
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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 3 days of ValueEncoder-ing, no coercion found
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; pAbout 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 ListLibraryQueueMemberEvent getQMEvents() { ListLibraryQueueMemberEvent 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); ListLibraryQueueMemberEvent findAll(); ListLibraryQueueMemberEvent findRange(int[] range); int count(); public LibraryQueueMemberEvent getMostRecentByQueueNumberAndMember( String queueNumber, String qMember); public ListLibraryQueueMemberEvent 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 AbstractFacadeLibraryQueueMemberEvent 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(); }
Re: 3 days of ValueEncoder-ing, no coercion found
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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 3 days of ValueEncoder-ing, no coercion found
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 ValueEncoderLibraryQueueMemberEvent, ValueEncoderFactoryLibraryQueueMemberEvent { 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 ValueEncoderLibraryQueueMemberEvent create(ClassLibraryQueueMemberEvent 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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 3 days of ValueEncoder-ing, no coercion found
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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org