java.lang.NullPointerException

tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Spring can't connect to database when started by Monit

    Stack Overflow | 2 months ago | Fernando Camargo
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springfr$
  2. 0

    Grails User (Old Archive) - Problem running integration tests on 1.1

    nabble.com | 2 years ago
    lang.NullPointerException
  3. 0

    java.security.AllPermission fails for Grails 1.3.2 app on JBoss 5.1 Community Edition

    Stack Overflow | 6 years ago | Stephen Swensen
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I create an application as such: grails create-app joda C:\temp>grails create-app joda Welcome to Grails 1.1-RC2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\Programming\Libraries\grails-1.1 Base Directory: C:\temp Running script D:\Programming\Libraries\grails-1.1\scripts\CreateApp_.groovy Environment set to development [mkdir] Created dir: C:\temp\joda\src [mkdir] Created dir: C:\temp\joda\src\java [mkdir] Created dir: C:\temp\joda\src\groovy [mkdir] Created dir: C:\temp\joda\grails-app [mkdir] Created dir: C:\temp\joda\grails-app\controllers [mkdir] Created dir: C:\temp\joda\grails-app\services [mkdir] Created dir: C:\temp\joda\grails-app\domain [mkdir] Created dir: C:\temp\joda\grails-app\taglib [mkdir] Created dir: C:\temp\joda\grails-app\utils [mkdir] Created dir: C:\temp\joda\grails-app\views [mkdir] Created dir: C:\temp\joda\grails-app\views\layouts [mkdir] Created dir: C:\temp\joda\grails-app\i18n [mkdir] Created dir: C:\temp\joda\grails-app\conf [mkdir] Created dir: C:\temp\joda\test [mkdir] Created dir: C:\temp\joda\test\unit [mkdir] Created dir: C:\temp\joda\test\integration [mkdir] Created dir: C:\temp\joda\scripts [mkdir] Created dir: C:\temp\joda\web-app [mkdir] Created dir: C:\temp\joda\web-app\js [mkdir] Created dir: C:\temp\joda\web-app\css [mkdir] Created dir: C:\temp\joda\web-app\images [mkdir] Created dir: C:\temp\joda\web-app\META-INF [mkdir] Created dir: C:\temp\joda\lib [mkdir] Created dir: C:\temp\joda\grails-app\conf\spring [mkdir] Created dir: C:\temp\joda\grails-app\conf\hibernate [propertyfile] Creating new property file: C:\temp\joda\application.properties [copy] Copying 1 resource to C:\temp\joda [unjar] Expanding: C:\temp\joda\grails-shared-files.jar into C:\temp\joda [delete] Deleting: C:\temp\joda\grails-shared-files.jar [copy] Copying 1 resource to C:\temp\joda [unjar] Expanding: C:\temp\joda\grails-app-files.jar into C:\temp\joda [delete] Deleting: C:\temp\joda\grails-app-files.jar [move] Moving 1 file to C:\temp\joda [move] Moving 1 file to C:\temp\joda [move] Moving 1 file to C:\temp\joda Installing plug-in hibernate-1.1-RC2 [mkdir] Created dir: C:\Documents and Settings\Administrator\.grails\1.1-RC2 \projects\joda\plugins\hibernate-1.1-RC2 [unzip] Expanding: C:\Documents and Settings\Administrator\.grails\1.1-RC2\p lugins\grails-hibernate-1.1-RC2.zip into C:\Documents and Settings\Administrator \.grails\1.1-RC2\projects\joda\plugins\hibernate-1.1-RC2 Executing hibernate-1.1-RC2 plugin post-install script ... Plugin hibernate-1.1-RC2 installed Created Grails Application at C:\temp/joda Then I install the plugin as such: grails install-plugin joda-time C:\temp\joda>grails install-plugin joda-time Welcome to Grails 1.1-RC2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\Programming\Libraries\grails-1.1 Base Directory: C:\temp\joda Running script D:\Programming\Libraries\grails-1.1\scripts\InstallPlugin.groovy Environment set to development Reading remote plugin list ... Reading remote plugin list ... [copy] Copying 1 file to C:\Documents and Settings\Administrator\.grails\1. 1-RC2\projects\joda\plugins Installing plug-in joda-time-0.4.1 [mkdir] Created dir: C:\Documents and Settings\Administrator\.grails\1.1-RC2 \projects\joda\plugins\joda-time-0.4.1 [unzip] Expanding: C:\Documents and Settings\Administrator\.grails\1.1-RC2\p lugins\grails-joda-time-0.4.1.zip into C:\Documents and Settings\Administrator\. grails\1.1-RC2\projects\joda\plugins\joda-time-0.4.1 Executing joda-time-0.4.1 plugin post-install script ... The Joda-Time plugin will now install templates to support Grails scaffo lding for domain classes with Joda-Time properties. You will be prompted if this will overwrite any custom templ ates you already have in src/templates/scaffolding. If the existing templates are only from a previous version of the Joda-T ime plugin they can be safely overwritten. Otherwise you may want to look at the patch files in: C:/Documents and Settings/Administrator/.grails/1.1-RC2/projects /joda/plugins/joda-time-0.4.1/src/templates/scaffolding so you can apply changes manually. Copying templates from <plugin>\src\templates\scaffolding\1.1 for Grails 1.1-RC2 ... Overwrite show.gsp? (y, n, a) a [copy] Copying 1 file to C:\temp\joda\src\templates\scaffolding [copy] Copying 1 file to C:\temp\joda\src\templates\scaffolding [copy] Copying 1 file to C:\temp\joda\src\templates\scaffolding Template installation complete ... Plugin joda-time-0.4.1 installed I then create my domain class as such: grails create-domain-class Test C:\temp\joda>grails create-domain-class Test Welcome to Grails 1.1-RC2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\Programming\Libraries\grails-1.1 Base Directory: C:\temp\joda Running script D:\Programming\Libraries\grails-1.1\scripts\CreateDomainClass.gro ovy Environment set to development Created DomainClass for Test Created Tests for Test I then paste the sample from the plugin doc. import org.joda.time.* import org.joda.time.contrib.hibernate.* class Test { DateTime registered mapping { registered type: PersistentDateTimeTZ, { column: "registered_timestamp" column: "registered_zone" } } static constraints = { } } I then generate all as such: grails generate-all Test C:\temp\joda>grails generate-all Test Welcome to Grails 1.1-RC2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\Programming\Libraries\grails-1.1 and I get the below error Base Directory: C:\temp\joda Running script D:\Programming\Libraries\grails-1.1\scripts\GenerateAll.groovy Environment set to development [copy] Copied 5 empty directories to 3 empty directories under C:\Documents and Settings\Administrator\.grails\1.1-RC2\projects\joda\resources [mkdir] Created dir: C:\temp\joda\web-app\plugins\joda-time-0.4.1 [copy] Copying 27 files to C:\temp\joda\web-app\plugins\joda-time-0.4.1 [mkdir] Created dir: C:\Documents and Settings\Administrator\.grails\1.1-RC2 \projects\joda\classes [groovyc] Compiling 6 source files to C:\Documents and Settings\Administrator\ .grails\1.1-RC2\projects\joda\classes [groovyc] Compiling 7 source files to C:\Documents and Settings\Administrator\ .grails\1.1-RC2\projects\joda\classes [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: star tup failed, C:\temp\joda\grails-app\domain\Test.groovy: 7: unexpected token: map ping @ line 7, column 3. [groovyc] mapping { [groovyc] ^ [groovyc] [groovyc] 1 error Compilation error: Compilation Failed So then I try.... import org.joda.time.* import org.joda.time.contrib.hibernate.* class Test { DateTime registered static mapping = { registered type: PersistentDateTimeTZ, { column: "registered_timestamp" column: "registered_zone" } } static constraints = { } } C:\temp\joda>grails generate-all Test Welcome to Grails 1.1-RC2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\Programming\Libraries\grails-1.1 Base Directory: C:\temp\joda Running script D:\Programming\Libraries\grails-1.1\scripts\GenerateAll.groovy Environment set to development [groovyc] Compiling 7 source files to C:\Documents and Settings\Administrator\ .grails\1.1-RC2\projects\joda\classes [mkdir] Created dir: C:\Documents and Settings\Administrator\.grails\1.1-RC2 \projects\joda\resources\grails-app\i18n [native2ascii] Converting 11 files from C:\temp\joda\grails-app\i18n to C:\Docum ents and Settings\Administrator\.grails\1.1-RC2\projects\joda\resources\grails-a pp\i18n [copy] Copying 1 file to C:\Documents and Settings\Administrator\.grails\1. 1-RC2\projects\joda\classes [copy] Copied 2 empty directories to 2 empty directories under C:\Documents and Settings\Administrator\.grails\1.1-RC2\projects\joda\resources [groovyc] Compiling 1 source file to C:\Documents and Settings\Administrator\. grails\1.1-RC2\projects\joda\classes Generating views for domain class Test ... Generating controller for domain class Test ... Finished generation for domain class Test Ok seems to work.... I then run the app such as: grails run-app C:\temp\joda>grails run-app Welcome to Grails 1.1-RC2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\Programming\Libraries\grails-1.1 Base Directory: C:\temp\joda Running script D:\Programming\Libraries\grails-1.1\scripts\RunApp.groovy Environment set to development [groovyc] Compiling 2 source files to C:\Documents and Settings\Administrator\ .grails\1.1-RC2\projects\joda\classes Running Grails application.. 2009-03-29 18:43:50,088 [main] ERROR context.ContextLoader - Context initializa tion failed org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name 'messageSource': Initialization of bean failed; nested exception is org.s pringframework.beans.factory.BeanCreationException: Error creating bean with nam e 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework. beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ry': Invocation of init method failed; nested exception is java.lang.NullPointer Exception: Cannot get property 'name' on null object at java.security.AccessController.doPrivileged(Native Method) at grails.web.container.EmbeddableServer$start.call(Unknown Source) at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:14 5) at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy) at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:2 69) at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137) at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104) at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy) at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58) at RunApp$_run_closure1.doCall(RunApp.groovy:33) at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:344) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:334) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.processTargets(Gant.groovy:495) at gant.Gant.processTargets(Gant.groovy:480) Caused by: org.springframework.beans.factory.BeanCreationException: Error creati ng bean with name 'transactionManager': Cannot resolve reference to bean 'sessio nFactory' while setting bean property 'sessionFactory'; nested exception is org. springframework.beans.factory.BeanCreationException: Error creating bean with na me 'sessionFactory': Invocation of init method failed; nested exception is java. lang.NullPointerException: Cannot get property 'name' on null object at java.security.AccessController.doPrivileged(Native Method) ... 21 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creati ng bean with name 'sessionFactory': Invocation of init method failed; nested exc eption is java.lang.NullPointerException: Cannot get property 'name' on null obj ect at java.security.AccessController.doPrivileged(Native Method) ... 22 more Caused by: java.lang.NullPointerException: Cannot get property 'name' on null ob ject ... 23 more 2009-03-29 18:43:50,103 [main] ERROR mortbay.log - Failed startup of context or g.mortbay.jetty.webapp.WebAppContext@1f53293{/joda,C:\temp\joda/web-app} org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name 'messageSource': Initialization of bean failed; nested exception is org.s pringframework.beans.factory.BeanCreationException: Error creating bean with nam e 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework. beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ry': Invocation of init method failed; nested exception is java.lang.NullPointer Exception: Cannot get property 'name' on null object at java.security.AccessController.doPrivileged(Native Method) at grails.web.container.EmbeddableServer$start.call(Unknown Source) at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:14 5) at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy) at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:2 69) at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137) at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104) at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy) at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58) at RunApp$_run_closure1.doCall(RunApp.groovy:33) at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:344) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:334) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.processTargets(Gant.groovy:495) at gant.Gant.processTargets(Gant.groovy:480) Caused by: org.springframework.beans.factory.BeanCreationException: Error creati ng bean with name 'transactionManager': Cannot resolve reference to bean 'sessio nFactory' while setting bean property 'sessionFactory'; nested exception is org. springframework.beans.factory.BeanCreationException: Error creating bean with na me 'sessionFactory': Invocation of init method failed; nested exception is java. lang.NullPointerException: Cannot get property 'name' on null object at java.security.AccessController.doPrivileged(Native Method) ... 21 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creati ng bean with name 'sessionFactory': Invocation of init method failed; nested exc eption is java.lang.NullPointerException: Cannot get property 'name' on null obj ect at java.security.AccessController.doPrivileged(Native Method) ... 22 more Caused by: java.lang.NullPointerException: Cannot get property 'name' on null ob ject ... 23 more 2009-03-29 18:43:50,103 [main] ERROR mortbay.log - Nested in org.springframewor k.beans.factory.BeanCreationException: Error creating bean with name 'messageSou rce': Initialization of bean failed; nested exception is org.springframework.bea ns.factory.BeanCreationException: Error creating bean with name 'transactionMana ger': Cannot resolve reference to bean 'sessionFactory' while setting bean prope rty 'sessionFactory'; nested exception is org.springframework.beans.factory.Bean CreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot get property 'name' on null object: java.lang.NullPointerException: Cannot get property 'name' on null object at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessController.doPrivileged(Native Method) at grails.web.container.EmbeddableServer$start.call(Unknown Source) at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:14 5) at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy) at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:2 69) at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137) at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104) at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy) at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58) at RunApp$_run_closure1.doCall(RunApp.groovy:33) at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:344) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:334) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.processTargets(Gant.groovy:495) at gant.Gant.processTargets(Gant.groovy:480) Server running. Browse to http://localhost:8080/joda i comment out the property registered and run-app again. Application startup fine, but obviously I get a view error since the property registered doesn't exist! Any ideas? Thanks

    Grails JIRA | 8 years ago | None None
    lang.NullPointerException: Cannot get property 'name' on null object

  1. rp 3 times, last 4 months ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NullPointerException

    No message provided

    at java.security.AccessController.doPrivileged()
  2. Java RT
    AccessController.doPrivileged
    1. java.security.AccessController.doPrivileged(Native Method)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.security.AccessController.doPrivileged(Native Method)
    3 frames