That sounds like our code for checking for relative url is not working
great when it contains an environment variable. I am surprised that the
environment variable has not been replaced before it gets to the h2 code

On Thu, 23 Jan 2025 at 22:53, 'philfrei1' via H2 Database <
[email protected]> wrote:

> I have a Spring Boot project meant to run on a remote server. The project
> interacts with the H2 database correctly when I run the following command
> from the ssh shell:
>     *java -jar shiftstarts-0.0.1.jar*
>
> When I run this same command using systemd (*sudo systemctl start
> shiftstarts*) I get the following error:
> *unable to obtain isolated JDBC connection [A file path that is implicitly
> relative to the current working directory is not allowed in the database
> URL "jdbc:h2:file:${PATH_TO_SHIFTSTARTSDB}". Use an absolute path... *
>
> The application.properties file has the following line:
>
> *spring.datasource.url=jdbc:h2:file:${PATH_TO_SHIFTSTARTSDB}*
>
> *PATH_TO_SHIFTSTARTSDB* is defined as "*/var/lib/shiftstarts/ShiftStartDB*
> ".
>
> Any thoughts on why the error message turns up on the systemd start but is
> fine when executing the java -jar command from the ssh shell? Are there
> additional lines I need to add to the configuration? Is the syntax for the
> use of the environment variable correct?
>
> What exactly does "implicitly relative" mean in this context? The address
> given, assuming the environment variable is properly expanded, is absolute,
> is it not? Is the variable not expanding when running from the systemd
> wrapper?
>
> I wonder if this might be more a *systemd *issue than an H2 issue,
> though, since the expansion only fails (afaik) during the systemd start.
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/h2-database/3ae263c6-c5ff-4734-aec8-7062ec84e4fan%40googlegroups.com
> <https://groups.google.com/d/msgid/h2-database/3ae263c6-c5ff-4734-aec8-7062ec84e4fan%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/h2-database/CAFYHVnUtCE-8Nuicm4d0XRQbcR_K1ZVu1CXVYz9BpthJwc1QQA%40mail.gmail.com.

Reply via email to