Overview
Features
Download
Documentation
Community
Add-Ons & Services

Apache Connector and Application

Please post support and help requests here.

Apache Connector and Application

Postby fbraem » 30 Dec 2008, 22:07

The docs states the following:

In a request handler, the configuration properties loaded this way can be accessed using:

Code: Select all
Poco::Util::Application& app = Poco::Util::Application::instance();
std::string myProp = app.config().getString("MyProperty");


But when I do this in the createRequestHandler I get a NullPointerException:

Code: Select all
[Tue Dec 30 20:54:06 2008] [error] Null pointer: _pInstance in file "c:\\development\\poco-1.3.2-data\\Util\\include\\Poco/Util/Application.h", line 426


It seems that the instance is defined in ApacheApplication and not in Poco::Util::Application.

Franky.
Zumuta!, that's the way to do IT!
fbraem
 
Posts: 109
Joined: 11 Aug 2008, 22:47
Location: Belgium

Re: Apache Connector and Application

Postby fbraem » 02 Jan 2009, 22:58

Could it be that the problem occurs because I link with POCO_STATIC?
Zumuta!, that's the way to do IT!
fbraem
 
Posts: 109
Joined: 11 Aug 2008, 22:47
Location: Belgium

Re: Apache Connector and Application

Postby fbraem » 03 Jan 2009, 23:01

I've solved this problem now as follows:

1. Add a _configFile property to the ApacheApplication class
2. Set the value of _configFile instead of loading the configuration in ApacheConnector
3. Add a _configFile property to ApacheServerRequest which is set in the constructor
4. I load the configuration in my Application class the first time a request is handled
Zumuta!, that's the way to do IT!
fbraem
 
Posts: 109
Joined: 11 Aug 2008, 22:47
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests