dneema Posted July 9, 2013 Share Posted July 9, 2013 As i have to add a job for particular user. Sop, i need this. And after this user should be able to edit this job. Can you please give me complete details of this as i am stuck here.I tried this following code:UserAndRoleManagement userAndRoleManagement = new UserAndRoleManagement();WSUser user = new WSUser(); user.setUsername("xyz"); user.setTenantId("organization_1"); user.setEnabled(true); user.setFullName("XYZ ABC"); WSRole role = new WSRole(); role.setRoleName("ROLE_USER"); role.setTenantId(null); user.setRoles(new WSRole[] {role});WSUser value = userAndRoleManagement.putUser(user);But i am getting the error :java.lang.NullPointerException at com.jaspersoft.jasperserver.ws.axis2.authority.UserAndRoleManagement.getService(UserAndRoleManagement.java:72) at com.jaspersoft.jasperserver.ws.axis2.authority.UserAndRoleManagement.putUser(UserAndRoleManagement.java:48)After searching a lot not getting any solution how to create the object of UserAndRoleManagement.Please suggest me ASAP.Thanks,Deepal Link to comment Share on other sites More sharing options...
Yuri Savochenko Posted July 9, 2013 Share Posted July 9, 2013 Hi, can you try something like this: WSUser user = new com.jaspersoft.jasperserver.ws.authority.WSUser(); user.setUsername(name); user.setPassword(name); user.setTenantId(tenantId); user.setEnabled(enabled); user.setFullName("Service User"); You're doing WSRole role = new WSRole(); role.setRoleName("ROLE_USER"); role.setTenantId(null); user.setRoles(new WSRole[] {role}); but ROLE_USER is assigned automatically to every user. What version of JRS you're using? Maybe it would be easier to use REST webservices?http://community.jaspersoft.com/documentation/jasperreports-server-web-service-guide (chapter 4.2.1) Link to comment Share on other sites More sharing options...
dneema Posted July 9, 2013 Author Share Posted July 9, 2013 Thanks for your reply but... >> but ROLE_USER is assigned automatically to every user. This just for the demo. >> What version of JRS you're using? Jaspersoft 5.0 Actually We have to schedule job for the particular user logged in, so we have to add a dynamic user. By which we can add a Job ID and username for the particular Job. And during saving of new job we are using: ReportSchedulerFacade scheduler = new ReportSchedulerFacade(new URL("http://xx.xx.xx.xxx:xxxx/jasperserver/services/ReportScheduler"), "jasperadmin", "jasperadmin"); Job savedJob = scheduler.scheduleJob(job); For every user looged. But we required specific user for this job creation. So, that particular user can update and delete his job from GUI. Please suggest me on this ASAP. Link to comment Share on other sites More sharing options...
Yuri Savochenko Posted July 9, 2013 Share Posted July 9, 2013 didn't you forget to set: user.setPassword("xyz")? Link to comment Share on other sites More sharing options...
dneema Posted July 9, 2013 Author Share Posted July 9, 2013 If found confusing than check 8.2.2 i am try to use this Code but not getting the binding Instance. Link to comment Share on other sites More sharing options...
dneema Posted July 9, 2013 Author Share Posted July 9, 2013 >> didn't you forget to set: user.setPassword("xyz")? No, i try with this too but getting the same problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now