Re: T5.0.6 I'm lost after upgrade T5
Ok, I got it It was not the right import ;o) I used this : import org.apache.log4j.Logger; instead of import org.slf4j.Logger; Thanks :) 2007/11/4, Michael Bernagou <[EMAIL PROTECTED]>: > > I already tried to add the setters, without success. But Itried to access > Home and I got an error regarding my Logger : > > > > My Home.java > public class Home { > ... > > @Inject > private Logger logger; > > String refreshList() { > try { > logger.debug("Processiong refreshList..."); > users = applicationService.getUserList().getUserList(); > logger.debug("User lists set to page."); > } > catch (PapoException pe) { > logger.error("Failed to get the user list. Nothing set in the > page!"); > return FAILURE; > } > return SUCCESS; > } > } > > And now I have this error : > org.apache.tapestry.internal.services.TransformationException: Error > obtaining injected value for field papo.pages.Home.logger: No service > implements the interface org.apache.log4j.Logger. > > I thought Tapestry know everything about logging and in the documentation > it says @Inject private Logger logger; was enought. > > Usually I used log4j like that : > private static Logger logger = Logger.getLogger(MyClass.class.getName()); > but Howard told me in a old and previous mailing to not use the logging > like that... So, how to use the logger in T5? > > > 2007/11/4, Nick Westgate <[EMAIL PROTECTED]>: > > > > Try adding setters to your fields. > > > > Cheers, > > Nick. > > > > > > Josh Canfield wrote: > > >> @InjectPage > > >> private Home home; > > >> > > > > > > The error message seems a little strange, but the code above is > > injecting a > > > page called Home. Does that page load correctly if accessed directly? > > > > > > Josh > > > > > > On 11/3/07, Michael Bernagou <[EMAIL PROTECTED]> wrote: > > >> Everything worked perfectly, but since I upgraded to T5.0.6, it fails > > for > > >> an > > >> understandable reason! > > >> > > >> I replaced my html by tml and placed them in the right place. I > > upgrade > > >> log4j to get the latest and add the new logging api (to avoid runtime > > >> error). > > >> The thing is really strange... > > >> > > >> My Start.tml > > >> > > >> > >>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > > >> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd > > "> > > >> > > >> Paper and Pen Online - Identification > > >> > > >> > > >> ${message} > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> Si vous n'avez pas encore de compte, > >> page="Register">crees-en > > >> un!! > > >> > > >> > > >> > > >> > > >> My Start.java > > >> > > >> public class Start { > > >> private static final String SUCCESS = "Home"; > > >> private static final String FAILURE = "Start"; > > >> > > >> @ApplicationState > > >> private Login login; > > >> public Login getLogin() { return login; } > > >> > > >> @Persist > > >> private String message; > > >> public String getMessage() { return message; } > > >> > > >> @ApplicationState > > >> private User user; > > >> > > >> @InjectPage > > >> private Home home; > > >> > > >> @Inject > > >> private UserService userService; > > >> > > >> @Inject > > >> private ApplicationService applicationService; > > >> > > >> String onSuccess() { > > >> message = null; > > >> > > >> try { > > >> user = userService.getAuthenticatedUser(login.getLogin(), > > >> login.getPassword()); > > >> if (user != null) { > > >> home.setUser(user); > > >> UserLite userLite = new UserLite(user.getLogin ()); > > >> applicationService.makeOnline(userLite); > > >> home.setUsers(applicationService.getUserList > > ().getUserList()); > > >> } > > >> else { > > >> message = "Login ou Password inconnue. L'identification a > > >> échoué."; > > >> return FAILURE; > > >> } > > >> } > > >> catch (PapoException pe) { > > >> message = "La procedure d'identification a rencontré un > > probleme > > >> !!"; > > >> return FAILURE; > > >> } > > >> return SUCCESS; > > >> } > > >> } > > >> > > >> And the error : > > >> > > >> Could not convert 'message' into a component parameter binding: > > >> java.lang.NoClassDefFoundError: papo/pages/Home > > >> location context:Start_fr.tml, line 8, column 363http://tapestry.apache.org/schema/tapestry_5_0_0.xsd > > ">45Paper > > >> and Pen Online - Identification678 > >> style="color:red;">${message}9 > >> tracker="login">10 > > >> 11 12 > >> for="password"/>13 > >> t:validate="required" value=" > > >> login.password"/>So, the tml is found, read, interpreted but for a > > reason > > >> I > > >> don't understand it refer to my class Home which is in the same > > package > > >> than > > >> my class Start. > > >> I have a Register page (tml + java) and it give me exactly the same > > error! > > >> > > >> No error at runtime, no compilation error (
Re: T5.0.6 I'm lost after upgrade T5
I already tried to add the setters, without success. But Itried to access Home and I got an error regarding my Logger : My Home.java public class Home { ... @Inject private Logger logger; String refreshList() { try { logger.debug("Processiong refreshList..."); users = applicationService.getUserList().getUserList(); logger.debug("User lists set to page."); } catch (PapoException pe) { logger.error("Failed to get the user list. Nothing set in the page!"); return FAILURE; } return SUCCESS; } } And now I have this error : org.apache.tapestry.internal.services.TransformationException: Error obtaining injected value for field papo.pages.Home.logger: No service implements the interface org.apache.log4j.Logger. I thought Tapestry know everything about logging and in the documentation it says @Inject private Logger logger; was enought. Usually I used log4j like that : private static Logger logger = Logger.getLogger(MyClass.class.getName()); but Howard told me in a old and previous mailing to not use the logging like that... So, how to use the logger in T5? 2007/11/4, Nick Westgate <[EMAIL PROTECTED]>: > > Try adding setters to your fields. > > Cheers, > Nick. > > > Josh Canfield wrote: > >> @InjectPage > >> private Home home; > >> > > > > The error message seems a little strange, but the code above is > injecting a > > page called Home. Does that page load correctly if accessed directly? > > > > Josh > > > > On 11/3/07, Michael Bernagou <[EMAIL PROTECTED]> wrote: > >> Everything worked perfectly, but since I upgraded to T5.0.6, it fails > for > >> an > >> understandable reason! > >> > >> I replaced my html by tml and placed them in the right place. I upgrade > >> log4j to get the latest and add the new logging api (to avoid runtime > >> error). > >> The thing is really strange... > >> > >> My Start.tml > >> > >> >>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > >> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";> > >> > >> Paper and Pen Online - Identification > >> > >> > >> ${message} > >> > >> > >> > >> > >> > >> > >> > >> Si vous n'avez pas encore de compte, >> page="Register">crees-en > >> un!! > >> > >> > >> > >> > >> My Start.java > >> > >> public class Start { > >> private static final String SUCCESS = "Home"; > >> private static final String FAILURE = "Start"; > >> > >> @ApplicationState > >> private Login login; > >> public Login getLogin() { return login; } > >> > >> @Persist > >> private String message; > >> public String getMessage() { return message; } > >> > >> @ApplicationState > >> private User user; > >> > >> @InjectPage > >> private Home home; > >> > >> @Inject > >> private UserService userService; > >> > >> @Inject > >> private ApplicationService applicationService; > >> > >> String onSuccess() { > >> message = null; > >> > >> try { > >> user = userService.getAuthenticatedUser(login.getLogin(), > >> login.getPassword()); > >> if (user != null) { > >> home.setUser(user); > >> UserLite userLite = new UserLite(user.getLogin()); > >> applicationService.makeOnline(userLite); > >> home.setUsers(applicationService.getUserList().getUserList()); > >> } > >> else { > >> message = "Login ou Password inconnue. L'identification a > >> échoué."; > >> return FAILURE; > >> } > >> } > >> catch (PapoException pe) { > >> message = "La procedure d'identification a rencontré un probleme > >> !!"; > >> return FAILURE; > >> } > >> return SUCCESS; > >> } > >> } > >> > >> And the error : > >> > >> Could not convert 'message' into a component parameter binding: > >> java.lang.NoClassDefFoundError: papo/pages/Home > >> location context:Start_fr.tml, line 8, column 363http://tapestry.apache.org/schema/tapestry_5_0_0.xsd > ">45Paper > >> and Pen Online - Identification678 >> style="color:red;">${message}9 >> tracker="login">10 > >> 11 12 >> for="password"/>13 >> t:validate="required" value=" > >> login.password"/>So, the tml is found, read, interpreted but for a > reason > >> I > >> don't understand it refer to my class Home which is in the same package > >> than > >> my class Start. > >> I have a Register page (tml + java) and it give me exactly the same > error! > >> > >> No error at runtime, no compilation error (Inject are the new Inject, > for > >> example). > >> > >> Thanks > >> > >> -- > >> Michael Bernagou > >> Java Developper > >> > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Michael Bernagou Java Developper
Re: T5.0.6 I'm lost after upgrade T5
Try adding setters to your fields. Cheers, Nick. Josh Canfield wrote: @InjectPage private Home home; The error message seems a little strange, but the code above is injecting a page called Home. Does that page load correctly if accessed directly? Josh On 11/3/07, Michael Bernagou <[EMAIL PROTECTED]> wrote: Everything worked perfectly, but since I upgraded to T5.0.6, it fails for an understandable reason! I replaced my html by tml and placed them in the right place. I upgrade log4j to get the latest and add the new logging api (to avoid runtime error). The thing is really strange... My Start.tml http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";> Paper and Pen Online - Identification ${message} Si vous n'avez pas encore de compte, crees-en un!! My Start.java public class Start { private static final String SUCCESS = "Home"; private static final String FAILURE = "Start"; @ApplicationState private Login login; public Login getLogin() { return login; } @Persist private String message; public String getMessage() { return message; } @ApplicationState private User user; @InjectPage private Home home; @Inject private UserService userService; @Inject private ApplicationService applicationService; String onSuccess() { message = null; try { user = userService.getAuthenticatedUser(login.getLogin(), login.getPassword()); if (user != null) { home.setUser(user); UserLite userLite = new UserLite(user.getLogin()); applicationService.makeOnline(userLite); home.setUsers(applicationService.getUserList().getUserList()); } else { message = "Login ou Password inconnue. L'identification a échoué."; return FAILURE; } } catch (PapoException pe) { message = "La procedure d'identification a rencontré un probleme !!"; return FAILURE; } return SUCCESS; } } And the error : Could not convert 'message' into a component parameter binding: java.lang.NoClassDefFoundError: papo/pages/Home location context:Start_fr.tml, line 8, column 363http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>45Paper and Pen Online - Identification678${message}910 11 12 13So, the tml is found, read, interpreted but for a reason I don't understand it refer to my class Home which is in the same package than my class Start. I have a Register page (tml + java) and it give me exactly the same error! No error at runtime, no compilation error (Inject are the new Inject, for example). Thanks -- Michael Bernagou Java Developper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5.0.6 I'm lost after upgrade T5
> > @InjectPage > private Home home; > The error message seems a little strange, but the code above is injecting a page called Home. Does that page load correctly if accessed directly? Josh On 11/3/07, Michael Bernagou <[EMAIL PROTECTED]> wrote: > > Everything worked perfectly, but since I upgraded to T5.0.6, it fails for > an > understandable reason! > > I replaced my html by tml and placed them in the right place. I upgrade > log4j to get the latest and add the new logging api (to avoid runtime > error). > The thing is really strange... > > My Start.tml > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";> > > Paper and Pen Online - Identification > > > ${message} > > > > > > > > Si vous n'avez pas encore de compte, page="Register">crees-en > un!! > > > > > My Start.java > > public class Start { > private static final String SUCCESS = "Home"; > private static final String FAILURE = "Start"; > > @ApplicationState > private Login login; > public Login getLogin() { return login; } > > @Persist > private String message; > public String getMessage() { return message; } > > @ApplicationState > private User user; > > @InjectPage > private Home home; > > @Inject > private UserService userService; > > @Inject > private ApplicationService applicationService; > > String onSuccess() { > message = null; > > try { > user = userService.getAuthenticatedUser(login.getLogin(), > login.getPassword()); > if (user != null) { > home.setUser(user); > UserLite userLite = new UserLite(user.getLogin()); > applicationService.makeOnline(userLite); > home.setUsers(applicationService.getUserList().getUserList()); > } > else { > message = "Login ou Password inconnue. L'identification a > échoué."; > return FAILURE; > } > } > catch (PapoException pe) { > message = "La procedure d'identification a rencontré un probleme > !!"; > return FAILURE; > } > return SUCCESS; > } > } > > And the error : > > Could not convert 'message' into a component parameter binding: > java.lang.NoClassDefFoundError: papo/pages/Home > location context:Start_fr.tml, line 8, column 363http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>45Paper > and Pen Online - Identification678 style="color:red;">${message}9 tracker="login">10 > 11 12 for="password"/>13 t:validate="required" value=" > login.password"/>So, the tml is found, read, interpreted but for a reason > I > don't understand it refer to my class Home which is in the same package > than > my class Start. > I have a Register page (tml + java) and it give me exactly the same error! > > No error at runtime, no compilation error (Inject are the new Inject, for > example). > > Thanks > > -- > Michael Bernagou > Java Developper > -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox.
T5.0.6 I'm lost after upgrade T5
Everything worked perfectly, but since I upgraded to T5.0.6, it fails for an understandable reason! I replaced my html by tml and placed them in the right place. I upgrade log4j to get the latest and add the new logging api (to avoid runtime error). The thing is really strange... My Start.tml http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";> Paper and Pen Online - Identification ${message} Si vous n'avez pas encore de compte, crees-en un!! My Start.java public class Start { private static final String SUCCESS = "Home"; private static final String FAILURE = "Start"; @ApplicationState private Login login; public Login getLogin() { return login; } @Persist private String message; public String getMessage() { return message; } @ApplicationState private User user; @InjectPage private Home home; @Inject private UserService userService; @Inject private ApplicationService applicationService; String onSuccess() { message = null; try { user = userService.getAuthenticatedUser(login.getLogin(), login.getPassword()); if (user != null) { home.setUser(user); UserLite userLite = new UserLite(user.getLogin()); applicationService.makeOnline(userLite); home.setUsers(applicationService.getUserList().getUserList()); } else { message = "Login ou Password inconnue. L'identification a échoué."; return FAILURE; } } catch (PapoException pe) { message = "La procedure d'identification a rencontré un probleme !!"; return FAILURE; } return SUCCESS; } } And the error : Could not convert 'message' into a component parameter binding: java.lang.NoClassDefFoundError: papo/pages/Home location context:Start_fr.tml, line 8, column 363http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>45Paper and Pen Online - Identification678${message}910 11 12 13So, the tml is found, read, interpreted but for a reason I don't understand it refer to my class Home which is in the same package than my class Start. I have a Register page (tml + java) and it give me exactly the same error! No error at runtime, no compilation error (Inject are the new Inject, for example). Thanks -- Michael Bernagou Java Developper