You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Peter Kilian <pi...@googlemail.com> on 2012/03/29 15:06:27 UTC
Problem with the http feature on Windows
Hallo,
i try to deploy my web application to Karaf 3.0.0-SNAPSHOT, but he
application failed to load the resources.
I checked the code, in my opinion the Problem is in the pax-web
ResorceServlet.
There is following code (in my source version line 97)
if (!"default".equalsIgnoreCase(m_name))
mapping = mapping.replaceFirst(m_alias, m_name);
The variable m_name is for me:
"C:\java\apache-karaf-3.0.0-SNAPSHOT\data\cache\bundle168\data\rwtcontext_30827939_1554794/rwt-resources"
The problem is that "\", the separator character on windows, is a
special Character for regular expressions.
After the call of String.replaceFirst, all "\" are lost and the result ist
an invalid
path: C:javaapache-karaf-3.0.0-SNAPSHOTdatacachebundle168datarwtcontext_30827939_1554794/rwt-resources/rap-client-cc82b8ac.js
The JavaDoc to String.replaceFirst suggest the use of
java.util.regex.Matcher.quoteReplacement() if desired. I can image this
will fix the problem.
Best Regards
Peter
Re: Problem with the http feature on Windows
Posted by Achim Nierbeck <bc...@googlemail.com>.
Thanx for reporting I opened a issue for it at Pax-Web
http://team.ops4j.org/browse/PAXWEB-359
regards, Achim
2012/3/29 Peter Kilian <pi...@googlemail.com>:
> Hallo,
>
> i try to deploy my web application to Karaf 3.0.0-SNAPSHOT, but he
> application failed to load the resources.
> I checked the code, in my opinion the Problem is in the pax-web
> ResorceServlet.
> There is following code (in my source version line 97)
>
> if (!"default".equalsIgnoreCase(m_name))
> mapping = mapping.replaceFirst(m_alias, m_name);
>
>
> The variable m_name is for me:
> "C:\java\apache-karaf-3.0.0-SNAPSHOT\data\cache\bundle168\data\rwtcontext_30827939_1554794/rwt-resources"
> The problem is that "\", the separator character on windows, is a
> special Character for regular expressions.
> After the call of String.replaceFirst, all "\" are lost and the result ist
> an invalid
> path: C:javaapache-karaf-3.0.0-SNAPSHOTdatacachebundle168datarwtcontext_30827939_1554794/rwt-resources/rap-client-cc82b8ac.js
>
> The JavaDoc to String.replaceFirst suggest the use of
> java.util.regex.Matcher.quoteReplacement() if desired. I can image this will
> fix the problem.
>
> Best Regards
>
> Peter
>
>
>
--
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/>