Issue Details (XML | Word | Printable)

Key: CARGO-568
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Adrian Cole
Reporter: Jason Royals
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Cargo

Datasource definition containing backslashes causes problems in server.xml generation

Created: 27/Mar/08 07:56 AM   Updated: 06/Mar/09 09:02 AM
Component/s: Tomcat
Affects Version/s: 0.3.1-maven2
Fix Version/s: 1.0

Time Tracking:
Not Specified

Environment: Windows

Complexity: Intermediate
Tested on JDKs: 1.5, 1.6


 Description  « Hide
I am using Cargo to set up Tomcat with a JDBC connection to a HSQLDB file-based database in a multi-module project.

For a number of reasons, we need to use ${project.build.directory} in the JDBC URL string. However, putting this in the pom...

<cargo.datasource.datasource>
    cargo.datasource.url=jdbc:hsqldb:file:${project.build.directory}/database/db|
     ... other properties ...
</cargo.datasource.datasource>

... does not generate a valid conf/server.xml file under Windows. Imagine my project's target directory is C:\foo\bar\baz\target - this is the result...

Server.xml
<Resource url='jdbc:hsqldb:file:C:foobarbaz    arget/database/db'
                     ...other attrs.../>

This will obviously cause an error on container startup - the backslashes are not being escaped correctly and so the database cannot be found. There are no workarounds for us as far as I know.

One solution might be to escape the backslashes in the string, similar to how the Maven Resources plugin works: http://maven.apache.org/plugins/maven-resources-plugin/xref/org/apache/maven/plugin/resources/ReflectionProperties.html#62.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Adrian Cole added a comment - 08/Dec/08 06:27 PM
thanks for specifying the issue so clearly. this is now covered by unit tests

Philip Peitsch added a comment - 26/Feb/09 06:15 PM
Has this been fixed yet? What release version should I be looking for to avoid this issue?

Adrian Cole added a comment - 26/Feb/09 08:22 PM
this is available in the current beta, or 1.0-SNAPSHOT

Philip Peitsch added a comment - 05/Mar/09 10:36 PM
Hello again. I was just wondering where can I download the current snapshot from? The current beta (1.0-beta-2) was released early December sometime and does not appear to fix the issue.

Matt Wringe added a comment - 06/Mar/09 09:02 AM
http://snapshots.repository.codehaus.org/

I guestion like this should have been asked on one of the mailing lists instead of in the jira.