You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Ludwig <ge...@gmail.com> on 2011/09/27 10:43:51 UTC
selenium hijacks TransformerFactory and breaks XML pretty print...wtf?
I've been ripping my hair out the last few hours trying to figure out
why my XML pretty print stopped working under Tapestry...
I'm running Eclipe 3.7, JDK 1.6, and Tapestry 5.2.5 on Jetty 6.1.26
I created the project using one of the maven Tapestry 5 prototypes,
and it included selenium server standalone and core 1.0.3 via
Tapestry-Test 5.2.5.
When I run the app, I can see that when I hit my pretty print code,
the selenium server jar contains the class
javax.xml.transform.TransformerFactory. It must be some ancient
version of Xalan embedded in there that's causing the problem.
I deleted the two selenium jars from my classpath, and now my app
works fine (so far), but what is the best long term solution? What are
the selenium jars actually used for? What does it take to get the
Tapestry build on a more modern version of selenium (I think it's up
to 2.7 at this point)? Finally, (this is a rhetorical question), WTF
is some alternate version of javax.xml.transform.TransformerFactory
embedded in the selenium jars?!
Best,
George
For reference, here's the Pretty print code:
TransformerFactory transformerFactory=TransformerFactory.newInstance();
transformerFactory.setAttribute("indent-number", 3);
Transformer transformer=transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
//initialize StreamResult with File object to save to file
StreamResult result = new StreamResult(new StringWriter());
DOMSource source = new DOMSource(document);
transformer.transform(source, result);
String xmlString = result.getWriter().toString();
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: selenium hijacks TransformerFactory and breaks XML pretty print...wtf?
Posted by George Ludwig <ge...@gmail.com>.
Steve,
For the time being, that works, yet the rub comes later on when I will
actually want to use the testing stuff. Other than hacking the
selenium jar to remove the code (which may break selenium for all I
know), I'm unsure of how to address this problem.
Frankly, I'm shocked that selenium over-rides core java classes...that
was just a bad idea from the get-go.
-George
On Tue, Sep 27, 2011 at 1:49 AM, Steve Eynon
<st...@alienfactory.co.uk> wrote:
> As you say, it's the tapestry-test module that references selenium
> (via a Maven test dependency). If you don't use it, then you could
> exclude it from your Maven POM.
>
>
>
>
> On 27 September 2011 16:43, George Ludwig <ge...@gmail.com> wrote:
>> I've been ripping my hair out the last few hours trying to figure out
>> why my XML pretty print stopped working under Tapestry...
>>
>> I'm running Eclipe 3.7, JDK 1.6, and Tapestry 5.2.5 on Jetty 6.1.26
>>
>> I created the project using one of the maven Tapestry 5 prototypes,
>> and it included selenium server standalone and core 1.0.3 via
>> Tapestry-Test 5.2.5.
>>
>> When I run the app, I can see that when I hit my pretty print code,
>> the selenium server jar contains the class
>> javax.xml.transform.TransformerFactory. It must be some ancient
>> version of Xalan embedded in there that's causing the problem.
>>
>> I deleted the two selenium jars from my classpath, and now my app
>> works fine (so far), but what is the best long term solution? What are
>> the selenium jars actually used for? What does it take to get the
>> Tapestry build on a more modern version of selenium (I think it's up
>> to 2.7 at this point)? Finally, (this is a rhetorical question), WTF
>> is some alternate version of javax.xml.transform.TransformerFactory
>> embedded in the selenium jars?!
>>
>> Best,
>>
>> George
>>
>> For reference, here's the Pretty print code:
>>
>> TransformerFactory transformerFactory=TransformerFactory.newInstance();
>> transformerFactory.setAttribute("indent-number", 3);
>> Transformer transformer=transformerFactory.newTransformer();
>> transformer.setOutputProperty(OutputKeys.INDENT, "yes");
>> //initialize StreamResult with File object to save to file
>> StreamResult result = new StreamResult(new StringWriter());
>> DOMSource source = new DOMSource(document);
>> transformer.transform(source, result);
>> String xmlString = result.getWriter().toString();
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: selenium hijacks TransformerFactory and breaks XML pretty print...wtf?
Posted by Steve Eynon <st...@alienfactory.co.uk>.
As you say, it's the tapestry-test module that references selenium
(via a Maven test dependency). If you don't use it, then you could
exclude it from your Maven POM.
On 27 September 2011 16:43, George Ludwig <ge...@gmail.com> wrote:
> I've been ripping my hair out the last few hours trying to figure out
> why my XML pretty print stopped working under Tapestry...
>
> I'm running Eclipe 3.7, JDK 1.6, and Tapestry 5.2.5 on Jetty 6.1.26
>
> I created the project using one of the maven Tapestry 5 prototypes,
> and it included selenium server standalone and core 1.0.3 via
> Tapestry-Test 5.2.5.
>
> When I run the app, I can see that when I hit my pretty print code,
> the selenium server jar contains the class
> javax.xml.transform.TransformerFactory. It must be some ancient
> version of Xalan embedded in there that's causing the problem.
>
> I deleted the two selenium jars from my classpath, and now my app
> works fine (so far), but what is the best long term solution? What are
> the selenium jars actually used for? What does it take to get the
> Tapestry build on a more modern version of selenium (I think it's up
> to 2.7 at this point)? Finally, (this is a rhetorical question), WTF
> is some alternate version of javax.xml.transform.TransformerFactory
> embedded in the selenium jars?!
>
> Best,
>
> George
>
> For reference, here's the Pretty print code:
>
> TransformerFactory transformerFactory=TransformerFactory.newInstance();
> transformerFactory.setAttribute("indent-number", 3);
> Transformer transformer=transformerFactory.newTransformer();
> transformer.setOutputProperty(OutputKeys.INDENT, "yes");
> //initialize StreamResult with File object to save to file
> StreamResult result = new StreamResult(new StringWriter());
> DOMSource source = new DOMSource(document);
> transformer.transform(source, result);
> String xmlString = result.getWriter().toString();
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org