Skip to Content
0

BusinessLogicException - Steplet class

Jun 29, 2017 at 06:19 AM

57

avatar image
Former Member

Hi Experts,

I'm working on SAP Work Manager 6.0 and customizing the notification add transaction to add a new field.

As per enhancement guide, I've extended steplet, stephandler, BAPI and object class, Also added parameters in config portal.

In the Agentry application notification post step, I've changed the value so that it's pointing to the new steplet class.

When I run the application with new changes, I'm getting the below Java Exception.

doStepLet::this._user:com.syclo.sap.crm.User@4e7ae8a5:005056A059601ED591833CB9BCC1E0D9 | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########doStepLet::begin | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########doStepLet::step handler user is:com.syclo.sap.crm.User@4e7ae8a5:005056A059601ED591833CB9BCC1E0D9 | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########doStepLet::crm user from step handler:com.syclo.sap.crm.User@4e7ae8a5 | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########doStepLet::begin | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########doStepLet::crm user from step handler create method:com.syclo.sap.crm.User@4e7ae8a5 | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########BAPI::begin | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########java.lang.NullPointerException: while trying to invoke the method com.syclo.sap.User.getSAPObject(java.lang.String) of a null object loaded from field com.syclo.sap.component.serviceorder.bapi.ZConfirmationBAPI._crmUser of an object loaded from local variable 'this' | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.bapi.ZConfirmationBAPI.getConfirmation(ZConfirmationBAPI.java:166) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.bapi.ZConfirmationBAPI.getConfirmation(ZConfirmationBAPI.java:1) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.confirmation.bapi.ConfirmationBAPI.<init>(ConfirmationBAPI.java:59) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.bapi.ZConfirmationBAPI.<init>(ZConfirmationBAPI.java:40) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.bapi.ZConfirmationAddBAPI.<init>(ZConfirmationAddBAPI.java:13) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at java.lang.reflect.Constructor.newInstance(Constructor.java:422) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.BAPIFactory.create(BAPIFactory.java:70) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.stephandler.ZConfirmationAddStepHandler.create(ZConfirmationAddStepHandler.java:38) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.steplet.ZConfirmationAddSteplet.execute(ZConfirmationAddSteplet.java:32) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.Steplet.doSteplet(Steplet.java:172) | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########throwExceptionToClient::begin | 2017 06 29 10:58:39#+0530#INFO#System.out###Agentry com.syclo.sapcrmsmTR Worker Thread#########throwExceptionToClient::com.syclo.sap.component.serviceorder.steplet.ZConfirmationAddSteplet::throwExceptionToClient::7315::ZConfirmationAddSteplet - | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########java.lang.reflect.InvocationTargetException | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at java.lang.reflect.Constructor.newInstance(Constructor.java:422) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.BAPIFactory.create(BAPIFactory.java:70) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.stephandler.ZConfirmationAddStepHandler.create(ZConfirmationAddStepHandler.java:38) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.steplet.ZConfirmationAddSteplet.execute(ZConfirmationAddSteplet.java:32) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.Steplet.doSteplet(Steplet.java:172) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########Caused by: java.lang.NullPointerException: while trying to invoke the method com.syclo.sap.component.confirmation.object.Confirmation.setProperties(com.syclo.sap.User, com.syclo.sap.component.confirmation.bapi.ConfirmationBAPI) of a null object returned from com.syclo.sap.component.confirmation.bapi.ConfirmationBAPI.getConfirmation() | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.confirmation.bapi.ConfirmationBAPI.<init>(ConfirmationBAPI.java:59) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.bapi.ZConfirmationBAPI.<init>(ZConfirmationBAPI.java:40) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########at com.syclo.sap.component.serviceorder.bapi.ZConfirmationAddBAPI.<init>(ZConfirmationAddBAPI.java:13) | 2017 06 29 10:58:39#+0530#ERROR#System.err###Agentry com.syclo.sapcrmsmTR Worker Thread#########... 8 more | 2017 06 29 10:58:40#+0530#ERROR#com.sap.mobile.platform.server.agentry.console###Agentry com.syclo.sapcrmsmTR Worker Thread#########Exception: 10:58:39 06/29/2017 : 20 (Agentry3), Java Business Logic Error (com.syclo.agentry.BusinessLogicException: ZConfirmationAddSteplet - ), |

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Jun 29, 2017 at 08:29 AM
0

Can any one please help me to resolve this issue.

my sample code will look like this.

public class ZConfirmationAddStepHandler extends StepHandler

{

protected User _crmUser = null;

public ZConfirmationAddStepHandler(User user) {

super(user);

Logger log = new Logger(this._user, "doStepLet"); log.info("step handler user is:"+user+":"+user.getUserGUID());

this._crmUser = user; tmpUser = user ;

log.info("crm user from step handler:"+this._crmUser);

}

public void create() throws Exception {

Logger log = new Logger(this._user, "doStepLet");

log.info("crm user from step handler create method:"+this._crmUser);

log.info("tmpUser from step handler create method:"+tmpUser);

ZConfirmationAddBAPI bapi = (ZConfirmationAddBAPI)BAPIFactory.create("ZConfirmationAddBAPI", new Class[] { User.class }, new Object[] { tmpUser });

bapi.create(bapi.getConfirmation());

bapi.execute();

bapi.checkForErrors();

bapi.processResults();

}

--------------------------

ZConfirmationAddBAPI

----------------------

public class ZConfirmationAddBAPI extends ZConfirmationBAPI {

public ZConfirmationAddBAPI(User u) throws Exception {

super(u);

Logger log = new Logger(this._user, "doStepLet");

log.info("step handler user is:"+u+":"+u.getUserGUID());

}

}

getting null pointer exception when the super(u) method is getting called...

The object User u is passing as null...

Share
10 |10000 characters needed characters left characters exceeded