views:

122

answers:

2

The ClassLoader doesn't find me the file. It throws a:

javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException: java.io.FileNotFoundException:

I was trying to do the follwoing:

TransformerFactory.newInstance().newTransformer(new StreamSource("C:\\dev\\workspace\\test1\\a#b\\Browser-Email.xslt"))
+3  A: 

That is because the StreamSource(string) constructor takes an URI, not a file name and # has special meaning in URIs:

StreamSource

public StreamSource(String systemId)

Construct a StreamSource from a URL.

Parameters:
systemId - Must be a String that conforms to the URI syntax.

You can use

new StreamSource(new File("C:\\dev\\workspace\\test1\\a#b\\Browser-Email.xslt"))

instead.

Joey
+1  A: 

Here is workaround for above problem http://bugs.sun.com/bugdatabase/view%5Fbug.do?bug%5Fid=4294586

valli