Can anyone help on this?

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Can anyone help on this?

Russel Winder
I am trying to create a Grails version of a trivial students marks
application that I have already in Groovy.  This is just for a demo not
for real.

I am using the Books example from the GORM page as a driver.

In the Student domain class I have:

  @Property relatesToMany = [ courses : Course ]
  @Property Set courses = new HashSet ( )

but when I run "grails run-app", I get the exception:

   [groovy] org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in resource
loaded through InputStream: Initialization of bean failed; nested
exception is org.hibernate.MappingException: property mapping has wrong
number of columns: Student.relatesToMany type: object
   [groovy] org.hibernate.MappingException: property mapping has wrong
number of columns: Student.relatesToMany type: object

Unfortunately, I have no idea how to interpret this message so have no
idea what I have done wrong.

The Web server starts despite this problem but when I try to connect to
the page I get 404 error.

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

graemer
On 3/28/06, Russel Winder <[hidden email]> wrote:

> I am trying to create a Grails version of a trivial students marks
> application that I have already in Groovy.  This is just for a demo not
> for real.
>
> I am using the Books example from the GORM page as a driver.
>
> In the Student domain class I have:
>
>   @Property relatesToMany = [ courses : Course ]
>   @Property Set courses = new HashSet ( )
>
> but when I run "grails run-app", I get the exception:
>
>    [groovy] org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'sessionFactory' defined in resource
> loaded through InputStream: Initialization of bean failed; nested
> exception is org.hibernate.MappingException: property mapping has wrong
> number of columns: Student.relatesToMany type: object
>    [groovy] org.hibernate.MappingException: property mapping has wrong
> number of columns: Student.relatesToMany type: object
>
> Unfortunately, I have no idea how to interpret this message so have no
> idea what I have done wrong.

Its not a message you should get, are you using the right CVS
repository as I said its moved. Check that you're not using the old
Groovy one which I'm due to delete. see http://grails.codehaus.org/CVS

Graeme

>
> The Web server starts despite this problem but when I try to connect to
> the page I get 404 error.
>
> --
> Russel.
> ====================================================
> Dr Russel Winder                +44 20 7585 2200
> 41 Buckmaster Road              +44 7770 465 077
> London SW11 1EN, UK             [hidden email]
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQBEKRLJr2EGkixYSboRAjQ7AJwKiRbRq3S8d8kl/XaVe4hHYdE9sACfTZUT
> EQkNbWGUzEJxYKagodEARZ4=
> =cqcg
> -----END PGP SIGNATURE-----
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Russel Winder
On Tue, 2006-03-28 at 11:45 +0100, Graeme Rocher wrote:

> Its not a message you should get, are you using the right CVS
> repository as I said its moved. Check that you're not using the old
> Groovy one which I'm due to delete. see http://grails.codehaus.org/CVS

I got your update to the grails shell script this morning so unless you
updated old and new I must be pointing at the new.

I checked a CVS/Root file and it says:

:pserver:[hidden email]:/home/projects/grails/scm

which is clearly wrong but is it also right in that grails.codehaus.org
and groovy.codehaus.org both resolve to the same IP address.

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Russel Winder
On Tue, 2006-03-28 at 12:21 +0100, Russel Winder wrote:

> > Its not a message you should get, are you using the right CVS
> > repository as I said its moved. Check that you're not using the old
> > Groovy one which I'm due to delete. see http://grails.codehaus.org/CVS

I did a complete reinstall from scratch of the Grails system.  On the
assumption that I didn't need to recreate my application I just ran it
and...  the original message has gone away to be replaced with:

   [groovy] Started SocketListener on 0.0.0.0:8080
   [groovy]
org.mortbay.util.MultiException[org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NullPointerException]
   [groovy]     at
org.mortbay.http.HttpServer.doStart(HttpServer.java:731)
   [groovy]     at org.mortbay.util.Container.start(Container.java:72)
   [groovy]     at
gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source)
   [groovy]     at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:652)
   [groovy]     at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:343)
   [groovy]     at
org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:144)
   [groovy]     at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:175)
   [groovy]     at Script1.run(Script1.groovy:11)
   [groovy]     at
org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:455)
 [ . . . ]

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

graemer
Can you post the full stack trace please or at least the 'caused by' bit

Graeme

On 3/28/06, Russel Winder <[hidden email]> wrote:

> On Tue, 2006-03-28 at 12:21 +0100, Russel Winder wrote:
>
> > > Its not a message you should get, are you using the right CVS
> > > repository as I said its moved. Check that you're not using the old
> > > Groovy one which I'm due to delete. see http://grails.codehaus.org/CVS
>
> I did a complete reinstall from scratch of the Grails system.  On the
> assumption that I didn't need to recreate my application I just ran it
> and...  the original message has gone away to be replaced with:
>
>    [groovy] Started SocketListener on 0.0.0.0:8080
>    [groovy]
> org.mortbay.util.MultiException[org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NullPointerException]
>    [groovy]     at
> org.mortbay.http.HttpServer.doStart(HttpServer.java:731)
>    [groovy]     at org.mortbay.util.Container.start(Container.java:72)
>    [groovy]     at
> gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source)
>    [groovy]     at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
>    [groovy]     at
> org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:652)
>    [groovy]     at
> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:343)
>    [groovy]     at
> org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:144)
>    [groovy]     at
> org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
>    [groovy]     at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
>    [groovy]     at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:175)
>    [groovy]     at Script1.run(Script1.groovy:11)
>    [groovy]     at
> org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:455)
>  [ . . . ]
>
> --
> Russel.
> ====================================================
> Dr Russel Winder                +44 20 7585 2200
> 41 Buckmaster Road              +44 7770 465 077
> London SW11 1EN, UK             [hidden email]
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQBEKShpr2EGkixYSboRAobpAJ9h1Kp59ZZuKyvqWdSj1EhAO8T/ZwCfaWtF
> TMvPY2xRmubxnePgjMqpgCw=
> =v2gB
> -----END PGP SIGNATURE-----
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Russel Winder
On Tue, 2006-03-28 at 13:21 +0100, Graeme Rocher wrote:
> Can you post the full stack trace please or at least the 'caused by' bit

No problem.  It's long though.

   [groovy]
org.mortbay.util.MultiException[org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NullPointerException]
   [groovy]     at
org.mortbay.http.HttpServer.doStart(HttpServer.java:731)
   [groovy]     at org.mortbay.util.Container.start(Container.java:72)
   [groovy]     at
gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source)
   [groovy]     at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:652)
   [groovy]     at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:343)
   [groovy]     at
org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:144)
   [groovy]     at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:175)
   [groovy]     at Script1.run(Script1.groovy:11)
   [groovy]     at
org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:455)
   [groovy]     at
org.codehaus.groovy.ant.Groovy.execute(Groovy.java:349)
   [groovy]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   [groovy]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [groovy]     at org.apache.tools.ant.Target.execute(Target.java:341)
   [groovy]     at
org.apache.tools.ant.Target.performTasks(Target.java:369)
   [groovy]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   [groovy]     at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
   [groovy]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   [groovy]     at
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
   [groovy]     at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
   [groovy]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   [groovy]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [groovy]     at org.apache.tools.ant.Target.execute(Target.java:341)
   [groovy]     at
org.apache.tools.ant.Target.performTasks(Target.java:369)
   [groovy]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   [groovy]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
   [groovy]     at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
   [groovy]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   [groovy]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
   [groovy]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
   [groovy]     at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
   [groovy]     at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
   [groovy] org.codehaus.groovy.runtime.InvokerInvocationException:
java.lang.NullPointerException
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:654)
   [groovy]     at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:343)
   [groovy]     at groovy.lang.Closure.call(Closure.java:176)
   [groovy]     at
