I am trying to add SGWT datasources to my existing Grails domain classes (~beans).
Since the SGWT-Grails plugin is broken at the moment, I reverted to the hibernate DS integration strategy as this seems to be able to leverage the existing bean definition. This is the DS description file for one of the domain classes:
The corresponding domain class (~bean) reads (stripped to the bone):
Alas, there is a
on startup.
This post might describe the problem and suggests a fix:
http://binarybuffer.com/2012/03/grails-class-forname-classnotfoundexception
So is there a way to influence, how the Beans are loaded from the SGWT (server-) side?
Or is there an even better strategy to add SGWT Power features to an existing Grails application using existing domain classes as a base (SQL datasource is no option due to existing business logic)
Thanks
fazopilot
Grails 2.11, SGWT Power 3.1 SNAPSHOT_v8.3d_2012-09-21/PowerEdition Deployment (built 2012-09-21), GWT 2.4, Java build 1.7.0-b147
Since the SGWT-Grails plugin is broken at the moment, I reverted to the hibernate DS integration strategy as this seems to be able to leverage the existing bean definition. This is the DS description file for one of the domain classes:
Code:
<DataSource ID="task" serverType="hibernate" autoDeriveSchema="true" schemaBean="com.aCompany.Task" > <fields> <field name="id" hidden="true"/> </fields> </DataSource>
Code:
class Task { String name }
Code:
ERROR DataSourceLoader - Exception while attempting to load a DataSource java.lang.ClassNotFoundException: com.aCompany.Task at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:156) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:128) at org.codehaus.groovy.grails.cli.support.GrailsRootLoader.loadClass(GrailsRootLoader.java:48) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at com.isomorphic.hibernate.HibernateDataSource.getDataSourceConfigFromJavaClass(HibernateDataSource.java:4897) at com.isomorphic.hibernate.HibernateDataSource.init(HibernateDataSource.java:241) at com.isomorphic.datasource.DataSource.initialize(DataSource.java:400) at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:163) at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:385) at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110) at com.isomorphic.datasource.DataSource.forName(DataSource.java:204) at com.isomorphic.datasource.DataSource.forName(DataSource.java:195) at com.isomorphic.datasource.DataSource.forName(DataSource.java:184) at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:119) at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:127) at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:94) at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:89) at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:83) at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:126) at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:364) at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:231) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:200) at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:151) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:69) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.codehaus.groovy.grails.plugins.gwt.GwtCacheControlFilter.doFilter(GwtCacheControlFilter.java:50) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:55) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)
This post might describe the problem and suggests a fix:
http://binarybuffer.com/2012/03/grails-class-forname-classnotfoundexception
So is there a way to influence, how the Beans are loaded from the SGWT (server-) side?
Or is there an even better strategy to add SGWT Power features to an existing Grails application using existing domain classes as a base (SQL datasource is no option due to existing business logic)
Thanks
fazopilot
Grails 2.11, SGWT Power 3.1 SNAPSHOT_v8.3d_2012-09-21/PowerEdition Deployment (built 2012-09-21), GWT 2.4, Java build 1.7.0-b147
Comment