comundus / vfs-maven-plugin

Plugin for the development of OpenCms projects using Maven
GNU Lesser General Public License v2.1
4 stars 5 forks source link

Synchronisation mit hsqldb fehlerhaft / Sync with hsqldb fails #10

Open RaphaelLiskor opened 6 years ago

RaphaelLiskor commented 6 years ago

Hallo,

bei der Arbeit mit dem Plugin gibt es ein Problem, wenn OpenCms mit einer serverless hsqldb betrieben wird. Mit einer MySQL gibt es keine Probleme. Installation des OpenCms erfolgt zuvor mittels setup-scripts.

English Version:

Hello,

I encountered an issue while working with a serveless hsqldb and using this plugin for synchronisation. There is no problem if I use a MySQL DB. OpenCms installation is done via setup-script beforehand.

Fehlermeldung / Error message (Maven):

--------------------
The following critical error occurred:
Critical error during OpenCms initialization: Unable to initialize connection pool "default". Is the database up and running?
Giving up, unable to start OpenCms.
--------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.463 s
[INFO] Finished at: 2017-12-13T16:04:19+01:00
[INFO] Final Memory: 23M/273M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.comundus.maven:vfs-maven-plugin:10.5.2:sync (sync_resources) on project basesetup: Undetermined error executing com.comundus.opencms.VfsSync: Critical error during OpenCms initialization: Unable to initialize connection pool "default". Is the database up and running?: org.hsqldb.jdbcDriver -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Genutzte Konfiguration / Configuration used:

setup.properties


setup.webapp.path=C:\workspaces\basesetup\..\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\basesetup
setup.default.webapp=/opencms
setup.install.components=workplace

db.product=hsqldb
db.provider=hsqldb
db.create.user=sa
db.create.pwd=
db.worker.user=sa
db.worker.pwd=
db.connection.url=jdbc:hsqldb:file:C:\workspaces\basesetup\hsqldb\opencms;shutdown\=false
db.name=basesetup
db.create.db=true
db.create.tables=true
db.dropDb=true
db.default.tablespace=
db.index.tablespace=
db.jdbc.driver=org.hsqldb.jdbcDriver
db.template.db=
db.temporary.tablespace=

server.url=http://localhost
server.name=OpenCmsServer
server.ethernet.address=
server.servlet.mapping=

opencms.properties


#
# Configuration of the driver manager*
#################################################################################
driver.vfs=db
driver.project=db
driver.user=db
driver.history=db
driver.subscription=db

#
# Declaration of database pools
#################################################################################
db.pools=default

#
# Configuration of the default database pool
#################################################################################
# name of the JDBC driver 
db.pool.default.jdbcDriver=org.hsqldb.jdbcDriver

# URL of the JDBC driver
db.pool.default.jdbcUrl=jdbc:hsqldb:file:C:\workspaces\basesetup\hsqldb\opencms;shutdown\=false

# optional parameters for the URL of the JDBC driver
db.pool.default.jdbcUrl.params=?characterEncoding\=UTF-8

# user name to connect to the database
db.pool.default.user=sa

# password to connect to the database
db.pool.default.password=

# the URL to make the JDBC DriverManager return connections from the DBCP pool
db.pool.default.poolUrl=opencms:default

# the maximum number of objects that can be borrowed from the pool
db.pool.default.maxActive=50

# the maximum amount of time before throwing an exception when the pool is exhausted
db.pool.default.maxWait=2000

# the minimum number of objects that will kept connected
db.pool.default.minIdle=5

# the maximum number of objects that can sit idled in the pool
db.pool.default.maxIdle=20

# action to take when the pool is exhausted {grow|block|fail}
db.pool.default.whenExhaustedAction=grow

# connections will be validated before they are borrowed from the pool
db.pool.default.testOnBorrow=false

# connections will be validated by evictor thread
db.pool.default.testWhileIdle=true

# number of milliseconds to sleep between runs of the evictor thread
# -1 means no idle connection evictor thread will be run
db.pool.default.timeBetweenEvictionRuns=3600000

# number of connections tested in a run of the evictor thread
db.pool.default.numTestsPerEvictionRun=3

# minimum amount of time in milliseconds a connection may be idle in the pool before it is eligable for eviction
db.pool.default.minEvictableIdleTime=1800000

# the query to validate connections
#db.pool.default.testQuery=SELECT STRUCTURE_ID FROM CMS_OFFLINE_STRUCTURE WHERE RESOURCE_PATH = '/'
db.pool.default.testQuery=

# number of attempts to connect to the database during startup (default = 10)
db.pool.default.connects=10

# sleep time between two attempts to connect to the database during startup in ms (default = 5000)
db.pool.default.wait=5000

# The pool size for the Entity Manger (only required for JPA)
db.pool.default.entityMangerPoolSize=250

#
# Configuration for statement pooling
#################################################################################
db.statements.default.pooling=true
db.statements.default.maxActive=200
db.statements.default.maxWait=2000
db.statements.default.maxIdle=100
db.statements.default.whenExhaustedAction=grow

#
# Configuration of the database driver manager
#################################################################################
db.name=basesetup

db.vfs.driver=org.opencms.db.hsqldb.CmsVfsDriver
db.vfs.pool=opencms:default
db.vfs.sqlmanager=org.opencms.db.hsqldb.CmsSqlManager

db.project.driver=org.opencms.db.hsqldb.CmsProjectDriver
db.project.pool=opencms:default
db.project.sqlmanager=org.opencms.db.hsqldb.CmsSqlManager

db.user.driver=org.opencms.db.hsqldb.CmsUserDriver
db.user.pool=opencms:default
db.user.sqlmanager=org.opencms.db.hsqldb.CmsSqlManager

db.history.driver=org.opencms.db.hsqldb.CmsHistoryDriver
db.history.pool=opencms:default
db.history.sqlmanager=org.opencms.db.hsqldb.CmsSqlManager

db.subscription.driver=org.opencms.db.hsqldb.CmsSubscriptionDriver
db.subscription.pool=opencms:default
db.subscription.sqlmanager=org.opencms.db.hsqldb.CmsSqlManager

#
# Ethernet address used for UUID generation
# Server name used for various messages
#################################################################################
server.ethernet.address=73:f5:12:57:85:b0
server.name=OpenCmsServer

#
# Enable/Disable OpenCms Setup Wizard
# The wizard sets the flag to false after the setup.
# To use the wizard again, reset it manually to true.
# By setting no value, wizard can always be used.
#################################################################################
wizard.enabled=false

#
# Enable/Disable exception thrown during servlet initialization.
# If disabled there is no attempt to reinitialize the servlet, so the servlet
# container has to be restarted, as required by some servlet containers that
# does not like servlets throwing exceptions during initialization.
# valid values are true, false and auto. default is auto
#################################################################################
servlet.exception.enabled=auto

pom.xml (Auszug / Excerpt)

<plugin>
    <groupId>com.comundus.maven</groupId>
    <artifactId>vfs-maven-plugin</artifactId>
    <version>${vfs-plugin.version}</version>
    <configuration>
        <adminPassword>admin</adminPassword>
        <jspVersion>2.0</jspVersion>
        <servletVersion>2.4</servletVersion>
        <webappDirectory>${basedir}/target/${project.artifactId}-${project.version}</webappDirectory>
    </configuration>
    <executions>
        <execution>
            <id>sync_resources</id>
            <goals>
                <goal>sync</goal>
            </goals>
            <configuration>
                <syncResources>
                    <!-- Path to Synchronize (recursive) -->
                    <syncResource>
                        <resource>/system/modules/</resource>
                        <excludes>
                            <!-- Exclude OpenCms Core-Module Directories from Sync -->
                            <exclude>/system/modules/org.opencms.ade.config/</exclude>
                            <exclude>/system/modules/org.opencms.jquery/</exclude>
                            <exclude>/system/modules/org.opencms.editors.codemirror/</exclude>
                            <exclude>/system/modules/org.opencms.gwt/</exclude>
                            <exclude>/system/modules/org.opencms.jsp.search/</exclude>
                            <exclude>/system/modules/org.opencms.ugc/</exclude>
                            <exclude>/system/modules/org.opencms.workplace/</exclude>
                            <exclude>/system/modules/org.opencms.workplace.administration/</exclude>
                            <exclude>/system/modules/org.opencms.workplace.spellcheck/</exclude>
                            <exclude>/system/modules/org.opencms.workplace.tools.git/</exclude>
                            <exclude>/system/modules/org.opencms.workplace.tools.link/</exclude>
                            <exclude>/system/modules/org.opencms.workplace.tools.modules/</exclude>
                            <exclude>/system/modules/org.opencms.workplace.tools.sites/</exclude>
                        </excludes>
                    </syncResource>
                    <syncResource>
                        <resource>/sites/default</resource>
                    </syncResource>
                    <!-- /Path to Synchronize (recursive) -->
                </syncResources>
                <deleteRFSResources>false</deleteRFSResources>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>${jdbcDriver.groupId}</groupId>
            <artifactId>${jdbcDriver.artifactId}</artifactId>
            <version>${jdbcDriver.version}</version>
        </dependency>
    </dependencies>
</plugin>
veggie4ever commented 6 years ago

Hallo Raphael, wir haben das Plugin nie mit der hsqldb getestet. Wenn Du die passenden SQL-Skripte hast (kommen mit dem Standardinstallationswizard mit), solltest Du in der Lage sein, das komplette Projekt mit dem Plugin zu bauen. Dazu brauchst Du auf jeden Fall auch das opencms-basic-Projekt. Dort ist dann wichtig, die richtige Datenbankverbindung anzugeben. In der Datei https://github.com/comundus/opencms-basic/blob/master/parent/pom.xml gibt es ein Profil für mysql. An diesem kannst Du Dich orientieren und ein eigenes Profil für hsql anlegen. Nicht vergessen, die Dependency für den Datenbanktreiber in der POM anzugeben. Solltest Du eine laufähige Version hinbekommen, ist ein Pull request von Dir herzlich willkommen. Viele Grüße und frohe Weihnachten veggie

veggie4ever commented 6 years ago

Sorry. Wollte eigentlich nur kommentieren.