[ 
https://issues.apache.org/jira/browse/HADOOP-14387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16000906#comment-16000906
 ] 

Steve Loughran edited comment on HADOOP-14387 at 5/8/17 3:24 PM:
-----------------------------------------------------------------

I'm also seeing problems when I'm trying to XInclude resources from different 
JARs, specifically hadoop-common-test referencing anything in hadoop common JAR.

I don't actually know if this is a regression or not because it's something 
I've never tested before

{code}

<configuration>
  <include xmlns="http://www.w3.org/2001/XInclude";
    href="/core-default.xml">
  </include>
...
{code}

Here's the stack trace with the 001 patch applied. Its extra diagnostics are 
valuable

{code}
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at 
org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
Caused by: java.io.IOException: Fetch fail on include for '/core-default.xml' 
with no fallback while loading 'contract/localfs.xml'
        at 
org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2840)
        at 
org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2663)
        at 
org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2546)
        at org.apache.hadoop.conf.Configuration.get(Configuration.java:1326)
        at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:240)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:471)
        at org.apache.hadoop.fs.FileSystem.getLocal(FileSystem.java:439)
        at 
org.apache.hadoop.fs.contract.localfs.LocalFSContract.getLocalFS(LocalFSContract.java:89)
        at 
org.apache.hadoop.fs.contract.localfs.LocalFSContract.init(LocalFSContract.java:63)
        at 
org.apache.hadoop.fs.contract.AbstractFSContractTestBase.setup(AbstractFSContractTestBase.java:177)
        at 
org.apache.hadoop.fs.contract.AbstractContractSetTimesTest.setup(AbstractContractSetTimesTest.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at 
org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
{code}



was (Author: [email protected]):
I'm also seeing problems when I'm trying to XInclude resources from different 
JARs, specifically hadoop-common-test referencing anything in hadoop common JAR.

I don't actually know if this is a regression or not because it's something 
I've never tested before

{code}

<configuration>
  <include xmlns="http://www.w3.org/2001/XInclude";
    href="/core-default.xml">
  </include>
...
{code}


{code}
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at 
org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
Caused by: java.io.IOException: Fetch fail on include for '/core-default.xml' 
with no fallback while loading 'contract/localfs.xml'
        at 
org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2840)
        at 
org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2663)
        at 
org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2546)
        at org.apache.hadoop.conf.Configuration.get(Configuration.java:1326)
        at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:240)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:471)
        at org.apache.hadoop.fs.FileSystem.getLocal(FileSystem.java:439)
        at 
org.apache.hadoop.fs.contract.localfs.LocalFSContract.getLocalFS(LocalFSContract.java:89)
        at 
org.apache.hadoop.fs.contract.localfs.LocalFSContract.init(LocalFSContract.java:63)
        at 
org.apache.hadoop.fs.contract.AbstractFSContractTestBase.setup(AbstractFSContractTestBase.java:177)
        at 
org.apache.hadoop.fs.contract.AbstractContractSetTimesTest.setup(AbstractContractSetTimesTest.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at 
org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
{code}


> new Configuration().get() fails if core-site.xml isn't on the classpath
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-14387
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14387
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 3.0.0-alpha3
>         Environment: test run in downstream project with no core-site in 
> test/resources
>            Reporter: Steve Loughran
>            Assignee: Jonathan Eagles
>            Priority: Blocker
>         Attachments: HADOOP-14387.1.patch
>
>
> If you try to create a config via {{new Configuration()}} and there isn't a 
> {{core-site.xml}} on the CP, you get a stack trace. Previously it'd just skip 
> the failure to load.
> This is a regression which breaks downstream apps that don't need a core-site 
> to run, but do want to load core-default &c



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to