[Mapbender-users] Mapbender3: Searchrouter/additional database connection

Uwe Seher uwe.seher at gmail.com
Fri Jan 13 01:05:09 PST 2017


Hello again!

I an trying to set up a search function in my application with the search
router element.
For this i had setup an additional database connection following teh
desctioption in the documentation with the following parameters:

parameters.yml:

parameters:
    # Default-Datenbank
    database_driver:   pdo_pgsql
    database_host:     192.168.1.3
    database_port:     5432
    database_name:     mapbender3
    database_path:     ~
    database_user:     mapbender
    database_password: xxxx

    # Rhein-Datenbank
    database1_driver:   pdo_pgsql
    database1_host:     192.168.1.3
    database1_port:     5432
    database1_name:     rhein
    database1_path:     ~
    database1_user:     gdi_user
    database1_password: xxxx

config.yml:

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   %database_driver%
                host:     %database_host%
                port:     %database_port%
                dbname:   %database_name%
                path:     %database_path%
                user:     %database_user%
                password: %database_password%
                charset:  UTF8
                logging: %kernel.debug%
                profiling: %kernel.debug%
            rhein:
                driver:   %database1_driver%
                host:     %database1_host%
                port:     %database1_port%
                dbname:   %database1_name%
                path:     %database1_path%
                user:     %database1_user%
                password: %database1_password%
                charset:  UTF8
                logging: %kernel.debug%
                profiling: %kernel.debug%
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

The search-dialog parameters look like this:

class: Mapbender\CoreBundle\Component\SQLSearchEngine
class_options:
    connection: rhein
    relation: mrh_1509.engstellen
    attributes:
        - objectid
        - name
    geometry_attribute: geom
form:
    name:
        type: choice
        options:
            empty_value: 'Bitte wählen'
            required: true
            choices:
                1: 'Reg.Bereich 1'
                2: 'Reg.Bereich 2'
                3: 'Reg.Bereich 3'
                4: 'Reg.Bereich 3'
                5: 'Reg.Bereich 5'
                6: 'Reg.Bereich 6'
                7: 'Reg.Bereich 6'
results:
    view: table
    count: true
    headers:
        objectid: ID
        name: Name
    callback:
        event: click
        options:
            buffer: 10
            minScale: null
            maxScale: null

The dialog itself works fine, but no results are found. In the logfile i
found this entry:

[2017-01-13 08:45:04] request.CRITICAL: Uncaught PHP Exception
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
"You have requested a non-existent service
"doctrine.dbal.rhein_connection". Did you mean this:
"doctrine.dbal.default_connection"?" at
/srv/www/htdocs/mapbender3-3.0.5.3/app/bootstrap.php.cache line 2063
{"exception":"[object]
(Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException(code:
0): You have requested a non-existent service
\"doctrine.dbal.rhein_connection\". Did you mean this:
\"doctrine.dbal.default_connection\"? at
/srv/www/htdocs/mapbender3-3.0.5.3/app/bootstrap.php.cache:2063)"} []

So i think, the second database connection is not etablished. If i use the
parameters with other applications or psql everything works. Restarting
apache has no effect. It would be great if someone has a hint what i missed
here.

Thanks in advance

Uwe Seher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapbender_users/attachments/20170113/a2d762f1/attachment.html>


More information about the Mapbender_users mailing list