org.codehaus.groovy.grails.commons.DefaultGrailsBootstrapClass.callInit(DefaultGrailsBootstrapClass.java:43)
   [groovy]     at
org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.createWebApplicationContext(GrailsDispatcherServlet.java:111)
   [groovy]     at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:250)
   [groovy]     at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219)
   [groovy]     at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112)
   [groovy]     at
javax.servlet.GenericServlet.init(GenericServlet.java:168)
   [groovy]     at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:383)
   [groovy]     at
org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:243)
   [groovy]     at
org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:446)
   [groovy]     at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:321)
   [groovy]     at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:511)
   [groovy]     at org.mortbay.util.Container.start(Container.java:72)
   [groovy]     at
org.mortbay.http.HttpServer.doStart(HttpServer.java:753)
   [groovy]     at org.mortbay.util.Container.start(Container.java:72)
   [groovy]     at
gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source)
   [groovy]     at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:652)
   [groovy]     at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:343)
   [groovy]     at
org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:144)
   [groovy]     at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:175)
   [groovy]     at Script1.run(Script1.groovy:11)
   [groovy]     at
org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:455)
   [groovy]     at
org.codehaus.groovy.ant.Groovy.execute(Groovy.java:349)
   [groovy]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   [groovy]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [groovy]     at org.apache.tools.ant.Target.execute(Target.java:341)
   [groovy]     at
org.apache.tools.ant.Target.performTasks(Target.java:369)
   [groovy]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   [groovy]     at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
   [groovy]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   [groovy]     at
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
   [groovy]     at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
   [groovy]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   [groovy]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [groovy]     at org.apache.tools.ant.Target.execute(Target.java:341)
   [groovy]     at
org.apache.tools.ant.Target.performTasks(Target.java:369)
   [groovy]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   [groovy]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
   [groovy]     at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
   [groovy]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   [groovy]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
   [groovy]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
   [groovy]     at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
   [groovy]     at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
   [groovy] Caused by: java.lang.NullPointerException
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.intUnbox(ScriptBytecodeAdapter.java:616)
   [groovy]     at Course.hashCode(Course.groovy)
   [groovy]     at java.util.HashMap.hash(HashMap.java:264)
   [groovy]     at java.util.HashMap.containsKey(HashMap.java:342)
   [groovy]     at java.util.HashSet.contains(HashSet.java:182)
   [groovy]     at
org.apache.commons.lang.builder.ReflectionToStringBuilder.isRegistered(ReflectionToStringBuilder.java:141)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.appendInternal(ToStringStyle.java:340)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.appendDetail(ToStringStyle.java:754)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.appendInternal(ToStringStyle.java:416)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.append(ToStringStyle.java:314)
   [groovy]     at
org.apache.commons.lang.builder.ToStringBuilder.append(ToStringBuilder.java:496)
   [groovy]     at
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:206)
   [groovy]     at
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:187)
   [groovy]     at
org.codehaus.groovy.grails.commons.metaclass.AbstractDynamicMethods.invokeMethod(AbstractDynamicMethods.java:127)
   [groovy]     at
org.codehaus.groovy.grails.commons.metaclass.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:50)
   [groovy]     at
org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:156)
   [groovy]     at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
   [groovy]     at ApplicationBootStrap
$_closure1.doCall(ApplicationBootStrap:4)
   [groovy]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
   [groovy]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   [groovy]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   [groovy]     at java.lang.reflect.Method.invoke(Method.java:585)
   [groovy]     at
org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:67)
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:652)
   [groovy]     ... 48 more
   [groovy] org.codehaus.groovy.runtime.InvokerInvocationException:
java.lang.NullPointerException
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:654)
   [groovy]     at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:343)
   [groovy]     at groovy.lang.Closure.call(Closure.java:176)
   [groovy]     at
org.codehaus.groovy.grails.commons.DefaultGrailsBootstrapClass.callInit(DefaultGrailsBootstrapClass.java:43)
   [groovy]     at
org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.createWebApplicationContext(GrailsDispatcherServlet.java:111)
   [groovy]     at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:250)
   [groovy]     at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219)
   [groovy]     at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112)
   [groovy]     at
javax.servlet.GenericServlet.init(GenericServlet.java:168)
   [groovy]     at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:383)
   [groovy]     at
org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:243)
   [groovy]     at
org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:446)
   [groovy]     at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:321)
   [groovy]     at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:511)
   [groovy]     at org.mortbay.util.Container.start(Container.java:72)
   [groovy]     at
org.mortbay.http.HttpServer.doStart(HttpServer.java:753)
   [groovy]     at org.mortbay.util.Container.start(Container.java:72)
   [groovy]     at
gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source)
   [groovy]     at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:652)
   [groovy]     at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:343)
   [groovy]     at
org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:144)
   [groovy]     at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:175)
   [groovy]     at Script1.run(Script1.groovy:11)
   [groovy]     at
org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:455)
   [groovy]     at
org.codehaus.groovy.ant.Groovy.execute(Groovy.java:349)
   [groovy]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   [groovy]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [groovy]     at org.apache.tools.ant.Target.execute(Target.java:341)
   [groovy]     at
org.apache.tools.ant.Target.performTasks(Target.java:369)
   [groovy]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   [groovy]     at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
   [groovy]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   [groovy]     at
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
   [groovy]     at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
   [groovy]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   [groovy]     at org.apache.tools.ant.Task.perform(Task.java:364)
   [groovy]     at org.apache.tools.ant.Target.execute(Target.java:341)
   [groovy]     at
org.apache.tools.ant.Target.performTasks(Target.java:369)
   [groovy]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
   [groovy]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
   [groovy]     at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
   [groovy]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   [groovy]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
   [groovy]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
   [groovy]     at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
   [groovy]     at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
   [groovy] Caused by: java.lang.NullPointerException
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.intUnbox(ScriptBytecodeAdapter.java:616)
   [groovy]     at Course.hashCode(Course.groovy)
   [groovy]     at java.util.HashMap.hash(HashMap.java:264)
   [groovy]     at java.util.HashMap.containsKey(HashMap.java:342)
   [groovy]     at java.util.HashSet.contains(HashSet.java:182)
   [groovy]     at
org.apache.commons.lang.builder.ReflectionToStringBuilder.isRegistered(ReflectionToStringBuilder.java:141)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.appendInternal(ToStringStyle.java:340)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.appendDetail(ToStringStyle.java:754)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.appendInternal(ToStringStyle.java:416)
   [groovy]     at
org.apache.commons.lang.builder.ToStringStyle.append(ToStringStyle.java:314)
   [groovy]     at
org.apache.commons.lang.builder.ToStringBuilder.append(ToStringBuilder.java:496)
   [groovy]     at
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:206)
   [groovy]     at
org.apache.commons.lang.ArrayUtils.toString(ArrayUtils.java:187)
   [groovy]     at
org.codehaus.groovy.grails.commons.metaclass.AbstractDynamicMethods.invokeMethod(AbstractDynamicMethods.java:127)
   [groovy]     at
org.codehaus.groovy.grails.commons.metaclass.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:50)
   [groovy]     at
org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:156)
   [groovy]     at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
   [groovy]     at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
   [groovy]     at ApplicationBootStrap
$_closure1.doCall(ApplicationBootStrap:4)
   [groovy]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
   [groovy]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   [groovy]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   [groovy]     at java.lang.reflect.Method.invoke(Method.java:585)
   [groovy]     at
