Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.3.1
-
Fix Version/s: 1.3.3
-
Component/s: Commons, Persistence
-
Labels:None
-
Environment:Windows Vista, Grails 1.3.1
-
Testcase included:yes
Description
It took me a very long time to narrow down to this bug because stacktrace contains useless logs.
Very easy to reproduce.
1- Create a project
2- Create a domain class
3- Add method :
def getName(int i)
4- grails run-app => BOUM when starting the application
If you replace the method by def getName(Integer i), then it works ??!!!
Project attached.
-
Hide
- bugInt.zip
- 01/Jul/10 4:09 AM
- 246 kB
- Fabien Benichou
-
- bugInt/.classpath 0.7 kB
- bugInt/.project 0.5 kB
- bugInt/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- bugInt/application.properties 0.2 kB
- bugInt/grails-app/conf/BootStrap.groovy 0.1 kB
- bugInt/grails-app/.../BuildConfig.groovy 1 kB
- bugInt/grails-app/conf/Config.groovy 3 kB
- bugInt/grails-app/conf/DataSource.groovy 0.6 kB
- bugInt/grails-app/.../resources.groovy 0.0 kB
- bugInt/grails-app/.../UrlMappings.groovy 0.2 kB
- bugInt/grails-app/.../MyDomain.groovy 0.1 kB
- bugInt/grails-app/.../messages.properties 3 kB
- bugInt/grails-app/.../messages_da.properties 3 kB
- bugInt/grails-app/.../messages_de.properties 4 kB
- bugInt/grails-app/.../messages_es.properties 3 kB
- bugInt/grails-app/.../messages_fr.properties 2 kB
- bugInt/grails-app/.../messages_it.properties 2 kB
- bugInt/grails-app/.../messages_ja.properties 2 kB
- bugInt/grails-app/.../messages_nl.properties 3 kB
- bugInt/.../messages_pt_BR.properties 3 kB
- bugInt/.../messages_pt_PT.properties 3 kB
- bugInt/grails-app/.../messages_ru.properties 4 kB
- bugInt/grails-app/.../messages_th.properties 5 kB
- bugInt/.../messages_zh_CN.properties 2 kB
- bugInt/grails-app/views/error.gsp 2 kB
- bugInt/grails-app/views/index.gsp 3 kB
- bugInt/grails-app/views/layouts/main.gsp 0.7 kB
- bugInt/target/.../application.properties 0.2 kB
- bugInt/target/.../BootStrap$_closure1.class 2 kB
- bugInt/target/.../BootStrap$_closure2.class 3 kB
-
- stacktrace.log
- 06/Jul/10 7:06 AM
- 141 kB
- Fabien Benichou
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Did you run the project on Windows?? I tried on 2 different machines (Windows Vista and Windows 7) and I always get a NPE at startup with:
ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:164)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:159)
...
Caused by: java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
... 23 more
Please see my comments. I have given the attached project to another person that has also experienced the startup failure
No I tried it on Mac OS X.
Reducing priority since it only effects a small subset of environments. It would help if you attached your stacktrace.log file.
I have no idea how this exception could possibly occur because the getType() method cannot return null, anyway I've added a null check which should fix the problem, however I cannot reproduce (not even on a local Windows VM) so cannot be sure:
http://github.com/grails/grails-core/commit/85f71a3aff30fe55adb25eed9781cd86f60bea48
Very strange that you cannot reproduce it. If currentProp.getType() returns null, I believe that other issues will be raised. I will test 1.3.3 and post my results on this Jira issue.
I followed your steps and tried the attached application and cannot reproduce this problem