Grails : NoClassDefFoundError

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

Grails : NoClassDefFoundError

Saka-2
Hi all:

i success running Grails without JDK or JDT-Compiler.
(sure i don't use JSP but GSP)

i rewrite grails.bat below...

---8<---

@echo off
set JAVA_HOME='C:\Program Files\Java\jre1.5.0_06\'
set GRAILS_HOME=C:\temp\grails


if "%JAVA_HOME%"=="" goto javaHomeNotSet
if "%GRAILS_HOME"=="" goto grailsHomeNotSet
goto getArguments

:javaHomeNotSet
echo Error: JAVA_HOME is not defined
echo Please set the JAVA_HOME environment variable and start Grails again
goto errorExit

:grailsHomeNotSet
echo Error: GRAILS_HOME is not defined
echo Please set the GRAILS_HOME environment variable and start Grails again
goto errorExit

:getArguments
set GRAILS_ARGUMENTS=%1
if ""%1""=="""" goto getClasspath
shift
:loopArguments
if ""%1""=="""" goto getClasspath
set GRAILS_ARGUMENTS=%GRAILS_ARGUMENTS% %1
shift
goto loopArguments

:getClasspath
set GRAILS_ANT_CLASSPATH="%GRAILS_HOME%\lib\bsf.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\groovy-all-1.0-RC-01-SNAPSHOT.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\org.mortbay.jetty.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-logging.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-el.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\javax.servlet.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\log4j-1.2.8.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\jasper-compiler.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\jasper-runtime.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\xml-apis.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\xercesImpl.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\dist\grails-0.1a-alpha-SNAPSHOT.jar

set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\antlr-2.7.6rc1.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\asm-attrs.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\asm.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\cglib-2.1.3.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-cli-1.0.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-collections-3.0.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-dbcp-1.2.1.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-fileupload.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-lang-2.0.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-logging.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-pool-1.2.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\commons-validator.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\dom4j-1.6.1.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\ehcache-1.1.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\ejb3-persistence.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\hibernate-annotations.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\hibernate3.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\hsqldb.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\jakarta-oro-2.0.8.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\jdbc2_0-stdext.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\jstl-2.3.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\jstl-2.4.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\jta.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\junit.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\ognl-2.7.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\sitemesh-2.2.1.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\spring-binding.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\spring-mock.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\spring-webflow.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\spring.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\springmodules-sandbox.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\standard-2.3.jar
set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;%GRAILS_HOME%\lib\standard-2.4.jar"


rem set GRAILS_ANT_CLASSPATH=%GRAILS_ANT_CLASSPATH%;C:\app\jdt\jdtCompilerAdapter.jar;C:\app\jdt\jdtcore.jar"
goto startGrails

:startGrails
set ANT_HOME=%GRAILS_HOME%\ant
call %ANT_HOME%\bin\ant.bat -lib %GRAILS_ANT_CLASSPATH% -f %GRAILS_HOME%\src\grails\build.xml -Dbasedir="%CD%" -
Dgrails.home="%GRAILS_HOME%" %GRAILS_ARGUMENTS%

:errorExit


---8<---

Only all jar file adding to env.
and Success log of run-app is below...

---8<---

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:
   [groovy] statements executed successfully

package:checkj5:

package:java5:

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] Root WebApplicationContext: initialization started
   [groovy] Loading Spring root WebApplicationContext
   [groovy] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
   [groovy] Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/resources.xml]
   [groovy] Bean factory for application context [Root WebApplicationContext]:
org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans
[grailsApplication,grailsResourceHolder]; root of BeanFactory hierarchy
   [groovy] 2 beans defined in application context [Root WebApplicationContext]
   [groovy] JDK 1.4+ collections available
   [groovy] Commons Collections 3.x available
   [groovy] Unable to locate MessageSource with name 'messageSource': using default
[org.springframework.context.support.DelegatingMessageSource@120540c]
   [groovy] Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default