org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:67)
   [groovy]     at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:652)
   [groovy]     ... 48 more
   [groovy] statements executed successfully

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Jochen Theodorou
Russel Winder schrieb:
> On Tue, 2006-03-28 at 13:21 +0100, Graeme Rocher wrote:
>> Can you post the full stack trace please or at least the 'caused by' bit
>
> No problem.  It's long though.
[...]
>    [groovy] Caused by: java.lang.NullPointerException
>    [groovy]     at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.intUnbox(ScriptBytecodeAdapter.java:616)
>    [groovy]     at Course.hashCode(Course.groovy)
>    [groovy]     at java.util.HashMap.hash(HashMap.java:264)


I guess that you tried to assign null to a primitve int. You can do this
in groovy as long that int is not the return type, a parameter type or a
field type, whichc leaves local variables. I guess your Course.hashCode
method does something nasty here.

btw, that is no groovy bug, java5 behaves the same here (besides the
local variables).

bye blackdrag
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Russel Winder
On Tue, 2006-03-28 at 15:00 +0200, Jochen Theodorou wrote:

> >    [groovy] Caused by: java.lang.NullPointerException
> >    [groovy]     at
> > org.codehaus.groovy.runtime.ScriptBytecodeAdapter.intUnbox(ScriptBytecodeAdapter.java:616)
> >    [groovy]     at Course.hashCode(Course.groovy)
> >    [groovy]     at java.util.HashMap.hash(HashMap.java:264)
>
>
> I guess that you tried to assign null to a primitve int. You can do this
> in groovy as long that int is not the return type, a parameter type or a
> field type, whichc leaves local variables. I guess your Course.hashCode
> method does something nasty here.
The hashCode methods are the ones written by Grails when I did "grails
create-domain-class".  Even though this is not shown on the webpages,
Grails creates a hashCode and equals method for every domain class.

In terms of the application, the equals needs changing but that was to
be the next stage of development.

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

graemer
In reply to this post by Jochen Theodorou
On 3/28/06, Jochen Theodorou <[hidden email]> wrote:

> Russel Winder schrieb:
> > On Tue, 2006-03-28 at 13:21 +0100, Graeme Rocher wrote:
> >> Can you post the full stack trace please or at least the 'caused by' bit
> >
> > No problem.  It's long though.
> [...]
> >    [groovy] Caused by: java.lang.NullPointerException
> >    [groovy]     at
> > org.codehaus.groovy.runtime.ScriptBytecodeAdapter.intUnbox(ScriptBytecodeAdapter.java:616)
> >    [groovy]     at Course.hashCode(Course.groovy)
> >    [groovy]     at java.util.HashMap.hash(HashMap.java:264)
>
>
> I guess that you tried to assign null to a primitve int. You can do this
> in groovy as long that int is not the return type, a parameter type or a
> field type, whichc leaves local variables. I guess your Course.hashCode
> method does something nasty here.
>
> btw, that is no groovy bug, java5 behaves the same here (besides the
> local variables).
Ah thanks for spotting that blackdrag.. need to correct the domain
class template so that it doesn't just return the id as the hash code

Graeme
>
> bye blackdrag
>
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Russel Winder
On Tue, 2006-03-28 at 14:15 +0100, Graeme Rocher wrote:

> Ah thanks for spotting that blackdrag.. need to correct the domain
> class template so that it doesn't just return the id as the hash code

So the upshot is that I need to change the Grails generated methods:

    int hashCode() { id }

to something different?  Presumably

    int hashCode() { id.intValue ( ) }

?
--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Jochen Theodorou
In reply to this post by graemer
Graeme Rocher schrieb:
[...]

btw, isn't it possible to shorten the trace a little? I don't mean
filtering the output, but removing nested GroovyRuntimeExceptions. Take
a look at ScriptBytecodeAdapter#unwrap about how to do that

bye blackdrag
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Jochen Theodorou
In reply to this post by Russel Winder
Russel Winder schrieb:

