[jira] [Closed] (TAP5-1575) DateField is not multi-timezone safe
[ https://issues.apache.org/jira/browse/TAP5-1575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul Stanton closed TAP5-1575. -- Resolution: Duplicate dup of TAP5-841 > DateField is not multi-timezone safe > > > Key: TAP5-1575 > URL: https://issues.apache.org/jira/browse/TAP5-1575 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.1.0.5 >Reporter: Paul Stanton >Priority: Critical > Labels: DateField, TimeZone > > If the client is in a different timezone to the server, selecting a date will > set the wrong value in the input field in most cases. > The cause is the use of 'milliseconds since epoch'. > The following demonstrates part of the problem: > TimeZone serverTz = TimeZone.getTimeZone("GMT+1000"); > TimeZone clientTz = TimeZone.getTimeZone("GMT-1500"); > // simulates client to server communication method used by > DateField > TimeZone.setDefault(serverTz); > SimpleDateFormat serverDf = new SimpleDateFormat("-MM-dd > HH:mm:ss"); > SimpleDateFormat clientDf = (SimpleDateFormat) serverDf.clone(); > clientDf.setTimeZone(clientTz); > String dateSelection = "2011-07-01 00:00:00"; > Date clientDate = clientDf.parse(dateSelection); > Date serverDate = new Date(clientDate.getTime()); > System.out.println("2011-07-01 00:00:00 = " + > serverDf.format(serverDate) + "?"); > So if a user selected July 7 2011, the field would display July 2 2011 if the > timezones were as above. > My solution was to remove the usage of both the java and javascript > `Date.getTime` and `new Date(time)` functions. Instead, I serialise to > "-MM-dd" and format/parse this on the server using the same tz as the > format parameter. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-841) DateField selects wrong date if client is in a different timezone than the server
[ https://issues.apache.org/jira/browse/TAP5-841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066755#comment-13066755 ] Paul Stanton commented on TAP5-841: --- my current solution to this bug is to convert the date selection into a string (-MM-dd) for transportation, avoiding any issues with timezone offsets. And Chris is right, the synchonization of the DF is concerning. Is there a separate Jira for this? I am going to patch my version (my patch jar is growing!!!) so that the DF parameter is cloned before use and synchronized when used. > DateField selects wrong date if client is in a different timezone than the > server > - > > Key: TAP5-841 > URL: https://issues.apache.org/jira/browse/TAP5-841 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.1.0.5 >Reporter: David Rees > > This affects 5.0.18 and 5.1.0.5 in my testing. > Situation is that if the server is running in a different timezone than the > client, the DateField chooser will select the wrong date on the calendar. > For example, if the server is running in "Pacific/Auckland" and the client is > running in "America/Los_Angeles", Auckland is a "day ahead" of Los Angeles > for most of the time and the bug is easy to reproduce. > Right now it is 3:40PM Sep 8, 2009 America/Los_Angeles and 10:40AM Sep 9, > 2009 Pacific/Auckland. If the date on the server to be displayed by the > DateField is Sep 9, 2009, when you select the date chooser, Sep 8, 2009 is > selected in the JavaScript calendar dialog. > I found this message which seems to indicate that Howard thought it might be > an issue - looks like he was correct: > http://www.nabble.com/Re%3A-Tapestry-5.0.15-DateField-localization-problem--patch-included--p20033325.html -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-841) DateField selects wrong date if client is in a different timezone than the server
[ https://issues.apache.org/jira/browse/TAP5-841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066753#comment-13066753 ] Paul Stanton commented on TAP5-841: --- tapx is NOT a solution to a tapestry BUG. > DateField selects wrong date if client is in a different timezone than the > server > - > > Key: TAP5-841 > URL: https://issues.apache.org/jira/browse/TAP5-841 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.1.0.5 >Reporter: David Rees > > This affects 5.0.18 and 5.1.0.5 in my testing. > Situation is that if the server is running in a different timezone than the > client, the DateField chooser will select the wrong date on the calendar. > For example, if the server is running in "Pacific/Auckland" and the client is > running in "America/Los_Angeles", Auckland is a "day ahead" of Los Angeles > for most of the time and the bug is easy to reproduce. > Right now it is 3:40PM Sep 8, 2009 America/Los_Angeles and 10:40AM Sep 9, > 2009 Pacific/Auckland. If the date on the server to be displayed by the > DateField is Sep 9, 2009, when you select the date chooser, Sep 8, 2009 is > selected in the JavaScript calendar dialog. > I found this message which seems to indicate that Howard thought it might be > an issue - looks like he was correct: > http://www.nabble.com/Re%3A-Tapestry-5.0.15-DateField-localization-problem--patch-included--p20033325.html -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1576) JPA Integration 5.3.0 with Primary Key Entity Classes Fails
[ https://issues.apache.org/jira/browse/TAP5-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066729#comment-13066729 ] Lenny Primak commented on TAP5-1576: Thank you - that works perfectly. > JPA Integration 5.3.0 with Primary Key Entity Classes Fails > --- > > Key: TAP5-1576 > URL: https://issues.apache.org/jira/browse/TAP5-1576 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-jpa >Affects Versions: 5.3 >Reporter: Lenny Primak >Assignee: Igor Drobiazko > Fix For: 5.3 > > > Single Persistence Unit this time, Glassfish 3,1 > This used to work with Tynamo JPA as well. > Everything works until I introduce a primary key entity reference such as > this: > Thanks! > --- Main Entity -- > /** > * > * @author lprimak > */ > @Entity > @Table(name = "webstats") > @XmlRootElement > @NamedQueries( > { > ... > }) > @Data > public class WebStats implements Serializable > { >public String getDate() >{ >return webStatsPK.getSdate(); >} >public String getStatisticName() >{ >return webStatsPK.getSName(); >} >private static final long serialVersionUID = 1L; >@EmbeddedId >protected WebStatsPK webStatsPK; >@Basic(optional = false) >@NotNull >@Column(name = "nvisit") >private long nvisit; >@Column(name = "ncarrier") >private Long ncarrier; >@Column(name = "ntrack") >private Long ntrack; >@Column(name = "nadmin") >private Long nadmin; >@Column(name = "nother") >private Long nother; >public WebStats() >{ >} >public WebStats(WebStatsPK webstatsPK) >{ >this.webStatsPK = webstatsPK; >} >public WebStats(WebStatsPK webstatsPK, long nvisit) >{ >this.webStatsPK = webstatsPK; >this.nvisit = nvisit; >} >public WebStats(String sdate, String sName) >{ >this.webStatsPK = new WebStatsPK(sdate, sName); >} > } > - Embedded Primary Key --- > /** > * > * @author lprimak > */ > @Embeddable > @Data > public class WebStatsPK implements Serializable > { >/** > * > */ >private static final long serialVersionUID = 1L; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 8) >@Column(name = "sdate") >private String sdate; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 50) >@Column(name = "sName") >private String sName; >public WebStatsPK() >{ >} >public WebStatsPK(String sdate, String sName) >{ >this.sdate = sdate; >this.sName = sName; >} > } > > Here is the error: > SEVERE: Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > SEVERE: Operations trace: > SEVERE: [ 1] Constructing instance of page class > org.apache.tapestry5.corelib.pages.ExceptionReport > SEVERE: [ 2] Realizing service ValueEncoderSource > SEVERE: [ 3] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 4] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 5] Determining injection value for parameter #1 (java.util.Map) > SEVERE: [ 6] Collecting mapped configuration for service ValueEncoderSource > SEVERE: [ 7] Invoking method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource) (at JpaModule.java:180). > SEVERE: Construction of service ValueEncoderSource failed: Error invoking > service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > java.lang.RuntimeException: Error invoking service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at Tap
[jira] [Resolved] (TAP5-1576) JPA Integration 5.3.0 with Primary Key Entity Classes Fails
[ https://issues.apache.org/jira/browse/TAP5-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Drobiazko resolved TAP5-1576. -- Resolution: Fixed > JPA Integration 5.3.0 with Primary Key Entity Classes Fails > --- > > Key: TAP5-1576 > URL: https://issues.apache.org/jira/browse/TAP5-1576 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-jpa >Affects Versions: 5.3 >Reporter: Lenny Primak >Assignee: Igor Drobiazko > Fix For: 5.3 > > > Single Persistence Unit this time, Glassfish 3,1 > This used to work with Tynamo JPA as well. > Everything works until I introduce a primary key entity reference such as > this: > Thanks! > --- Main Entity -- > /** > * > * @author lprimak > */ > @Entity > @Table(name = "webstats") > @XmlRootElement > @NamedQueries( > { > ... > }) > @Data > public class WebStats implements Serializable > { >public String getDate() >{ >return webStatsPK.getSdate(); >} >public String getStatisticName() >{ >return webStatsPK.getSName(); >} >private static final long serialVersionUID = 1L; >@EmbeddedId >protected WebStatsPK webStatsPK; >@Basic(optional = false) >@NotNull >@Column(name = "nvisit") >private long nvisit; >@Column(name = "ncarrier") >private Long ncarrier; >@Column(name = "ntrack") >private Long ntrack; >@Column(name = "nadmin") >private Long nadmin; >@Column(name = "nother") >private Long nother; >public WebStats() >{ >} >public WebStats(WebStatsPK webstatsPK) >{ >this.webStatsPK = webstatsPK; >} >public WebStats(WebStatsPK webstatsPK, long nvisit) >{ >this.webStatsPK = webstatsPK; >this.nvisit = nvisit; >} >public WebStats(String sdate, String sName) >{ >this.webStatsPK = new WebStatsPK(sdate, sName); >} > } > - Embedded Primary Key --- > /** > * > * @author lprimak > */ > @Embeddable > @Data > public class WebStatsPK implements Serializable > { >/** > * > */ >private static final long serialVersionUID = 1L; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 8) >@Column(name = "sdate") >private String sdate; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 50) >@Column(name = "sName") >private String sName; >public WebStatsPK() >{ >} >public WebStatsPK(String sdate, String sName) >{ >this.sdate = sdate; >this.sName = sName; >} > } > > Here is the error: > SEVERE: Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > SEVERE: Operations trace: > SEVERE: [ 1] Constructing instance of page class > org.apache.tapestry5.corelib.pages.ExceptionReport > SEVERE: [ 2] Realizing service ValueEncoderSource > SEVERE: [ 3] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 4] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 5] Determining injection value for parameter #1 (java.util.Map) > SEVERE: [ 6] Collecting mapped configuration for service ValueEncoderSource > SEVERE: [ 7] Invoking method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource) (at JpaModule.java:180). > SEVERE: Construction of service ValueEncoderSource failed: Error invoking > service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > java.lang.RuntimeException: Error invoking service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error
[jira] [Commented] (TAP5-1576) JPA Integration 5.3.0 with Primary Key Entity Classes Fails
[ https://issues.apache.org/jira/browse/TAP5-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066728#comment-13066728 ] Hudson commented on TAP5-1576: -- Integrated in tapestry-trunk-freestyle #419 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/419/]) TAP5-1576: JPA Integration 5.3.0 with Primary Key Entity Classes Fails drobiazko : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1147707 Files : * /tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java > JPA Integration 5.3.0 with Primary Key Entity Classes Fails > --- > > Key: TAP5-1576 > URL: https://issues.apache.org/jira/browse/TAP5-1576 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-jpa >Affects Versions: 5.3 >Reporter: Lenny Primak >Assignee: Igor Drobiazko > Fix For: 5.3 > > > Single Persistence Unit this time, Glassfish 3,1 > This used to work with Tynamo JPA as well. > Everything works until I introduce a primary key entity reference such as > this: > Thanks! > --- Main Entity -- > /** > * > * @author lprimak > */ > @Entity > @Table(name = "webstats") > @XmlRootElement > @NamedQueries( > { > ... > }) > @Data > public class WebStats implements Serializable > { >public String getDate() >{ >return webStatsPK.getSdate(); >} >public String getStatisticName() >{ >return webStatsPK.getSName(); >} >private static final long serialVersionUID = 1L; >@EmbeddedId >protected WebStatsPK webStatsPK; >@Basic(optional = false) >@NotNull >@Column(name = "nvisit") >private long nvisit; >@Column(name = "ncarrier") >private Long ncarrier; >@Column(name = "ntrack") >private Long ntrack; >@Column(name = "nadmin") >private Long nadmin; >@Column(name = "nother") >private Long nother; >public WebStats() >{ >} >public WebStats(WebStatsPK webstatsPK) >{ >this.webStatsPK = webstatsPK; >} >public WebStats(WebStatsPK webstatsPK, long nvisit) >{ >this.webStatsPK = webstatsPK; >this.nvisit = nvisit; >} >public WebStats(String sdate, String sName) >{ >this.webStatsPK = new WebStatsPK(sdate, sName); >} > } > - Embedded Primary Key --- > /** > * > * @author lprimak > */ > @Embeddable > @Data > public class WebStatsPK implements Serializable > { >/** > * > */ >private static final long serialVersionUID = 1L; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 8) >@Column(name = "sdate") >private String sdate; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 50) >@Column(name = "sName") >private String sName; >public WebStatsPK() >{ >} >public WebStatsPK(String sdate, String sName) >{ >this.sdate = sdate; >this.sName = sName; >} > } > > Here is the error: > SEVERE: Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > SEVERE: Operations trace: > SEVERE: [ 1] Constructing instance of page class > org.apache.tapestry5.corelib.pages.ExceptionReport > SEVERE: [ 2] Realizing service ValueEncoderSource > SEVERE: [ 3] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 4] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 5] Determining injection value for parameter #1 (java.util.Map) > SEVERE: [ 6] Collecting mapped configuration for service ValueEncoderSource > SEVERE: [ 7] Invoking method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource) (at JpaModule.java:180). > SEVERE: Construction of service ValueEncoderSource failed: Error invoking > service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > Pr
[jira] [Reopened] (TAP5-1576) JPA Integration 5.3.0 with Primary Key Entity Classes Fails
[ https://issues.apache.org/jira/browse/TAP5-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Drobiazko reopened TAP5-1576: -- > JPA Integration 5.3.0 with Primary Key Entity Classes Fails > --- > > Key: TAP5-1576 > URL: https://issues.apache.org/jira/browse/TAP5-1576 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-jpa >Affects Versions: 5.3 >Reporter: Lenny Primak >Assignee: Igor Drobiazko > Fix For: 5.3 > > > Single Persistence Unit this time, Glassfish 3,1 > This used to work with Tynamo JPA as well. > Everything works until I introduce a primary key entity reference such as > this: > Thanks! > --- Main Entity -- > /** > * > * @author lprimak > */ > @Entity > @Table(name = "webstats") > @XmlRootElement > @NamedQueries( > { > ... > }) > @Data > public class WebStats implements Serializable > { >public String getDate() >{ >return webStatsPK.getSdate(); >} >public String getStatisticName() >{ >return webStatsPK.getSName(); >} >private static final long serialVersionUID = 1L; >@EmbeddedId >protected WebStatsPK webStatsPK; >@Basic(optional = false) >@NotNull >@Column(name = "nvisit") >private long nvisit; >@Column(name = "ncarrier") >private Long ncarrier; >@Column(name = "ntrack") >private Long ntrack; >@Column(name = "nadmin") >private Long nadmin; >@Column(name = "nother") >private Long nother; >public WebStats() >{ >} >public WebStats(WebStatsPK webstatsPK) >{ >this.webStatsPK = webstatsPK; >} >public WebStats(WebStatsPK webstatsPK, long nvisit) >{ >this.webStatsPK = webstatsPK; >this.nvisit = nvisit; >} >public WebStats(String sdate, String sName) >{ >this.webStatsPK = new WebStatsPK(sdate, sName); >} > } > - Embedded Primary Key --- > /** > * > * @author lprimak > */ > @Embeddable > @Data > public class WebStatsPK implements Serializable > { >/** > * > */ >private static final long serialVersionUID = 1L; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 8) >@Column(name = "sdate") >private String sdate; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 50) >@Column(name = "sName") >private String sName; >public WebStatsPK() >{ >} >public WebStatsPK(String sdate, String sName) >{ >this.sdate = sdate; >this.sName = sName; >} > } > > Here is the error: > SEVERE: Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > SEVERE: Operations trace: > SEVERE: [ 1] Constructing instance of page class > org.apache.tapestry5.corelib.pages.ExceptionReport > SEVERE: [ 2] Realizing service ValueEncoderSource > SEVERE: [ 3] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 4] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 5] Determining injection value for parameter #1 (java.util.Map) > SEVERE: [ 6] Collecting mapped configuration for service ValueEncoderSource > SEVERE: [ 7] Invoking method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource) (at JpaModule.java:180). > SEVERE: Construction of service ValueEncoderSource failed: Error invoking > service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > java.lang.RuntimeException: Error invoking service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error invoking service cont
[jira] [Updated] (TAP5-1576) JPA Integration 5.3.0 with Primary Key Entity Classes Fails
[ https://issues.apache.org/jira/browse/TAP5-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Drobiazko updated TAP5-1576: - Affects Version/s: (was: 5.4) Fix Version/s: 5.3 > JPA Integration 5.3.0 with Primary Key Entity Classes Fails > --- > > Key: TAP5-1576 > URL: https://issues.apache.org/jira/browse/TAP5-1576 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-jpa >Affects Versions: 5.3 >Reporter: Lenny Primak >Assignee: Igor Drobiazko > Fix For: 5.3 > > > Single Persistence Unit this time, Glassfish 3,1 > This used to work with Tynamo JPA as well. > Everything works until I introduce a primary key entity reference such as > this: > Thanks! > --- Main Entity -- > /** > * > * @author lprimak > */ > @Entity > @Table(name = "webstats") > @XmlRootElement > @NamedQueries( > { > ... > }) > @Data > public class WebStats implements Serializable > { >public String getDate() >{ >return webStatsPK.getSdate(); >} >public String getStatisticName() >{ >return webStatsPK.getSName(); >} >private static final long serialVersionUID = 1L; >@EmbeddedId >protected WebStatsPK webStatsPK; >@Basic(optional = false) >@NotNull >@Column(name = "nvisit") >private long nvisit; >@Column(name = "ncarrier") >private Long ncarrier; >@Column(name = "ntrack") >private Long ntrack; >@Column(name = "nadmin") >private Long nadmin; >@Column(name = "nother") >private Long nother; >public WebStats() >{ >} >public WebStats(WebStatsPK webstatsPK) >{ >this.webStatsPK = webstatsPK; >} >public WebStats(WebStatsPK webstatsPK, long nvisit) >{ >this.webStatsPK = webstatsPK; >this.nvisit = nvisit; >} >public WebStats(String sdate, String sName) >{ >this.webStatsPK = new WebStatsPK(sdate, sName); >} > } > - Embedded Primary Key --- > /** > * > * @author lprimak > */ > @Embeddable > @Data > public class WebStatsPK implements Serializable > { >/** > * > */ >private static final long serialVersionUID = 1L; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 8) >@Column(name = "sdate") >private String sdate; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 50) >@Column(name = "sName") >private String sName; >public WebStatsPK() >{ >} >public WebStatsPK(String sdate, String sName) >{ >this.sdate = sdate; >this.sName = sName; >} > } > > Here is the error: > SEVERE: Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > SEVERE: Operations trace: > SEVERE: [ 1] Constructing instance of page class > org.apache.tapestry5.corelib.pages.ExceptionReport > SEVERE: [ 2] Realizing service ValueEncoderSource > SEVERE: [ 3] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 4] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 5] Determining injection value for parameter #1 (java.util.Map) > SEVERE: [ 6] Collecting mapped configuration for service ValueEncoderSource > SEVERE: [ 7] Invoking method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource) (at JpaModule.java:180). > SEVERE: Construction of service ValueEncoderSource failed: Error invoking > service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > java.lang.RuntimeException: Error invoking service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (fo
[jira] [Closed] (TAP5-1576) JPA Integration 5.3.0 with Primary Key Entity Classes Fails
[ https://issues.apache.org/jira/browse/TAP5-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Drobiazko closed TAP5-1576. Resolution: Fixed Thanks, Lenny. I fixed the issue already yesterday but haven't time to commit it. FYI: Your patch is incomplete because there is same issue when contributing to ApplicationStateManager service's configuration. > JPA Integration 5.3.0 with Primary Key Entity Classes Fails > --- > > Key: TAP5-1576 > URL: https://issues.apache.org/jira/browse/TAP5-1576 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-jpa >Affects Versions: 5.3 >Reporter: Lenny Primak >Assignee: Igor Drobiazko > > Single Persistence Unit this time, Glassfish 3,1 > This used to work with Tynamo JPA as well. > Everything works until I introduce a primary key entity reference such as > this: > Thanks! > --- Main Entity -- > /** > * > * @author lprimak > */ > @Entity > @Table(name = "webstats") > @XmlRootElement > @NamedQueries( > { > ... > }) > @Data > public class WebStats implements Serializable > { >public String getDate() >{ >return webStatsPK.getSdate(); >} >public String getStatisticName() >{ >return webStatsPK.getSName(); >} >private static final long serialVersionUID = 1L; >@EmbeddedId >protected WebStatsPK webStatsPK; >@Basic(optional = false) >@NotNull >@Column(name = "nvisit") >private long nvisit; >@Column(name = "ncarrier") >private Long ncarrier; >@Column(name = "ntrack") >private Long ntrack; >@Column(name = "nadmin") >private Long nadmin; >@Column(name = "nother") >private Long nother; >public WebStats() >{ >} >public WebStats(WebStatsPK webstatsPK) >{ >this.webStatsPK = webstatsPK; >} >public WebStats(WebStatsPK webstatsPK, long nvisit) >{ >this.webStatsPK = webstatsPK; >this.nvisit = nvisit; >} >public WebStats(String sdate, String sName) >{ >this.webStatsPK = new WebStatsPK(sdate, sName); >} > } > - Embedded Primary Key --- > /** > * > * @author lprimak > */ > @Embeddable > @Data > public class WebStatsPK implements Serializable > { >/** > * > */ >private static final long serialVersionUID = 1L; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 8) >@Column(name = "sdate") >private String sdate; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 50) >@Column(name = "sName") >private String sName; >public WebStatsPK() >{ >} >public WebStatsPK(String sdate, String sName) >{ >this.sdate = sdate; >this.sName = sName; >} > } > > Here is the error: > SEVERE: Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > SEVERE: Operations trace: > SEVERE: [ 1] Constructing instance of page class > org.apache.tapestry5.corelib.pages.ExceptionReport > SEVERE: [ 2] Realizing service ValueEncoderSource > SEVERE: [ 3] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 4] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 5] Determining injection value for parameter #1 (java.util.Map) > SEVERE: [ 6] Collecting mapped configuration for service ValueEncoderSource > SEVERE: [ 7] Invoking method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource) (at JpaModule.java:180). > SEVERE: Construction of service ValueEncoderSource failed: Error invoking > service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) (for service > 'ValueEncoderSource'): Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > java.lang.RuntimeException: Error invoking service builder m
svn commit: r1147707 - /tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java
Author: drobiazko Date: Sun Jul 17 20:05:55 2011 New Revision: 1147707 URL: http://svn.apache.org/viewvc?rev=1147707&view=rev Log: TAP5-1576: JPA Integration 5.3.0 with Primary Key Entity Classes Fails Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java?rev=1147707&r1=1147706&r2=1147707&view=diff == --- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java (original) +++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java Sun Jul 17 20:05:55 2011 @@ -14,26 +14,9 @@ package org.apache.tapestry5.jpa; -import java.util.Collection; -import java.util.Map; - -import javax.persistence.EntityManagerFactory; -import javax.persistence.metamodel.EntityType; -import javax.persistence.metamodel.Metamodel; -import javax.persistence.spi.PersistenceUnitInfo; - import org.apache.tapestry5.ValueEncoder; import org.apache.tapestry5.internal.InternalConstants; -import org.apache.tapestry5.internal.jpa.CommitAfterWorker; -import org.apache.tapestry5.internal.jpa.EntityApplicationStatePersistenceStrategy; -import org.apache.tapestry5.internal.jpa.EntityManagerManagerImpl; -import org.apache.tapestry5.internal.jpa.EntityManagerObjectProvider; -import org.apache.tapestry5.internal.jpa.EntityManagerSourceImpl; -import org.apache.tapestry5.internal.jpa.EntityPersistentFieldStrategy; -import org.apache.tapestry5.internal.jpa.JpaTransactionAdvisorImpl; -import org.apache.tapestry5.internal.jpa.JpaValueEncoder; -import org.apache.tapestry5.internal.jpa.PackageNamePersistenceUnitConfigurer; -import org.apache.tapestry5.internal.jpa.PersistenceContextWorker; +import org.apache.tapestry5.internal.jpa.*; import org.apache.tapestry5.internal.services.PersistentFieldManager; import org.apache.tapestry5.ioc.Configuration; import org.apache.tapestry5.ioc.LoggerSource; @@ -65,9 +48,16 @@ import org.apache.tapestry5.services.Val import org.apache.tapestry5.services.ValueEncoderSource; import org.slf4j.Logger; +import javax.persistence.EntityManagerFactory; +import javax.persistence.metamodel.EntityType; +import javax.persistence.metamodel.Metamodel; +import javax.persistence.spi.PersistenceUnitInfo; +import java.util.Collection; +import java.util.Map; + /** * Defines core services for JPA support. - * + * * @since 5.3 */ public class JpaModule @@ -81,15 +71,15 @@ public class JpaModule public static EntityManagerSource buildEntityManagerSource(final Logger logger, -@Symbol(JpaSymbols.PERSISTENCE_DESCRIPTOR) -Resource persistenceDescriptor, + @Symbol(JpaSymbols.PERSISTENCE_DESCRIPTOR) + Resource persistenceDescriptor, -@Local -PersistenceUnitConfigurer persistenceUnitConfigurer, + @Local + PersistenceUnitConfigurer persistenceUnitConfigurer, -final Map configuration, + final Map configuration, -final RegistryShutdownHub hub) + final RegistryShutdownHub hub) { final EntityManagerSourceImpl ems = new EntityManagerSourceImpl(logger, persistenceDescriptor, persistenceUnitConfigurer, configuration); @@ -112,7 +102,7 @@ public class JpaModule @Scope(ScopeConstants.PERTHREAD) public static EntityManagerManager buildEntityManagerManager(final EntityManagerSource entityManagerSource, -final PerthreadManager perthreadManager, final Logger logger) + final PerthreadManager perthreadManager, final Logger logger) { final EntityManagerManagerImpl service = new EntityManagerManagerImpl(entityManagerSource, logger); @@ -124,8 +114,8 @@ public class JpaModule @Contribute(JpaEntityPackageManager.class) public static void provideEntityPackages(Configuration configuration, -@Symbol(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM) -String appRootPackage) + @Symbol(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM) + String appRootPackage) { configuration.add(appRootPackage + ".entities"); } @@ -171,10 +161,10 @@ public class JpaModule @Contribute(ValueEncoderSource.class) public static void provideValueEncoders(final MappedConfigu
[jira] [Commented] (TAP5-1576) JPA Integration 5.3.0 with Primary Key Entity Classes Fails
[ https://issues.apache.org/jira/browse/TAP5-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066715#comment-13066715 ] Lenny Primak commented on TAP5-1576: The following patch solves the problem for me: Index: src/main/java/org/apache/tapestry5/jpa/JpaModule.java === --- src/main/java/org/apache/tapestry5/jpa/JpaModule.java (revision 1147680) +++ src/main/java/org/apache/tapestry5/jpa/JpaModule.java (working copy) @@ -184,14 +184,10 @@ { final EntityManagerFactory emf = entityManagerSource.getEntityManagerFactory(info.getPersistenceUnitName()); -for (final String className : info.getManagedClassNames()) +for(final EntityType entity : emf.getMetamodel().getEntities()) +//for (final String className : info.getManagedClassNames()) { -final Metamodel metamodel = emf.getMetamodel(); - -final Class clazz = loadClass(info, className); - -final EntityType entity = metamodel.entity(clazz); - +final Class clazz = entity.getClass(); final ValueEncoderFactory factory = new ValueEncoderFactory() { public ValueEncoder create(final Class type) > JPA Integration 5.3.0 with Primary Key Entity Classes Fails > --- > > Key: TAP5-1576 > URL: https://issues.apache.org/jira/browse/TAP5-1576 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-jpa >Affects Versions: 5.3, 5.4 >Reporter: Lenny Primak >Assignee: Igor Drobiazko > > Single Persistence Unit this time, Glassfish 3,1 > This used to work with Tynamo JPA as well. > Everything works until I introduce a primary key entity reference such as > this: > Thanks! > --- Main Entity -- > /** > * > * @author lprimak > */ > @Entity > @Table(name = "webstats") > @XmlRootElement > @NamedQueries( > { > ... > }) > @Data > public class WebStats implements Serializable > { >public String getDate() >{ >return webStatsPK.getSdate(); >} >public String getStatisticName() >{ >return webStatsPK.getSName(); >} >private static final long serialVersionUID = 1L; >@EmbeddedId >protected WebStatsPK webStatsPK; >@Basic(optional = false) >@NotNull >@Column(name = "nvisit") >private long nvisit; >@Column(name = "ncarrier") >private Long ncarrier; >@Column(name = "ntrack") >private Long ntrack; >@Column(name = "nadmin") >private Long nadmin; >@Column(name = "nother") >private Long nother; >public WebStats() >{ >} >public WebStats(WebStatsPK webstatsPK) >{ >this.webStatsPK = webstatsPK; >} >public WebStats(WebStatsPK webstatsPK, long nvisit) >{ >this.webStatsPK = webstatsPK; >this.nvisit = nvisit; >} >public WebStats(String sdate, String sName) >{ >this.webStatsPK = new WebStatsPK(sdate, sName); >} > } > - Embedded Primary Key --- > /** > * > * @author lprimak > */ > @Embeddable > @Data > public class WebStatsPK implements Serializable > { >/** > * > */ >private static final long serialVersionUID = 1L; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 8) >@Column(name = "sdate") >private String sdate; >@Basic(optional = false) >@NotNull >@Size(min = 1, max = 50) >@Column(name = "sName") >private String sName; >public WebStatsPK() >{ >} >public WebStatsPK(String sdate, String sName) >{ >this.sdate = sdate; >this.sName = sName; >} > } > > Here is the error: > SEVERE: Error invoking service contribution method > org.apache.tapestry5.jpa.JpaModule.provideValueEncoders(MappedConfiguration, > boolean, EntityManagerSource, EntityManagerManager, TypeCoercer, > PropertyAccess, LoggerSource): The type [null] is not the expected > [EntityType] for the key class [class > com.flowlogix.website.entities.WebStatsPK]. > SEVERE: Operations trace: > SEVERE: [ 1] Constructing instance of page class > org.apache.tapestry5.corelib.pages.ExceptionReport > SEVERE: [ 2] Realizing service ValueEncoderSource > SEVERE: [ 3] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 4] Invoking > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, > InvalidationEventHub) (at TapestryModule.java:2337) > SEVERE: [ 5] Determining injection value for parameter #1 (java.util.Map) > SEVERE: [ 6]
[jira] [Commented] (TAP5-1575) DateField is not multi-timezone safe
[ https://issues.apache.org/jira/browse/TAP5-1575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066671#comment-13066671 ] Bob Harner commented on TAP5-1575: -- This issue looks like a duplicate of TAP5-841 > DateField is not multi-timezone safe > > > Key: TAP5-1575 > URL: https://issues.apache.org/jira/browse/TAP5-1575 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.1.0.5 >Reporter: Paul Stanton >Priority: Critical > Labels: DateField, TimeZone > > If the client is in a different timezone to the server, selecting a date will > set the wrong value in the input field in most cases. > The cause is the use of 'milliseconds since epoch'. > The following demonstrates part of the problem: > TimeZone serverTz = TimeZone.getTimeZone("GMT+1000"); > TimeZone clientTz = TimeZone.getTimeZone("GMT-1500"); > // simulates client to server communication method used by > DateField > TimeZone.setDefault(serverTz); > SimpleDateFormat serverDf = new SimpleDateFormat("-MM-dd > HH:mm:ss"); > SimpleDateFormat clientDf = (SimpleDateFormat) serverDf.clone(); > clientDf.setTimeZone(clientTz); > String dateSelection = "2011-07-01 00:00:00"; > Date clientDate = clientDf.parse(dateSelection); > Date serverDate = new Date(clientDate.getTime()); > System.out.println("2011-07-01 00:00:00 = " + > serverDf.format(serverDate) + "?"); > So if a user selected July 7 2011, the field would display July 2 2011 if the > timezones were as above. > My solution was to remove the usage of both the java and javascript > `Date.getTime` and `new Date(time)` functions. Instead, I serialise to > "-MM-dd" and format/parse this on the server using the same tz as the > format parameter. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
svn commit: r1147593 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java
Author: bobharner Date: Sun Jul 17 12:18:53 2011 New Revision: 1147593 URL: http://svn.apache.org/viewvc?rev=1147593&view=rev Log: Added copyright Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java?rev=1147593&r1=1147592&r2=1147593&view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Checklist.java Sun Jul 17 12:18:53 2011 @@ -1,3 +1,17 @@ +// Copyright 2011 The Apache Software Foundation +// +// 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.apache.tapestry5.corelib.components; import org.apache.tapestry5.*;