Event handlers can only be bound to HttpApplication events during IHttpModule initial

Hello all,

I'm getting the error "Event handlers can only be bound to HttpApplication events during IHttpModule initialization" while trying to navigate in our application functionalities.

In service center we don't have that much information about the error, below I send the stack trace:

Event handlers can only be bound to HttpApplication events during IHttpModule initialization.
   at System.Web.HttpApplication.ThrowIfEventBindingDisallowed()
   at System.Web.HttpApplication.AddSyncEventHookup(Object key, Delegate handler, RequestNotification notification, Boolean isPostNotification)
   at OutSystems.NssDB2iSeriesODBCConnector.CssDB2iSeriesODBCConnector.MssDB2InitializeConnections(RLDB2ConnectionRecordList ssConnections)
   at ssCoreDB2.RssExtensionDB2iSeriesODBCConnector.MssDB2InitializeConnections(HeContext heContext, RecordList inParamConnections)


We have searched about it but didn't find anything usefull.


Could you please help us to understand?

Best regards


Hi Andre,

I'm not sure i understand what you mean with 'navigating in our application functionalities'.

Could you give more details what you do, and where you do it?

Hello Stefano,


Thanks for your reply.

We migrate the application from v10 to v11, it has some webblock with the Notify action to return data to the parent screen. When I refer 'navigatin in our application functionalities', I mean click in a button/link, go to next screen, do what is need (fill some form) then submit and it returns to the parent page.


I'm still searching about this error and  verified that for v11 there is the Events for Webblocks that should be used instead of Notify actions, but it is still not clear to me.


I'm still looking into it



Ah ok, i see. 

Without looking at the code/oml, i would guess your webblock was not build when your screen was: did you put it in a screen-If component?

If not: can you post your oml?

Stefano Valente wrote:

Ah ok, i see. 

Without looking at the code/oml, i would guess your webblock was not build when your screen was: did you put it in a screen-If component?

If not: can you post your oml?

Hello,


Thanks again for your help and support.

In attach I send the OML file.


I have investigated a bit more about this error but and it seems to be related to the way exceptions are caught, but the error doesn't give that much detail.

I have changed all my screen preparations a lot of times, tried to remove all the Exception Handlers but the error still occurs. Also removed all Exception Handlers and its the same.


I still didn't find nothing helpfull on Outsystems community that could help me to understand.


Getting out of ideas and do not know how what to do.


Best regards






Hi,

I opened the .oml but i get a lot of missing references. This is not bad, but i will not be able to run the application.

However i did see you use a drag and drop webblock. Is this whats causing the problem (in your opinion)?

I think the problem could be you are using a deprecated notify get message. You don't need it because you also have the input variable.


Because your application is big and has a lot of references to othe modules (which is good), i would recommend you try to create a new project and only use the screen features you think are causing the issue (try to narrow the possible errors). This might get you closer to finding the problem. I will try to do the same in the meantime.

Good luck!


Hello Stefano,

Thanks again for you reply and support.


I think the issue could be the web blocks because the error occurs when I open the screen "ShiftEquipmentLocation":


This screen has no preparation, it has a web block "EquipmentLocation" that has two other web blocks "EquipmentInactiveLocationDisplay" and "EquipmentLocationDisplay":


These web blocks doesn't have any event or notify action to send information to the parent screen.

The input parameter is obtained throught a function.


I'm really not understanding why this error occurs and there is no much information about it on community.


Best regards




You could try to eliminate this webblock and see what happens.


I dont have your module SpaceFlow, where you have this webblock.

This makes it hard for me to find out what happens. Perhaps you can also include this code?





Stefano Valente wrote:

You could try to eliminate this webblock and see what happens.


I dont have your module SpaceFlow, where you have this webblock.

This makes it hard for me to find out what happens. Perhaps you can also include this code?





Hello Stefano,

I'm sending the OML for the Space Flow.


I stil didn't solve these errors and also coulsn't find the root cause.

There are no documentation/ information about it.


Kind regards




Hello Community,

Can anyone please help me on this subject?


Best regards

Hello Everyone


We just ran into the same error message after upgrading from V10 to V11. 


In our particular case we are polling an External Warehouse DB via a .NET extension. Upon the upgrade the minimum .NET SDK target is changed from  Version=v4.6.1 to Version=4.7.2 (Outsystems Team please correct me if I'm wrong on this one)

In our .NET code we had the following line:


HttpContext.Current.ApplicationInstance.UpdateRequestCache += new EventHandler(Application_EndRequest);


That line prepares the connection to the DB to be closed. Apparently the new SDK unbinds the events automatically when the request's application is destroyed, so there is no need to unbind the events ourselves.


We commented out this line and the error was fixed. 


I hope this helps someone!

 - CLSJ


P.S. We did not detect connections remaining open after commenting out the line.