cancel
Showing results for 
Search instead for 
Did you mean: 

SAP bug

Former Member
0 Kudos

Hi,

I'm experiencing a Nullpointerexception when I click on a button in my Web Dynpro app.

For testing purposes I'm throwing a RuntimeException in the button action handler,

but that RuntimeException is never thrown, so the problem is happening before the action handler is called.

When inspecting the stacktrace I would say this is a SAP-side bug.

Can somebody confirm this?

Thanks,

Jeroen

Web Dynpro Runtime
Vendor: SAP, Build ID: 6.4015.00.0000.20060810110535.0000 (release=NW04_15_REL, buildtime=2006-08-10:09:21:36[UTC], changelist=20523, host=PWDFM087)
J2EE Engine	6.40 patchlevel 100627.313
Java VM	Classic VM, version:1.4.2, vendor: IBM Corporation

java.lang.NullPointerException
	at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.handleUIElementEvent(HtmlClient.java(Compiled Code))
	at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.updateEventQueue(HtmlClient.java(Compiled Code))
	at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.initEvents(AbstractClient.java:131)
	at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.prepareTasks(AbstractClient.java:99)
	at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)
	at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
	at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
	at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
	at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java(Compiled Code))
	at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java(Compiled Code))
	at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java(Inlined Compiled Code))
	at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java(Compiled Code))
	at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java(Compiled Code))
	at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java(Compiled Code))
	at com.sap.engine.services.httpserver.server.Client.handle(Client.java(Inlined Compiled Code))
	at com.sap.engine.services.httpserver.server.Processor.request(Processor.java(Compiled Code))
	at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java(Compiled Code))
	at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java(Compiled Code))
	at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java(Compiled Code))
	at java.security.AccessController.doPrivileged1(Native Method)
	at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code))
	at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java(Compiled Code))
	at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java(Compiled Code))

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

After decompiling the SAP binaries & some testing I found out that the problem was initially caused by:

someIWDButton.mappingOfOnAction().addParameter(name, value);

Apparently the <value> parameter (type String) may NOT contain '.'

Second condition to get the NPE is a call to

((IWDTransparentContainer)view.getRootElement()).destroyAllChildren()

This was hard to find out, I'm wondering why this is not mentioned in the API documentation (or am I looking over it?).

Jeroen

Former Member
0 Kudos

Sounds strange.

I remember having seen this error if a UI element has a "." (dot) in the ID. This is not checked (in earlier version) if you create the UI element via API.

So please check the IDs of all programmatically created UI elements.

I don't think it has to do with a dot inside the value of an addParameter() statement.

And there also should never be a NPE in the statement ((IWDUIElementContainer)view.getRootElement()).destroyAllChildren(), because the root element is created automatically and cannot be removed afterwards.

Armin

Former Member
0 Kudos

Hi,

Concerning the NPE: as you can see in the stacktrace it is not thrown when ((IWDUIElementContainer)view.getRootElement()).destroyAllChildren() is executed, but in HtmlClient.handleUIElementEvent (after clicking on a IWDButton).

What I found out is when the value of a mappingOfOnAction parameter contains a dot, only the part BEFORE the dot is passed to the action handler.

I rechecked my code and indeed, as you said, I'm also using the value of the mappingOfOnAction parameter as the ID of the corresponding button, so that probably caused the NPE

Jeroen

Former Member
0 Kudos

Believe me, the dot in the UI element ID is the root of the evil, the rest are consequences.

Armin

Former Member
0 Kudos

Open OSS message (BC-WD-CLT-HTML).

Armin