views:

29

answers:

2

We're deploying the same web application multiple times on the same weblogic domain, for multiple test environments.

Even though we use different servers and ports, we find it convenient to use different names to easily identify the deployed application. So far, we've put the environment name in the application name, between brackets, like this:

Applic[DEV]
Applic[SIT1]
Applic[SIT2]

Until today, it worked like a charm. But now we're facing an issue when redeploying an application. I'm not sure what we could have changed that causes this problem.

The exception we get is:

java.net.URISyntaxException: Illegal character in path at index 65: file:/APPLICdev1/applicDomain/servers/SIT2/tmp/_WL_user/ApplicWeb[Sit2]/gp8nae/war/WEB-INF/lib/applicCommons-RELEASE.jar

According to the W3C (here) the character in question "[" is supposed to be a valid character, reserved but valid. We solved the issue by removing the brackets but I'm curious to understand the cause of this problem.

Thanks

+1  A: 

As stated in RFC3986, [ and ] are reserved characters which are valid only in IPv6 address representation:

3.2.2. Host
...
A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax.

So, in other places they should be escaped.

However, it doesn't explain behaviour of Weblogic regarding file names. Perhaps it's a bug caused by using new URI(...) instead of new File(...).toURI() for creating file:/ URIs.

axtavt
It's not totally true, `[` and `]` *can* be used for later IP addresses versions, but it depends on the implementation.
Colin Hebert
+1  A: 

Your content doesn't match the required content of a '[' ']' bloc.

IPv6 addresses are permitted for the host component. An IPv6 address must be enclosed in square brackets ('[' and ']') as specified by RFC 2732. The IPv6 address itself must parse according to RFC 2373. IPv6 addresses are further constrained to describe no more than sixteen bytes of address information, a constraint implicit in RFC 2373 but not expressible in the grammar.

And as the RFC states :

A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax. In anticipation of future, as-yet-undefined IP literal address formats, an implementation may use an optional version flag to indicate such a format explicitly rather than rely on heuristic determination.

IP-literal = "[" ( IPv6address / IPvFuture  ) "]"
IPvFuture  = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

The java.net.URI implementation considers "[]" valid for IPV6 only.


Resources :

Colin Hebert