0

I'm a newbie to mapbender and need some help. I installed apache 2.4.27, php 7.1.10, mapbender 3.0.6.3 succesfully and connect to my DB oracle 12g works fine. I used this manual> https://doc.mapbender3.org/en/book/installation/installation_windows.html Admin console works fine http://localhost:83/mapbender3/app.php. But when I add a new wms source an error occurs >

[2017-10-30 12:44:57] request.INFO: Matched route "mapbender_manager_repository_create". {"route_parameters":{"_controller":"Mapbender\ManagerBundle\Controller\RepositoryController::createAction","managertype":"wms","_route":"mapbender_manager_repository_create"},"request_uri":"http://localhost:83/mapbender3/app.php/manager/repository/create/wms"} [] [2017-10-30 12:44:57] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area"} [] [2017-10-30 12:44:57] security.DEBUG: User was reloaded from a user provider. {"username":"root","provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider"} [] [2017-10-30 12:44:57] security.DEBUG: No ACL found for the object identity. Voting to deny access. [] [] [2017-10-30 12:44:57] security.DEBUG: No ACL found for the object identity. Voting to deny access. [] [] [2017-10-30 12:44:59] app.DEBUG: CommonProxy->createBrowser rowUrl:Array ( [scheme] => http [host] => xxx.xxx.x.xxx [port] => xxxx [path] => /mapviewer/wms ) [] [] [2017-10-30 12:44:59] app.DEBUG: CommonProxy->handle GET:http://ipadresse:port/mapviewer/wms?REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1 [] [] [2017-10-30 12:44:59] app.DEBUG: CommonProxy->handle Headers: Array ( [Host] => 192.168.0.125 ) [] [] [2017-10-30 12:45:11] app.ERROR: Element 'WMT_MS_Capabilities': No matching global declaration available for the validation root. [] [] [2017-10-30 12:45:11] app.ERROR: mb.wms.repository.parser.not_valid_xsd [] [] [2017-10-30 12:45:11] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

When I add a new application an error occurs >

[2017-10-30 14:05:49] request.INFO: Matched route "mapbender_manager_application_create". {"route_parameters":{"_controller":"Mapbender\ManagerBundle\Controller\ApplicationController::createAction","_route":"mapbender_manager_application_create"},"request_uri":"http://localhost:83/mapbender3/app.php/manager/application"} [] [2017-10-30 14:05:49] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area"} [] [2017-10-30 14:05:50] security.DEBUG: User was reloaded from a user provider. {"username":"root","provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider"} [] [2017-10-30 14:05:50] security.DEBUG: Object identity unavailable. Voting to grant access. [] [] [2017-10-30 14:05:51] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing 'INSERT INTO mb_core_application (id, title, slug, description, template, published, screenshot, extra_assets, updated, custom_css) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [4, "Maja GIS", "majagis", "Maja's GIS playground :) Let's play.", "Mapbender\CoreBundle\Template\Fullscreen", 0, null, "N;", "2017-10-30 14:05:51", null]: ORA-01843: not a valid month" at D:\MapBender3\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractOracleDriver.php line 76 {"exception":"[object] (Doctrine\DBAL\Exception\DriverException(code: 0): An exception occurred while executing 'INSERT INTO mb_core_application (id, title, slug, description, template, published, screenshot, extra_assets, updated, custom_css) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [4, \"Maja GIS\", \"majagis\", \"Maja's GIS playground :) Let's play.\", \"Mapbender\\CoreBundle\\Template\\Fullscreen\", 0, null, \"N;\", \"2017-10-30 14:05:51\", null]:\n\nORA-01843: not a valid month at D:\MapBender3\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractOracleDriver.php:76, Doctrine\DBAL\Driver\OCI8\OCI8Exception(code: 0): ORA-01843: not a valid month at D:\MapBender3\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\OCI8\OCI8Exception.php:33)"} [] [2017-10-30 14:05:51] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

I need this nls params in oracle >

NLS_DATE_FORMAT DD.MM.RR NLS_TIME_FORMAT HH24:MI:SSXFF NLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF

So I set php.ini for mapbender (+restart apache) >

date.timezone = Europe/Bratislava

; Default timestamp format. ibase.timestampformat = "%d.%m.%Y %H:%M:%S" ; Default date format. ibase.dateformat = "%d.%m.%Y" ; Default time format. ibase.timeformat = "%H:%M:%S"

When I click on "view mapbender demo map" an error occurs >

