You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by André Gustavo Lomônaco <lo...@ipplus.com.br> on 2010/02/22 14:47:33 UTC

How to use the 2.1.0 Click Version in Click and Cayenne Example

Hi guys,

  I'm trying to use the Click and Cayenne WebApplication to understand more 
how the Cayenne can be used with Click. I think is better to understand 
this example before try to understand the Click/Cayenne/Spring Example
  But I can't do it work with the click-2.1.0 and cayenne 3.06M version. 
Can anybody help me ??

  Here what I did

  I did the checkout from 
http://svn.apache.org/repos/asf/click/trunk/examples/click-cayenne/

  1) When I used these versions all works as expected:

            click-2.0.1-incubating
            cayenne-nodeps-2.0.4.jar

  2) When I used these versions the WebApplication runs correctly but when 
I try to create the first department I receive the following error

            click-2.1.0-RC1-incubating or click-2.1.0
            cayenne-nodeps-2.0.4.jar

[Click] [error] handleException: java.lang.RuntimeException: Error occured 
invoking public method: public boolean 
click.cayenne.page.DepartmentEditor.onOkClick()
        at 
org.apache.click.util.ClickUtils.invokeListener(ClickUtils.java:1777)
        at 
org.apache.click.util.ActionListenerAdaptor.onAction(ActionListenerAdaptor.j
ava:59)
        at 
org.apache.click.ActionEventDispatcher.fireActionEvent(ActionEventDispatcher
.java:247)
        at 
org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatche
r.java:192)
        at 
org.apache.click.ActionEventDispatcher$EventHolder.fireActionEvents(ActionEv
entDispatcher.java:432)
        at 
org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatche
r.java:225)
        at 
org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatche
r.java:211)
        at 
org.apache.click.ClickServlet.performOnProcess(ClickServlet.java:637)
        at 
org.apache.click.ClickServlet.processPage(ClickServlet.java:533)
        at 
org.apache.click.ClickServlet.handleRequest(ClickServlet.java:363)
        at org.apache.click.ClickServlet.doPost(ClickServlet.java:283)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
        at 
org.apache.cayenne.conf.WebApplicationContextFilter.doFilter(WebApplicationC
ontextFilter.java:91)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)


        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:588)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoSuchMethodError: 
org.apache.cayenne.access.DataContext.registerNewObject(Ljava/lang/Object;)V

        at 
org.apache.click.extras.cayenne.CayenneForm.saveChanges(CayenneForm.java:502
)
        at 
click.cayenne.page.DepartmentEditor.onOkClick(DepartmentEditor.java:70)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.click.util.ClickUtils.invokeListener(ClickUtils.java:1749)
        ... 27 more

        3) Finally, when I used these versions the WebApplication doesn't 
run

            click-2.1.0
            cayenne-server-3.0M6.jar

            INFO: Deploying web application archive click-cayenne.war
            Feb 19, 2010 3:52:54 AM 
org.apache.catalina.core.StandardContext start
            SEVERE: Error filterStart
            Feb 19, 2010 3:52:54 AM 
org.apache.catalina.core.StandardContext start
            SEVERE: Context [/click-cayenne] startup failed due to previous 
errors

           Has anbody run this example with the click-2.1.0 and 
cayenne-server-3.0M6 jars ???

           My Best Regards,

          Andre Lomonaco


Re: How to use the 2.1.0 Click Version in Click and Cayenne Example

Posted by Malcolm Edgar <ma...@gmail.com>.
Agree with most Adrian's comments.

This application was developed as a proof of concept to examine the
benefit of Spring / Cayenne integration in the context of a Click
application.  The outcome was that Spring provided no significant
benefit for Cayenne as Cayenne already had very good support for web
applications, and did not need the Spring Hibernate style helper
classes you generally see in a Spring Hibernate web application.

Note however there are other reasons to use Spring, such as Spring
Security or if you are using Hibernate as the ORM.

We should remove the reference to this application in the Click documentation.

regards Malcolm Edgar

On Tue, Feb 23, 2010 at 1:50 AM, Adrian A. <a....@gmail.com> wrote:
>> I'm trying to use the Click and Cayenne WebApplication to understand
>> more how the Cayenne can be used with Click. I think is better to
>> understand this example before try to understand the
>> Click/Cayenne/Spring Example
>> But I can't do it work with the click-2.1.0 and cayenne 3.06M version.
>> Can anybody help me ??
>> Here what I did
>>
>> I did the checkout from
>> http://svn.apache.org/repos/asf/click/trunk/examples/click-cayenne/
>
> Unfortunately that webapplication is rather old, and the Click-Cayenne
> integration changed since that time.
> Also note that /examples/click-spring-cayenne/ is old too.
>
> For a more actual way to use Click together with Cayenne, I would suggest to
> use the click-examples (the cayenne part of it).
> You can see them live here: http://www.avoka.com/click-examples/
>  (the  Integrations menu item)
> And the sources are distributed together with Click or here:
> http://svn.apache.org/repos/asf/click/trunk/click/examples/
> the Cayenne related pages are here:
> http://svn.apache.org/repos/asf/click/trunk/click/examples/src/org/apache/click/examples/page/cayenne/
>
> Unfortunately these examples make use of Spring too, but you can ignore
> Spring (as it is not really needed in most applications).
>
> Adrian.
> P.S. If you still have difficulties using click-examples as a starting
> point, or/and can wait a little, I'll try over this week-end to make a new
> version of that old examples/click-cayenne webapplication.
>
>

Re: How to use the 2.1.0 Click Version in Click and Cayenne Example

