PortletRequestListener not called

I have a small problem, i implemented the PortletRequestListener but it is not called when the application is started or has ended.

What am i doing wrong?


public class TestApplication extends Application implements PortletRequestListener {
        private PortletRequest request;
	private PortletResponse response;
	
	@Override
	public void init() {
                request.getContextPath();
		Window mainWindow = new Window("test");
                setMainWindow(mainWindow);
        }

	@Override
	public void onRequestEnd(PortletRequest request, PortletResponse response) {
		this.request = request;
		this.response = response;
	}

	@Override
	public void onRequestStart(PortletRequest request, PortletResponse response) {
		this.request = request;
		this.response = response;
	}
} 

I was just browsing the forum and I saw this, perhaps this is useful:

http://vaadin.com/forum/-/message_boards/message/97766

I found my problem, i was using the PortletApplicationContext instead of PortletApplicationContext2.
Stupid me.

Hello Joris,

I’m having the same problem than you and I know you have already solve it.

Could you help me by posting your final code (including the imports)