I have been getting the same error. I feel like im missing something. Maybe I
am doing something horibly wrong but I haven't been able to figure out what
it is. 

I am using spring 2.5, Wicket 1.3.2, and I have put the
OpenEntityManagerInViewFilter  in my web xml. The filter is loading ok, im
not sure what to do next...

If anyone can help please let me know what you need to see. I even have an
example application i can upload. 
I am using a DataView, I have tried to inject the spring beans into every
part (data provider, etc) and I always get the same result... 
For now I will include the wicket stuff: 


public class Home extends WebPage {
        @SpringBean
        private TestService testService;

        public Home() {
                init();
        }

        public Home(PageParameters parameters) {
                super(parameters);
                init();
        }

        private void init() {
                add(new DataView("container", new ListOwnerProvider()) {
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected void populateItem(Item item) {
                                /*ListOwner owner = 
(ListOwner)item.getModelObject();*/
                                item.add(new Label("name"));
                                item.add(new ListView("entries"){
                                        private static final long 
serialVersionUID = 1L;

                                        @Override
                                        protected void populateItem(ListItem 
item) {
                                                item.add(new Label("value"));
                                        }
                                });
                        }
                });
        }

        class ListOwnerProvider implements IDataProvider {

                private static final long serialVersionUID = 1L;

                @Override
                public void detach() {


                }

                @Override
                public Iterator iterator(int first, int count) {
                        return 
testService.getListOwners(first,count).iterator();
                }

                @Override
                public IModel model(Object object) {
                        
                        return new CompoundPropertyModel(new 
ListOwnerModel((ListOwner)object));
                }

                @Override
                public int size() {
                        return testService.getListOwners().size();
                }
        }

        class ListOwnerModel extends LoadableDetachableModel {
                private static final long serialVersionUID = 1L;
                private Integer id;

                public ListOwnerModel(ListOwner listOwner) {
                        this.id = listOwner.getId();
                }

                @Override
                protected Object load() {
                        return testService.getListOwner(id);
                }
        }
}



Mathias P.W Nilsson wrote:
> 
> I'm using wicket with hibernate and spring. In my web.xml I have
> OpenEntityManagerInViewFilter. But when trying to add a dataview to my
> wicket page I get the org.hibernate.LazyInitializationException
> 

-- 
View this message in context: 
http://www.nabble.com/Lazy-load-exception-wicket-and-hibernate-tp15976668p16361116.html
Sent from the Wicket - User mailing list archive at Nabble.com.

Reply via email to