Grails : NoClassDefFoundError

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails : NoClassDefFoundError

Saka-2

Hi;

i try recent(2006Mar09version) Grails on WinXP/JRE1.5.0_06...and i run as "QuickStart" ,

http://grails.codehaus.org/Quick+Start


but when run-app,  java.lang.NoClassDefFoundError: org/springframework/orm/hibernate3/s
upport/OpenSessionInViewFilter occured.


it's below.


-->8--
C:\temp\grails>bin\grails create-app
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.
0_06\lib\tools.jar
Buildfile: C:\temp\grails\src\grails\build.xml

init-props:
   [groovy] statements executed successfully

create-app:
    [input] Enter application name:
qqq

init-props:
   [groovy] statements executed successfully

init:
    [mkdir] Created dir: C:\temp\grails\qqq\src
    [mkdir] Created dir: C:\temp\grails\qqq\src\java
    [mkdir] Created dir: C:\temp\grails\qqq\src\groovy
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\controllers
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\services
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\domain
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\taglib
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\views
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\views\layouts
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\i18n
    [mkdir] Created dir: C:\temp\grails\qqq\grails-app\conf
    [mkdir] Created dir: C:\temp\grails\qqq\grails-tests
    [mkdir] Created dir: C:\temp\grails\qqq\web-app
    [mkdir] Created dir: C:\temp\grails\qqq\web-app\js
    [mkdir] Created dir: C:\temp\grails\qqq\web-app\css
    [mkdir] Created dir: C:\temp\grails\qqq\web-app\WEB-INF\classes
    [mkdir] Created dir: C:\temp\grails\qqq\lib
    [mkdir] Created dir: C:\temp\grails\qqq\spring
    [mkdir] Created dir: C:\temp\grails\qqq\hibernate
     [copy] Copying 1 file to C:\temp\grails\qqq\web-app\WEB-INF
     [copy] Copying 7 files to C:\temp\grails\qqq\grails-app
     [copy] Copying 1 file to C:\temp\grails\qqq\web-app\WEB-INF
     [copy] Copying 1 file to C:\temp\grails\qqq\web-app\WEB-INF
     [copy] Copying 9 files to C:\temp\grails\qqq\web-app\js
     [copy] Copying 1 file to C:\temp\grails\qqq\web-app\css
     [copy] Copying 5 files to C:\temp\grails\qqq\web-app\WEB-INF\tld
     [copy] Copying 1 file to C:\temp\grails\qqq\spring
    [touch] Creating C:\temp\grails\qqq\grails-app\i18n\messages.properties
   [groovy] statements executed successfully
     [copy] Copying 1 file to C:\temp\grails\qqq\grails-app\conf
     [copy] Copying 1 file to C:\temp\grails\qqq\grails-app\conf

BUILD SUCCESSFUL
Total time: 17 seconds
C:\temp\grails>




C:\temp\grails\qqq>..\bin\grails create-domain-class
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.
0_06\lib\tools.jar
Buildfile: C:\temp\grails\src\grails\build.xml

init-props:
   [groovy] statements executed successfully

create-domain-class:
    [input] Enter domain class name:
book
   [groovy] statements executed successfully
     [copy] Copying 1 file to C:\temp\grails\qqq\grails-app\domain
     [echo] Domain class created: grails-app/domain/Book.groovy

internal-create-test-suite:
   [groovy] statements executed successfully
     [copy] Copying 1 file to C:\temp\grails\qqq\grails-tests
     [echo] Created test suite: grails-tests/BookTests.groovy

BUILD SUCCESSFUL
Total time: 10 seconds
C:\temp\grails\qqq>




C:\temp\grails\qqq>cd grails-app

C:\temp\grails\qqq\grails-app>cd domain

C:\temp\grails\qqq\grails-app\domain>more Book.groovy
class Book {
        @Property Long id;
        @Property Long version;
        @Property String title;
        @Property String author;
}

C:\temp\grails\qqq\grails-app\domain>cd ..

C:\temp\grails\qqq\grails-app>cd ..

C:\temp\grails\qqq>

C:\temp\grails\qqq>cd grails-app

C:\temp\grails\qqq\grails-app>cd conf

C:\temp\grails\qqq\grails-app\conf>more ApplicationBootStrap.groovy
class ApplicationBootStrap {

     @Property Closure init = { servletContext ->
       new Book(author:"Stephen King",title:"The Shining").save();
       new Book(author:"James Patterson",title:"Along Came a Spider").save();
     }
     @Property Closure destroy = {
     }
}

C:\temp\grails\qqq\grails-app\conf>cd ..

C:\temp\grails\qqq\grails-app>cd ..

C:\temp\grails\qqq>





C:\temp\grails\qqq>..\bin\grails create-controller
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.
0_06\lib\tools.jar
Buildfile: C:\temp\grails\src\grails\build.xml

init-props:
   [groovy] statements executed successfully

create-controller:
    [input] Enter controller name:
book
   [groovy] statements executed successfully
     [copy] Copying 1 file to C:\temp\grails\qqq\grails-app\controllers
     [echo] Created controller: grails-app/controllers/BookController.groovy

internal-create-test-suite:
   [groovy] statements executed successfully
     [echo] Created test suite: grails-tests/BookTests.groovy

BUILD SUCCESSFUL
Total time: 14 seconds
C:\temp\grails\qqq>



C:\temp\grails\qqq>cd grails-app

C:\temp\grails\qqq\grails-app>cd controllers

C:\temp\grails\qqq\grails-app\controllers>more BookController.groovy
class BookController {
   @Property index = {
         redirect(action:list)
   }
   @Property list = {
             [ books : Book.list() ]
   }
}

C:\temp\grails\qqq\grails-app\controllers>cd ..

C:\temp\grails\qqq\grails-app>cd ..

C:\temp\grails\qqq>

C:\temp\grails\qqq>cd grails-app

C:\temp\grails\qqq\grails-app>cd views

C:\temp\grails\qqq\grails-app\views>more list.gsp
<html>
<head>
    <title>Book list</title>
</head>
<body>
<h1>Book list</h1>
<table>
    <tr>
        <th>Title</th>
         <th>Author</th>
    </tr>

    <% books.each { %>
        <tr>
             <td>${it.title}</td>
             <td>${it.author}</td>
        </tr>
    <% } %>
</table>
</body>
</html>

C:\temp\grails\qqq\grails-app\views>cd ..

C:\temp\grails\qqq\grails-app>cd ..

C:\temp\grails\qqq>





C:\temp\grails\qqq>..\bin\grails run-app
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.
0_06\lib\tools.jar
Buildfile: C:\temp\grails\src\grails\build.xml

dev:

init-props:
   [groovy] statements executed successfully

build:

package:
    [mkdir] Created dir: C:\temp\grails\qqq\tmp\war
     [copy] Copying 16 files to C:\temp\grails\qqq\tmp\war
     [copy] Copied 5 empty directories to 1 empty directory under C:\temp\grails
\qqq\tmp\war
   [groovy] statements executed successfully
    [touch] Creating C:\temp\grails\qqq\tmp\war\WEB-INF\classes\.dummy
    [mkdir] Created dir: C:\temp\grails\qqq\tmp\war\WEB-INF\lib
    [touch] Creating C:\temp\grails\qqq\tmp\war\WEB-INF\lib\.dummy
    [mkdir] Created dir: C:\temp\grails\qqq\tmp\war\WEB-INF\spring
    [touch] Creating C:\temp\grails\qqq\tmp\war\WEB-INF\spring\.dummy
     [copy] Copying 31 files to C:\temp\grails\qqq\tmp\war\WEB-INF\lib

package:checkj5:

package:java5:
     [copy] Copying 2 files to C:\temp\grails\qqq\tmp\war\WEB-INF\lib
     [copy] Copying 13 files to C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app
     [copy] Copied 9 empty directories to 1 empty directory under C:\temp\grails
\qqq\tmp\war\WEB-INF\grails-app
     [copy] Copying 2 files to C:\temp\grails\qqq\tmp\war\WEB-INF\classes
     [copy] Copying 1 file to C:\temp\grails\qqq\tmp\war\WEB-INF\spring
     [copy] Copying 1 file to C:\temp\grails\qqq\tmp\war\WEB-INF

run-app:

run-app:impl:
   [groovy] log4j:WARN No appenders could be found for logger (org.mortbay.util.
Container).
   [groovy] log4j:WARN Please initialize the log4j system properly.
   [groovy] java.lang.NoClassDefFoundError: org/springframework/orm/hibernate3/s
