Re: 1.5 integer textfield
see Alexander Morozov reply either use new TextFieldInteger(refreshRate, refreshRateModel, Integer.class); or call textField.setType(Integer.class) On Wed, Dec 15, 2010 at 7:48 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: same result : private void addViewerAjaxrefreshRateForm() { refreshRateModel = new ModelInteger(); refreshRateModel.setObject(coreDaoService .getWallboardRefreshTimeInSeconds()); FormVoid viewerAjaxrefreshRateForm = new FormVoid( viewerAjaxrefreshRateForm) { @Override protected void onSubmit() { Integer newRefreshRate = refreshRateModel.getObject(); coreDaoService .saveWallboardRefreshTimeInSeconds(newRefreshRate); info(Stored new refresh rate); } }; TextFieldInteger refreshRateTextField = new TextFieldInteger( refreshRate, refreshRateModel); RangeValidatorInteger rangeValidator = new RangeValidatorInteger(1, 1800); refreshRateTextField.add(rangeValidator); viewerAjaxrefreshRateForm.add(refreshRateTextField); add(viewerAjaxrefreshRateForm); } full stack: Root cause: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at java.lang.String.compareTo(String.java:92) at org.apache.wicket.validation.validator.RangeValidator.validate(RangeValidator.java:76) at org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1445) at org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1042) at org.apache.wicket.markup.html.form.Form$17.validate(Form.java:1833) at org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:164) at org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:148) at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:278) at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:267) at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:249) at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:338) at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1041) at org.apache.wicket.markup.html.form.Form.validateComponents(Form.java:1825) at org.apache.wicket.markup.html.form.Form.validate(Form.java:1805) at org.apache.wicket.markup.html.form.Form.process(Form.java:863) at org.apache.wicket.markup.html.form.Form.process(Form.java:821) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:786) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:211) at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:192) at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:173) at org.apache.wicket.request.RequestHandlerStack.executeRequestHandler(RequestHandlerStack.java:84) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:248) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:131) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:184) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.wideplay.warp.persist.PersistenceFilter$3.run(PersistenceFilter.java:141) at com.wideplay.warp.persist.internal.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29) at com.wideplay.warp.persist.PersistenceFilter.doFilter(PersistenceFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at
Wicket extensions AjaxIndicatingDropdownChoice?
should I add one, its just inline with the other indicating components? package com.netdesign.wallboard.component; import java.util.List; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.IAjaxIndicatorAware; import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.behavior.IBehavior; import org.apache.wicket.extensions.ajax.markup.html.AjaxIndicatorAppender; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.model.IModel; public abstract class AjaxIndicatingDropDownChoiceT extends DropDownChoiceT implements IAjaxIndicatorAware { private AjaxIndicatorAppender indicatorAppender; public AjaxIndicatingDropDownChoice(String id, IModelT model, IModel? extends List? extends T choices, IChoiceRenderer? super T renderer) { super(id, model, choices, renderer); AjaxFormComponentUpdatingBehavior ajaxFormComponentUpdatingBehavior = new AjaxFormComponentUpdatingBehavior( onchange) { @Override protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) { AjaxIndicatingDropDownChoice.this.onUpdate(ajaxRequestTarget); } }; add(ajaxFormComponentUpdatingBehavior); this.indicatorAppender = new AjaxIndicatorAppender(); add(new IBehavior[] { this.indicatorAppender }); } @Override public String getAjaxIndicatorMarkupId() { return this.indicatorAppender.getMarkupId(); } public abstract void onUpdate(AjaxRequestTarget ajaxRequestTarget); }
Re: How to listen for CHILD ajax form submits
if you use 1.5 then you can use the new event mechanism. see WICKET-1312 in 1.4 you can use something like: new AjaxFormSubmitBehavior(event) { onSubmit(AjaxRequestTarget target, Form form) { ... target.addChildren(getPage(), MyDialog.class); } } The last line will register all instances of type MyDialog to be re-rendered in this Ajax request/response. Then in your MyDialog#onBeforeRender() { target = AjaxRequestTarget.get(); doSomethingWithTarget(target); } On Tue, Dec 14, 2010 at 9:16 PM, guydog28 g...@guydo.com wrote: Anyone? Abstract: I have extended WiQuery Dialog with our own custom dialog. I want the MyDialog to know if any child components are a Form, being submitted via AJAX (AjaxFormSubmitBehavior). I need access to the AjaxRequestTarget created by that ajax form submit so I can append javascript to it or add components. I'm really hoping someone has a suggestion that I missed. This is a major blocker for us right now. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-listen-for-CHILD-ajax-form-submits-tp3086439p3087882.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: Detach() explanation
hi, each page with all its components is being serialized and stored somewhere (session, disk) at the end of a request. This is needed to be able to support stateful pages and to be able to return to previous page or version of a page with the browser back button. Each component and model has detach() method in which it can null-ify any member variable that is not needed to be stored, i.e. the value of this variable is either not important or can be restored by other means. On Sat, Dec 11, 2010 at 7:26 PM, kumar ku...@mailinator.com wrote: Hi everyone, can I get an example how to implement the detach() method ? can someone please post a detailed example ? why and in which cases implementing detach() is important ? thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Detach-explanation-tp3083568p3083568.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 extensions AjaxIndicatingDropdownChoice?
Yes, your code seems accordant with other indicating components. should I add one, its just inline with the other indicating components? package com.netdesign.wallboard.component; import java.util.List; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.IAjaxIndicatorAware; import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.behavior.IBehavior; import org.apache.wicket.extensions.ajax.markup.html.AjaxIndicatorAppender; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.model.IModel; public abstract class AjaxIndicatingDropDownChoiceT extends DropDownChoiceT implements IAjaxIndicatorAware { private AjaxIndicatorAppender indicatorAppender; public AjaxIndicatingDropDownChoice(String id, IModelT model, IModel? extends List? extends T choices, IChoiceRenderer? super T renderer) { super(id, model, choices, renderer); AjaxFormComponentUpdatingBehavior ajaxFormComponentUpdatingBehavior = new AjaxFormComponentUpdatingBehavior( onchange) { @Override protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) { AjaxIndicatingDropDownChoice.this.onUpdate(ajaxRequestTarget); } }; add(ajaxFormComponentUpdatingBehavior); this.indicatorAppender = new AjaxIndicatorAppender(); add(new IBehavior[] { this.indicatorAppender }); } @Override public String getAjaxIndicatorMarkupId() { return this.indicatorAppender.getMarkupId(); } public abstract void onUpdate(AjaxRequestTarget ajaxRequestTarget); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
help me please!!! Wicket/Spring/Hibernate configuration woes
Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.WicketRuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at
Re: How to listen for CHILD ajax form submits
If you have full control over the contents of your dialog you could try to 1- create the interface to mark your dialog: public interface IAjaxSubmitAware { void onSubmit(AjaxRequestTarget target); } 2- create your own link, buttons, etc as in public abstract class MyAjaxSubmitLink extends AjaxSubmitLink { private static final long serialVersionUID = 1L; /** * @param id */ public MyAjaxSubmitLink(String id) { super(id); } /** * @param id * @param form */ public MyAjaxSubmitLink(String id, Form? form) { super(id, form); } @Override protected final void onSubmit(AjaxRequestTarget target, Form? form) { IAjaxSubmitAware submitAware = findParent(IAjaxSubmitAware.class); if(submitAware != null) { submitAware.onSubmit(target); } doOnSubmit(target, form); } protected abstract void doOnSubmit(AjaxRequestTarget target, Form? form); } Ernesto On Tue, Dec 14, 2010 at 9:16 PM, guydog28 g...@guydo.com wrote: Anyone? Abstract: I have extended WiQuery Dialog with our own custom dialog. I want the MyDialog to know if any child components are a Form, being submitted via AJAX (AjaxFormSubmitBehavior). I need access to the AjaxRequestTarget created by that ajax form submit so I can append javascript to it or add components. I'm really hoping someone has a suggestion that I missed. This is a major blocker for us right now. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-listen-for-CHILD-ajax-form-submits-tp3086439p3087882.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
@SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons adam.s.gibb...@gmail.com wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class
Re: Form.isMultiPart - Visitor not checking for IFormVisitorParticipant
Works perfectly fine with the snapshot. Thanks a lot for the quick change Pedro (gotta love the Wicket community for its helpful members). Cheers, Daniel Soneira On 14.12.2010 21:18, Pedro Santos wrote: I changed the PagingToolbar to set the visibility at onConfigure to avoid early initialize the QueryResult. You can test on the next snapshot from now at http://oss.sonatype.org/content/repositories/snapshots/org/wicketstuff/inmethod-grid/1.4.15-SNAPSHOT/ On Tue, Dec 14, 2010 at 4:40 PM, Pedro Santospedros...@gmail.com wrote: you can get the jar at: http://repo1.maven.org/maven2/org/wicketstuff/inmethod-grid/1.4.14/ On Tue, Dec 14, 2010 at 4:37 PM, Daniel Soneiradaniel.sone...@joyn-it.at wrote: I'll try to put a quickstart together tomorrow. I'm not really using maven in my tool chain (ant guy) so I get the binary releases from here: http://wicketstuff.org/maven/repository/ On 14.12.2010 19:21, Pedro Santos wrote: ops, I miss that, can u send a quickstart? The last version is 1.4.14, you can use dependency groupIdorg.wicketstuff/groupId artifactIdinmethod-grid/artifactId version1.4.14/version /dependency On Tue, Dec 14, 2010 at 4:12 PM, Daniel Soneira daniel.sone...@joyn-it.atwrote: PagingToolbar is not my code. It's a class of inmethod-grid (wicketstuff project). So I have no influence on that. That's what I would do if it _was_ my code though ;) Maybe inmethod-grid adapts the new onConfigure / onInitialize methods. I'm currently using 1.4.1 which I _think_ is the latest official release. On 14.12.2010 18:52, Pedro Santos wrote: use the onConfigure to set the paging-toolbar onConfigure(){ setVisible( getDataGrid().getTotalRowCount() != 0); } On Tue, Dec 14, 2010 at 3:39 PM, Daniel Soneira daniel.sone...@joyn-it.atwrote: Hi there, In the private method Form#isMultiPart the visitor algorithm does not check for components that implement IFormVisitorParticipant. Here is my use case (I've been debugging quite some time to find the source of recent problems I've encountered): Within a form I have a nested In-Method PagingNavigator (with a read-only text field) that returns FALSE for IFormVisitorParticipant#processChildren. Also the grid uses some filtering criteria that the user can change (some text fields - also children of the form). Hierarchy: -- form -- filter -- criteria-1...x -- grid -- paging-toolbar -- paging-navigator [IFormVisitorParticipant - processChildren() returns false] -- text-field -- search-button -- When the form is submitted (via SEARCH button) the following happens: Form#isMultiPart() tries to determine if that text field is visible in the hierarchy; which at some time (through recursion) asks the toolbar. The paging-toolbar contains the following code: -- @Override public boolean isVisible() { return getDataGrid().getTotalRowCount() != 0; } -- This queries the data provider which at that point can not use the current filtering criteria - because they are not submitted yet. Therefore the results in the grid are wrong. The text field is ignored for validation / updating of the model. That works as expected. In my option the text-field should not be visited at all since its parent (navigator) specifies otherwise. Note, that prior to wicket 1.4.12 I didn't have this problem (I was using 1.4.10 before where there is no check for visibleInHierarchy in Form#isMultiPart). I've looked at the source code of Form#isMultiPart in 1.4.14 and 1.5.M3 and both seem to be the same. Should I create a JIRA issue for that (I think it's a bug) or is there an easy workaround that I miss? Kind regards, Daniel Soneira - 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 -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RadioGroup/Radio runtime exception
I'm kinda still stuck with this problem. Any help would be appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-Radio-runtime-exception-tp2331304p3088874.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: 1.5 integer textfield
hmm that fixes it, it's because of generic limitations that we need to set the class explicitly, correct? 2010/12/15 Martin Grigorov mgrigo...@apache.org see Alexander Morozov reply either use new TextFieldInteger(refreshRate, refreshRateModel, Integer.class); or call textField.setType(Integer.class) On Wed, Dec 15, 2010 at 7:48 AM, nino martinez wael nino.martinez.w...@gmail.com wrote: same result : private void addViewerAjaxrefreshRateForm() { refreshRateModel = new ModelInteger(); refreshRateModel.setObject(coreDaoService .getWallboardRefreshTimeInSeconds()); FormVoid viewerAjaxrefreshRateForm = new FormVoid( viewerAjaxrefreshRateForm) { @Override protected void onSubmit() { Integer newRefreshRate = refreshRateModel.getObject(); coreDaoService .saveWallboardRefreshTimeInSeconds(newRefreshRate); info(Stored new refresh rate); } }; TextFieldInteger refreshRateTextField = new TextFieldInteger( refreshRate, refreshRateModel); RangeValidatorInteger rangeValidator = new RangeValidatorInteger(1, 1800); refreshRateTextField.add(rangeValidator); viewerAjaxrefreshRateForm.add(refreshRateTextField); add(viewerAjaxrefreshRateForm); } full stack: Root cause: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at java.lang.String.compareTo(String.java:92) at org.apache.wicket.validation.validator.RangeValidator.validate(RangeValidator.java:76) at org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1445) at org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1042) at org.apache.wicket.markup.html.form.Form$17.validate(Form.java:1833) at org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:164) at org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:148) at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:278) at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:267) at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:249) at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:338) at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1041) at org.apache.wicket.markup.html.form.Form.validateComponents(Form.java:1825) at org.apache.wicket.markup.html.form.Form.validate(Form.java:1805) at org.apache.wicket.markup.html.form.Form.process(Form.java:863) at org.apache.wicket.markup.html.form.Form.process(Form.java:821) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:786) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:211) at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:192) at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:173) at org.apache.wicket.request.RequestHandlerStack.executeRequestHandler(RequestHandlerStack.java:84) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:248) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:131) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:184) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.wideplay.warp.persist.PersistenceFilter$3.run(PersistenceFilter.java:141) at com.wideplay.warp.persist.internal.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29) at com.wideplay.warp.persist.PersistenceFilter.doFilter(PersistenceFilter.java:155) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943) at
Re: wicket global call handlers
function wicketGlobalPreCallHandler() { } this method gets called before sending ajaxrequest ? can I retrieve more information about the request , please help me understand -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-global-call-handlers-tp3088445p3088965.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: help me please!!! Wicket/Spring/Hibernate configuration woes
Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] ml-node+3088802-1498820770-201...@n4.nabble.comml-node%2b3088802-1498820770-201...@n4.nabble.com wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons adam.s.gibb...@gmail.com wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] ml-node+3088802-1498820770-201...@n4.nabble.comml-node%2b3088802-1498820770-201...@n4.nabble.com wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345) at
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
I thought that was the whole point of the Wicket-Spring project... That tutorial looked like it worked as recently as a year ago. I find it hard to believe that it's no longer possible or harder to integrate Wicket and Spring than it was a year ago. On researching that error, all I find are comments about deleting the session file from Tomcat, and turning off session persistance. I've done both and I still get the same start up error. On 15 December 2010 13:53, James Carman [via Apache Wicket] ml-node+3089041-1452804699-201...@n4.nabble.comml-node%2b3089041-1452804699-201...@n4.nabble.com wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Does the spring context startup without the wicket part? I've integrated Wicket in an existing Spring project (following the same guide as you did) and it worked without any (greater) problem. cheers, Matthias Am 15.12.2010 um 15:06 schrieb adam.gibbons: I thought that was the whole point of the Wicket-Spring project... That tutorial looked like it worked as recently as a year ago. I find it hard to believe that it's no longer possible or harder to integrate Wicket and Spring than it was a year ago. On researching that error, all I find are comments about deleting the session file from Tomcat, and turning off session persistance. I've done both and I still get the same start up error. On 15 December 2010 13:53, James Carman [via Apache Wicket] ml-node+3089041-1452804699-201...@n4.nabble.comml-node%2b3089041-1452804699-201...@n4.nabble.com wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
What's the code for UserServiceImpl? On Wed, Dec 15, 2010 at 9:02 AM, adam.gibbons adam.s.gibb...@gmail.com wrote: New log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Hi Matthias, Sorry, I'm not sure what you mean by that? If you look at the new log I just posted, Spring seems to be starting up fine. How could I check it without the wicket part? What would I need to change exactly? Thanks, Adam On 15 December 2010 14:15, Matthias Gasser [via Apache Wicket] ml-node+3089072-2099328675-201...@n4.nabble.comml-node%2b3089072-2099328675-201...@n4.nabble.com wrote: Does the spring context startup without the wicket part? I've integrated Wicket in an existing Spring project (following the same guide as you did) and it worked without any (greater) problem. cheers, Matthias Am 15.12.2010 um 15:06 schrieb adam.gibbons: I thought that was the whole point of the Wicket-Spring project... That tutorial looked like it worked as recently as a year ago. I find it hard to believe that it's no longer possible or harder to integrate Wicket and Spring than it was a year ago. On researching that error, all I find are comments about deleting the session file from Tomcat, and turning off session persistance. I've done both and I still get the same start up error. On 15 December 2010 13:53, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=0[hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=1 wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
The UserServiceImpl code is in the first post. On 15 December 2010 13:53, James Carman [via Apache Wicket] ml-node+3089041-1452804699-201...@n4.nabble.comml-node%2b3089041-1452804699-201...@n4.nabble.com wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at
Re: RadioGroup/Radio runtime exception
Lucky me. I checked newest Wicket release (1.4.14) and saw bugfix about Radio button. https://issues.apache.org/jira/browse/WICKET-3175 My bug occurred because we use one page for everything. That solution worked like a charm. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-Radio-runtime-exception-tp2331304p3089098.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: help me please!!! Wicket/Spring/Hibernate configuration woes
Spring is not starting up fine. It's unable to instantiate the UserServiceImpl bean which is why I asked for the code for that class. On Wed, Dec 15, 2010 at 9:19 AM, adam.gibbons adam.s.gibb...@gmail.com wrote: Hi Matthias, Sorry, I'm not sure what you mean by that? If you look at the new log I just posted, Spring seems to be starting up fine. How could I check it without the wicket part? What would I need to change exactly? Thanks, Adam On 15 December 2010 14:15, Matthias Gasser [via Apache Wicket] ml-node+3089072-2099328675-201...@n4.nabble.comml-node%2b3089072-2099328675-201...@n4.nabble.com wrote: Does the spring context startup without the wicket part? I've integrated Wicket in an existing Spring project (following the same guide as you did) and it worked without any (greater) problem. cheers, Matthias Am 15.12.2010 um 15:06 schrieb adam.gibbons: I thought that was the whole point of the Wicket-Spring project... That tutorial looked like it worked as recently as a year ago. I find it hard to believe that it's no longer possible or harder to integrate Wicket and Spring than it was a year ago. On researching that error, all I find are comments about deleting the session file from Tomcat, and turning off session persistance. I've done both and I still get the same start up error. On 15 December 2010 13:53, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=0[hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=1 wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
So, you didn't change UserServiceImpl, as I suggested? The section you need to change is: @SpringBean private Temp1DAO temp1DAO; Change that to @Autowired instead of @SpringBean On Wed, Dec 15, 2010 at 9:23 AM, adam.gibbons adam.s.gibb...@gmail.com wrote: The UserServiceImpl code is in the first post. On 15 December 2010 13:53, James Carman [via Apache Wicket] ml-node+3089041-1452804699-201...@n4.nabble.comml-node%2b3089041-1452804699-201...@n4.nabble.com wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at
Re: RequiredValidator
Hi, I dont see how this reply solves the problem. The forms fields have this: passwordField.setRequired(true); the Page.properties file has the following structure: Form.FeildName=fieldname RequiredValidator=Holy cow, ${lablel} is blank. This works fine, except the Required Validator part of the properties file does seem to work any more. I.e. it picks up the Form.Fieldname but not the RequiredValidator patterns. I am aware that RequiredValidator has been depricated, and there is no direct replacement, but how do you get the RequiredValidator string functionality back? E.g. if you need to translate the default Field 'xx' is required. which is hard coded into reply a the moment? Which class has an onErrorMessage() call? The form has a bunch of error methods which presumably can be overridden, but not this one. Many thanks for any help! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RequiredValidator-tp1864291p3088996.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
Fwd: Wicket 1.5-M3 migration experiences
Hi all, I have been working on a 1.5 WiQuery branch to see if we can get an experimental version online. I am facing several problems, most of which I can find a workaround for. One, though, I can't seem to tackle. We provide ResourceReferences, Resources and ResourceStreams for the plugin developers, in Wicket 1.5 this has all been changeD but I can't seem to get my head around how to use the new system. The migration guide speaks only of an extra option called variation but does not speak of the fact that subclassing resources is nearly impossible. I hope someone can point me in the right direction. We have a Resource[1] which extends from PackageResource and get the bytes the PackageResource would normally serve to the user and runs this through the YUI compressor. Previously this meant subclassing PackageResources ResourceStream[2], catching the original bytes, running them through the YUI compressor and returning them to the user. Now, however, it is impossible to intercept the original bytes because this is all locked in a private method of PackageResource and using a WriteCallback is useless as this does not provide us access to the original bytes. This would mean we would have to create a near exact copy of PackageResource in order to achieve this. Am I missing anything here, is there anyone who knows another way to achieve the same thing as with wicket 1.4? I do not mind rewriting wiquery completely as long as it's solid and maintainable. Regards, Hielke Hoeve [1] http://code.google.com/p/wiquery/source/browse/trunk/src/main/java/org/odlabs/wiquery/core/commons/compressed/WiQueryYUICompressedJavaScriptResource.java [2] http://code.google.com/p/wiquery/source/browse/trunk/src/main/java/org/odlabs/wiquery/core/commons/compressed/WiQueryYUICompressedJavascriptResourceStream.java
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Yes but directly below it states: Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.WicketRuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] ...so it's the same error. here is the code for UserServiceImpl again: @Service public class UserServiceImpl extends _AbstractService implements UserService{ final private TestUserService testUserService = new TestUserService(); @Autowired private Temp1DAO temp1DAO; @Override @Required final public void setTemp1DAO(final Temp1DAO temp1dao){ temp1DAO = temp1dao; } public UserServiceImpl(){ super(); InjectorHolder.getInjector().inject(this);//-- VERY IMPORTANT to get Spring DI to work. } /* (non-Javadoc) * @see uk.co.company.product.business.spring.UserService#authenticate(java.lang.String, java.lang.String) */ @Override @Transactional final public boolean authenticate(final String userName, final String password){ final Temp1 temp1 = new Temp1(); temp1.setValue(userName); temp1DAO.save(temp1); return testUserService.authenticate(userName, password); } /* (non-Javadoc) * @see uk.co.company.product.business.spring.UserService#getRoles(java.lang.String, boolean) */ @Override @Transactional final public Roles getRoles(final String userName, final boolean signedIn){ return testUserService.getRoles(userName, signedIn); } } On 15 December 2010 14:26, James Carman [via Apache Wicket] ml-node+3089100-955689425-201...@n4.nabble.comml-node%2b3089100-955689425-201...@n4.nabble.com wrote: Spring is not starting up fine. It's unable to instantiate the UserServiceImpl bean which is why I asked for the code for that class. On Wed, Dec 15, 2010 at 9:19 AM, adam.gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3089100i=0 wrote: Hi Matthias, Sorry, I'm not sure what you mean by that? If you look at the new log I just posted, Spring seems to be starting up fine. How could I check it without the wicket part? What would I need to change exactly? Thanks, Adam On 15 December 2010 14:15, Matthias Gasser [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089100i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089100i=2 wrote: Does the spring context startup without the wicket part? I've integrated Wicket in an existing Spring project (following the same guide as you did) and it worked without any (greater) problem. cheers, Matthias Am 15.12.2010 um 15:06 schrieb adam.gibbons: I thought that was the whole point of the Wicket-Spring project... That tutorial looked like it worked as recently as a year ago. I find it hard to believe that it's no longer possible or harder to integrate Wicket and Spring than it was a year ago. On researching that error, all I find are comments about deleting the session file from Tomcat, and turning off session persistance. I've done both and I still get the same start up error. On 15 December 2010 13:53, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=0[hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=1 wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Sorry perhaps I didn't make that clear before. I made that change as you suggested and this is the result. On 15 December 2010 14:28, James Carman [via Apache Wicket] ml-node+3089111-1454695690-201...@n4.nabble.comml-node%2b3089111-1454695690-201...@n4.nabble.com wrote: So, you didn't change UserServiceImpl, as I suggested? The section you need to change is: @SpringBean private Temp1DAO temp1DAO; Change that to @Autowired instead of @SpringBean On Wed, Dec 15, 2010 at 9:23 AM, adam.gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3089111i=0 wrote: The UserServiceImpl code is in the first post. On 15 December 2010 13:53, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089111i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089111i=2 wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups and downs, and found this guide really useful: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/ However, I still seem to be having some problems and I've no idea where to look now. Here's the error I get in my log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl' defined in file [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.Wicket RuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Get rid of the InjectorHolder code in your constructor. On Wed, Dec 15, 2010 at 9:39 AM, adam.gibbons adam.s.gibb...@gmail.com wrote: Yes but directly below it states: Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw exception; nested exception is org.apache.wicket.WicketRuntimeException: There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] ...so it's the same error. here is the code for UserServiceImpl again: @Service public class UserServiceImpl extends _AbstractService implements UserService{ final private TestUserService testUserService = new TestUserService(); �...@autowired private Temp1DAO temp1DAO; �...@override �...@required final public void setTemp1DAO(final Temp1DAO temp1dao){ temp1DAO = temp1dao; } public UserServiceImpl(){ super(); InjectorHolder.getInjector().inject(this);//-- VERY IMPORTANT to get Spring DI to work. } /* (non-Javadoc) * @see uk.co.company.product.business.spring.UserService#authenticate(java.lang.String, java.lang.String) */ �...@override �...@transactional final public boolean authenticate(final String userName, final String password){ final Temp1 temp1 = new Temp1(); temp1.setValue(userName); temp1DAO.save(temp1); return testUserService.authenticate(userName, password); } /* (non-Javadoc) * @see uk.co.company.product.business.spring.UserService#getRoles(java.lang.String, boolean) */ �...@override �...@transactional final public Roles getRoles(final String userName, final boolean signedIn){ return testUserService.getRoles(userName, signedIn); } } On 15 December 2010 14:26, James Carman [via Apache Wicket] ml-node+3089100-955689425-201...@n4.nabble.comml-node%2b3089100-955689425-201...@n4.nabble.com wrote: Spring is not starting up fine. It's unable to instantiate the UserServiceImpl bean which is why I asked for the code for that class. On Wed, Dec 15, 2010 at 9:19 AM, adam.gibbons [hidden email]http://user/SendEmail.jtp?type=nodenode=3089100i=0 wrote: Hi Matthias, Sorry, I'm not sure what you mean by that? If you look at the new log I just posted, Spring seems to be starting up fine. How could I check it without the wicket part? What would I need to change exactly? Thanks, Adam On 15 December 2010 14:15, Matthias Gasser [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089100i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089100i=2 wrote: Does the spring context startup without the wicket part? I've integrated Wicket in an existing Spring project (following the same guide as you did) and it worked without any (greater) problem. cheers, Matthias Am 15.12.2010 um 15:06 schrieb adam.gibbons: I thought that was the whole point of the Wicket-Spring project... That tutorial looked like it worked as recently as a year ago. I find it hard to believe that it's no longer possible or harder to integrate Wicket and Spring than it was a year ago. On researching that error, all I find are comments about deleting the session file from Tomcat, and turning off session persistance. I've done both and I still get the same start up error. On 15 December 2010 13:53, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=0[hidden email] http://user/SendEmail.jtp?type=nodenode=3089072i=1 wrote: You need to be able to fire your spring context outside the context of Wicket. Can it be instantiated outside your container? Once you get that down, you should be good to go. On Wed, Dec 15, 2010 at 8:50 AM, adam.gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=0 wrote: Hi James, Thanks for the suggestion! However, even with your change, I still get the There is no application attached to current thread ContainerBackgroundProcessor[StandardEngine[Catalina]] error. Regards, Adam On 15 December 2010 11:17, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=1[hidden email] http://user/SendEmail.jtp?type=nodenode=3089041i=2 wrote: @SpringBean isn't for use inside your Spring services, just Wicket stuff. Just use the native Spring injection mechanisms. Try @Autowired. On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons [hidden email] http://user/SendEmail.jtp?type=nodenode=3088802i=0 wrote: Hi there, For some time now I have been trying to put together a simple project to get me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups
SV: 1.5 integer textfield
hmm that fixes it, it's because of generic limitations that we need to set the class explicitly, correct? Yes, type information is only available at compile time, the compiler synthesizes generics use into explicit casting used at runtime. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5-M3 migration experiences
Hi Hielke, So basically you need org.apache.wicket.request.resource.PackageResource.getResourceStream() to become protected, right ? This way you can wrap super.getResourceStream() with compressing one. On Wed, Dec 15, 2010 at 11:35 AM, Hielke Hoeve hielke.ho...@gmail.comwrote: Hi all, I have been working on a 1.5 WiQuery branch to see if we can get an experimental version online. I am facing several problems, most of which I can find a workaround for. One, though, I can't seem to tackle. We provide ResourceReferences, Resources and ResourceStreams for the plugin developers, in Wicket 1.5 this has all been changeD but I can't seem to get my head around how to use the new system. The migration guide speaks only of an extra option called variation but does not speak of the fact that subclassing resources is nearly impossible. I hope someone can point me in the right direction. We have a Resource[1] which extends from PackageResource and get the bytes the PackageResource would normally serve to the user and runs this through the YUI compressor. Previously this meant subclassing PackageResources ResourceStream[2], catching the original bytes, running them through the YUI compressor and returning them to the user. Now, however, it is impossible to intercept the original bytes because this is all locked in a private method of PackageResource and using a WriteCallback is useless as this does not provide us access to the original bytes. This would mean we would have to create a near exact copy of PackageResource in order to achieve this. Am I missing anything here, is there anyone who knows another way to achieve the same thing as with wicket 1.4? I do not mind rewriting wiquery completely as long as it's solid and maintainable. Regards, Hielke Hoeve [1] http://code.google.com/p/wiquery/source/browse/trunk/src/main/java/org/odlabs/wiquery/core/commons/compressed/WiQueryYUICompressedJavaScriptResource.java [2] http://code.google.com/p/wiquery/source/browse/trunk/src/main/java/org/odlabs/wiquery/core/commons/compressed/WiQueryYUICompressedJavascriptResourceStream.java
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Put a log statement in your DAO's constructor to see if it's getting instantiated (it's probably not). Then turn on component scanning as suggested by someone else. On Wed, Dec 15, 2010 at 10:01 AM, adam.gibbons adam.s.gibb...@gmail.com wrote: There is definitely only 1 implementation. I read the error as it finds 0 implementations... On 15 December 2010 14:54, jcgarciam [via Apache Wicket] ml-node+3089160-35062030-201...@n4.nabble.comml-node%2b3089160-35062030-201...@n4.nabble.com wrote: It seems be two Implementation in the classpath, and �...@autowired can't pick one of them. On Wed, Dec 15, 2010 at 11:50 AM, James Carman [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089160i=0 wrote: Now this isn't a Wicket question. This is a Spring question. Wrong forum. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Ok, I think this is now back to a Wicket question. Start up is ok now. However when I try and invoke UserServiceImpl.authenticate(){ final Temp1 temp1 = new Temp1(); temp1.setValue(userName); temp1DAO.save(temp1); return testUserService.authenticate(userName, password); } I get the following error through the GUI: Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = signInForm]] threw an exception Root cause: org.hibernate.HibernateException: persist is not valid without active transaction at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297) at $Proxy18.persist(Unknown Source) at uk.co.company.product.persistance.hibernate.AbstractTemp1DAO.save(AbstractTemp1DAO.java:21) at uk.co.company.product.persistance.hibernate.Temp1DAOImpl.save(Temp1DAOImpl.java:1) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy9.save(Unknown Source) at uk.co.company.product.business.spring.UserServiceImpl.authenticate(UserServiceImpl.java:42) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy10.authenticate(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416) at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source) at uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29) I was under the impression that the OpenSessionInViewFilter was supposed to do this for us? Once again here is the source code: web.xml: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 display-nameZenTemplate/display-name context-param param-namecontextConfigLocation/param-name param-valueclasspath:applicationContext.xml/param-value /context-param listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener filter filter-nameopensessioninview/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class /filter filter filter-namewicket-spring-hibernate/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-nameapplicationClassName/param-name param-valueuk.co.company.product.presentation.wicket.app.WicketApplication/param-value /init-param /filter filter-mapping filter-nameopensessioninview/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namewicket-spring-hibernate/filter-name url-pattern/*/url-pattern /filter-mapping /web-app applicationContext.xml: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation= http://www.springframework.org/schema/beans
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
In your web.xml the OSV Filter must comes in front (first) of the wicket filter On Wed, Dec 15, 2010 at 12:58 PM, adam.gibbons [via Apache Wicket] ml-node+3089284-1530997070-65...@n4.nabble.comml-node%2b3089284-1530997070-65...@n4.nabble.com wrote: Ok, I think this is now back to a Wicket question. Start up is ok now. However when I try and invoke UserServiceImpl.authenticate(){ final Temp1 temp1 = new Temp1(); temp1.setValue(userName); temp1DAO.save(temp1); return testUserService.authenticate(userName, password); } I get the following error through the GUI: Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = signInForm]] threw an exception Root cause: org.hibernate.HibernateException: persist is not valid without active transaction at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297) at $Proxy18.persist(Unknown Source) at uk.co.company.product.persistance.hibernate.AbstractTemp1DAO.save(AbstractTemp1DAO.java:21) at uk.co.company.product.persistance.hibernate.Temp1DAOImpl.save(Temp1DAOImpl.java:1) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy9.save(Unknown Source) at uk.co.company.product.business.spring.UserServiceImpl.authenticate(UserServiceImpl.java:42) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy10.authenticate(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416) at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source) at uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29) I was under the impression that the OpenSessionInViewFilter was supposed to do this for us? Once again here is the source code: web.xml: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 display-nameZenTemplate/display-name context-param param-namecontextConfigLocation/param-name param-valueclasspath:applicationContext.xml/param-value /context-param listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener filter filter-nameopensessioninview/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class /filter filter filter-namewicket-spring-hibernate/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-nameapplicationClassName/param-name param-valueuk.co.company.product.presentation.wicket.app.WicketApplication/param-value /init-param /filter filter-mapping filter-nameopensessioninview/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namewicket-spring-hibernate/filter-name url-pattern/*/url-pattern /filter-mapping /web-app applicationContext.xml: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans;
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Hey Adam, This is still a spring error, you need a sessionfactory and transactionfactory and link them together. The opensessioninview filter only opens a transaction if you get this right. The spring forums are filled with examples. Hielke On 15 Dec 2010 16:58, adam.gibbons adam.s.gibb...@gmail.com wrote: Ok, I think this is now back to a Wicket question. Start up is ok now. However when I try and invoke UserServiceImpl.authenticate(){ final Temp1 temp1 = new Temp1(); temp1.setValue(userName); temp1DAO.save(temp1); return testUserService.authenticate(userName, password); } I get the following error through the GUI: Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = signInForm]] threw an exception Root cause: org.hibernate.HibernateException: persist is not valid without active transaction at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297) at $Proxy18.persist(Unknown Source) at uk.co.company.product.persistance.hibernate.AbstractTemp1DAO.save(AbstractTemp1DAO.java:21) at uk.co.company.product.persistance.hibernate.Temp1DAOImpl.save(Temp1DAOImpl.java:1) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy9.save(Unknown Source) at uk.co.company.product.business.spring.UserServiceImpl.authenticate(UserServiceImpl.java:42) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy10.authenticate(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416) at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source) at uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29) I was under the impression that the OpenSessionInViewFilter was supposed to do this for us? Once again here is the source code: web.xml: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 display-nameZenTemplate/display-name context-param param-namecontextConfigLocation/param-name param-valueclasspath:applicationContext.xml/param-value /context-param listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener filter filter-nameopensessioninview/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class /filter filter filter-namewicket-spring-hibernate/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-nameapplicationClassName/param-name param-valueuk.co.company.product.presentation.wicket.app.WicketApplication/param-value /init-param /filter filter-mapping filter-nameopensessioninview/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namewicket-spring-hibernate/filter-name url-pattern/*/url-pattern /filter-mapping /web-app applicationContext.xml: ?xml version=1.0 encoding=UTF-8? beans
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Like this?: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=2.4 display-nameZenTemplate/display-name context-param param-namecontextConfigLocation/param-name param-valueclasspath:applicationContext.xml/param-value /context-param listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener filter filter-nameopensessioninview/filter-name filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class /filter filter filter-namewicket-spring-hibernate/filter-name filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-nameapplicationClassName/param-name param-valueuk.co.company.product.presentation.wicket.app.WicketApplication/param-value /init-param /filter filter-mapping filter-nameopensessioninview/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namewicket-spring-hibernate/filter-name url-pattern/*/url-pattern /filter-mapping /web-app On 15 December 2010 16:15, jcgarciam [via Apache Wicket] ml-node+3089321-765746748-201...@n4.nabble.comml-node%2b3089321-765746748-201...@n4.nabble.com wrote: In your web.xml the OSV Filter must comes in front (first) of the wicket filter On Wed, Dec 15, 2010 at 12:58 PM, adam.gibbons [via Apache Wicket] [hidden email] http://user/SendEmail.jtp?type=nodenode=3089321i=0 wrote: Ok, I think this is now back to a Wicket question. Start up is ok now. However when I try and invoke UserServiceImpl.authenticate(){ final Temp1 temp1 = new Temp1(); temp1.setValue(userName); temp1DAO.save(temp1); return testUserService.authenticate(userName, password); } I get the following error through the GUI: Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = signInForm]] threw an exception Root cause: org.hibernate.HibernateException: persist is not valid without active transaction at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297) at $Proxy18.persist(Unknown Source) at uk.co.company.product.persistance.hibernate.AbstractTemp1DAO.save(AbstractTemp1DAO.java:21) at uk.co.company.product.persistance.hibernate.Temp1DAOImpl.save(Temp1DAOImpl.java:1) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy9.save(Unknown Source) at uk.co.company.product.business.spring.UserServiceImpl.authenticate(UserServiceImpl.java:42) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy10.authenticate(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416) at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source) at uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29) I was under the impression that the OpenSessionInViewFilter was supposed to do this for us? Once again here is the source code: web.xml: ?xml version=1.0
RE: Wicket extensions AjaxIndicatingDropdownChoice?
+1 I just made the exact same thing locally the other day. :) -Original Message- From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] Sent: Wednesday, December 15, 2010 2:14 AM To: users@wicket.apache.org Subject: Wicket extensions AjaxIndicatingDropdownChoice? should I add one, its just inline with the other indicating components? package com.netdesign.wallboard.component; import java.util.List; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.IAjaxIndicatorAware; import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.behavior.IBehavior; import org.apache.wicket.extensions.ajax.markup.html.AjaxIndicatorAppender; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.model.IModel; public abstract class AjaxIndicatingDropDownChoiceT extends DropDownChoiceT implements IAjaxIndicatorAware { private AjaxIndicatorAppender indicatorAppender; public AjaxIndicatingDropDownChoice(String id, IModelT model, IModel? extends List? extends T choices, IChoiceRenderer? super T renderer) { super(id, model, choices, renderer); AjaxFormComponentUpdatingBehavior ajaxFormComponentUpdatingBehavior = new AjaxFormComponentUpdatingBehavior( onchange) { @Override protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) { AjaxIndicatingDropDownChoice.this.onUpdate(ajaxRequestTarget); } }; add(ajaxFormComponentUpdatingBehavior); this.indicatorAppender = new AjaxIndicatorAppender(); add(new IBehavior[] { this.indicatorAppender }); } @Override public String getAjaxIndicatorMarkupId() { return this.indicatorAppender.getMarkupId(); } public abstract void onUpdate(AjaxRequestTarget ajaxRequestTarget); } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
Hi Hielke, Thank you for the helpful reply. :) But I think I already have those in my applicationConext.xml...: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd default-autowire=byType default-lazy-init=false bean id=wicketApplication class=uk.co.company.product.presentation.wicket.app.WicketApplication / bean id=placeholderConfigurer class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer autowire=byName property name=ignoreUnresolvablePlaceholders value=false / property name=systemPropertiesModeName value=SYSTEM_PROPERTIES_MODE_OVERRIDE / property name=ignoreResourceNotFound value=false / property name=locationslist valueclasspath*:/application.properties/value /list/property /bean bean id=dataSource class=org.springframework.jdbc.datasource.DriverManagerDataSource autowire=byName property name=driverClassNamevalue${jdbc.driver}/value/property property name=urlvalue${jdbc.url}/value/property property name=usernamevalue${jdbc.username}/value/property property name=passwordvalue${jdbc.password}/value/property /bean tx:annotation-driven transaction-manager=txManager / bean id=txManager class=org.springframework.orm.hibernate3.HibernateTransactionManager autowire=byName property name=sessionFactory ref=sessionFactory / /bean !--bean id=interceptor class=com.mycompany.hibernate.HibernateInterceptor /bean-- bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean autowire=byName property name=dataSource ref=dataSource / property name=hibernateProperties props !-- GENERAL -- prop key=hibernate.dialect${hibernate.dialect}/prop prop key=hibernate.show_sqltrue/prop prop key=hibernate.show_sqlhibernate.format_sql/prop prop key=hibernate.default_schemazen_template/prop prop key=hibernate.max_fetch_depth2/prop !-- prop key=hibernate.default_batch_fetch_size16/prop -- prop key=hibernate.default_entity_modepojo/prop prop key=hibernate.order_updatestrue/prop prop key=hibernate.generate_statisticstrue/prop prop key=hibernate.use_identifier_rollbacktrue/prop prop key=hibernate.current_session_context_classthread/prop prop key=hibernate.use_outer_jointrue/prop !-- JDBC -- !-- prop key=hibernate.jdbc.batch_size20/prop -- !-- prop key=hibernate.jdbc.batch_versioned_datatrue/prop -- prop key=hibernate.jdbc.use_streams_for_binarytrue/prop prop key=hibernate.jdbc.use_get_generated_keystrue/prop !-- CONNECTION -- prop key=hibernate.connection.isolation8/prop!-- TRANSACTION_SERIALIZABLE -- prop key=hibernate.connection.autocommitfalse/prop prop key=hibernate.connection.pool_size5/prop !-- CACHE -- !-- prop key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop -- !-- prop key=hibernate.cache.use_minimal_putstrue/prop -- !-- prop key=hibernate.cache.use_query_cachetrue/prop -- !-- MISCELLANEOUS -- prop key=hibernate.bytecode.use_reflection_optimizertrue/prop prop key=hibernate.cglib.use_reflection_optimizertrue/prop !-- prop key=hibernate.bytecode.providercglib/prop -- !-- prop key=hibernate.query.substitutionstrue/prop -- /props /property !--property name=entityInterceptor ref bean=interceptor / /property-- property name=packagesToScanlist valueuk.co.company.product.persistance.hibernate/value /list/property /bean context:component-scan base-package=uk.co.company.product / context:annotation-config/ /beans On 15 December 2010 16:17, Hielke Hoeve [via Apache Wicket]
Re: RequiredValidator
See if this can help: https://cwiki.apache.org/WICKET/form-validation-messages.html https://cwiki.apache.org/WICKET/form-validation-messages.htmlFrom the link aboves: --- Changes in Wicket 1.3 Whether a field is required is now determined by testing the isRequired() method of FormComponent, therefore 'RequiredValidator' in the above examples has to be replaced by 'Required'. --- On Wed, Dec 15, 2010 at 10:29 AM, mrblobby [via Apache Wicket] ml-node+3088996-1577718881-65...@n4.nabble.comml-node%2b3088996-1577718881-65...@n4.nabble.com wrote: Hi, I dont see how this reply solves the problem. The forms fields have this: passwordField.setRequired(true); the Page.properties file has the following structure: Form.FeildName=fieldname RequiredValidator=Holy cow, ${lablel} is blank. This works fine, except the Required Validator part of the properties file does seem to work any more. I.e. it picks up the Form.Fieldname but not the RequiredValidator patterns. I am aware that RequiredValidator has been depricated, and there is no direct replacement, but how do you get the RequiredValidator string functionality back? E.g. if you need to translate the default Field 'xx' is required. which is hard coded into reply a the moment? Which class has an onErrorMessage() call? The form has a bunch of error methods which presumably can be overridden, but not this one. Many thanks for any help! -- View message @ http://apache-wicket.1842946.n4.nabble.com/RequiredValidator-tp1864291p3088996.html To start a new topic under Apache Wicket, email ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com To unsubscribe from Apache Wicket, click herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=. -- Sincerely, JC (http://www.linkedin.com/in/jcgarciam) --Anyone who has never made a mistake has never tried anything new.-- -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RequiredValidator-tp1864291p3089345.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
Test CheckBoxMultipleChoice or CheckGroup
Hello list, I'm trying to set checkboxes with junit but without significant success. My trouble is to find checkboxes. I've not found any way to access it if I use CheckBoxMultipleChoice. With CheckGroup I get access with Visitor tester.getLastRenderedPage().visitChildren(Check.class, new IVisitorComponent() { public Object component(Component component) { if(component.getDefaultModelObject().equals(TestLabel)) [...] but it's very ugly way. Any suggestions? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Test CheckBoxMultipleChoice or CheckGroup
Use getters: https://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html 2010/12/15 Anton Bessonov exe...@googlemail.com: Hello list, I'm trying to set checkboxes with junit but without significant success. My trouble is to find checkboxes. I've not found any way to access it if I use CheckBoxMultipleChoice. With CheckGroup I get access with Visitor tester.getLastRenderedPage().visitChildren(Check.class, new IVisitorComponent() { public Object component(Component component) { if(component.getDefaultModelObject().equals(TestLabel)) [...] but it's very ugly way. Any suggestions? - 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: Test CheckBoxMultipleChoice or CheckGroup
Thanks, I will try! Use getters: https://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket resources (css, js and images)?
Though this topic is quite old, I think it is still actual. Since the 1.5 release is not far away, did anybody thought if the (at least) js resource merging should occur? This is very useful when you have a page with a large number of components, each loading a large number of small resources. Having a single resource (js and/or css) as a result of page rendering could have a dramatic page loading time improvement. Thanks! Alex Objelean -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-resources-css-js-and-images-tp1868800p3089781.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: help me please!!! Wicket/Spring/Hibernate configuration woes
You also need to make sure you've set up your transactions properly. Are you using the @Transactional annotations? On Wed, Dec 15, 2010 at 11:40 AM, adam.gibbons adam.s.gibb...@gmail.com wrote: Hi Hielke, Thank you for the helpful reply. :) But I think I already have those in my applicationConext.xml...: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd default-autowire=byType default-lazy-init=false bean id=wicketApplication class=uk.co.company.product.presentation.wicket.app.WicketApplication / bean id=placeholderConfigurer class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer autowire=byName property name=ignoreUnresolvablePlaceholders value=false / property name=systemPropertiesModeName value=SYSTEM_PROPERTIES_MODE_OVERRIDE / property name=ignoreResourceNotFound value=false / property name=locationslist valueclasspath*:/application.properties/value /list/property /bean bean id=dataSource class=org.springframework.jdbc.datasource.DriverManagerDataSource autowire=byName property name=driverClassNamevalue${jdbc.driver}/value/property property name=urlvalue${jdbc.url}/value/property property name=usernamevalue${jdbc.username}/value/property property name=passwordvalue${jdbc.password}/value/property /bean tx:annotation-driven transaction-manager=txManager / bean id=txManager class=org.springframework.orm.hibernate3.HibernateTransactionManager autowire=byName property name=sessionFactory ref=sessionFactory / /bean !--bean id=interceptor class=com.mycompany.hibernate.HibernateInterceptor /bean-- bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean autowire=byName property name=dataSource ref=dataSource / property name=hibernateProperties props !-- GENERAL -- prop key=hibernate.dialect${hibernate.dialect}/prop prop key=hibernate.show_sqltrue/prop prop key=hibernate.show_sqlhibernate.format_sql/prop prop key=hibernate.default_schemazen_template/prop prop key=hibernate.max_fetch_depth2/prop !-- prop key=hibernate.default_batch_fetch_size16/prop -- prop key=hibernate.default_entity_modepojo/prop prop key=hibernate.order_updatestrue/prop prop key=hibernate.generate_statisticstrue/prop prop key=hibernate.use_identifier_rollbacktrue/prop prop key=hibernate.current_session_context_classthread/prop prop key=hibernate.use_outer_jointrue/prop !-- JDBC -- !-- prop key=hibernate.jdbc.batch_size20/prop -- !-- prop key=hibernate.jdbc.batch_versioned_datatrue/prop -- prop key=hibernate.jdbc.use_streams_for_binarytrue/prop prop key=hibernate.jdbc.use_get_generated_keystrue/prop !-- CONNECTION -- prop key=hibernate.connection.isolation8/prop!-- TRANSACTION_SERIALIZABLE -- prop key=hibernate.connection.autocommitfalse/prop prop key=hibernate.connection.pool_size5/prop !-- CACHE -- !-- prop key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop -- !-- prop key=hibernate.cache.use_minimal_putstrue/prop -- !-- prop key=hibernate.cache.use_query_cachetrue/prop -- !-- MISCELLANEOUS -- prop key=hibernate.bytecode.use_reflection_optimizertrue/prop prop key=hibernate.cglib.use_reflection_optimizertrue/prop !-- prop key=hibernate.bytecode.providercglib/prop -- !-- prop key=hibernate.query.substitutionstrue/prop -- /props /property !--property name=entityInterceptor ref bean=interceptor / /property-- property name=packagesToScanlist valueuk.co.company.product.persistance.hibernate/value /list/property /bean
Re: help me please!!! Wicket/Spring/Hibernate configuration woes
A good way to resolve the spring/hibernate/transactional errors first (to separate from the wicket errors) is to create a junit test case that bootstraps the spring context (everything except the wicketapplication bean). You can verify that your transaction demarcation is correct before injecting the service into your wicket form. Something like this (in Spring 2.5.6): @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { file:src/test/resources/testContext.xml }, inheritLocations=true) @TestExecutionListeners( { DependencyInjectionTestExecutionListener.class}) public class TestSpringServices { @Autowired private UserService uService; @Test public void testUserService() { // this assumes that uService is a transactional proxy (@Transactional on the authenticate method) in the implementation. User u = uService.authenticate(userName, password); Assert.notNull (u); } ... You need to add the spring-test artifact to get the SpringJUnit4ClassRunner class and junit 4.4 to get the annotations (Junit 4.7 is not compatible with spring 2.5.6). Regards, Mike You also need to make sure you've set up your transactions properly. Are you using the @Transactional annotations? On Wed, Dec 15, 2010 at 11:40 AM, adam.gibbonsadam.s.gibb...@gmail.com wrote: Hi Hielke, Thank you for the helpful reply. :) But I think I already have those in my applicationConext.xml...: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:context=http://www.springframework.org/schema/context; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd default-autowire=byType default-lazy-init=false bean id=wicketApplication class=uk.co.company.product.presentation.wicket.app.WicketApplication / bean id=placeholderConfigurer class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer autowire=byName property name=ignoreUnresolvablePlaceholders value=false / property name=systemPropertiesModeName value=SYSTEM_PROPERTIES_MODE_OVERRIDE / property name=ignoreResourceNotFound value=false / property name=locationslist valueclasspath*:/application.properties/value /list/property /bean bean id=dataSource class=org.springframework.jdbc.datasource.DriverManagerDataSource autowire=byName property name=driverClassNamevalue${jdbc.driver}/value/property property name=urlvalue${jdbc.url}/value/property property name=usernamevalue${jdbc.username}/value/property property name=passwordvalue${jdbc.password}/value/property /bean tx:annotation-driven transaction-manager=txManager / bean id=txManager class=org.springframework.orm.hibernate3.HibernateTransactionManager autowire=byName property name=sessionFactory ref=sessionFactory / /bean !--bean id=interceptor class=com.mycompany.hibernate.HibernateInterceptor /bean-- bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean autowire=byName property name=dataSource ref=dataSource / property name=hibernateProperties props !-- GENERAL -- prop key=hibernate.dialect${hibernate.dialect}/prop prop key=hibernate.show_sqltrue/prop prop key=hibernate.show_sqlhibernate.format_sql/prop prop key=hibernate.default_schemazen_template/prop prop key=hibernate.max_fetch_depth2/prop !--prop key=hibernate.default_batch_fetch_size16/prop -- prop key=hibernate.default_entity_modepojo/prop prop key=hibernate.order_updatestrue/prop prop key=hibernate.generate_statisticstrue/prop prop key=hibernate.use_identifier_rollbacktrue/prop prop key=hibernate.current_session_context_classthread/prop prop key=hibernate.use_outer_jointrue/prop !-- JDBC -- !--prop key=hibernate.jdbc.batch_size20/prop -- !--prop key=hibernate.jdbc.batch_versioned_datatrue/prop -- prop key=hibernate.jdbc.use_streams_for_binarytrue/prop prop key=hibernate.jdbc.use_get_generated_keystrue/prop !--
Re: Wicket resources (css, js and images)?
On 15 December 2010 21:05, Alex Objelean alex.objel...@gmail.com wrote: Though this topic is quite old, I think it is still actual. Since the 1.5 release is not far away, did anybody thought if the (at least) js resource merging should occur? We at WiQuery have been discussing multiple approaches. All options so far have downsides. Here is a shortlist: - Merge all js resources and css into 1 js resource and 1 css resource. Problem: the 2 merged resources could be different on each page, rendering this option useless. Also this causes alot of bandwidth. Fix: Serve 2 Mother Of All resources, meaning appending only new resources to the 2 merged resources and serving them. This does not illiminate the problem of having to serve resources per page. - Serve deltas, meaning assessing which resources has already been served and only serve the new resources, in a merged form, so the user still has all the required resources. Problem: The client could have more resources than necessary, but since they were already at the client this should not matter. Problem: Serving resources to the client possibly every page but the size of the resources is considerable smaller than option 1. I like option 2 more than option 1, simply because it costs less bandwidth. This is very useful when you have a page with a large number of components, each loading a large number of small resources. Having a single resource (js and/or css) as a result of page rendering could have a dramatic page loading time improvement. This could be a problem yes, however there is no way to illiminate the fact that a page has multiple resources. Hielke
vararg'ing StringResourceModel
I noticed today that StringResourceModel could be slightly nicer to use if the Object[] parameter used by the underlying MessageFormat was replaced with a vararg in the StringResourceModel constructor. Sure enough, there was an old thread that touched on this topic. The defaultValue would have to move in a couple of the constructor signatures. Thoughts? Worth doing? Old thread: http://www.mail-archive.com/users@wicket.apache.org/msg24385.html Tested briefly in my code with: public class VarArgResourceModel extends StringResourceModel { public VarArgResourceModel( String resourceKey, IModel? model, Object... parameters ) { super( resourceKey, model, parameters ); } } Enrique - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Page mounting
I think this was discussed here but I can't seems to find it so I will ask again. I would like to mount a page Login to Login.class. I know how to do this and have it working. Now I would like to mount a page called AdminLogin to Login.class but also pass a parameter to Login.class so that I can change the login form but still use the same page. Is this possible? How would I do this? Thanks.
Re: how to validate a ListView?
thanks for your reply.I'd like to try your second suggestion. But after looking into AbstractFormValidator and other related examples, I find that in my case I don't have any FormComponet to pass to error(FormComponent fc) after validate. Is there any way or examples to validate without FormComponet? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-ListView-tp3088381p3090249.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: how to validate a ListView?
@Override protected void onInitialize() { super.onInitialize(); Form.findForm(this).add(new AbstractFormValidator() { private static final long serialVersionUID = 1L; @Override public void validate(Form? form) { if (/* ... */) { form.error(price too small); } } @Override public FormComponent?[] getDependentFormComponents() { return null; } }); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-ListView-tp3088381p3090256.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: how to validate a ListView?
That's really what I want!Thank you very much. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-ListView-tp3088381p3090257.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: Page mounting
Its fairly simple. Create a class Login, give it a constructor with pageparameters. Create two panels, one for each login type. Based on the page parameters you show one or the other. Mount the page on 2 paths, each with its own parameter. Hielke On 16 Dec 2010 00:43, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: