Gilberto,

Thanks a lot for your help, i will use your zip file right now. 

With respect to the context-filter thing of the last two emails, if you use 
apache versions the servlet name in web.xml has changed to ClickServlet, for 
net.sf versions it's still click-servlet.

Hans


----- "Gilberto C. Andrade" <[email protected]> escribió:

> One more thing (run mvn cayenne-modeler:run):
> 1-change org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy to
> org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy in DataNode
> Configuration;
> 2-the QuerySelect(QuerySelect("title", true)) and
> QuerySelect("address.state", "State", true) fields won't work because
> there isn't any data in the database.
> 
> Hope this help (the attached project can opened on netbeans 6.7+ or
> with eclipse+m2eclipse or eclipse+iam),
> 
> Gilberto
> 
> 
> On Mon, Mar 29, 2010 at 10:11 AM, Gilberto C. Andrade <
> [email protected] > wrote:
> 
> 
> I just found the problem!
> If I set the Filter match a specific specific servlet the exception
> occur, but setting it match a specific URL as shown below it works:
> 
> <filter>
> <filter-name>data-context-filter</filter-name>
> <filter-class>org.apache.click.extras.cayenne.DataContextFilter</filter-class>
> </filter>
> 
> <!--filter-mapping>
> <filter-name>data-context-filter</filter-name>
> <servlet-name>click-servlet</servlet-name>
> </filter-mapping-->
> 
> <filter-mapping>
> <filter-name>data-context-filter</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> 
> Gilberto
> 
> 
> 
> 
> 
> On Mon, Mar 29, 2010 at 9:51 AM, Gilberto C. Andrade <
> [email protected] > wrote:
> 
> 
> Hi, Hans!
> 
> What is the problem with the zip file? (I've attached another one)
> I get an exception when trying /cayenne-form-page.htm form:
> <quote>
> [Click] [debug] GET http://localhost:8080/home.htm
> [Click] [info ] renderTemplate: /home.htm,border-template.htm - 178 ms
> [Click] [info ] handleRequest: /home.htm - 211 ms
> [Click] [debug] GET http://localhost:8080/cayenne-form-page.htm
> [Click] [error] handleException: java.lang.RuntimeException:
> java.lang.IllegalStateException: Current thread has no bound
> ObjectContext.
> at
> org.apache.click.extras.cayenne.CayenneForm.applyMetaData(CayenneForm.java:611)
> at
> org.apache.click.extras.cayenne.CayenneForm.onProcess(CayenneForm.java:535)
> at
> org.apache.click.ClickServlet.performOnProcess(ClickServlet.java:618)
> at org.apache.click.ClickServlet.processPage(ClickServlet.java:533)
> at org.apache.click.ClickServlet.handleRequest(ClickServlet.java:363)
> at org.apache.click.ClickServlet.doGet(ClickServlet.java:266)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:427)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494)
> at
> org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
> at org.eclipse.jetty.server.Server.handle(Server.java:334)
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
> at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541)
> at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
> at
> org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
> at java.lang.Thread.run(Thread.java:636)
> Caused by: java.lang.IllegalStateException: Current thread has no
> bound ObjectContext.
> at
> org.apache.cayenne.BaseContext.getThreadObjectContext(BaseContext.java:73)
> at
> org.apache.cayenne.access.DataContext.getThreadDataContext(DataContext.java:119)
> at
> org.apache.click.extras.cayenne.CayenneForm.getDataContext(CayenneForm.java:279)
> at
> org.apache.click.extras.cayenne.CayenneForm.applyMetaData(CayenneForm.java:593)
> ... 28 more
> [Click] [info ] renderTemplate: /click/error.htm - 38 ms
> [Click] [info ] handleRequest: /cayenne-form-page.htm - 126 ms
> </quote>
> 
> I've configured the data-context-filter filter (web.xml):
> 
> <filter>
> <filter-name>data-context-filter</filter-name>
> <filter-class>org.apache.click.extras.cayenne.DataContextFilter</filter-class>
> </filter>
> 
> <filter-mapping>
> <filter-name>data-context-filter</filter-name>
> <servlet-name>click-servlet</servlet-name>
> </filter-mapping>
> 
> And know that there is a ObjectContext initialized, see the jetty log
> below:
> 
> <quote>
> 2010-03-29 09:38:20.835:INFO::jetty-7.0.1.v20091125
> 2010-03-29 09:38:22.325:INFO::No Transaction manager found - if your
> webapp requires one, please configure one.
> Mar 29, 2010 9:38:22 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> startedLoading
> INFO: started configuration loading.
> Mar 29, 2010 9:38:22 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> shouldLoadDataDomain
> INFO: loaded domain: cayenne
> Mar 29, 2010 9:38:22 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> loadDataMap
> INFO: loaded <map name='cayenneMap' location='cayenneMap.map.xml'>.
> Mar 29, 2010 9:38:22 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> shouldLoadDataNode
> INFO: loading <node name='cayenneNode'
> datasource='cayenneNode.driver.xml'
> factory='org.apache.cayenne.conf.DriverDataSourceFactory'
> schema-update-strategy='org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy'>.
> Mar 29, 2010 9:38:22 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> shouldLoadDataNode
> INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
> Mar 29, 2010 9:38:22 AM
> org.apache.cayenne.conf.DriverDataSourceFactory load
> INFO: loading driver information from 'cayenneNode.driver.xml'.
> Mar 29, 2010 9:38:23 AM
> org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler init
> INFO: loading driver org.hsqldb.jdbcDriver
> Mar 29, 2010 9:38:23 AM
> org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler init
> INFO: loading user name and password.
> Mar 29, 2010 9:38:23 AM org.apache.cayenne.access.QueryLogger
> logPoolCreated
> INFO: Created connection pool: jdbc:hsqldb:mem:examples
> Driver class: org.hsqldb.jdbcDriver
> Min. connections in the pool: 10
> Max. connections in the pool: 20
> Mar 29, 2010 9:38:23 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> shouldLoadDataNode
> INFO: loaded datasource.
> Mar 29, 2010 9:38:23 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> initAdapter
> INFO: no adapter set, using automatic adapter.
> Mar 29, 2010 9:38:23 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> shouldLinkDataMap
> INFO: loaded map-ref: cayenneMap.
> Mar 29, 2010 9:38:23 AM org.apache.cayenne.conf.RuntimeLoadDelegate
> finishedLoading
> INFO: finished configuration loading in 581 ms.
> 2010-03-29 09:38:23.184:INFO:/:DataContextFilter initialized:
> auto-rollback=true, session-scope=false, shared-cache=default,
> oscache-enabled=false
> [Click] [debug] listing classes in
> jar:file:/home/gilberto/.m2/repository/org/apache/click/click/2.1.0/click-2.1.0.jar!/META-INF/resources
> [Click] [info ] found jar:
> file:/home/gilberto/.m2/repository/org/apache/click/click/2.1.0/click-2.1.0.jar
> [Click] [debug] listing classes in
> jar:file:/home/gilberto/.m2/repository/org/apache/click/click-extras/2.1.0/click-extras-2.1.0.jar!/META-INF/resources
> [Click] [info ] found jar:
> file:/home/gilberto/.m2/repository/org/apache/click/click-extras/2.1.0/click-extras-2.1.0.jar
> [Click] [debug] listing classes in
> jar:file:/home/gilberto/.m2/repository/org/apache/click/click-nodeps/2.1.0/click-nodeps-2.1.0.jar!/META-INF/resources
> [Click] [info ] found jar:
> file:/home/gilberto/.m2/repository/org/apache/click/click-nodeps/2.1.0/click-nodeps-2.1.0.jar
> [Click] [debug] automapped pages:
> [Click] [debug] /border-template.htm -> CLASS NOT FOUND
> [Click] [debug] /cayenne-form-page.htm ->
> com.mycompany.canyenneclick.CayenneFormPage
> </quote>
> 
> Fixing this exception would help to impruve the example.
> Does anyone, that knows more about cayenne, help on this issue?
> 
> Gilberto
> 
> 
> 
> 
> 
> On Thu, Mar 25, 2010 at 6:33 PM, < [email protected] > wrote:
> 
> 
> Gilberto,
> 
> May be a good idea to post a fixed zip file...
> 
> I will try it out.
> 
> Thank you
> 
> 
> 
> Hans
> 
> ----- "Gilberto C. Andrade" < [email protected] > escribió:
> 
> > Ops! On step 3, should be:
> > 3-copy from click-2.1.0/examples/src to
> > canyenneclick/src/main/resources:
> >
> > Kinda regards,
> >
> > Gilberto
> >
> >
> > On Thu, Mar 25, 2010 at 5:17 PM, Gilberto C. Andrade <
> > [email protected] > wrote:
> >
> >
> > Ok, lets begin!
> > First, make a new check out the maven click archetype project, ok?
> >
> > I've created a new project(attached) using it the following way:
> >
> > 1-create one project from the click archetype
> > 2-change the pom.xml file:
> > <plugin>
> > <groupId>org.apache.cayenne.plugins</groupId>
> > <artifactId>maven-cayenne-modeler-plugin</artifactId>
> > <version>3.0RC2</version>
> > </plugin>
> > 3-copy from click-2.1.0/examples/src to canyenneclick/src:
> > cayenne.xml
> > cayenneMap.map.xml
> > cayenneNode.driver.xml
> > 4-copy from
> click-2.1.0/examples/src/org/apache/click/examples/domain/
> > to canyenneclick/src/main/java/com/mycompany/canyenneclick/domain:
> > BaseEntity.java
> > 5-change the pom.xml file:
> > <dependency>
> > <groupId>org.apache.cayenne</groupId>
> > <artifactId>cayenne-server</artifactId>
> > <version>3.0RC2</version>
> > <exclusions>
> > <exclusion>
> > <groupId>velocity</groupId>
> > <artifactId>velocity</artifactId>
> > </exclusion>
> > </exclusions>
> > </dependency>
> > <dependency>
> > <groupId>hsqldb</groupId>
> > <artifactId>hsqldb</artifactId>
> > <version>1.8.0.7</version>
> > </dependency>
> >
> > 5-run cayenne-modeler:run, adjust the project (package name) and
> > generates the classes
> > 6-copy from click-2.1.0/examples/webapp/cayenne/ to
> > canyenneclick/src/main/webapp/:
> > cayenne-form-page.htm
> > 7-copy from
> > click-2.1.0/examples/src/org/apache/click/examples/service/ to
> > canyenneclick/src/main/java/com/mycompany/canyenneclick/service/
> > ClientService.java
> > #make the adjusts (remove spring dependence)
> >
> > 8-copy click-2.1.0/examples/src/org/apache/click/examples/page/ to
> > canyenneclick/src/main/java/com/mycompany/canyenneclick/:
> > cayenneCayenneFormPage.java
> > FormTablePage.java
> >
> > #make the adjusts (remove spring dependence)
> > private ClientService clientService = new ClientService();
> >
> > 9-change the web.xml file:
> > <filter>
> > <filter-name>data-context-filter</filter-name>
> >
> <filter-class>org.apache.click.extras.cayenne.DataContextFilter</filter-class>
> > </filter>
> >
> > <filter-mapping>
> > <filter-name>data-context-filter</filter-name>
> > <servlet-name>click-servlet</servlet-name>
> > </filter-mapping>
> > 10-finally run the app:
> > mvn jetty:run
> >
> > Hope this help,
> >
> > Gilberto
> >
> >
> >
> >
> >
> > On Thu, Mar 25, 2010 at 4:22 PM, < [email protected] > wrote:
> >
> >
> > Gilberto,
> >
> > I'll keep on trying with Milestone 6. If you have any advance in the
> > archetype, please let me know. Maybe the click community should
> > address with more interest this "maven" thing.
> >
> > Bye
> >
> >
> >
> > Hans
> >
> > ----- "Gilberto C. Andrade" < [email protected] > escribió:
> >
> > > On Thu, Mar 25, 2010 at 2:47 PM, < [email protected] > wrote:
> > >
> > >
> > > Gilberto,
> > >
> > > In fact i created the project using your archetype, thank you.
> > >
> > >
> > > You're welcome!
> > >
> > >
> > >
> > >
> > > Click actually doesn't have dependencies on cayenne.
> > > But it has if you use the hibernateForm.
> > > Do you want to use that control or use you own forms?
> > >
> > >
> > > After creating the project included latest Cayenne 3.0RC2 and the
> > i've
> > > been having troubles with dependencies, mainly cayenne, i'm
> > > considering going back to ant, but i don't want give up.
> > >
> > >
> > > Click 2.1.0 was tested with cayenne-server-3.0M6 and maybe this
> new
> > > version can cause problems.
> > >
> > >
> > >
> > >
> > > ¿ Do you have some idea on what is going on with dependencies
> > > maven/eclipse/click/cayenne ?
> > >
> > >
> > > I'm using NetBeans 6.8/maven/jpa/click. I will try create a new
> > > archetype with cayenne.
> > >
> > > Kinda regards,
> > >
> > > Gilberto
> > >
> > >
> > > Hans
> > >
> > > ----- "Gilberto C. Andrade" < [email protected] > escribió:
> > >
> > >
> > >
> > >
> > > > Hi,
> > > > Can you try this contrib [1]?
> > > >
> > > > Gilberto
> > > > [1]
> > > >
> > >
> >
> http://n2.nabble.com/Maven-Archetype-for-Apache-Click-td4520258.html#a4520258
> > > >
> > > >
> > > >
> > > > On Thu, Mar 25, 2010 at 9:24 AM, < [email protected] > wrote:
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I've done the exclusion, and it seems to be better, know i've
> been
> > > > faced with a problem with auto deplpoyed click resources giving
> > > > java.io.IOException:
> > > >
> > > > Click] [warn ] error occured deploying resource
> > > > /cl/welinux/controls/cookie-checkbox.js, error
> > java.io.IOException:
> > > > could not locate classpath resource:
> > > > /cl/welinux/controls/cookie-checkbox.js
> > > >
> > > > May be some maven click users can help me... I apologize to
> people
> > > not
> > > > using maven/eclipse, but it seems to be an important tool, and
> may
> > > be
> > > > a good thing to have click / apache projects maven/eclipse
> > aware...
> > > >
> > > >
> > > > Thanks
> > > > Hans
> > > >
> > > >
> > > >
> > > >
> > > > ----- "Atle Prange" < [email protected] > escribió:
> > > >
> > > >
> > > >
> > > >
> > > > > Excluding from an import is done by just adding an <exclude>
> tag
> > > in
> > > > > the
> > > > > import definition. That should prevent maven from pulling in
> the
> > > > > excluded resource.
> > > > >
> > > > > <exclude>
> > > > > <groupId>[groupId here]</groupId>
> > > > > <artifactId>[artifactid here]</artifactId>
> > > > > </exclude>
> > > > >
> > > > > -atle
> > > > >
> > > > > On Thu, 2010-03-25 at 10:14 +1100, Bob Schellink wrote:
> > > > > > Hi Hans,
> > > > > >
> > > > > > Velocity is backward compatible so you only need to include
> > > 1.6.3.
> > > > > I'm not familiar with maven so
> > > > > > can you tell it to "exclude" velocity 1.3?
> > > > > >
> > > > > > kind regards
> > > > > >
> > > > > > bob
> > > > > >
> > > > > >
> > > > > > On 25/03/2010 10:01 AM, [email protected] wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > I'm new to maven and i'm trying to refactor an old ant
> > project
> > > > to
> > > > > maven2.
> > > > > > >
> > > > > > > I've noticed that Click nodeps depends on Velocity 1.6.3,
> > but
> > > > > latest cayenne release Cayenne Server 3.0RC2 depends on
> velocity
> > > > 1.3.
> > > > > > >
> > > > > > > I've been with various problems giving class not found
> when
> > > > > running on tomcat 6, i figured out this could be some of the
> > > > > problems..
> > > > > > >
> > > > > > > ¿ Can anyone give some advise ?
> > > > > > >
> > > > > > > Thanks
> > > > > > > Hans
> > > > > > >
> > > > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Hans Poo, WeLinux S.A. http://www.welinux.cl
> > > > Oficina: 697.25.42, Celular: 09-319.93.05
> > > > Bombero Ossa # 1010, Santiago
> > >
> > > --
> > >
> > >
> > >
> > > Hans Poo, WeLinux S.A. http://www.welinux.cl
> > > Oficina: 697.25.42, Celular: 09-319.93.05
> > > Bombero Ossa # 1010, Santiago
> >
> > --
> >
> >
> >
> > Hans Poo, WeLinux S.A. http://www.welinux.cl
> > Oficina: 697.25.42, Celular: 09-319.93.05
> > Bombero Ossa # 1010, Santiago
> 
> --
> 
> 
> 
> Hans Poo, WeLinux S.A. http://www.welinux.cl
> Oficina: 697.25.42, Celular: 09-319.93.05
> Bombero Ossa # 1010, Santiago

-- 
Hans Poo, WeLinux S.A. http://www.welinux.cl
Oficina: 697.25.42, Celular: 09-319.93.05
Bombero Ossa # 1010, Santiago

Reply via email to