• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    Null pointer exception when adding a new user

    Scheduled Pinned Locked Moved Troubleshooting
    11 Posts 3 Posters 2.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jkandasaJ Offline
      jkandasa
      last edited by

      @daniele What version of MyController are you using? I remember I fixed this issue already, could you please confirm it with SNAPSHOT version?

      If you face this issue on SNAPSHOT version, could you please open an issue?

      1 Reply Last reply Reply Quote 0
      • D Offline
        Daniele
        last edited by

        I'm using version 1.0.0.Final from https://www.mycontroller.org/#/downloads
        It's my first time with MyController, and I'm not really an expert... so please be patient!
        Should I move to snapshot version? Is it stable enough for "not so expert" user like me?
        What's the easier way to upgrade?

        Thanks a lot
        Daniele

        jkandasaJ T 2 Replies Last reply Reply Quote 0
        • jkandasaJ Offline
          jkandasa @Daniele
          last edited by

          @daniele steps to upgrade from one version to another version https://forum.mycontroller.org/topic/206/upgrade-to-new-version

          It's my first time with MyController, and I'm not really an expert... so please be patient!

          Welcome to MyControler 🙂
          No worries. I will setup locally and verify this. Thank you!

          1 Reply Last reply Reply Quote 0
          • T Offline
            Tag MOD @Daniele
            last edited by

            @daniele

            Hi Daniele, welcome!!

            I use the snapshot version for a couple of weeks now, it works like a charm and is very stable......👍

            1 Reply Last reply Reply Quote 0
            • D Offline
              Daniele
              last edited by

              I moved to version 1.1.0 snapshot, but I still have the same issue with user creation.

              T 1 Reply Last reply Reply Quote 0
              • T Offline
                Tag MOD @Daniele
                last edited by

                @daniele

                What if you install the snapshot in a new directory with a clean database...
                do you still have the issue?

                It might be that you import a "broken" database.....

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Daniele
                  last edited by

                  I built it from scratch, not from a backup of the previous version

                  T 1 Reply Last reply Reply Quote 0
                  • T Offline
                    Tag MOD @Daniele
                    last edited by Tag

                    @daniele

                    Was able to reproduce your problem!

                    2017-11-17 21:03:39,766 ERROR [Acme.Utils.ThreadPool(0)-PooledThread: Acme.Serve.Serve$ServeConnection@4dc1b0] [org.mycontroller.standalone.api.jaxrs.exception.mappers.ApplicationExceptionMapper:42] ApplicationException,
                    org.jboss.resteasy.spi.ApplicationException: java.lang.NullPointerException: userId
                    	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:152)
                    	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
                    	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
                    	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
                    	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)
                    	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
                    	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
                    	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
                    	at org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40)
                    	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
                    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
                    	at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2328)
                    	at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2282)
                    	at Acme.Serve.Serve$ServeConnection.run(Serve.java:2054)
                    	at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402)
                    	at java.lang.Thread.run(Thread.java:748)
                    Caused by: java.lang.NullPointerException: userId
                    	at org.mycontroller.standalone.api.jaxrs.model.AllowedResources.<init>(AllowedResources.java:33)
                    	at org.mycontroller.standalone.api.jaxrs.model.AllowedResources$AllowedResourcesBuilder.build(AllowedResources.java:34)
                    	at org.mycontroller.standalone.db.tables.User.getAllowedResources(User.java:86)
                    	at org.mycontroller.standalone.db.tables.User.toString(User.java:47)
                    	at java.lang.String.valueOf(String.java:2994)
                    	at java.lang.StringBuilder.append(StringBuilder.java:131)
                    	at com.j256.ormlite.stmt.mapped.MappedCreate.insert(MappedCreate.java:137)
                    	at com.j256.ormlite.stmt.StatementExecutor.create(StatementExecutor.java:458)
                    	at com.j256.ormlite.dao.BaseDaoImpl.create(BaseDaoImpl.java:328)
                    	at org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl.create(BaseAbstractDaoImpl.java:244)
                    	at org.mycontroller.standalone.api.jaxrs.model.UserJson.createOrUpdateUser(UserJson.java:74)
                    	at org.mycontroller.standalone.api.jaxrs.SecurityHandler.addUser(SecurityHandler.java:184)
                    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    	at java.lang.reflect.Method.invoke(Method.java:498)
                    	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
                    	... 15 common frames omitted
                    

                    Do you fill in all fields when creating the user?
                    for the email addres just add a@b.com if there is no email available

                    This error only shows if not all fields are filled.... (at least on my system, using the same version you use..)

                    seems you can use spaces in the username

                    jkandasaJ 1 Reply Last reply Reply Quote 0
                    • jkandasaJ Offline
                      jkandasa @Tag
                      last edited by

                      @tag @Daniele Thank you. I have created an issue to track this.

                      https://github.com/mycontroller-org/mycontroller/issues/426

                      T 1 Reply Last reply Reply Quote 0
                      • T Offline
                        Tag MOD @jkandasa
                        last edited by

                        @jkandasa
                        👍 Thank you!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        0

                        Online

                        586

                        Users

                        529

                        Topics

                        3.4k

                        Posts
                        Copyright © 2015-2025 MyController.org | Contributors | Localization