You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Chris Papademos (JIRA)" <ji...@apache.org> on 2012/05/07 10:35:58 UTC

[jira] [Created] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Chris Papademos created SLING-2465:
--------------------------------------

             Summary: RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
                 Key: SLING-2465
                 URL: https://issues.apache.org/jira/browse/SLING-2465
             Project: Sling
          Issue Type: Bug
          Components: JCR, Servlets
    Affects Versions: JCR Jackrabbit User Manager 2.2.0
         Environment: Xubuntu 
            Reporter: Chris Papademos
            Priority: Critical


@Component
@Service(Servlet.class)
@Properties({
		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
		@Property(name = "service.vendor", value = "IPVS"),
		@Property(name = "sling.servlet.methods", value = "POST"),
		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
public class UserCreateServlet extends SlingAllMethodsServlet {

	@Override
	protected void doPost(SlingHttpServletRequest request,
			SlingHttpServletResponse response) throws ServletException,
			IOException {
		
		// Redirect Request to the Sling CreateUserServlet.
	
		RequestDispatcher dispatcher = request
				.getRequestDispatcher("/system/userManager/user.create.html");
		dispatcher.forward(request, response);


	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Hall resolved SLING-2465.
------------------------------

       Resolution: Fixed
    Fix Version/s: JCR Jackrabbit User Manager 2.2.2

Eric Norman shared an approach on the mail list that outlines getting the user path more cleanly. I have applied his patch in revision 1347825.
                
> RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2465
>                 URL: https://issues.apache.org/jira/browse/SLING-2465
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR, Servlets
>    Affects Versions: JCR Jackrabbit User Manager 2.2.0
>         Environment: Xubuntu 
>            Reporter: Chris Papademos
>            Assignee: Carl Hall
>            Priority: Critical
>              Labels: Create, Request, RequestHandler, User, servlet, usermanager
>             Fix For: JCR Jackrabbit User Manager 2.2.2
>
>
> @Component
> @Service(Servlet.class)
> @Properties({
> 		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
> 		@Property(name = "service.vendor", value = "IPVS"),
> 		@Property(name = "sling.servlet.methods", value = "POST"),
> 		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
> public class UserCreateServlet extends SlingAllMethodsServlet {
> 	@Override
> 	protected void doPost(SlingHttpServletRequest request,
> 			SlingHttpServletResponse response) throws ServletException,
> 			IOException {
> 		
> 		// Redirect Request to the Sling CreateUserServlet.
> 	
> 		RequestDispatcher dispatcher = request
> 				.getRequestDispatcher("/system/userManager/user.create.html");
> 		dispatcher.forward(request, response);
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13276756#comment-13276756 ] 

Carl Hall commented on SLING-2465:
----------------------------------

I was able to recreate this by enabling self-registration and visiting the following URL:

    curl -F:name=reader -Fpwd=ourReader -FpwdConfirm=ourReader -F"desc=Read only access" http://localhost:8080/system/userManager/user.create.html

The exception is not shown in the logs. It comes back as part of the response.

            <tr>
                <td>Status</td>
                <td><div id="Status">500</div></td>
            </tr>
            <tr>
                <td>Message</td>
                <td><div id="Message">java.lang.NullPointerException</div></td>
            </tr>
                
> RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2465
>                 URL: https://issues.apache.org/jira/browse/SLING-2465
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR, Servlets
>    Affects Versions: JCR Jackrabbit User Manager 2.2.0
>         Environment: Xubuntu 
>            Reporter: Chris Papademos
>            Assignee: Carl Hall
>            Priority: Critical
>              Labels: Create, Request, RequestHandler, User, servlet, usermanager
>
> @Component
> @Service(Servlet.class)
> @Properties({
> 		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
> 		@Property(name = "service.vendor", value = "IPVS"),
> 		@Property(name = "sling.servlet.methods", value = "POST"),
> 		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
> public class UserCreateServlet extends SlingAllMethodsServlet {
> 	@Override
> 	protected void doPost(SlingHttpServletRequest request,
> 			SlingHttpServletResponse response) throws ServletException,
> 			IOException {
> 		
> 		// Redirect Request to the Sling CreateUserServlet.
> 	
> 		RequestDispatcher dispatcher = request
> 				.getRequestDispatcher("/system/userManager/user.create.html");
> 		dispatcher.forward(request, response);
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13276797#comment-13276797 ] 

Carl Hall commented on SLING-2465:
----------------------------------

I see this NPE showing up without forwarding to /system/userManager/user.create.html but going directly to it. `createUser(..)` is returning a null object. The user is created as shown by subsequent create-calls that return with "user exists." I'm digging into why this is happening.
                
> RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2465
>                 URL: https://issues.apache.org/jira/browse/SLING-2465
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR, Servlets
>    Affects Versions: JCR Jackrabbit User Manager 2.2.0
>         Environment: Xubuntu 
>            Reporter: Chris Papademos
>            Assignee: Carl Hall
>            Priority: Critical
>              Labels: Create, Request, RequestHandler, User, servlet, usermanager
>
> @Component
> @Service(Servlet.class)
> @Properties({
> 		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
> 		@Property(name = "service.vendor", value = "IPVS"),
> 		@Property(name = "sling.servlet.methods", value = "POST"),
> 		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
> public class UserCreateServlet extends SlingAllMethodsServlet {
> 	@Override
> 	protected void doPost(SlingHttpServletRequest request,
> 			SlingHttpServletResponse response) throws ServletException,
> 			IOException {
> 		
> 		// Redirect Request to the Sling CreateUserServlet.
> 	
> 		RequestDispatcher dispatcher = request
> 				.getRequestDispatcher("/system/userManager/user.create.html");
> 		dispatcher.forward(request, response);
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13276881#comment-13276881 ] 

Carl Hall commented on SLING-2465:
----------------------------------

The problem here is the JCR session is bound to the `anonymous` user and that user can't see the user that is created. We could use the submitted `principalName` instead of using user.getID(). I assume the two are the same but I need to check if this okay to do.
                
> RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2465
>                 URL: https://issues.apache.org/jira/browse/SLING-2465
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR, Servlets
>    Affects Versions: JCR Jackrabbit User Manager 2.2.0
>         Environment: Xubuntu 
>            Reporter: Chris Papademos
>            Assignee: Carl Hall
>            Priority: Critical
>              Labels: Create, Request, RequestHandler, User, servlet, usermanager
>
> @Component
> @Service(Servlet.class)
> @Properties({
> 		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
> 		@Property(name = "service.vendor", value = "IPVS"),
> 		@Property(name = "sling.servlet.methods", value = "POST"),
> 		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
> public class UserCreateServlet extends SlingAllMethodsServlet {
> 	@Override
> 	protected void doPost(SlingHttpServletRequest request,
> 			SlingHttpServletResponse response) throws ServletException,
> 			IOException {
> 		
> 		// Redirect Request to the Sling CreateUserServlet.
> 	
> 		RequestDispatcher dispatcher = request
> 				.getRequestDispatcher("/system/userManager/user.create.html");
> 		dispatcher.forward(request, response);
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Posted by "Chris Papademos (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269460#comment-13269460 ] 

Chris Papademos commented on SLING-2465:
----------------------------------------

By the way. I have selfRegistration enabled. Seems this issue appears only, when Anonymous tries to create a new user.
                
> RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2465
>                 URL: https://issues.apache.org/jira/browse/SLING-2465
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR, Servlets
>    Affects Versions: JCR Jackrabbit User Manager 2.2.0
>         Environment: Xubuntu 
>            Reporter: Chris Papademos
>            Priority: Critical
>              Labels: Create, Request, RequestHandler, User, servlet, usermanager
>
> @Component
> @Service(Servlet.class)
> @Properties({
> 		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
> 		@Property(name = "service.vendor", value = "IPVS"),
> 		@Property(name = "sling.servlet.methods", value = "POST"),
> 		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
> public class UserCreateServlet extends SlingAllMethodsServlet {
> 	@Override
> 	protected void doPost(SlingHttpServletRequest request,
> 			SlingHttpServletResponse response) throws ServletException,
> 			IOException {
> 		
> 		// Redirect Request to the Sling CreateUserServlet.
> 	
> 		RequestDispatcher dispatcher = request
> 				.getRequestDispatcher("/system/userManager/user.create.html");
> 		dispatcher.forward(request, response);
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13277039#comment-13277039 ] 

Carl Hall commented on SLING-2465:
----------------------------------

After talking with Justin, we decided to impersonate the session with the new user but that breaks down if the impersonated session is closed before the User is returned. Taking the conversation to dev@sling to figure this out.
                
> RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2465
>                 URL: https://issues.apache.org/jira/browse/SLING-2465
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR, Servlets
>    Affects Versions: JCR Jackrabbit User Manager 2.2.0
>         Environment: Xubuntu 
>            Reporter: Chris Papademos
>            Assignee: Carl Hall
>            Priority: Critical
>              Labels: Create, Request, RequestHandler, User, servlet, usermanager
>
> @Component
> @Service(Servlet.class)
> @Properties({
> 		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
> 		@Property(name = "service.vendor", value = "IPVS"),
> 		@Property(name = "sling.servlet.methods", value = "POST"),
> 		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
> public class UserCreateServlet extends SlingAllMethodsServlet {
> 	@Override
> 	protected void doPost(SlingHttpServletRequest request,
> 			SlingHttpServletResponse response) throws ServletException,
> 			IOException {
> 		
> 		// Redirect Request to the Sling CreateUserServlet.
> 	
> 		RequestDispatcher dispatcher = request
> 				.getRequestDispatcher("/system/userManager/user.create.html");
> 		dispatcher.forward(request, response);
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (SLING-2465) RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Hall reassigned SLING-2465:
--------------------------------

    Assignee: Carl Hall
    
> RequestDispatcher throws NullPointer Exception when forwarding to /system/userManager/user.create.html
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2465
>                 URL: https://issues.apache.org/jira/browse/SLING-2465
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR, Servlets
>    Affects Versions: JCR Jackrabbit User Manager 2.2.0
>         Environment: Xubuntu 
>            Reporter: Chris Papademos
>            Assignee: Carl Hall
>            Priority: Critical
>              Labels: Create, Request, RequestHandler, User, servlet, usermanager
>
> @Component
> @Service(Servlet.class)
> @Properties({
> 		@Property(name = "service.description", value = "Creates a new User and sends an Activation Email to the given Address."),
> 		@Property(name = "service.vendor", value = "IPVS"),
> 		@Property(name = "sling.servlet.methods", value = "POST"),
> 		@Property(name = "sling.servlet.paths", value = "/satlab/user/create") })
> public class UserCreateServlet extends SlingAllMethodsServlet {
> 	@Override
> 	protected void doPost(SlingHttpServletRequest request,
> 			SlingHttpServletResponse response) throws ServletException,
> 			IOException {
> 		
> 		// Redirect Request to the Sling CreateUserServlet.
> 	
> 		RequestDispatcher dispatcher = request
> 				.getRequestDispatcher("/system/userManager/user.create.html");
> 		dispatcher.forward(request, response);
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira