cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Fischer <farkmisc...@gmail.com>
Subject Re: Wicket and Cayenne
Date Thu, 02 Dec 2010 19:51:06 GMT
That originally started out as (like the getting started tutorial):
<filter-mapping>
        <filter-name>CayenneFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
Which didn't work either but in searching the internet I was just copying
and pasting stuff and I for got to change it back
Mark

On Thu, Dec 2, 2010 at 1:44 PM, Andrus Adamchik <andrus@objectstyle.org>wrote:

> Just a guess. Know nothing about Wicket...
>
> Looks like CayenneFilter wraps something called "ClickServlet" (which is
> not shown elsewhere in web.xml), and Wicket call is made from the
> "wicket.lockbox" filter, which is out of scope of CayenneFilter.
>
> Andrus
>
> On Dec 2, 2010, at 9:39 PM, Mark Fischer wrote:
>
> > I am stuck again.  I can get my wicket page to load but the first thing I
> > see is:
> >
> > WicketMessage: Can't instantiate page using constructor public .......
> >
> >
> > Stacktrace
> >
> > Root cause:
> >
> > java.lang.IllegalStateException: Current thread has no bound
> ObjectContext.
> >     at
> org.apache.cayenne.BaseContext.getThreadObjectContext(BaseContext.java:73)
> >
> > .......
> >
> >
> > My web.xml looks like this:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <web-app version="2.4" 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">
> > <display-name>lockbox</display-name>
> >        <filter-mapping>
> >  <filter-name>wicket.lockbox</filter-name>
> >  <url-pattern>/*</url-pattern>
> > </filter-mapping>
> >
> > <filter-mapping>
> >        <filter-name>CayenneFilter</filter-name>
> >        <servlet-name>ClickServlet</servlet-name>
> >    </filter-mapping>
> >
> > <filter>
> >  <filter-name>wicket.lockbox</filter-name>
> >
>  <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
> >  <init-param>
> >   <param-name>applicationClassName</param-name>
> >   <param-value>***.*****.****.WicketApplication</param-value>
> >  </init-param>
> > </filter>
> >
> > <filter>
> >        <filter-name>CayenneFilter</filter-name>
> >
>  <filter-class>org.apache.cayenne.conf.WebApplicationContextFilter</filter-class>
> >    </filter>
> > </web-app>
> >
> > my java code looks like:
> >
> > import org.apache.cayenne.ObjectContext;
> > import org.apache.cayenne.access.DataContext;
> > import org.apache.cayenne.query.SelectQuery;
> > import java.util.*;
> > import org.apache.wicket.request.mapper.parameter.PageParameters;
> > import org.apache.wicket.markup.html.WebPage;
> > import ***.******.lockbox.persistent.*;
> >
> >
> >
> > /**
> > * Home page
> > * @param <ObjectContext>
> > */
> > public class HomePage<BaseContext> extends WebPage {
> >
> >       private static final long serialVersionUID = 1L;
> >
> >       // TODO Add any page properties or variables here
> >
> >    /**
> >        * Constructor that is invoked when page is invoked without a
> session.
> >        *
> >        * @param parameters
> >        *            Page parameters
> >        */
> >    public HomePage(final PageParameters parameters) {
> >
> >       //DataContext context = DataContext.createDataContext();
> >       //DataContext context =
> (DataContext)BaseContext.getThreadObjectContext();
> >       //ObjectContext context = DataContext.getThreadObjectContext();
> >       //ObjectContext oc = BaseContext.getThreadObjectContext();
> >
> > ObjectContext context = DataContext.getThreadObjectContext();
> >
> >
> > SelectQuery select1 = new SelectQuery(Credentials.class);
> > List CredentialsList = context.performQuery(select1);
> >
> > // Add the simplest type of label
> > //add(new Label("message", "If you see this message wicket is properly
> > configured and running"));
> >
> > add(new Label("message", CredentialsList.toString()));
> >
> > // TODO Add your page's components here
> > }
> > }
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message