You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Anders Hammar (JIRA)" <ji...@apache.org> on 2007/02/01 13:46:02 UTC
[jira] Updated: (SM-829) Incorrect file encoding of created jbi.xml
[ https://issues.apache.org/activemq/browse/SM-829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anders Hammar updated SM-829:
-----------------------------
Attachment: JbiServiceUnitDescriptorWriterTest.java
Minor update the the test case clarifying the todo comment.
> Incorrect file encoding of created jbi.xml
> ------------------------------------------
>
> Key: SM-829
> URL: https://issues.apache.org/activemq/browse/SM-829
> Project: ServiceMix
> Issue Type: Bug
> Components: tooling
> Affects Versions: 3.0, 3.0.1, 3.1
> Environment: Win XP, JDK 1.5.0_10
> Reporter: Anders Hammar
> Attachments: JbiServiceUnitDescriptorWriterTest.java, JbiServiceUnitDescriptorWriterTest.java
>
>
> When the jbi.xml file is created by the jbi-maven-plugin tool, the file encoding isn't specified (the xml encoding for the xml header is defined though). As a FileWriter is used, the default system encoding is used which does not work for special characters.
> I've attached a test case that shows this for the JbiServiceUnitDescriptorWriter class. However, the same problem exists in all DescriptorWriter classes. The affected classes are:
> JbiComponentDescriptorWriter
> JbiServiceAssemblyDescriptorWriter
> JbiServiceUnitDescriptorWriter
> JbiSharedLibraryDescriptorWriter
> One solution is to change the used FileWriter to a PrintWriter and pass the encoding to the PrintWriter constructor. Like this:
> {code:title=JbiServiceUnitDescriptorWriter.java|borderStyle=solid}
> //...
> public void write(File descriptor, boolean bc, String name, String description, List uris, List consumes, List provides)
> throws JbiPluginException {
> PrintWriter w;
> try {
> w = new PrintWriter(descriptor, encoding);
> } catch (IOException ex) {
> throw new JbiPluginException("Exception while opening file[" + descriptor.getAbsolutePath() + "]", ex);
> }
> //...
> }
> //...
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.