[2017-10-30 14:25:16] request.INFO: Matched route "mapbender_core_application_application". {"route_parameters":{"_format":"html","_controller":"Mapbender\CoreBundle\Controller\ApplicationController::applicationAction","slug":"mapbender_user","_route":"mapbender_core_application_application"},"request_uri":"http://localhost:83/mapbender3/app.php/application/mapbender_user"} [] [2017-10-30 14:25:16] security.DEBUG: Read existing security token from the session. {"key":"_security_secured_area"} [] [2017-10-30 14:25:16] security.DEBUG: User was reloaded from a user provider. {"username":"root","provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider"} [] [2017-10-30 14:25:17] security.DEBUG: Object identity unavailable. Voting to grant access. [] [] [2017-10-30 14:25:17] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("ObjectIdentity(layertree-button, Mapbender\CoreBundle\Entity\Element) is already associated with an ACL.")." at D:\MapBender3\mapbender\src\Mapbender\CoreBundle/Resources/views/Template/fullscreen.html.twig line 33 {"exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"ObjectIdentity(layertree-button, Mapbender\CoreBundle\Entity\Element) is already associated with an ACL.\"). at D:\MapBender3\mapbender\src\Mapbender\CoreBundle/Resources/views/Template/fullscreen.html.twig:33, Symfony\Component\Security\Acl\Exception\AclAlreadyExistsException(code: 0): ObjectIdentity(layertree-button, Mapbender\CoreBundle\Entity\Element) is already associated with an ACL. at D:\MapBender3\vendor\symfony\security-acl\Dbal\MutableAclProvider.php:55)"} [] [2017-10-30 14:25:17] security.DEBUG: Stored the security token in the session. {"key":"_security_secured_area"} []

I read mapbender documentation and forums but I can't move forward.

  • Did you post on the User mailing list? – TurboGraphxBeige Oct 30 '17 at 23:08
  • @Gob Tron: Hi, I don't know. How can I change it ? Thank you. – GeoLady Oct 31 '17 at 8:24
  • No no, I mean, Mapbender 3 has a user mailing list. You could check on the website to subscribe to it. Some devs are quite active on it and it helped me a lot in the past. – TurboGraphxBeige Oct 31 '17 at 11:42
  • What does it say here?: localhost/mapbender3/config.php – TurboGraphxBeige Oct 31 '17 at 11:53
  • @Gob Tron: Thank you, I will try that user mailing list. config.php is without errors - 1.a PHP accelerator should be installed Install and/or enable a PHP accelerator (highly recommended). – GeoLady Oct 31 '17 at 14:45
2

What is the datatype of column PUBLISHED ? Is it DATE or TIMESTAMP ?

As you indicate, the problem is with the default format for dates (and/or timestamps) used in your database. You can change that by altering the NLS_DATE_FORMAT (and/or NLS_TIMESTAMP_FORMAT) parameter.

1) The parameter can be changed globally in the database for all users:

Connect as SYSTEM or SYS, then:

alter system set NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS' scope=spfile;
alter system set NLS_TIME_FORMAT='HH24:MI:SSXFF' scope=spfile;
alter system set NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SSXFF' scope=spfile;
alter system set NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SSXFF TZR' scope=spfile;
alter system set NLS_TIME_TZ_FORMAT='HH:MI:SSXFF TZR' scope=spfile;

That only takes effect after you stopped and restart your database.

The side effect is that from now on all your applications will use those formats both for displaying dates and for entering them.

2) You can change the parameters for the current session only:

alter session set NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
alter session set NLS_TIME_FORMAT='HH24:MI:SSXFF';
alter session set NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SSXFF';
alter session set NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SSXFF TZR';
alter session set NLS_TIME_TZ_FORMAT='HH:MI:SSXFF TZR';

That is possible if you can get Mapbender to automatically execute selected SQL commands when it connects.

3) You can change it also for the current session by setting environment variables:

export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
export NLS_TIME_FORMAT='HH24:MI:SSXFF'
export NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SSXFF'
export NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SSXFF TZR'
export NLS_TIME_TZ_FORMAT='HH:MI:SSXFF TZR'

You should be able to set those in the environment of the process that launches the Mapbender server.

  • That column is UPDATED and datatype TIMESTAMP(0) NOT NULL. I can't change DB nls params because of other apps. I will try set envir.variables for mapbender session. thx – GeoLady Oct 31 '17 at 14:54
  • Yes, sorry, I meant the UPDATED column. – Albert Godfrind Oct 31 '17 at 16:30
0

Albert Godfrind's answer pointed in the right direction. To work with Mapbender or in general doctrine and Oracle, you need the doctrine oracle session listener. You have to register it as a service in your config.yml with this code snippet.

services: oracle.session.listener: class: Doctrine\DBAL\Event\Listeners\OracleSessionInit tags: - { name: doctrine.event_listener, event: postConnect }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.