Quantcast
Channel: SCN : Discussion List - SAP NetWeaver Application Server
Viewing all articles
Browse latest Browse all 3078

UWL API NW7.3 NullPointerException

$
0
0

Hello everybody,

i am trying to play around with the UWL Api. It's a local Server on NW7.3.

I referenced tc/kmc/bc.uwl/api in my Project. I created an Webservice which should create a new UWL Task. But i only get an NullPointerException and i don't know why.

Here's my Code:

 

@WebMethod(operationName = "createTask", exclude = false)          public void createTask(@WebParam(name = "subject") String subject,                              @WebParam(name = "description") String description) {                    try {                              Properties env = new Properties();                              env.put(InitialContext.INITIAL_CONTEXT_FACTORY,                                                  "com.sapportals.portal.prt.registry.PortalRegistryFactory");                              // create initial context                              InitialContext ctx = new InitialContext(env);                              // retrieve UWL service                              IUWLService uwlService = (IUWLService) ctx                                                  .lookup("/broker/services/" + IUWLService.ALIAS_KEY);                              // find logged in user, in my case it's the "guest" user                              IUser loggedInUser = UMFactory.getAuthenticator().getLoggedInUser();                              IPushChannel pushChannel = uwlService.getPushChannel();                              IProviderConnector providerConnector = uwlService                                                  .getRegisterProviderConnector(IProviderConnector.BPEM_CONNECTOR_ID);                              Item item = new Item(providerConnector.getId(), "SAP_LocalSystem",                                                  Long.toString(System.currentTimeMillis()),                                                  "USER.PRIVATE_DATASOURCE.un:testUser");                              item.setDescription(description);                              item.setItemType(ItemType.UWL_ITEM_TASK);                              item.setCreatedDate(new Date());                              item.setCreatorId(loggedInUser.getUniqueID());                              item.setRequiredAction(true);                              item.setStatus(StatusEnum.INPROGRESS);                              item.setExternalObjectId(String.valueOf(item.getInternalId()));                              Set<String> users = new HashSet<String>();                              users.add("USER.PRIVATE_DATASOURCE.un:testUser");                              pushChannel.pushItems(providerConnector, loggedInUser,                                                  ConnectorResult.createUnknownResult(new ItemCollection(                                                                      Arrays.asList(item))));                    } catch (NamingException ne) {                              ne.printStackTrace();                    } catch (UWLException uwle) {                              uwle.printStackTrace();                    }          }

 

Notes to my Code:

  • "USER.PRIVATE_DATASOURCE.un:testUser" is a correct User-ID.
  • The Systemname "SAP_LocalSystem" and the Connector "BPEMUWLConnector" informations i have from the UWL->Show Connection Status Dialog.

 

The Response of this WebService is like that:

 

<SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   <SOAP-ENV:Body>      <SOAP-ENV:Fault>         <faultcode>SOAP-ENV:Client</faultcode>         <faultstring>while trying to invoke the method com.sap.netweaver.bc.uwl.admin.IPropertiesManager$SystemProperty.getCacheEnabled() of an object returned from com.sap.netweaver.bc.uwl.core.ServicePropertiesManager.getSystemProperty(java.lang.String, java.lang.String)</faultstring>         <detail>            <yq1:java.lang.NullPointerException xmlns:yq1="http://sap-j2ee-engine/client-runtime-error">while trying to invoke the method com.sap.netweaver.bc.uwl.admin.IPropertiesManager$SystemProperty.getCacheEnabled() of an object returned from com.sap.netweaver.bc.uwl.core.ServicePropertiesManager.getSystemProperty(java.lang.String, java.lang.String)</yq1:java.lang.NullPointerException>         </detail>      </SOAP-ENV:Fault>   </SOAP-ENV:Body></SOAP-ENV:Envelope>

 

Thanks for your Help.

Best Regards,

Michael


Viewing all articles
Browse latest Browse all 3078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>