Skip to Content
avatar image
Former Member

NullPointerException: while trying to invoke the method com.sap.mdi.Rfm.getRfmParameter

Hi All,

After a recent Portal upgrade a previously working Java app has began throwing an exception when attempting to call a Function Module. Many users are working ok and we’ve checked the software versions are the same across servers. We've had a user experiencing the problem to logon to each portal server but the error happens on each server.

The exception is:

java.lang.NullPointerException: while trying to invoke the method com.sap.mdi.Rfm.getRfmParameter(java.lang.String) of a
null object loaded from field com.sapportals.connectors.SAPCFConnector.metadata.functions.SAPFunctionParameter.rfm of an
object loaded from local variable 'this'

The exception occurs when querying the structure of the Function Module:

IFunction function = connection.getFunctionsMetaData().getFunction(ZCM_SELECTOR_IVIEW_SET_INFO);
IStructureFactory structureFactory = interaction.retrieveStructureFactory();
IRecordSet table = (IRecordSet)structureFactory.getStructure(function.getParameter(COMMENTS).getStructure()); 

Specifically the COMMENTS parameter of the Function Module:

IRecordSet table = (IRecordSet)structureFactory.getStructure(function.getParameter(COMMENTS).getStructure());

The exception occurs inside the JAR file GenericConnector.jar that was downloaded from the portal after the upgrade.

As part of the upgrade process the JAR files used by the app are downloaded and the app is recompiled to the same Java version used on the portal. GenericConnector.jar file is one of the updated files.

That's a whole lot of information, hoping someone out there can help!

Even more detail...

SAP source and target portal version/patch levels

Full Stack Trace

SAPCFConnectorException.isConnectionBroken
[EXCEPTION]
java.lang.NullPointerException: while trying to invoke the method com.sap.mdi.Rfm.getRfmParameter(java.lang.String) of a null object loaded from field com.sapportals.connectors.SAPCFConnector.metadata.functions.SAPFunctionParameter.rfm of an object loaded from local variable 'this'
at com.sapportals.connectors.SAPCFConnector.metadata.functions.SAPFunctionParameter.getStructure(SAPFunctionParameter.java:173)
at uk.ac.ncl.SelectorConnector.setSelectorData(SelectorConnector.java:243)
at uk.ac.ncl.ExecuteDecision$ExecuteDecisionDynPage.onReturn(ExecuteDecision.java:515)
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 com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:173)
at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:106)
at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:213)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:129)
at com.sap.portal.prt.core.RequestDispatcherFactory$PortalComponentRequestDispatcher$5.service(RequestDispatcherFactory.java:308)
at com.sap.engine.services.servlets_jsp.server.deploy.impl.module.IRequestDispatcherImpl.dispatch(IRequestDispatcherImpl.java:292)
at com.sap.portal.prt.core.RequestDispatcherFactory$PortalComponentRequestDispatcher.service(RequestDispatcherFactory.java:298)
at com.sap.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:229)
at com.sap.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:107)
at com.sap.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:141)
at com.sap.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:206)
at com.sapportals.portal.navigation.workAreaiView.doContent(workAreaiView.java:319)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:213)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:129)
at com.sap.portal.prt.core.RequestDispatcherFactory$PortalComponentRequestDispatcher$5.service(RequestDispatcherFactory.java:308)
at com.sap.engine.services.servlets_jsp.server.deploy.impl.module.IRequestDispatcherImpl.dispatch(IRequestDispatcherImpl.java:292)
at com.sap.portal.prt.core.RequestDispatcherFactory$PortalComponentRequestDispatcher.service(RequestDispatcherFactory.java:298)
at com.sap.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:229)
at com.sap.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:107)
at com.sap.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:141)
at com.sap.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:206)
at com.sap.portal.prt.pom.PortalNode.service(PortalNode.java:590)
at com.sap.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:233)
at com.sap.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:107)
at com.sap.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:141)
at com.sap.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:520)
at com.sapportals.portal.prt.connection.ServletConnection._handleRequest(ServletConnection.java:224)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:101)
at com.sap.portal.prt.dispatcher.DispatcherServlet.service(DispatcherServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.runServlet(FilterChainImpl.java:202)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:103)
at com.sap.portal.http.EnrichNavRequestFilter.doFilter(EnrichNavRequestFilter.java:49)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at com.sap.portal.prt.dispatcher.CustomHeaderFilter.doFilter(CustomHeaderFilter.java:58)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at com.sap.portal.http.EnrichNavRequestFilter.doFilter(EnrichNavRequestFilter.java:49)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:441)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:210)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:441)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:430)
at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:81)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:278)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.SessionSizeFilter.process(SessionSizeFilter.java:26)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:57)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:43)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:468)
at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:262)
at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 14, 2017 at 02:29 PM

    I stumbled across an old post that had a similar problem and ultimately provided a solution:

    https://archive.sap.com/discussions/thread/1330443

    Instead of the querying the function module meta data before the call, the trick is to calls the function module with empty parameters then query the output structures to get the input structures. Then call the function module again.

    connection = cgService.getConnection(systemAlias, cp);
    IInteraction interaction = connection.createInteractionEx();
    IInteractionSpec interactionSpec = interaction.getInteractionSpec();
    interactionSpec.setPropertyValue(NAME,ZCM_MY_FUNCTION_MODULE);
    
    RecordFactory recordFactory = interaction.getRecordFactory();
    MappedRecord importParams = recordFactory.createMappedRecord(INPUT);
    
    MappedRecord output = (MappedRecord)interaction.execute(interactionSpec, importParams);
          
    IRecordSet table = (IRecordSet)output.get(COMMENTS);
    
    ... populate table ...
    
    importParams.put(COMMENTS, table);
    output = (MappedRecord)interaction.execute(interactionSpec, importParams);

    Hope this helps someone in the future!

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 24, 2017 at 03:05 PM

    We have a very similar error while checking the configuration via the BI Support Desktop Tool:

    Any solutions on this yet? We couldn't solve the issue till know and don't really have idea what the cause could be.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Andras,

      Sorry for the slow reply, I didn't get any notification of your comment in my inbox. Probably too late for you but I'll leave a response anyway for anyone else who might hit this problem in the future.

      I stumbled across an old post that had a similar problem and ultimately provided a solution:

      https://archive.sap.com/discussions/thread/1330443

      Instead of the querying the function module meta data before the call, it calls the function module, queries the output and then calls the function module again.

      Hope this helps someone in the future!

      Thanks,

      Justin

  • avatar image
    Former Member
    Mar 02, 2017 at 09:55 AM

    Hi both,

    the solution should be:

    https://launchpad.support.sap.com/#/notes/2372099/E

    https://launchpad.support.sap.com/#/notes/2433273/E

    Hope this helps.

    Kind regards

    André

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Andre,

      Sorry for the slow reply, I didn't get any notification of your comment in my inbox.

      Although I do think it was a patching problem I eventually came up with a solution after stumbling across an old post:

      https://archive.sap.com/discussions/thread/1330443

      I changed the Java code so instead of the querying the function module meta data before the call, it calls the function module, queries the output and then calls the function module again.

      Hope this helps someone in the future!

      Thanks,

      Justin