Lucee/Tomcat v. Lucee/Jetty H2 Embedded Mode Issue ...

161 views
Skip to first unread message

Steve Withington

unread,
Mar 9, 2015, 6:53:23 PM3/9/15
to lu...@googlegroups.com
When I create a H2 Database in Embedded Mode on Lucee/Jetty, the h2 files are placed in the appropriately named path. For example, if I specify path=db/ when creating a datasource via the Lucee Admin, a "db/" directory is created relative to the Lucee/Jetty directory structure and the h2 files are placed there.

However, on Lucee/Tomcat, using the same exact setup, the path is not created relative to the Lucee/Tomcat directory structure, and the h2 files are placed elsewhere on the OS filesystem.

Is this expected? Or, is there some variable/syntax I should use for the Lucee/Tomcat setup to have the files created relative to its directory structure?

Thanks,
Steve


Jeroen Knoef

unread,
Mar 10, 2015, 6:40:58 AM3/10/15
to lu...@googlegroups.com
Hi Steve,

Does it work if you create the datasource programmatically, like this:

this.datasources.myDatasource = {
class: "org.h2.Driver",
connectionString: "jdbc:h2:#myPath#;MODE=MySQL",
username: "sa",
password: ""
}

This works for me (although I'm not using Jetty). Or you could edit the connection string directly in the admin.

Are you sure Jetty and Tomcat are on the same jar versions?

Steve Withington

unread,
Mar 10, 2015, 12:43:52 PM3/10/15
to lu...@googlegroups.com
This is strange. So, when I create the datasource programmatically, a folder is created just under my Lucee/Tomcat Express directory. However, when I create it using the UI, it doesn't get created there, like I would expect it to be, even though the path is the same. The "db/" directory gets created elsewhere on my filesystem.

Steve Withington

unread,
Mar 10, 2015, 12:46:41 PM3/10/15
to lu...@googlegroups.com
@Jeroen, and yes, I've verified that both the Lucee/Tomcat Express and Lucee/Jetty Express are both using the same H2 jar file (v1.3.172).


On Tuesday, March 10, 2015 at 5:40:58 AM UTC-5, Jeroen Knoef wrote:

denstar

unread,
Mar 12, 2015, 2:39:57 PM3/12/15
to lu...@googlegroups.com
This is a result of the different containers resolving "/" differently,
I believe. If you use an absolute path, you should be good to go I
think. Somebody asked for the "tokens" like {lucee-web} to work
/everywhere/, which I think would be fantastic, and go a long way
towards being able to abstract various settings like these.

-Denny
> --
> You received this message because you are subscribed to the Google
> Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lucee+un...@googlegroups.com
> <mailto:lucee+un...@googlegroups.com>.
> To post to this group, send email to lu...@googlegroups.com
> <mailto:lu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/b8f36091-f195-427a-884c-aeb2d1fdbc57%40googlegroups.com
> <https://groups.google.com/d/msgid/lucee/b8f36091-f195-427a-884c-aeb2d1fdbc57%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages