[jira] [Updated] (HADOOP-7614) Reloading configuration when using imputstream resources results in org.xml.sax.SAXParseException

2015-05-08 Thread Ajith S (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-7614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ajith S updated HADOOP-7614:

Labels:   (was: BB2015-05-TBR)

 Reloading configuration when using imputstream resources results in 
 org.xml.sax.SAXParseException
 -

 Key: HADOOP-7614
 URL: https://issues.apache.org/jira/browse/HADOOP-7614
 Project: Hadoop Common
  Issue Type: Bug
  Components: conf
Affects Versions: 0.21.0
Reporter: Ferdy Galema
Priority: Minor
 Fix For: 2.7.0

 Attachments: HADOOP-7614-v1.patch, HADOOP-7614-v2.patch


 When using an inputstream as a resource for configuration, reloading this 
 configuration will throw the following exception:
 Exception in thread main java.lang.RuntimeException: 
 org.xml.sax.SAXParseException: Premature end of file.
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1576)
   at 
 org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1445)
   at 
 org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1381)
   at org.apache.hadoop.conf.Configuration.get(Configuration.java:569)
 ...
 Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at 
 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
   at 
 com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
   at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1504)
   ... 4 more
 To reproduce see following testcode:
 Configuration conf = new Configuration();
 ByteArrayInputStream bais = new 
 ByteArrayInputStream(configuration/configuration.getBytes());
 conf.addResource(bais);
 System.out.println(conf.get(blah));
 conf.addResource(core-site.xml); //just add a named resource, doesn't 
 matter which one
 System.out.println(conf.get(blah));
 Allowing inputstream resources is flexible, but in cases such as this in can 
 lead to difficult to debug problems.
 What do you think is the best solution? We could:
 A) reset the inputstream after it is read instead of closing it (but what to 
 do when the stream does not support marking?)
 B) leave it up to the client (for example make sure you implement close() so 
 that it resets the steam)
 C) when reading the inputstream for the first time, cache or wrap the 
 contents somehow so that is can be read multiple times (let's at least 
 document it)
 D) remove inputstream method altogether
 e) something else?
 For now I have attached a patch for solution A.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-7614) Reloading configuration when using imputstream resources results in org.xml.sax.SAXParseException

2015-05-08 Thread Ajith S (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-7614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ajith S updated HADOOP-7614:

   Resolution: Cannot Reproduce
Fix Version/s: 2.7.0
   Status: Resolved  (was: Patch Available)

Tested the issue in 2.7.0 and in trunk. Unable to reproduce using the testcase. 
Closing the issue. Feel free to reopen

 Reloading configuration when using imputstream resources results in 
 org.xml.sax.SAXParseException
 -

 Key: HADOOP-7614
 URL: https://issues.apache.org/jira/browse/HADOOP-7614
 Project: Hadoop Common
  Issue Type: Bug
  Components: conf
Affects Versions: 0.21.0
Reporter: Ferdy Galema
Priority: Minor
 Fix For: 2.7.0

 Attachments: HADOOP-7614-v1.patch, HADOOP-7614-v2.patch


 When using an inputstream as a resource for configuration, reloading this 
 configuration will throw the following exception:
 Exception in thread main java.lang.RuntimeException: 
 org.xml.sax.SAXParseException: Premature end of file.
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1576)
   at 
 org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1445)
   at 
 org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1381)
   at org.apache.hadoop.conf.Configuration.get(Configuration.java:569)
 ...
 Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at 
 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
   at 
 com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
   at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1504)
   ... 4 more
 To reproduce see following testcode:
 Configuration conf = new Configuration();
 ByteArrayInputStream bais = new 
 ByteArrayInputStream(configuration/configuration.getBytes());
 conf.addResource(bais);
 System.out.println(conf.get(blah));
 conf.addResource(core-site.xml); //just add a named resource, doesn't 
 matter which one
 System.out.println(conf.get(blah));
 Allowing inputstream resources is flexible, but in cases such as this in can 
 lead to difficult to debug problems.
 What do you think is the best solution? We could:
 A) reset the inputstream after it is read instead of closing it (but what to 
 do when the stream does not support marking?)
 B) leave it up to the client (for example make sure you implement close() so 
 that it resets the steam)
 C) when reading the inputstream for the first time, cache or wrap the 
 contents somehow so that is can be read multiple times (let's at least 
 document it)
 D) remove inputstream method altogether
 e) something else?
 For now I have attached a patch for solution A.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-7614) Reloading configuration when using imputstream resources results in org.xml.sax.SAXParseException