Posted by Joseph Schmidt <jo...@yahoo.com>.
> We should give consideration to breaking up click-examples into
> multiple example applications.
>
> * click-examples
> * click-spring-hibernate
> * click-gae
>
> Note going down this path will require more testing, and probably
> slower release cycles if we are to maintain multiple example
> applications.
Maybe there's a simpler(on the long) solution for this problem:
"Full Module Support"
--> like it's on the wishlist for click 2.2.0
http://cwiki.apache.org/CLICK/click-22-wishlist.html

If the click examples would use many of those reusable modules, than
they would be much simpler, and would require less maintenance.
I believe, since they would consist mostly of modules, people would be 
more effiicent: they would not copy and paste click-examples (like they 
do now), but simply use those modules in their applications.

Joseph.


Re: How to use the 2.1.0 Click Version in Click and Cayenne Example

Posted by Malcolm Edgar <ma...@gmail.com>.
We should give consideration to breaking up click-examples into
multiple example applications.

* click-examples
* click-spring-hibernate
* click-gae

Note going down this path will require more testing, and probably
slower release cycles if we are to maintain multiple example
applications.

regards Malcolm Edgar

On Tue, Feb 23, 2010 at 8:44 PM, Joseph Schmidt
<jo...@yahoo.com> wrote:
>>> I'm trying to use the Click and Cayenne WebApplication to understand
>>> more how the Cayenne can be used with Click. I think is better to
>>> understand this example before try to understand the
>>> Click/Cayenne/Spring Example
>>> But I can't do it work with the click-2.1.0 and cayenne 3.06M version.
>>> Can anybody help me ??
>>> Here what I did
>>>
>>> I did the checkout from
>>> http://svn.apache.org/repos/asf/click/trunk/examples/click-cayenne/
>>
>> For a more actual way to use Click together with Cayenne, I would
>> suggest to use the click-examples (the cayenne part of it).
>> You can see them live here: http://www.avoka.com/click-examples/
>> (the Integrations menu item)
>> And the sources are distributed together with Click or here:
>> http://svn.apache.org/repos/asf/click/trunk/click/examples/
>> the Cayenne related pages are here:
>>
>> http://svn.apache.org/repos/asf/click/trunk/click/examples/src/org/apache/click/examples/page/cayenne/
>
> I can testify that too: click-examples (+ the fantastic click docuemntation)
> are the best way to learn Click quickly.
> You can ignore Spring there by considering that where an "injection" takes
> place, you put there a simple constructor.
>
> Joseph.
> P.S. I still have from another Click user a "click-examples" web application
> version *without* Spring that was not committed to Click svn, so if you want
> I can send it to you.
>
>

Re: How to use the 2.1.0 Click Version in Click and Cayenne Example

Posted by Joseph Schmidt <jo...@yahoo.com>.
>> I'm trying to use the Click and Cayenne WebApplication to understand
>> more how the Cayenne can be used with Click. I think is better to
>> understand this example before try to understand the
>> Click/Cayenne/Spring Example
>> But I can't do it work with the click-2.1.0 and cayenne 3.06M version.
>> Can anybody help me ??
>> Here what I did
>>
>> I did the checkout from
>> http://svn.apache.org/repos/asf/click/trunk/examples/click-cayenne/
> For a more actual way to use Click together with Cayenne, I would
> suggest to use the click-examples (the cayenne part of it).
> You can see them live here: http://www.avoka.com/click-examples/
> (the Integrations menu item)
> And the sources are distributed together with Click or here:
> http://svn.apache.org/repos/asf/click/trunk/click/examples/
> the Cayenne related pages are here:
> http://svn.apache.org/repos/asf/click/trunk/click/examples/src/org/apache/click/examples/page/cayenne/
I can testify that too: click-examples (+ the fantastic click 
docuemntation) are the best way to learn Click quickly.
You can ignore Spring there by considering that where an "injection" 
takes place, you put there a simple constructor.

Joseph.
P.S. I still have from another Click user a "click-examples" web 
application version *without* Spring that was not committed to Click 
svn, so if you want I can send it to you.


Re: How to use the 2.1.0 Click Version in Click and Cayenne Example

Posted by "Adrian A." <a....@gmail.com>.
> I'm trying to use the Click and Cayenne WebApplication to understand
> more how the Cayenne can be used with Click. I think is better to
> understand this example before try to understand the
> Click/Cayenne/Spring Example
> But I can't do it work with the click-2.1.0 and cayenne 3.06M version.
> Can anybody help me ??
> Here what I did
>
> I did the checkout from
> http://svn.apache.org/repos/asf/click/trunk/examples/click-cayenne/
Unfortunately that webapplication is rather old, and the Click-Cayenne 
integration changed since that time.
Also note that /examples/click-spring-cayenne/ is old too.

For a more actual way to use Click together with Cayenne, I would 
suggest to use the click-examples (the cayenne part of it).
You can see them live here: http://www.avoka.com/click-examples/
  (the  Integrations menu item)
And the sources are distributed together with Click or here:
http://svn.apache.org/repos/asf/click/trunk/click/examples/
the Cayenne related pages are here:
http://svn.apache.org/repos/asf/click/trunk/click/examples/src/org/apache/click/examples/page/cayenne/

Unfortunately these examples make use of Spring too, but you can ignore 
Spring (as it is not really needed in most applications).

Adrian.
P.S. If you still have difficulties using click-examples as a starting 
point, or/and can wait a little, I'll try over this week-end to make a 
new version of that old examples/click-cayenne webapplication.