cancel
Showing results for 
Search instead for 
Did you mean: 

IWDConfirmationDialog Exceptions and WDCreationFailedException on handler

Former Member
0 Kudos

I have created a Confirmation dialog with the following code. It seems to run fine on my local J2EE Server through many test popup cycles but when the application using this method is deployed in the dev, qa, or prod portal envirnonments something happens, it works at first then after a while and I continually get nasty <b>Null Pointer Execptions</b> or the <b>WDCreationFailedException</b> below for for the dialog box

In the No action I am trying to attach below I call the destroy method of the confirmation window handle to dispose of it. Any ideas what is causing this problem or how to correct it?

private void popupConfirmationMsgWin(
		String popupTitle,
		ArrayList messages) {
 
		StringBuffer usrMsgBuf = new StringBuffer();
		for (int i = 0; i < messages.size(); i++) {
			usrMsgBuf.append(messages.get(i));
			usrMsgBuf.append("n");
		}
 
		String ok =
			wdThis.wdGetPortfolioMsgComponentInterface().getMessage(
				"ORDOK",
				null);
 
		
		IWDControllerInfo controllerInfo =
			wdControllerAPI.getViewInfo().getViewController();
		IWDConfirmationDialog dialog =
			wdComponentAPI.getWindowManager().createConfirmationWindow(
				usrMsgBuf.toString(),
				controllerInfo.findInEventHandlers(
					"onActionDestroyPopupDialogWin"),
				ok);
		dialog.setTitle(popupTitle);
 
		_CurrentCtx.setPopupMsgDialogueWindow(dialog);
 
		dialog.open();
 
	}

// WDCreationFailedException

<b>com.sap.tc.webdynpro.services.exceptions.WDCreationFailedException: add of choice (label: No)failed! (evenhandler: null</b>

at com.sap.tc.webdynpro.clientserver.window.ConfirmationDialogDelegate.addChoice(ConfirmationDialogDelegate.java:88)

at com.sap.tc.webdynpro.clientserver.window.ConfirmationDialogDelegate.addChoice(ConfirmationDialogDelegate.java:97)

at com.chep.portfolio.dynpro.DashboardView.onActionAcceptPreNote(DashboardView.java:1958)

at com.chep.portfolio.dynpro.wdp.InternalDashboardView.wdInvokeEventHandler(InternalDashboardView.java:1631)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

... 25 more

// Null Pointer Exception when it trys to create the dialog.

<b>java.lang.NullPointerException</b>at com.sap.tc.webdynpro.clientserver.window.ConfirmationDialogDelegate.<init>(ConfirmationDialogDelegate.java:58)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createConfirmationWindow(ClientComponent.java:927)

at com.chep.portfolio.dynpro.DashboardView.popupConfirmationMsgWin(DashboardView.java:4215)

at com.chep.portfolio.dynpro.DashboardView.onActionSearch(DashboardView.java:3665)

at com.chep.portfolio.dynpro.wdp.InternalDashboardView.wdInvokeEventHandler(InternalDashboardView.java:2030)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

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

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

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

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:853)

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

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

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

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

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

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

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

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

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

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

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:100)

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Steven,

Make Sure that the action "onActionDestroyPopupDialogWin" exists.

Also make

IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();

as

controllerInfo=wdControllerAPI.getControllerInfo();

Make sure that usrMsgBuf is not null

Regards

Fahad Hamsa

Answers (7)

Answers (7)

Former Member
0 Kudos

Thanks for you suggestions but have found the root cause of the trouble. Although many answers showed the correct way to create a dialog box they could not solve my problem below is actually how it got solved. I am posting this in case someone has similar issues.

After researching the error we (Dynpro Build Manager & I) have confirmed the that some other WebDynpro project was using the same package name as mine and when that dynpro application gets deployed on the Portal a package naming conflict occurs causing the next call to find the event handler, IWDControllerInfo.findInEventHandlers("Ok"), to return null, subsequently the CofirmationDialog box creation fails.

Its an example of why it is important to register/reserve your package names in the landscape. Our Portal Architect is now a bit more careful when creating (copy/paste-ing) from an already existing application.

Former Member
0 Kudos

Thanks will close the thread out. I just made sure I am destroying the popup everywhere and it seems to be working for now.

Former Member
0 Kudos

David,

We are using NWDS 04 sp16 (not 2004s) at our corporation. I am saving the

instance reference of the popup Confirmation Dialog window to call the destroy

method on it since it does extend the IWDWindow IF and the IWDWindow needs

to be explicitly destroyed or else you will get the ]"DuplicateInstanceException"</b>.

I do not know 100% if this also applies to IWDConfirmationDialogWindow just

coding it as a precaution. Clicking OK on the screen will make a

IWDConfirmationDialogWindow makes them disappear from the screen but may

not necessiarly destroy it.

I just destroy them to avoidthe change of getting the <b> DuplicateInstanceException</b>. The Tutorial "Dialog

Boxes in Web Dynpro Applications" ("TutWD_Popup_Init.zip") shows that they do

destroy window instances.

What I can not understand is why the findInEventHandlers("onActionDestroy...")

works for the first hours then all of a sudden the event handler can no longer be

found. Does something in the background delete the event handler method name

list of the object and they (SAP) does not run reflection a 2nd time.

Former Member
0 Kudos

Sorry guys this is the exact code where the No choice event handler is being added. The previous code example is also being used in the application frequently. Its like after a while something happens and the list of method names is being lost by the the SAP internal framework code (perhaps AlterEgo ) and can no longer find the event handler method onActionDestroy...()

<b> I am wondering what is happening to cause the SAP framework to loose the list of eventHandler method names?</b>


		if (!this.validateInboundRequiredFields()) {
			return;
		}

		IWDControllerInfo controllerInfo =
			wdControllerAPI.getViewInfo().getViewController();
		String dialogText =
			wdThis.wdGetPortfolioMsgComponentInterface().getMessage(
				"INBOUND_ACCEPT_CONFIRM",
				Collections.EMPTY_LIST);
		
		IWDConfirmationDialog dialog =
			wdComponentAPI.getWindowManager().createConfirmationWindow(
				dialogText,
				controllerInfo.findInEventHandlers("acceptPreNote"),
				"Yes");
				
		dialog.addChoice(
			controllerInfo.findInEventHandlers("onActionDestroyPopupDialogWin"),
			"No");
		_CurrentCtx.setPopupMsgDialogueWindow(dialog);
		dialog.open();

Former Member
0 Kudos

I'm not sure if this has anything to do with the source of your problem - more for my own curiousity - is it necessary to save a reference to the dialog and subsequently call destroy(), or is this done automatically (almost all the examples i've seen leave this out, but don't mention it)?

(I know the API is slightly different for 04s, but I assume you're using 04 since your using open())

Former Member
0 Kudos

Bala, Fahad,

Guys from the the Action Tab the Action DestoryPopupDialogWin has the event handler method onActionDestroyPopupDialogWin() and it does exist! the code works great for about 6 to 8 hrs w/o incident This method is called from several places within the application and is called many times in a users session without error then something happens in the portal which causes it to forget or loose the reference to the event handler. I am thinking that something gets garbage collected that should not be, the behind the scenes SAP code removes the reference to the action handler due to some freak event happening in the portal like when someone leaves a session, session time out, memory leak, ... Something like that then it just can not find the Action handler method anymore. The problem is difficult because for the first few hundred popups the code works very well. Has anyone experienced this before? I will try recoding the method to try to narrow this down a bit more and will let you know

Former Member
0 Kudos

Steven,

Are you sure that the name of the event handler that you've declared is really "onActionDestroyPopupDialogWin".

I believe that it refers to an action and NOT event handler. NPE might be because of the fact that WDR was not able to find such a event handler.

The trace accompanying WDCreationFailedException also shows that event handler is null !!.

So the solution would be to create a event handler with a simple name, say "destroy" and modify your code to


IWDConfirmationDialog dialog =
			wdComponentAPI.getWindowManager().createConfirmationWindow(
				usrMsgBuf.toString(),
				controllerInfo.findInEventHandlers(
        			"destroy"),
				ok);
		dialog.setTitle(popupTitle);

Bala

Former Member
0 Kudos

Hai,

This may error may happen when you are trying add a choice to confirmation window.

here is the code im using , I didnt get any problem.

refer this one.

IWDConfirmationDialog dialog=wdComponentAPI.getWindowManager().createConfirmationWindow(" Are you Sure to Delete ?",controllerInfo.findInEventHandlers("delete"),	"  YES  ");

dialog.addChoice(controllerInfo.findInEventHandlers("No"), "  NO  ");
dialog.setWindowPosition(250,250);
dialog.setWindowSize(550,50);
dialog.show();

Regards,

Naga