Re: Simple non ajax callback
Just add a behavior that had an on event callback, i know what you suggested are sort of the same. But the other would be simpler to grasp? On Aug 18, 2011 5:06 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: how could it possibly be _even_ simpler? -igor On Thu, Aug 18, 2011 at 12:33 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: ok that was also what I looked into but was unsure if there was another even simpler way. Thanks -Nino 2011/8/17 Igor Vaynberg igor.vaynb...@gmail.com: see how Link does it... all you need to do is implement one of the listener interfaces and call urlfor(component, interface) to generate a callback url.. -igor On Wed, Aug 17, 2011 at 10:22 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi i could not find a simple way todo non ajax callbacks. Its very simple to extend the abstractajaxdefaultbehavior. But could not find something similar for non ajax. Did i miss something? I figure its because if youre using javascript you might aswell do ajax? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: filter filter-namewicketFilter/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationClassName/param-name param-valuecom.company.apps.appname.WebApp/param-value /init-param init-param param-namefilterPath/param-name param-value//param-value /init-param /filter filter-mapping filter-namewicketFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter filter-namewicketSessionFilter/filter-name filter-classorg.apache.wicket.protocol.http.servlet.WicketSessionFilter/filter-class init-param param-namefilterName/param-name param-valuewicketFilter/param-value /init-param /filter filter-mapping filter-namewicketSessionFilter/filter-name url-pattern/friends/url-pattern dispatcherREQUEST/dispatcher dispatcherINCLUDE/dispatcher /filter-mapping servlet servlet-namefriendsManager/servlet-name servlet-classcom.company.apps.appname.servlet.FriendsManagerServlet/servlet-class /servlet servlet-mapping servlet-namefriendsManager/servlet-name url-pattern/friends/url-pattern /servlet-mapping The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo
Re: Simple non ajax callback
It sounds like you want to re-invent the Link ... On Sat, Aug 20, 2011 at 10:16 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: Just add a behavior that had an on event callback, i know what you suggested are sort of the same. But the other would be simpler to grasp? On Aug 18, 2011 5:06 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: how could it possibly be _even_ simpler? -igor On Thu, Aug 18, 2011 at 12:33 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: ok that was also what I looked into but was unsure if there was another even simpler way. Thanks -Nino 2011/8/17 Igor Vaynberg igor.vaynb...@gmail.com: see how Link does it... all you need to do is implement one of the listener interfaces and call urlfor(component, interface) to generate a callback url.. -igor On Wed, Aug 17, 2011 at 10:22 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: Hi i could not find a simple way todo non ajax callbacks. Its very simple to extend the abstractajaxdefaultbehavior. But could not find something similar for non ajax. Did i miss something? I figure its because if youre using javascript you might aswell do ajax? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, martin.ase...@mail.bg wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: filter filter-namewicketFilter/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationClassName/param-name param-valuecom.company.apps.appname.WebApp/param-value /init-param init-param param-namefilterPath/param-name param-value//param-value /init-param /filter filter-mapping filter-namewicketFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter filter-namewicketSessionFilter/filter-name filter-classorg.apache.wicket.protocol.http.servlet.WicketSessionFilter/filter-class init-param param-namefilterName/param-name param-valuewicketFilter/param-value /init-param /filter filter-mapping filter-namewicketSessionFilter/filter-name url-pattern/friends/url-pattern dispatcherREQUEST/dispatcher dispatcherINCLUDE/dispatcher /filter-mapping servlet servlet-namefriendsManager/servlet-name servlet-classcom.company.apps.appname.servlet.FriendsManagerServlet/servlet-class /servlet servlet-mapping servlet-namefriendsManager/servlet-name url-pattern/friends/url-pattern /servlet-mapping The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - Виж какво открих... Поръчваш си ЕДНА - получаваш цели ДВЕ, като втората е бонус! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo124utm_campaign=SummerPromo
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, martin.ase...@mail.bg wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - Виж какво открих... Поръчваш си ЕДНА - получаваш цели ДВЕ, като втората е бонус! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo124utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - Виж какво открих... Поръчваш си ЕДНА - получаваш цели ДВЕ, като втората е бонус! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo124utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - 50% Отстъпка за Хостинг услуги от ICN.Bg Хоствай до 101 сайта на 1 Хостинг и Вземи Безплатно Домейн име. http://www.icn.bg/default.icn?show=aboutstatus=about-newsnews=173
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, martin.ase...@mail.bg wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - Виж какво открих... Поръчваш си ЕДНА - получаваш цели ДВЕ, като
Re: Strange error
For 1.5 I can say that this is definitely true, the code is in org.apache.wicket.page.PageAccessSynchronizer.adapt(...).new PageManagerDecorator() {...}.commitRequest() The related code in 1.4 is in org.apache.wicket.Session.requestDetached() but I'm not sure what exactly happens there. On Sat, Aug 20, 2011 at 6:39 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: I believe there are numerous such Maps, but what can be the cause of concurrent modification? Wicket should be allowing only single thread operating on the object? ** Martin 2011/8/19 Dan Retzlaff dretzl...@gmail.com: I tend to agree that odds of a Wicket bug in this area are small. Can you think of a case in your application where a component has a HashMap of objects which have a TreeMap of objects? Maybe the source of this collection within your application is the problem. On Fri, Aug 19, 2011 at 8:50 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! I don't know how to reproduce it... and I wonder, because there is pagemap lock, what else can be modifying stuff during page serialization? ** Martin 2011/8/19 Dan Retzlaff dretzl...@gmail.com: How reproducible is this? I don't know how the serialization process itself would cause this, but if it's intermittent then maybe there's a threading / synchronization bug somewhere. On Fri, Aug 19, 2011 at 1:59 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! What can be the cause of this error, how can there be concurrent modification to a item on a page being serialized? ** Martin java.util.ConcurrentModificationException at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131) at java.util.TreeMap.writeObject(TreeMap.java:2250) at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at java.util.HashMap.writeObject(HashMap.java:1001) at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422) at org.apache.wicket.Component.writeObject(Component.java:4702) at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Actually I load a wicket page at root context and obtain a session. Afterwards I hit a button that posts to the servlet. I think I'm supposed to have HttpSession at the time. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:44 - the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - Виж какво открих... Поръчваш си ЕДНА - получаваш цели ДВЕ, като втората е бонус!
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
try with getWebRequest().getHttpServletRequest().getHttpSession(false) in your page before making the call to the servlet. It should return non-null. Additionally turn on DEBUG logging for WSF On Sat, Aug 20, 2011 at 12:54 PM, martin.ase...@mail.bg wrote: Actually I load a wicket page at root context and obtain a session. Afterwards I hit a button that posts to the servlet. I think I'm supposed to have HttpSession at the time. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:44 - the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери! http://www.superhosting.bg/SummerHostingPromo/?utm_source=MailBGutm_medium=FooterLinkutm_content=SummerPromo123utm_campaign=SummerPromo -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com
Re: Strange error
Yeah, is 1.4, but it should be behind pagemap lock.. ** Martin 2011/8/20 Martin Grigorov mgrigo...@apache.org For 1.5 I can say that this is definitely true, the code is in org.apache.wicket.page.PageAccessSynchronizer.adapt(...).new PageManagerDecorator() {...}.commitRequest() The related code in 1.4 is in org.apache.wicket.Session.requestDetached() but I'm not sure what exactly happens there. On Sat, Aug 20, 2011 at 6:39 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: I believe there are numerous such Maps, but what can be the cause of concurrent modification? Wicket should be allowing only single thread operating on the object? ** Martin 2011/8/19 Dan Retzlaff dretzl...@gmail.com: I tend to agree that odds of a Wicket bug in this area are small. Can you think of a case in your application where a component has a HashMap of objects which have a TreeMap of objects? Maybe the source of this collection within your application is the problem. On Fri, Aug 19, 2011 at 8:50 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! I don't know how to reproduce it... and I wonder, because there is pagemap lock, what else can be modifying stuff during page serialization? ** Martin 2011/8/19 Dan Retzlaff dretzl...@gmail.com: How reproducible is this? I don't know how the serialization process itself would cause this, but if it's intermittent then maybe there's a threading / synchronization bug somewhere. On Fri, Aug 19, 2011 at 1:59 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! What can be the cause of this error, how can there be concurrent modification to a item on a page being serialized? ** Martin java.util.ConcurrentModificationException at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131) at java.util.TreeMap.writeObject(TreeMap.java:2250) at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at java.util.HashMap.writeObject(HashMap.java:1001) at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422) at
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
yes, really session is null :O at servlet: req.getSession() returns null and wicketsessionfilter in debug mode prints 20-08-2011 13:25:57,753 DEBUG org.apache.wicket.protocol.http.servlet.WicketSessionFilter.bindSession:180 - could not set Wicket session: key null not found in http session for /appname,IP_ADDRESS, or http session does not exist I really don't get it... null http session... could this really be true? Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 13:16 - try with getWebRequest().getHttpServletRequest().getHttpSession(false) in your page before making the call to the servlet. It should return non-null. Additionally turn on DEBUG logging for WSF On Sat, Aug 20, 2011 at 12:54 PM, wrote: Actually I load a wicket page at root context and obtain a session. Afterwards I hit a button that posts to the servlet. I think I'm supposed to have HttpSession at the time. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:44 - the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Sorry, my mistake... Session is not null at servlet. There I have: session is: org.apache.catalina.session.StandardSessionFacade@412f4b while the statement in logs from wicketsessionfilter is: 20-08-2011 13:25:57,753 DEBUG org.apache.wicket.protocol.http.servlet.WicketSessionFilter.bindSession:180 - could not set Wicket session: key null not found in http session for /appname,IP_ADDRESS, or http session does not exist - Цитат от martin.ase...@mail.bg, на 20.08.2011 в 13:31 - yes, really session is null :O at servlet: req.getSession() returns null and wicketsessionfilter in debug mode prints 20-08-2011 13:25:57,753 DEBUG org.apache.wicket.protocol.http.servlet.WicketSessionFilter.bindSession:180 - could not set Wicket session: key null not found in http session for /appname,IP_ADDRESS, or http session does not exist I really don't get it... null http session... could this really be true? Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 13:16 - try with getWebRequest().getHttpServletRequest().getHttpSession(false) in your page before making the call to the servlet. It should return non-null. Additionally turn on DEBUG logging for WSF On Sat, Aug 20, 2011 at 12:54 PM, wrote: Actually I load a wicket page at root context and obtain a session. Afterwards I hit a button that posts to the servlet. I think I'm supposed to have HttpSession at the time. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:44 - the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
In the page, which calls the servlet afterwards, getWebRequestCycle().getWebRequest().getHttpServletRequest().getSession(false) returns null Do you have any ideas why this occurs? Thank you, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 13:16 - try with getWebRequest().getHttpServletRequest().getHttpSession(false) in your page before making the call to the servlet. It should return non-null. Additionally turn on DEBUG logging for WSF On Sat, Aug 20, 2011 at 12:54 PM, wrote: Actually I load a wicket page at root context and obtain a session. Afterwards I hit a button that posts to the servlet. I think I'm supposed to have HttpSession at the time. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:44 - the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin - Видя ли лятната промоция на СуперХостинг? Дават цели ДВЕ години, като плащаш само ЕДНА! Истина е, провери!
Wicket 1.4.18: Performance of unit test observation.
Hi can someone explain to me why performance of unit testing is faster using setUp and destory this way. @Before public void setup() { if (this.authenticatedWebApp == null) { this.authenticatedWebApp = new AuthenticatedTestApplication(); } if (this.tester == null) { this.tester = new WicketTester(this.authenticatedWebApp); } else { this.tester.setupRequestAndResponse(true); } } @After public void tearDown() { if (this.tester != null) { this.tester.destroy(); } } It runs my test case within 2 seconds compare to 25 seconds for this below @Before public void setup() { this.authenticatedWebApp = new AuthenticatedTestApplication(); this.tester = new WicketTester(this.authenticatedWebApp); } @After public void tearDown() { this.tester = null; this.authenticatedWebApp = null; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-18-Performance-of-unit-test-observation-tp3756900p3756900.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Call Session.get().bind() before the POST call and it will be fine. On Sat, Aug 20, 2011 at 1:57 PM, martin.ase...@mail.bg wrote: In the page, which calls the servlet afterwards, getWebRequestCycle().getWebRequest().getHttpServletRequest().getSession(false) returns null Do you have any ideas why this occurs? Thank you, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 13:16 - try with getWebRequest().getHttpServletRequest().getHttpSession(false) in your page before making the call to the servlet. It should return non-null. Additionally turn on DEBUG logging for WSF On Sat, Aug 20, 2011 at 12:54 PM, wrote: Actually I load a wicket page at root context and obtain a session. Afterwards I hit a button that posts to the servlet. I think I'm supposed to have HttpSession at the time. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:44 - the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin
Re: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle even through WicketSessionFilter
Thanks a lot for your time, it did the trick :) Best regards, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 14:31 - Call Session.get().bind() before the POST call and it will be fine. On Sat, Aug 20, 2011 at 1:57 PM, wrote: In the page, which calls the servlet afterwards, getWebRequestCycle().getWebRequest().getHttpServletRequest().getSession(false) returns null Do you have any ideas why this occurs? Thank you, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 13:16 - try with getWebRequest().getHttpServletRequest().getHttpSession(false) in your page before making the call to the servlet. It should return non-null. Additionally turn on DEBUG logging for WSF On Sat, Aug 20, 2011 at 12:54 PM, wrote: Actually I load a wicket page at root context and obtain a session. Afterwards I hit a button that posts to the servlet. I think I'm supposed to have HttpSession at the time. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:44 - the mapping is OK. we see WicketSessionFilter in the stack there is the following code in WSF#bindSession(): if (session == null) { if (logger.isDebugEnabled()) { logger.debug(could not set Wicket session: key + sessionKey + not found in http session for + ((HttpServletRequest)request).getContextPath() + , + request.getServerName() + , or http session does not exist); } } Maybe you don't have active HttpSession yet. On Sat, Aug 20, 2011 at 12:24 PM, wrote: Here is the exception: java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle at org.apache.wicket.Session.findOrCreate(Session.java:209) at org.apache.wicket.Session.get(Session.java:253) at com.company.apps.appname.servlet.FriendsManagerServlet.doPost(FriensManagerServlet.java:39) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206) at org.apache.wicket.protocol.http.servlet.WicketSessionFilter.doFilter(WicketSessionFilter.java:150) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.jva:370) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:17 - paste the last few lines of the exception On Sat, Aug 20, 2011 at 12:11 PM, wrote: Hi, namesake :) Already tried that, no result. Best, Martin - Цитат от Martin Grigorov (mgrigo...@apache.org), на 20.08.2011 в 12:09 - Try with url-mapping: /friends/* both for the session filter and the servlet On Sat, Aug 20, 2011 at 12:03 PM, wrote: Hello, guys, I experience a strange problem with trying to provide a custom servlet with the wicket session. Here is my web.xml conf: wicketFilter org.apache.wicket.protocol.http.WicketFilter applicationClassName com.company.apps.appname.WebApp filterPath / wicketFilter /* wicketSessionFilter org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName wicketFilter wicketSessionFilter /friends REQUEST INCLUDE friendsManager com.company.apps.appname.servlet.FriendsManagerServlet friendsManager /friends The exception java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle is being thrown by the 'friends' servlet. Everything seems to be configured properly; however I get this error. I'm using wicket 1.4.17. I would appreciate any help. Thank you and regards, Martin
Re: Wicket Basics.
Hi Shunmuga, try with this http://web.itu.edu.tr/uyar/wicket-tutorial/wicket-tutorial.pdf it's a basic Wicket tutorial for beginners. Hi Per Newgro, Thanks for your valuable information. I dont know wicket basics also. If u have any tuorials or tutorial links means pls send me. I downloaded some files for netbeans plugin from IDE Plugins link. But i dont know how to install it. Do you small program to understand the wicket easily. If so means, pls send those things to these id's. Thanks in advance On 8/19/11, Per Newgroper.new...@gmx.ch wrote: Welcome to wicket Shunmuga Did you check the website http://wicket.apache.org already. It's all there. Check the wiki, component examples and books section. Hope you have fun with wicket Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.4.18: Performance of unit test observation.
When you reuse the application instance across tests you are also reusing its caches. -igor On Aug 20, 2011 4:03 AM, cablepuff cablep...@gmail.com wrote: Hi can someone explain to me why performance of unit testing is faster using setUp and destory this way. @Before public void setup() { if (this.authenticatedWebApp == null) { this.authenticatedWebApp = new AuthenticatedTestApplication(); } if (this.tester == null) { this.tester = new WicketTester(this.authenticatedWebApp); } else { this.tester.setupRequestAndResponse(true); } } @After public void tearDown() { if (this.tester != null) { this.tester.destroy(); } } It runs my test case within 2 seconds compare to 25 seconds for this below @Before public void setup() { this.authenticatedWebApp = new AuthenticatedTestApplication(); this.tester = new WicketTester(this.authenticatedWebApp); } @After public void tearDown() { this.tester = null; this.authenticatedWebApp = null; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-18-Performance-of-unit-test-observation-tp3756900p3756900.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.4.18: Performance of unit test observation.
Not exactly... JUnit calls @Before and @After for each test method. That's why... *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Sat, Aug 20, 2011 at 1:59 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: When you reuse the application instance across tests you are also reusing its caches. -igor On Aug 20, 2011 4:03 AM, cablepuff cablep...@gmail.com wrote: Hi can someone explain to me why performance of unit testing is faster using setUp and destory this way. @Before public void setup() { if (this.authenticatedWebApp == null) { this.authenticatedWebApp = new AuthenticatedTestApplication(); } if (this.tester == null) { this.tester = new WicketTester(this.authenticatedWebApp); } else { this.tester.setupRequestAndResponse(true); } } @After public void tearDown() { if (this.tester != null) { this.tester.destroy(); } } It runs my test case within 2 seconds compare to 25 seconds for this below @Before public void setup() { this.authenticatedWebApp = new AuthenticatedTestApplication(); this.tester = new WicketTester(this.authenticatedWebApp); } @After public void tearDown() { this.tester = null; this.authenticatedWebApp = null; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-18-Performance-of-unit-test-observation-tp3756900p3756900.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.4.18: Performance of unit test observation.
Oh... sorry Igor... :-) *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Sat, Aug 20, 2011 at 2:20 PM, Bruno Borges bruno.bor...@gmail.comwrote: Not exactly... JUnit calls @Before and @After for each test method. That's why... *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Sat, Aug 20, 2011 at 1:59 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: When you reuse the application instance across tests you are also reusing its caches. -igor On Aug 20, 2011 4:03 AM, cablepuff cablep...@gmail.com wrote: Hi can someone explain to me why performance of unit testing is faster using setUp and destory this way. @Before public void setup() { if (this.authenticatedWebApp == null) { this.authenticatedWebApp = new AuthenticatedTestApplication(); } if (this.tester == null) { this.tester = new WicketTester(this.authenticatedWebApp); } else { this.tester.setupRequestAndResponse(true); } } @After public void tearDown() { if (this.tester != null) { this.tester.destroy(); } } It runs my test case within 2 seconds compare to 25 seconds for this below @Before public void setup() { this.authenticatedWebApp = new AuthenticatedTestApplication(); this.tester = new WicketTester(this.authenticatedWebApp); } @After public void tearDown() { this.tester = null; this.authenticatedWebApp = null; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-4-18-Performance-of-unit-test-observation-tp3756900p3756900.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org