> On Tue, 2006-03-28 at 14:15 +0100, Graeme Rocher wrote:
>
>> Ah thanks for spotting that blackdrag.. need to correct the domain
>> class template so that it doesn't just return the id as the hash code
>
> So the upshot is that I need to change the Grails generated methods:
>
>     int hashCode() { id }
>
> to something different?  Presumably
>
>     int hashCode() { id.intValue ( ) }
>
> ?

since it was a NPE I guess this will also not work. it seems that id is
null. Calling "intValue" on it will also cause a NPE. Why is id null?

bye blackdrag


Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Russel Winder
On Tue, 2006-03-28 at 15:29 +0200, Jochen Theodorou wrote:

> since it was a NPE I guess this will also not work. it seems that id is
> null. Calling "intValue" on it will also cause a NPE. Why is id null?

I have no idea -- but that is the whole point of a framework, the users
don't worry about what is happening internally!  But as you say the fact
that it is null means that an instantiated object has not been assigned
an id, which in an object store is pretty dire.  Unfortunately, I am not
in a position to debug this to provide useful information to Graeme.

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

graemer
On 3/28/06, Russel Winder <[hidden email]> wrote:

> On Tue, 2006-03-28 at 15:29 +0200, Jochen Theodorou wrote:
>
> > since it was a NPE I guess this will also not work. it seems that id is
> > null. Calling "intValue" on it will also cause a NPE. Why is id null?
>
> I have no idea -- but that is the whole point of a framework, the users
> don't worry about what is happening internally!  But as you say the fact
> that it is null means that an instantiated object has not been assigned
> an id, which in an object store is pretty dire.  Unfortunately, I am not
> in a position to debug this to provide useful information to Graeme.
For the moment delete the hashCode and equals methods. They need
re-working, they're only there in the case of a HashSet which is an
isolated use case.

We will fix this problem tonight

Cheers
Graeme


>
> --
> Russel.
> ====================================================
> Dr Russel Winder                +44 20 7585 2200
> 41 Buckmaster Road              +44 7770 465 077
> London SW11 1EN, UK             [hidden email]
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQBEKTv5r2EGkixYSboRAgL8AJ4uItHij5ODEF4MIfJTco5LfGKESwCgjXWe
> /Mfx+ZEVIcPoEXYsfT1ogV0=
> =PULY
> -----END PGP SIGNATURE-----
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

Russel Winder
On Tue, 2006-03-28 at 15:13 +0100, Graeme Rocher wrote:

> For the moment delete the hashCode and equals methods. They need
> re-working, they're only there in the case of a HashSet which is an
> isolated use case.

OK, that makes sense.  

I think HashSet is liable to be fairly common though isn't it?

> We will fix this problem tonight

That would be excellent.  But it will mean recreating things from
scratch to get the new default definitions.

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone help on this?

graemer
On 3/28/06, Russel Winder <[hidden email]> wrote:

> On Tue, 2006-03-28 at 15:13 +0100, Graeme Rocher wrote:
>
> > For the moment delete the hashCode and equals methods. They need
> > re-working, they're only there in the case of a HashSet which is an
> > isolated use case.
>
> OK, that makes sense.
>
> I think HashSet is liable to be fairly common though isn't it?
>
> > We will fix this problem tonight
>
> That would be excellent.  But it will mean recreating things from
> scratch to get the new default definitions.
You can copy the definitions from the template file in
src/grails/templates/artifacts

On windows and mac we have this thing called copy and paste, does it
not exist on your flavour unix? ;-)

Graeme

>
> --
> Russel.
> ====================================================
> Dr Russel Winder                +44 20 7585 2200
> 41 Buckmaster Road              +44 7770 465 077
> London SW11 1EN, UK             [hidden email]
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQBEKUT/r2EGkixYSboRAhojAJ9QF8joZQFFj43uktiaRMc1xgLxKgCghPi1
> fDp4zZ95NH2GdEDkUvTClQc=
> =ke3/
> -----END PGP SIGNATURE-----
>
>
>