2015-05-05 Thread Allen Wittenauer (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-7614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Allen Wittenauer updated HADOOP-7614:
-
Labels: BB2015-05-TBR  (was: )

 Reloading configuration when using imputstream resources results in 
 org.xml.sax.SAXParseException
 -

 Key: HADOOP-7614
 URL: https://issues.apache.org/jira/browse/HADOOP-7614
 Project: Hadoop Common
  Issue Type: Bug
  Components: conf
Affects Versions: 0.21.0
Reporter: Ferdy Galema
Priority: Minor
  Labels: BB2015-05-TBR
 Attachments: HADOOP-7614-v1.patch, HADOOP-7614-v2.patch


 When using an inputstream as a resource for configuration, reloading this 
 configuration will throw the following exception:
 Exception in thread main java.lang.RuntimeException: 
 org.xml.sax.SAXParseException: Premature end of file.
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1576)
   at 
 org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1445)
   at 
 org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1381)
   at org.apache.hadoop.conf.Configuration.get(Configuration.java:569)
 ...
 Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at 
 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
   at 
 com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
   at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1504)
   ... 4 more
 To reproduce see following testcode:
 Configuration conf = new Configuration();
 ByteArrayInputStream bais = new 
 ByteArrayInputStream(configuration/configuration.getBytes());
 conf.addResource(bais);
 System.out.println(conf.get(blah));
 conf.addResource(core-site.xml); //just add a named resource, doesn't 
 matter which one
 System.out.println(conf.get(blah));
 Allowing inputstream resources is flexible, but in cases such as this in can 
 lead to difficult to debug problems.
 What do you think is the best solution? We could:
 A) reset the inputstream after it is read instead of closing it (but what to 
 do when the stream does not support marking?)
 B) leave it up to the client (for example make sure you implement close() so 
 that it resets the steam)
 C) when reading the inputstream for the first time, cache or wrap the 
 contents somehow so that is can be read multiple times (let's at least 
 document it)
 D) remove inputstream method altogether
 e) something else?
 For now I have attached a patch for solution A.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (HADOOP-7614) Reloading configuration when using imputstream resources results in org.xml.sax.SAXParseException

2011-09-07 Thread Ferdy (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-7614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ferdy updated HADOOP-7614:
--

Attachment: HADOOP-7614-v1.patch

 Reloading configuration when using imputstream resources results in 
 org.xml.sax.SAXParseException
 -

 Key: HADOOP-7614
 URL: https://issues.apache.org/jira/browse/HADOOP-7614
 Project: Hadoop Common
  Issue Type: Bug
  Components: conf
Affects Versions: 0.21.0
Reporter: Ferdy
Priority: Minor
 Attachments: HADOOP-7614-v1.patch


 When using an inputstream as a resource for configuration, reloading this 
 configuration will throw the following exception:
 Exception in thread main java.lang.RuntimeException: 
 org.xml.sax.SAXParseException: Premature end of file.
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1576)
   at 
 org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1445)
   at 
 org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1381)
   at org.apache.hadoop.conf.Configuration.get(Configuration.java:569)
 ...
 Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at 
 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
   at 
 com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
   at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1504)
   ... 4 more
 To reproduce see following testcode:
 Configuration conf = new Configuration();
 ByteArrayInputStream bais = new 
 ByteArrayInputStream(configuration/configuration.getBytes());
 conf.addResource(bais);
 System.out.println(conf.get(blah));
 conf.addResource(core-site.xml); //just add a named resource, doesn't 
 matter which one
 System.out.println(conf.get(blah));
 Allowing inputstream resources is flexible, but in cases such as this in can 
 lead to difficult to debug problems.
 What do you think is the best solution? We could:
 A) reset the inputstream after it is read instead of closing it (but what to 
 do when the stream does not support marking?)
 B) leave it up to the client (for example make sure you implement close() so 
 that it resets the steam)
 C) when reading the inputstream for the first time, cache or wrap the 
 contents somehow so that is can be read multiple times (let's at least 
 document it)
 D) remove inputstream method altogether
 e) something else?
 For now I have attached a patch for solution A.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (HADOOP-7614) Reloading configuration when using imputstream resources results in org.xml.sax.SAXParseException

2011-09-07 Thread Ferdy (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-7614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ferdy updated HADOOP-7614:
--

Attachment: HADOOP-7614-v2.patch

Fixed issues with first patch. Also using proper LOG instead of system.out.

 Reloading configuration when using imputstream resources results in 
 org.xml.sax.SAXParseException
 -

 Key: HADOOP-7614
 URL: https://issues.apache.org/jira/browse/HADOOP-7614
 Project: Hadoop Common
  Issue Type: Bug
  Components: conf
Affects Versions: 0.21.0
Reporter: Ferdy
Priority: Minor
 Attachments: HADOOP-7614-v1.patch, HADOOP-7614-v2.patch


 When using an inputstream as a resource for configuration, reloading this 
 configuration will throw the following exception:
 Exception in thread main java.lang.RuntimeException: 
 org.xml.sax.SAXParseException: Premature end of file.
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1576)
   at 
 org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1445)
   at 
 org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1381)
   at org.apache.hadoop.conf.Configuration.get(Configuration.java:569)
 ...
 Caused by: org.xml.sax.SAXParseException: Premature end of file.
   at 
 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
   at 
 com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
   at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
   at 
 org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1504)
   ... 4 more
 To reproduce see following testcode:
 Configuration conf = new Configuration();
 ByteArrayInputStream bais = new 
 ByteArrayInputStream(configuration/configuration.getBytes());
 conf.addResource(bais);
 System.out.println(conf.get(blah));
 conf.addResource(core-site.xml); //just add a named resource, doesn't 
 matter which one
 System.out.println(conf.get(blah));
 Allowing inputstream resources is flexible, but in cases such as this in can 
 lead to difficult to debug problems.
 What do you think is the best solution? We could:
 A) reset the inputstream after it is read instead of closing it (but what to 
 do when the stream does not support marking?)
 B) leave it up to the client (for example make sure you implement close() so 
 that it resets the steam)
 C) when reading the inputstream for the first time, cache or wrap the 
 contents somehow so that is can be read multiple times (let's at least 
 document it)
 D) remove inputstream method altogether
 e) something else?
 For now I have attached a patch for solution A.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira