I can´t connect mojoportal with postgreSQL

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/30/2008 1:31:48 PM
Gravatar
Total Posts 3

I can´t connect mojoportal with postgreSQL

I tried to install Mojoportal with postgreSQL over XP

  • windows Service Pack 3.0 (with asp.net 3.5) Updating
  • mojoportal-2-2-7-6-pgsqlreleasefiles
  • postgreSQL 8.3

mojoPortal cannot conncect with PostgreSql. Open /setup/Default.aspx

Probing system...
File system permissions ok.
The system cannot connect to the pgsql database. Please check your connection string.

Npgsql.NpgsqlException: Failed to establish a connection to 'localhost'. en Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context) en Npgsql.NpgsqlConnector.Open() en Npgsql.NpgsqlConnectorPool.GetNonPooledConnector(NpgsqlConnection Connection) en Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection Connection) en Npgsql.NpgsqlConnection.Open() en mojoPortal.Data.DBPortal.DatabaseHelperGetConnectionError(String overrideConnectionInfo)


I tried to install mojoPortal on windows Service Pack 3.0 with asp.net 3.5
The IIS web site is configured for 2.0 ASP.NET.
User ASP.NET has read write permission on the whole web root folder (including data).

I can connect to PostgreSql with plsl. I develop a test with ASP.NET 2.0 and NpgSql library
(the last version, not mojo version). And It works.
While I was instaling, I do this:
psql -d template1 -f 1CreateDatabase.sql
createuser --pwprompt --no-adduser --no-createdb mojo
Ensure that mojo can connect through tcpip. I supose that my test do over tcpip.

In webconfig
<globalization
culture="es-ES"
uiCulture="es-ES"
requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="iso-8859-15" />

----------------------------------------------------------------------------
--I was for MySQL
<add key="SubSonicProvider" value="subsonicPostgreSql" />


<add name="Subsonic-pgSqlServer" connectionString="Server=localhost;Port=5444;User Id=mojo;Password=xxxxx;Database=mojoportal;Pooling=false;Encoding=UNICODE;" />

(Yes I use this port.)

¿Could you help me?
Regards.

Sorry for my english.

Antonio de la Cruz
 

10/30/2008 1:45:24 PM
Gravatar
Total Posts 18439

Re: I can´t connect mojoportal with postgreSQL

Hi Antonio,

Its not really using SubSonic, there is a developer page that uses it but not the main site. The connection string you need to find in Web.config looks like this:

<add key="PostgreSQLConnectionString" value="Server=localhost;Port=5432;Encoding=unicode;User Id=mojouser;Password=mojo123;Database=mojoportal;Pooling=false;CommandTimeout=120;" />
 

Ideally you will rename the user.config.sample file to user.config and put the connection string in there. This way you won't lose the connection string if upgrading later.

Once you set a good connection string in user.config it should work. After you edit user.config modify the web.config by just type a space in it then save it. This will recycle the app and make it read the new connection string from user.config

Hope it helps,

Joe

10/30/2008 1:50:02 PM
Gravatar
Total Posts 18439

Re: I can´t connect mojoportal with postgreSQL

Also, this change you made to the culture setting may cause null reference exceptions.

<globalization
culture="es-ES"
uiCulture="es-ES"
requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="iso-8859-15" />

It may cause null exceptions because the resource files for es-ES are not complete, they have missing keys. The default culture should not have any mising keys. I recommend change it back to this:

<globalization
culture="auto:en-US"
uiCulture="auto:en-US"
requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="iso-8859-15" />

auto means use the browser preferred language but for missing keys use the default culture en-US. en-US is the only resource that is always up to date. So if your browser preferred language is set to es-ES, then it will use the Spanish resource files but if any of the keys are missing it will fall back to the en-US files.

Hope it makes sense.

Best,

Joe

10/31/2008 6:53:30 PM
Gravatar
Total Posts 3

Re: I can´t connect mojoportal with postgreSQL

OK, It´s works.
In user.config I changed

<add key="PostgreSQLConnectionString" value="Server=localhost;Port=5432;Encoding=unicode;User Id=mojouser;Password=mojo123;Database=mojoportal;Pooling=false;CommandTimeout=120;" />

put mi  database, user, etc and modified web.config to advise JIT of ASP.NET

I found connectionStrings with a text editor, but I forgot this.

Thanks.
 

You must sign in to post in the forums. This thread is closed to new posts.