ApplicationState annotation problem since 5.0.11
Hello, I am currently upgrading my Tapestry version from 5.0.6 to 5.0.11 and I have a problem with @ApplicationState annotation. Here are my files: Login.tml : ?xml version=1.0 encoding=UTF-8? html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleLogin/title /head body div id=login_box t:form t:errors / table tr tdlabel t:type=Label for=login class=login_label//td tdinput t:type=TextField t:id=login t:value=login t:label=login class=login_input //td /tr tr tdlabel t:type=Label for=password class=login_label//td tdinput t:type=PasswordField t:id=password t:value=password t:label=password class=login_input //td /tr tr tdinput t:id=submitform t:type=Submit t:value=submit class=login_submit//td /tr /table /t:form /div /body /html Login.java : package tutos.web.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.beaneditor.Validate; public class Login { @ApplicationState private String login; private String password; public String getLogin() { return login; } @Validate(required) public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } @Validate(required) public void setPassword(String password) { this.password = password; } String onSuccess() { //my business coder String ret = Home; return ret; } } I get the error - no exception in stacktrace : Render queue error in BeginRender[Login:login]: Failure reading parameter 'value' of component Login:login: Error invoking constructor java.lang.String(byte[], int, int, int) (at null:-1) (for service 'ApplicationStateManager'): No service implements the interface [B. When I delete @ApplicationState annotation, everything works. I have made some tests on different Tapestry versions and it seems that @ApplicationState is correctly working until 5.0.10. I get the exception on 5.0.11 and 5.0.12-SNAPSHOT. Is it a bug or @ApplicationState implementation has changed since 5.0.11 ? In this case can someone give me the correct configuration ? Thanks, regards, Baptiste Meurant -- View this message in context: http://www.nabble.com/ApplicationState-annotation-problem-since-5.0.11-tp16118051p16118051.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ApplicationState annotation problem since 5.0.11
Hi! What are you really trying to do here? For me, this looks like a typo. Have you contributed an ApplicationStateObject? Then you need to refer to this. I'm pretty sure Tapestry doen't have a String ApplicationState object in place... I would expect something like @ApplicationState private MyClass myInstance; Where MyClass is contributed to ApplicationStateManager in AppModule.java. Hope this helps.. --alec Baptiste Meurant wrote: Hello, I am currently upgrading my Tapestry version from 5.0.6 to 5.0.11 and I have a problem with @ApplicationState annotation. Here are my files: Login.tml : ?xml version=1.0 encoding=UTF-8? html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleLogin/title /head body div id=login_box t:form t:errors / table tr tdlabel t:type=Label for=login class=login_label//td tdinput t:type=TextField t:id=login t:value=login t:label=login class=login_input //td /tr tr tdlabel t:type=Label for=password class=login_label//td tdinput t:type=PasswordField t:id=password t:value=password t:label=password class=login_input //td /tr tr tdinput t:id=submitform t:type=Submit t:value=submit class=login_submit//td /tr /table /t:form /div /body /html Login.java : package tutos.web.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.beaneditor.Validate; public class Login { @ApplicationState private String login; private String password; public String getLogin() { return login; } @Validate(required) public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } @Validate(required) public void setPassword(String password) { this.password = password; } String onSuccess() { //my business coder String ret = Home; return ret; } } I get the error - no exception in stacktrace : Render queue error in BeginRender[Login:login]: Failure reading parameter 'value' of component Login:login: Error invoking constructor java.lang.String(byte[], int, int, int) (at null:-1) (for service 'ApplicationStateManager'): No service implements the interface [B. When I delete @ApplicationState annotation, everything works. I have made some tests on different Tapestry versions and it seems that @ApplicationState is correctly working until 5.0.10. I get the exception on 5.0.11 and 5.0.12-SNAPSHOT. Is it a bug or @ApplicationState implementation has changed since 5.0.11 ? In this case can someone give me the correct configuration ? Thanks, regards, Baptiste Meurant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ApplicationState annotation problem since 5.0.11
Alec Leamas a écrit : Hi! What are you really trying to do here? For me, this looks like a typo. Have you contributed an ApplicationStateObject? Then you need to refer to this. I'm pretty sure Tapestry doen't have a String ApplicationState object in place... I would expect something like @ApplicationState private MyClass myInstance; Where MyClass is contributed to ApplicationStateManager in AppModule.java. Hope this helps.. --alec Yep, you have to contribute like that : public void contributeApplicationStateManager(MappedConfigurationClass, ApplicationStateContribution configuration) { configuration.add(SimExplorerState.class, new ApplicationStateContribution(session)); } I was using a String as AS before, and it works until 5.0.10 without contributing. Notice that you can store only one instance per class, so when you'll need anything else that your login, you will have to use a bean. -- Gabriel [EMAIL PROTECTED] http://www.codelutin.com tel : 02 40 50 29 28 / fax : 09 59 92 29 28 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ApplicationState annotation problem since 5.0.11
Hi Thank you for your quick answer. If I understand well, I have to create a custom ApplicationStateContribution to handle ApplicationState on String class ? Do you have some tips or instructions to do this ? I will try and tell you the result. I am just surprised that this configurations was working well before 5.0.11 version ... Thanks, Regards, Alec Leamas-2 wrote: Hi! What are you really trying to do here? For me, this looks like a typo. Have you contributed an ApplicationStateObject? Then you need to refer to this. I'm pretty sure Tapestry doen't have a String ApplicationState object in place... I would expect something like @ApplicationState private MyClass myInstance; Where MyClass is contributed to ApplicationStateManager in AppModule.java. Hope this helps.. --alec Baptiste Meurant wrote: Hello, I am currently upgrading my Tapestry version from 5.0.6 to 5.0.11 and I have a problem with @ApplicationState annotation. Here are my files: Login.tml : ?xml version=1.0 encoding=UTF-8? html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleLogin/title /head body div id=login_box t:form t:errors / table tr tdlabel t:type=Label for=login class=login_label//td tdinput t:type=TextField t:id=login t:value=login t:label=login class=login_input //td /tr tr tdlabel t:type=Label for=password class=login_label//td tdinput t:type=PasswordField t:id=password t:value=password t:label=password class=login_input //td /tr tr tdinput t:id=submitform t:type=Submit t:value=submit class=login_submit//td /tr /table /t:form /div /body /html Login.java : package tutos.web.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.beaneditor.Validate; public class Login { @ApplicationState private String login; private String password; public String getLogin() { return login; } @Validate(required) public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } @Validate(required) public void setPassword(String password) { this.password = password; } String onSuccess() { //my business coder String ret = Home; return ret; } } I get the error - no exception in stacktrace : Render queue error in BeginRender[Login:login]: Failure reading parameter 'value' of component Login:login: Error invoking constructor java.lang.String(byte[], int, int, int) (at null:-1) (for service 'ApplicationStateManager'): No service implements the interface [B. When I delete @ApplicationState annotation, everything works. I have made some tests on different Tapestry versions and it seems that @ApplicationState is correctly working until 5.0.10. I get the exception on 5.0.11 and 5.0.12-SNAPSHOT. Is it a bug or @ApplicationState implementation has changed since 5.0.11 ? In this case can someone give me the correct configuration ? Thanks, regards, Baptiste Meurant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ApplicationState-annotation-problem-since-5.0.11-tp16118051p16118858.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ApplicationState annotation problem since 5.0.11
AFAIK you should not use String for ApplicationsStateObjects nor other primitive types at all .. only complex types with a no arg constructor. if you must use a different constructor you have to contribute to the ApplicationStateManager to tell the service how to create the instances properly g, kris Baptiste Meurant [EMAIL PROTECTED] 18.03.2008 12:18 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Re: ApplicationState annotation problem since 5.0.11 Hi Thank you for your quick answer. If I understand well, I have to create a custom ApplicationStateContribution to handle ApplicationState on String class ? Do you have some tips or instructions to do this ? I will try and tell you the result. I am just surprised that this configurations was working well before 5.0.11 version ... Thanks, Regards, Alec Leamas-2 wrote: Hi! What are you really trying to do here? For me, this looks like a typo. Have you contributed an ApplicationStateObject? Then you need to refer to this. I'm pretty sure Tapestry doen't have a String ApplicationState object in place... I would expect something like @ApplicationState private MyClass myInstance; Where MyClass is contributed to ApplicationStateManager in AppModule.java. Hope this helps.. --alec Baptiste Meurant wrote: Hello, I am currently upgrading my Tapestry version from 5.0.6 to 5.0.11 and I have a problem with @ApplicationState annotation. Here are my files: Login.tml : ?xml version=1.0 encoding=UTF-8? html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleLogin/title /head body div id=login_box t:form t:errors / table tr tdlabel t:type=Label for=login class=login_label//td tdinput t:type=TextField t:id=login t:value=login t:label=login class=login_input //td /tr tr tdlabel t:type=Label for=password class=login_label//td tdinput t:type=PasswordField t:id=password t:value=password t:label=password class=login_input //td /tr tr tdinput t:id=submitform t:type=Submit t:value=submit class=login_submit//td /tr /table /t:form /div /body /html Login.java : package tutos.web.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.beaneditor.Validate; public class Login { @ApplicationState private String login; private String password; public String getLogin() { return login; } @Validate(required) public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } @Validate(required) public void setPassword(String password) { this.password = password; } String onSuccess() { //my business coder String ret = Home; return ret; } } I get the error - no exception in stacktrace : Render queue error in BeginRender[Login:login]: Failure reading parameter 'value' of component Login:login: Error invoking constructor java.lang.String(byte[], int, int, int) (at null:-1) (for service 'ApplicationStateManager'): No service implements the interface [B. When I delete @ApplicationState annotation, everything works. I have made some tests on different Tapestry versions and it seems that @ApplicationState is correctly working until 5.0.10. I get the exception on 5.0.11 and 5.0.12-SNAPSHOT. Is it a bug or @ApplicationState implementation has changed since 5.0.11 ? In this case can someone give me the correct configuration ? Thanks, regards, Baptiste Meurant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ApplicationState-annotation-problem-since-5.0.11-tp16118051p16118858.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ApplicationState annotation problem since 5.0.11
Hi Thanks to everybody. I have contributed an ApplicationStateObject for String in AppModule and it is working well now. code below : public void contributeApplicationStateManager( MappedConfigurationClass, ApplicationStateContribution configuration) { ApplicationStateCreatorString creator = new ApplicationStateCreatorString() { public String create() { return new String(); } }; configuration.add(String.class, new ApplicationStateContribution(session, creator)); } I have still few questions : you should not use String for ApplicationsStateObjects nor other primitive types at all - Why ? I understand that a custom complete bean is more usefull in many case but it could be sometime usefull to persist in Application scope a Primitive type object. If we have only one information to share in application scope in a single bean ... I don't see why it could'nt be possible ... Anyway, thanks for everything. Baptiste kristian.marinkovic wrote: AFAIK you should not use String for ApplicationsStateObjects nor other primitive types at all .. only complex types with a no arg constructor. if you must use a different constructor you have to contribute to the ApplicationStateManager to tell the service how to create the instances properly g, kris Baptiste Meurant [EMAIL PROTECTED] 18.03.2008 12:18 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Re: ApplicationState annotation problem since 5.0.11 Hi Thank you for your quick answer. If I understand well, I have to create a custom ApplicationStateContribution to handle ApplicationState on String class ? Do you have some tips or instructions to do this ? I will try and tell you the result. I am just surprised that this configurations was working well before 5.0.11 version ... Thanks, Regards, Alec Leamas-2 wrote: Hi! What are you really trying to do here? For me, this looks like a typo. Have you contributed an ApplicationStateObject? Then you need to refer to this. I'm pretty sure Tapestry doen't have a String ApplicationState object in place... I would expect something like @ApplicationState private MyClass myInstance; Where MyClass is contributed to ApplicationStateManager in AppModule.java. Hope this helps.. --alec Baptiste Meurant wrote: Hello, I am currently upgrading my Tapestry version from 5.0.6 to 5.0.11 and I have a problem with @ApplicationState annotation. Here are my files: Login.tml : ?xml version=1.0 encoding=UTF-8? html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleLogin/title /head body div id=login_box t:form t:errors / table tr tdlabel t:type=Label for=login class=login_label//td tdinput t:type=TextField t:id=login t:value=login t:label=login class=login_input //td /tr tr tdlabel t:type=Label for=password class=login_label//td tdinput t:type=PasswordField t:id=password t:value=password t:label=password class=login_input //td /tr tr tdinput t:id=submitform t:type=Submit t:value=submit class=login_submit//td /tr /table /t:form /div /body /html Login.java : package tutos.web.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.beaneditor.Validate; public class Login { @ApplicationState private String login; private String password; public String getLogin() { return login; } @Validate(required) public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } @Validate(required) public void setPassword(String password) { this.password = password; } String onSuccess() { //my business coder String ret = Home; return ret; } } I get the error - no exception in stacktrace : Render queue error in BeginRender[Login:login]: Failure reading parameter 'value' of component Login:login: Error invoking constructor java.lang.String(byte[], int, int, int