upport/OpenSessionInViewFilter
   [groovy]     at java.lang.ClassLoader.defineClass1(Native Method)
   [groovy]     at java.lang.ClassLoader.defineClass(Unknown Source)
   [groovy]     at java.security.SecureClassLoader.defineClass(Unknown Source)
   [groovy]     at java.net.URLClassLoader.defineClass(Unknown Source)
   [groovy]     at java.net.URLClassLoader.access$100(Unknown Source)
   [groovy]     at java.net.URLClassLoader$1.run(Unknown Source)
   [groovy]     at java.security.AccessController.doPrivileged(Native Method)
   [groovy]     at java.net.URLClassLoader.findClass(Unknown Source)
   [groovy]     at java.lang.ClassLoader.loadClass(Unknown Source)
   [groovy]     at java.lang.ClassLoader.loadClass(Unknown Source)
   [groovy]     at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:2
09)
   [groovy]     at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:1
93)
   [groovy]     at org.mortbay.http.HttpContext.loadClass(HttpContext.java:1262)

   [groovy]     at org.mortbay.jetty.servlet.Holder.start(Holder.java:188)
   [groovy]     at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.jav
a:60)
   [groovy]     at org.mortbay.jetty.servlet.WebApplicationHandler.initializeSer
vlets(WebApplicationHandler.java:310)
   [groovy]     at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebAp
plicationContext.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(Me
taClassHelper.java:636)
   [groovy]     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:345
)
   [groovy]     at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java
:144)
   [groovy]     at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(Invoke
rHelper.java:104)
   [groovy]     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMetho
d(ScriptBytecodeAdapter.java:85)
   [groovy]     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArg
umentsMethod(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.ja
va: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.jav
a:1216)
   [groovy]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTarget
s(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.j
ava:107)
   [groovy]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va: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.jav
a:1216)
   [groovy]     at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

   [groovy]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.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] statements executed successfully

wait-forever:


--8<--


Am i wrong? please gimme a suggestion or hint.

thanx in advance,
regards,

saka
 

Reply | Threaded
Open this post in threaded view
|

RE: Grails : NoClassDefFoundError

kusako
Hi Saka,

> -----Original Message-----
> From: saka [mailto:[hidden email]]
> Sent: Thursday, March 09, 2006 10:26 AM
> To: [hidden email]
> Subject: [grails-user] Grails : NoClassDefFoundError
>
>
> Hi;
>
> i try recent(2006Mar09version) Grails on
> WinXP/JRE1.5.0_06...and i run as "QuickStart" ,
>
You need teh full JDK (just the JRE is not enough) and have your JAVA_HOME variable point to it.

HTH,

-markus

Reply | Threaded
Open this post in threaded view
|

Re: Grails : NoClassDefFoundError

graemer
Thanks Markus, yes the line:

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.
0_06\lib\tools.jar

Is a bit of a giveaway as this jar is part of the JDK

Graeme

On 09/03/06, Markus Strickler <[hidden email]> wrote:

> Hi Saka,
>
> > -----Original Message-----
> > From: saka [mailto:[hidden email]]
> > Sent: Thursday, March 09, 2006 10:26 AM
> > To: [hidden email]
> > Subject: [grails-user] Grails : NoClassDefFoundError
> >
> >
> > Hi;
> >
> > i try recent(2006Mar09version) Grails on
> > WinXP/JRE1.5.0_06...and i run as "QuickStart" ,
> >
> You need teh full JDK (just the JRE is not enough) and have your JAVA_HOME variable point to it.
>
> HTH,
>
> -markus
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Grails : NoClassDefFoundError

Saka-2
Hi again:

thanks for your quick reply.
i'll try.

Can i run grails on JRE + JDT Compiler?

regards,

saka


Graeme Rocher wrote:

>Thanks Markus, yes the line:
>
>Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.5.
>0_06\lib\tools.jar
>
>Is a bit of a giveaway as this jar is part of the JDK
>
>Graeme
>
>On 09/03/06, Markus Strickler <[hidden email]> wrote:
>> Hi Saka,
>>
>> > -----Original Message-----
>> > From: saka [mailto:[hidden email]]
>> > Sent: Thursday, March 09, 2006 10:26 AM
>> > To: [hidden email]
>> > Subject: [grails-user] Grails : NoClassDefFoundError
>> >
>> >
>> > Hi;
>> >
>> > i try recent(2006Mar09version) Grails on
>> > WinXP/JRE1.5.0_06...and i run as "QuickStart" ,
>> >
>> You need teh full JDK (just the JRE is not enough) and have your JAVA_HOME variable point to it.
>>
>> HTH,
>>
>> -markus
>>
>>
>