[org.springframework.context.event.SimpleApplicationEventMulticaster@4d2af2]
   [groovy] Unable to locate ThemeSource with name 'themeSource': using default
[org.springframework.ui.context.support.ResourceBundleThemeSource@10c0f66]
   [groovy] Pre-instantiating singletons in factory
[org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans
[grailsApplication,grailsResourceHolder]; root of BeanFactory hierarchy]
   [groovy] Loading Grails application.
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\conf\ApplicationBootStrap.groovy]
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\conf\ApplicationDataSource.groovy]
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\taglib\ValidationTagLib.groovy]
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\taglib\ApplicationTagLib.groovy]
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\taglib\FormTagLib.groovy]
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\taglib\JavascriptTagLib.groovy]
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\domain\Book.groovy]
   [groovy] Loading groovy file :[C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\controllers\BookController.groovy]

::snip::
::snip::

   [groovy] Unable to locate ThemeResolver with name 'themeResolver': using default
[org.springframework.web.servlet.theme.FixedThemeResolver@1d1cdf7]
   [groovy] No HandlerAdapters found in servlet 'grails': using default
   [groovy] FrameworkServlet 'grails': initialization completed in 6625 ms
   [groovy] Servlet 'grails' configured successfully
   [groovy] Started WebApplicationContext[/qqq,/qqq]
   [groovy] Started SocketListener on 0.0.0.0:8080
   [groovy] Started org.mortbay.jetty.Server@13e0aba
   [groovy] statements executed successfully

wait-forever:
   [script]      [copy] Copying 4 files to C:\temp\grails\qqq\tmp\war\WEB-INF\grails-app\views

   [script] Opening single Hibernate Session in OpenSessionInViewFilter
   [script] Testing handler map [org.codehaus.groovy.grails.web.servlet.mvc.GrailsUrlHandlerMapping@12fcdf5] in
DispatcherServlet with name 'grails'
   [script] Looking up handler for [/book/list]
   [script] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1a05bdb]
   [script] Last-Modified value for [/qqq/book/list] is [-1]
   [script] DispatcherServlet with name 'grails' received request for [/qqq/book/list]
   [script] Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@1a05bdb]
   [script] [SimpleGrailsController] Processing request for uri [/book/list]
   [script] Processing request for controller [book], action [list], and id []
   [script] Extra params from uri [{}]
   [script] [DynamicMethods] Attempting invocation of dynamic static method [list] on target [class Book] with
arguments [{}]
   [script] [DynamicMethods] Static method matched, marking and invoking
   [script] [SimpleGrailsController] Forwarding to view [/book/list] with model [{books=[Book :  1, Book :  2]}]
   [script] Cached view '/book/list'
   [script] Rendering view [org.springframework.web.servlet.view.JstlView: name '/book/list'; URL [/WEB-INF/grails-
app/views//book/list.gsp]] in DispatcherServlet with name 'grails'
   [script] GSP servlet initialized
   [script] Loading GSP for url [/WEB-INF/grails-app/views//book/list.gsp]
   [script] Loading GSP for url [/WEB-INF/grails-app/views//book/list.gsp]
   [script] parse: page
   [script] parse: page
   [script] parse: html
   [script] parse: script
   [script] parse: html
   [script] parse: expr
   [script] parse: html
   [script] parse: expr
   [script] parse: html
   [script] parse: script
   [script] parse: html
   [script] Writing response with content type: text/html;charset=UTF-8
   [script] Successfully completed request
   [script] Closing single Hibernate Session in OpenSessionInViewFilter


---8<---

also, i can see BookList. Wow!
http://localhost:8080/qqq/book/list

So, java.lang.NoClassDefFoundError: org/springframework/orm/hibernate3/support/OpenSessionInViewFilter
At First time, What is That?



i try "QuickStart" using recent(2006Mar09version) Grails on WinXP/JRE1.5.0_06...
http://grails.codehaus.org/Quick+Start

Regards,

saka




Markus Strickler 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
>
>