cancel
Showing results for 
Search instead for 
Did you mean: 

error in creating WebDynpro Eventing tutorial

0 Kudos

Hi guys,

I was working with the Eventing Tutorial first part was ok but when i tried to implement the External Context Mapping it gives me this error

java.lang.NullPointerException

at com.sap.tc.webdynpro.tutorials.eventing.embedder.Embedder.wdDoInit(Embedder.java:97)

at com.sap.tc.webdynpro.tutorials.eventing.embedder.wdp.InternalEmbedder.wdDoInit(InternalEmbedder.java:114)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:95)

at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:346)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:352)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:593)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)

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.doGet(DispatcherServlet.java:48)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

the line of code which is causing the problem is

wdContext.currentDataSourceElement().setCounter(0);

when i try to initialize the counter Attribute in my Component Context.

please if some one had this problem and knows the solution then let me know Thank in Advance

regards

Yasir Noman

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hello ,

the reason of exception is that DataSourceElement node is empty. Use supply function to initialize it. Select node, go to property and create supply function.

public void supplyDataSourceElement(XXX.IDataSourceElementNode node, XXX.IContextElement parentElement)

{

//@@begin supplyDataSourceElement(IWDNode,IWDNodeElement)

node.addElement( node.createDataSourceElementElement() );

//@@end

}

Former Member
0 Kudos

Hi,

another idea could be to declare the cardinality of the context node to "1..1" or "1..n". Doing this there will be automatically at least one context node element.

Regards

Jochen

0 Kudos

Thnaks a lot for your replyies guys well i tried the supply function and it worked then i tried to implement the cardinality 1..n or 1..1 but it gave me error by saying cardinality for both nodes should be identical...

any way Thanks again.

regards

Yasir Noman

Former Member
0 Kudos

FYI: there is another way to say "thanks" on SDN forums: assign your reward points to helpful answer (see star icon in title of opened answer)

VS

0 Kudos

hi Velery,

thanks i did give the points to the person, thannks again for the reminder....

regards

Yasir Noman

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Yasir,

I do not exactly know in which way you implemented and declared the eventing application based on the tutorial description. I assume that you did it in an intuitive, individual manner (that's a compliment, not a reproval). The problem with this approach is, that unforeseen errors may occur - like in your case.

In the tutorial all relevant nodes have cardinality 1..1 so that no runtime exception is trown.

Greetings, Bertram

Answers (0)