Hi All,
I finally tried integrating Vaadin with Grails to see if it was possible to develop a Vaadin application without having to constantly redeploy in order to see my progress. The result is a new Vaadin Grails plugin, and I was very impressed with the increase in productivity. For details, check out the plugin
here , or install the it in your Grails app like this:
Hi Joe,
My original plans for the plugin were dependent on the response that it received. Recently a few people have requested information about the plugin, so I’ve decided to actively maintain it, starting this week. You can track my progress, or vote for features or issues for the plugin
on its Codehaus JIRA page . My first priority is to update the plugin to the latest version of Vaadin. After that, I plan to write a Hello World example and post it
on the wiki here . Hopefully that will be some time this week.
I tried Vaadin Grails Plugin but I get following exception when accessing a one-to-one|many mapped relation in Vaadin application. Did you ran into same issue? Are there any workarounds? It may be related to http://jira.codehaus.org/browse/GRAILS-5076 but I’m not sure. Thanks!
Michael
java.lang.RuntimeException: javax.servlet.ServletException: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:40)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:135)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:101)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
…
Hi Michael,
I’ve not come across the problem you’re describing while working with Vaadin in Grails. I have come across the same error in other applications though. Usually I’ve been able to fix them by changing the relationship to use eager loading instead of lazy loading, or accessing the collection that defines the relationship while the Hibernate session is still open.
Hi Joe,
I just posted a simple Hello World application to the wiki
here that uses the current version of the plugin. I’ve added some extra features to the plugin over the past week, and I’ll be releasing it as soon as I get the chance to test it properly.
Cheers,
Daniel
Thank you for the Vaadin Grails plugin and an overall great tutorial. It is really cool way to enable the developer to write Vaadin apps with Groovy. I do however have some problems using e.g. Button events within the Groovy/Vaadin setup. Is there anyway for you to extend the Hello World example and show how to use events within Groovy/Vaadin?
and foremost, thanks for providing the grails plugin.
However, I have a somewhat trivial newb question, which relates more to grails than Vaadin, though. How do you inject a grails service so that it can used in the Vaadin Application class?
A simple:
class MyApplication extends Application {
def someService
....
}
doesn’t seem to work. someService is null when I call it. Any ideas how to solve this?
Vaadin plugin is already working but I want to access grails controllers from the browser?
how can we access grails domain objects or controllers like the (index,list,etc…) ?
How can we change the URL mapping on Vaadin application so that I could access grails controller in the browser.
Actually I could now access grails controllers and vaadin application in the browser by changing the url mapping
in VaadinGrailsPlugin.groovy from “/" into "/VAADIN/”.
If I change it to other pattern like “/MainApp/" , I get widgetset not loaded error. It only works on this pattern ("/VAADIN/”).
I used your modifications to the plugin as a starting point, with the following changes:
Update the web.xml generation to set the URL mapping from a config property, instead of always using “/*” (otherwise it won’t play well with Grails controllers; it prevents you from ever seeing them).
Added another url mapping using the vaadin servlet to the URL pattern “/VAADIN/*”. Without this, you can never reach the widgetset URLs and your Vaadin app won’t run.
It’s the VaadinGrailsPlugin.groovy file that has to change, which is what manipulates the web.xml. Here’s a snippet of the main change, though I also modified the logging block under “getConfig” to show the currently configured urlValue.
Server running. Browse to http://localhost:8090/hello-vaadin
[groovyc]
Compiling 1 source file to
C:\Java\test\GrailsTests\hello-vaadin\target\classes
[groovyc]
Compiling 2 source files to
C:\Java\test\GrailsTests\hello-vaadin\target\classes
[delete]
Deleting directory C:\Documents and
Settings\admin.grails\1.2.1\projects\hello-vaadin\tomcat
2. When I load the page in browser, the page is sometimes unavailable
(error 503).
Maybe this has something to do with the first problem.
Has anyone seen the same problem?