|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
MissingMethodException on GORM dynamic methods for Java domain classesHello all,
I am using grails-1.0-RC2-SNAPSHOT (revision 6100). My domain model is implemented in Java and is included as a dependency in the lib folder. The hibernate mapping files, which are also in the jar, are referenced in the hibernate.cfg.xml. All tests pass and the application works great with grails run-app. However, when I package it into a war and deploy it on a JBoss instance, I receive errors indicating that the dynamic methods that are supposed to be supplied by GORM are not in play. For example: Message: No signature of method: static com.foo.Bar.findByName() is applicable for argument types: (java.lang.String) values: {"hello"} Caused by: Exception thrown executing org.codehaus.groovy.grails.webflow.engine.builder.ClosureInvokingAction@d2cfcb in state 'init' of flow 'do' -- action execution attributes were 'map[[empty]]'; nested exception is groovy.lang.MissingMethodException: No signature of method: static com.foo.Bar.findByName() is applicable for argument types: (java.lang.String) values: {"hello"} Class: Bar Also, I am using webflow as you can see by the error message. The first release of my application used a Groovy domain model in the grails-app/domain folder and did not use webflow. That release worked in the JBoss environment in which the current release fails. Does anyone out there know why this might fail? Any pointers would be greatly appreciated. Thanks, Matt |
|
|
Re: MissingMethodException on GORM dynamic methods for Java domain classesPlease raise an issue and attach a sample if possible
Cheers On Nov 30, 2007 11:06 PM, Matt DeHoust <mdehoust@...> wrote: > Hello all, > > I am using grails-1.0-RC2-SNAPSHOT (revision 6100). My domain model is > implemented in Java and is included as a dependency in the lib folder. The > hibernate mapping files, which are also in the jar, are referenced in the > hibernate.cfg.xml. All tests pass and the application works great with > grails run-app. However, when I package it into a war and deploy it on a > JBoss instance, I receive errors indicating that the dynamic methods that > are supposed to be supplied by GORM are not in play. For example: > > Message: No signature of method: static com.foo.Bar.findByName() is > applicable for argument types: (java.lang.String) values: > {"hello"} > Caused by: Exception thrown executing > org.codehaus.groovy.grails.webflow.engine.builder.ClosureInvokingAction@d2cfcb > in state 'init' of flow 'do' -- action execution attributes were > 'map[[empty]]'; nested exception is groovy.lang.MissingMethodException: No > signature of method: static com.foo.Bar.findByName() is applicable for > argument types: (java.lang.String) values: {"hello"} > Class: Bar > > Also, I am using webflow as you can see by the error message. > > The first release of my application used a Groovy domain model in the > grails-app/domain folder and did not use webflow. That release worked in the > JBoss environment in which the current release fails. > > Does anyone out there know why this might fail? Any pointers would be > greatly appreciated. > > Thanks, > Matt > > -- Graeme Rocher Grails Project Lead G2One, Inc. Chief Technology Officer http://www.g2one.com --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: MissingMethodException on GORM dynamic methods for Java domain classesComparing the console output from grails run-app and the jboss server.log for my application reveals a significant difference.
Excerpt from grails run-app console output [90015] cfg.Environment Hibernate 3.2.5 [90031] cfg.Environment hibernate.properties not found [90031] cfg.Environment Bytecode provider name : cglib [90031] cfg.Environment using JDK 1.4 java.sql.Timestamp handling [90125] cfg.Configuration configuring from url: file:/C:/dev/workspace/my-app/grails-app/conf/hibernate/hibernate.cfg.xml [90187] cfg.Configuration Reading mappings from resource : com/foo/Bar.hbm.xml [90297] cfg.HbmBinder Mapping class: com.foo.Bar -> bar_table [90468] cfg.Configuration Configured SessionFactory: null [90468] hibernate.ConfigurableLocalSessionFactoryBean Building new Hibernate SessionFactory Excerpt from jboss server.log 2007-12-01 09:10:04,002 INFO [org.hibernate.cfg.Environment] Hibernate 3.2.5 2007-12-01 09:10:04,018 INFO [ org.hibernate.cfg.Environment] hibernate.properties not found 2007-12-01 09:10:04,018 INFO [org.hibernate.cfg.Environment] Bytecode provider name : cglib 2007-12-01 09:10:04,033 INFO [org.hibernate.cfg.Environment ] using JDK 1.4 java.sql.Timestamp handling 2007-12-01 09:10:04,158 INFO [org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean] Building new Hibernate SessionFactory It looks as though the hibernate.cfg.xml is not found in the jboss deployment. Does this clue narrow down the possibilities a bit? I will try to create a suitable example app that reproduces this problem if necessary, but my hope is that we can identify the culprit and solve it without needing that. Thanks, Matt On Dec 1, 2007 3:19 AM, Graeme Rocher <graeme@...> wrote: Please raise an issue and attach a sample if possible |
|
|
Re: MissingMethodException on GORM dynamic methods for Java domain classesTurns out hibernate does not find the hibernate.cfg.xml because it is not in the classpath (it's placed in WEB-INF/classes/hibernate). If I move it to WEB-INF/classes, then all works fine.
I've created an issue for this http://jira.codehaus.org/browse/GRAILS-1923 Thanks, Matt On Dec 1, 2007 9:37 AM, Matt DeHoust <mdehoust@...> wrote: Comparing the console output from grails run-app and the jboss server.log for my application reveals a significant difference. |
| Free embeddable forum powered by Nabble | Forum Help |