Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm backend:dev expects a psql on localhost:5432 #720

Open
landryb opened this issue Nov 12, 2024 · 2 comments
Open

npm backend:dev expects a psql on localhost:5432 #720

landryb opened this issue Nov 12, 2024 · 2 comments

Comments

@landryb
Copy link
Member

landryb commented Nov 12, 2024

Describe the bug
developing in the mapstore2 submodule uses an h2 database so npm start works ootb by default.

Would it be possible/better to use an h2 database in the ms2-georchestra project instead of expecting a psql database on localhost ?

@Gaetanbrl @pierrejego what do you think about it ?

@landryb
Copy link
Member Author

landryb commented Nov 12, 2024

trying locally this:

diff --git a/web/src/main/resources/applicationContext.xml b/web/src/main/resources/applicationContext.xml
index d4f1984..358401c 100644
--- a/web/src/main/resources/applicationContext.xml
+++ b/web/src/main/resources/applicationContext.xml
@@ -127,15 +127,8 @@
                <property name="ignoreUnresolvablePlaceholders" value="true"/>
        </bean>
     <bean id="georchestraDataSource" class="org.apache.commons.dbcp.BasicDataSource">
-        <property name="driverClassName" value="org.postgresql.Driver" />
-        <property name="url" value="jdbc:postgresql://${pgsqlHost:localhost}:${pgsqlPort:5432}/${pgsqlDatabase:georchestra}" />
-        <property name="username" value="${pgsqlUser:postgres}" />
-        <property name="password" value="${pgsqlPassword:}" />
-        <property name="initialSize" value="${dataSource.initialSize:0}" />
-        <property name="minIdle" value="${dataSource.minIdle:0}" />
-        <property name="maxIdle" value="${dataSource.maxIdle:8}" />
-        <property name="minEvictableIdleTimeMillis" value="${dataSource.minEvictableIdleTimeMillis:180000}" />
-        <property name="timeBetweenEvictionRunsMillis" value="${dataSource.timeBetweenEvictionRunsMillis:3000}" />
+        <property name="driverClassName" value="org.h2.Driver" />
+        <property name="url" value="jdbc:h2:./test"/>
     </bean>
     <bean id="georchestraEntityManagerFactory"
                 class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
@@ -155,7 +148,7 @@
                 <entry key="hibernate.connection.autocommit" value="true"/>
                 <entry key="hibernate.generate_statistics" value="false"/>
                 <entry key="hibernate.hbm2ddl.auto" value="update" />
-                <entry key="hibernate.default_schema" value="${pgsqlGeoStoreSchema:geostore}" />
+<!--                <entry key="hibernate.default_schema" value="${pgsqlGeoStoreSchema:geostore}" /> -->
             </map>
         </property>
     </bean>

npm backend:dev starts and creates a .h2 file in ./web/target/apache-tomcat-8.5.69/test.h2.db

@landryb
Copy link
Member Author

landryb commented Nov 12, 2024

see sample in the doc pr in #721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant