Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message in Git Bash #370

Closed
UBmakla opened this issue Jun 8, 2021 · 11 comments
Closed

Error message in Git Bash #370

UBmakla opened this issue Jun 8, 2021 · 11 comments
Assignees
Labels

Comments

@UBmakla
Copy link
Collaborator

UBmakla commented Jun 8, 2021

log4j:ERROR Could not parse url [...] java.io.FileNotFoundException:

@dr0i
Copy link
Member

dr0i commented Jun 8, 2021

Could you provide some more information? What did you execute?

@UBmakla
Copy link
Collaborator Author

UBmakla commented Jun 8, 2021

I tried to edit a file with Metafacture 5.2.0 (first time using the new version)
$ /c/Users[...]metafactureCore520/flux.sh lobid2eisirTest.xml.flux
then I get the error message, my colleague as well. I hope this information helps.

@dr0i
Copy link
Member

dr0i commented Jun 8, 2021

Could you paste the content of your lobid2eisirTest.xml.flux? I suspect some file referenced there is not found.

@UBmakla
Copy link
Collaborator Author

UBmakla commented Jun 8, 2021

Here it is, but it worked with version 5.1.2.

default morphDir = "";
default namespacesFile = "lobid2eisir.namespaces.properties";

default sourceFile = "lobid2eisirTest.inputAlma.xml";
default targetFile = "lobid2eisirTest.output.xml";

default morphFile1 = morphDir + "lobid2eisirTest.morph1-Alma.xml";
default morphFile2 = morphDir + "lobid2eisirTest.morph2-Alma.xml";

sourceFile |
open-file |
decode-xml |
handle-generic-xml("record") |
morph(morphFile1) |
morph(morphFile2) |
stream-to-xml(roottag="EISIR:data", recordtag="EISIR:record", namespaceFile=namespacesFile) |
write(targetFile);

@dr0i
Copy link
Member

dr0i commented Jun 8, 2021

Ok, hm, not sure what's wrong. You don't have a URL or filename given as error? Do you only get "Could not parse url [...] java.io.FileNotFoundException:", i.e. an [...] ?
At the moment I don't have an idea why this should work with 5.1.2 but not with 5.2.
Where does the sourceFile etc. reside?
It is also crucial from where you execute the flux.sh. If you want to be independent of the place of execution you should not use morphDir but FLUX_DIR (a predefined variable) instead and place all needed files relative to the path where the flux.sh reside:

Paths are always relative to the directory within which the flux command is executed. To address files relative to the location of the executed flux file, use the predefined FLUX_DIR variable.

(https://github.com/metafacture/metafacture-core/wiki/Flux-user-guide#writing-flux-files)

@dr0i dr0i self-assigned this Jun 8, 2021
@dr0i dr0i added the Question label Jun 8, 2021
@fsteeg
Copy link
Member

fsteeg commented Jun 8, 2021

default morphDir = "";

Could this be caused by a missing morphDir variable that needs to be passed when running flux.sh (see https://github.com/metafacture/metafacture-core/wiki/Flux-user-guide#provide-arguments)? Are the morph files in the same location as the flux file? Then you could try default morphDir = FLUX_DIR; instead of the line above.

@UBmakla
Copy link
Collaborator Author

UBmakla commented Jun 8, 2021

Perhaps the complete error message (and also the message that it worked with Metafacture 5.1.2) helps

mmanklas@UB-ZB-t32 MINGW64 ~/Desktop/Homeoffice/Metafacture/Beispiele-Tests/TestMetafacture5.2
$ /c/Users/mmanklas/Desktop/Homeoffice/Metafacture/metafactureCore512/flux.sh lobid2eisirTest.xml.flux

mmanklas@UB-ZB-t32 MINGW64 ~/Desktop/Homeoffice/Metafacture/Beispiele-Tests/TestMetafacture5.2
$ /c/Users/mmanklas/Desktop/Homeoffice/Metafacture/metafactureCore520/flux.sh lobid2eisirTest.xml.flux
log4j:ERROR Could not parse url [file:////c/Users/mmanklas/Desktop/Homeoffice/Metafacture/metafactureCore520/config/log4j.xml].
java.io.FileNotFoundException: \\c\Users\mmanklas\Desktop\Homeoffice\Metafacture\metafactureCore520\config\log4j.xml (Der Netzwerkpfad wurde nicht gefunden)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
        at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
        at org.apache.log4j.xml.DOMConfigurator$2.parse(DOMConfigurator.java:765)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:871)
        at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)
        at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
        at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
        at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
        at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
        at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
        at org.metafacture.metamorph.Metamorph.<clinit>(Metamorph.java:104)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.metafacture.commons.reflection.ConfigurableClass.newInstance(ConfigurableClass.java:101)
        at org.metafacture.commons.reflection.ObjectFactory.newInstance(ObjectFactory.java:67)
        at org.metafacture.flux.parser.FluxProgramm.createElement(FluxProgramm.java:70)
        at org.metafacture.flux.parser.FluxProgramm.addElement(FluxProgramm.java:81)
        at org.metafacture.flux.parser.FlowBuilder.pipe(FlowBuilder.java:736)
        at org.metafacture.flux.parser.FlowBuilder.flowtail(FlowBuilder.java:514)
        at org.metafacture.flux.parser.FlowBuilder.flow(FlowBuilder.java:226)
        at org.metafacture.flux.parser.FlowBuilder.flux(FlowBuilder.java:122)
        at org.metafacture.flux.FluxCompiler.compileFlow(FluxCompiler.java:54)
        at org.metafacture.flux.FluxCompiler.compile(FluxCompiler.java:42)
        at org.metafacture.runner.Flux.main(Flux.java:79)

@dr0i
Copy link
Member

dr0i commented Jun 8, 2021

It seems that config/log4j.xml is missing resp. not accessible, while I can confirm that it is part of the distribution (and the main branch).
Can you try https://github.com/metafacture/metafacture-core/#getting-started step-by-step and " 4. Run one of the example scripts:" ?
Please report if this works for you.
Your problem may originate from using an NFS mount (or at least something similar, a non-local hard disk).

@UBmakla
Copy link
Collaborator Author

UBmakla commented Jun 10, 2021

config/log4j.xml is available und looks like in 5.1.2. I tried the steps in https://github.com/metafacture/metafacture-core/#getting-started, the example works but not my case described above, same error message.

@UBmakla
Copy link
Collaborator Author

UBmakla commented Jun 11, 2021

After our jitsi meeting yesterday I tried what we discussed. Results and good news: the process runs despite the error message, the output file looks fine. In my Linux VM the process runs without an error message, same in Windows cmd.

@dr0i
Copy link
Member

dr0i commented Jun 14, 2021

OK - great! I found some notes in the internet about problems regarding files on Windows with "git bash" so I assume you just ran into such an incident.
Going to close this issue with the remark that "git bash" is not recommended when using metafacture and that it's better to use other alternatives like those you've mentioned.
Closing.

@dr0i dr0i closed this as completed Jun 14, 2021
blackwinter pushed a commit that referenced this issue Dec 13, 2024
Review by @fsteeg #370

Co-authored-by: Fabian Steeg <[email protected]>
blackwinter pushed a commit that referenced this issue Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants