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

-Dlog4j.configurationFile=${bin}/log4j2.xml is always reported wrong,TKS! #562

Open
guyajun opened this issue Jun 12, 2015 · 10 comments
Open

Comments

@guyajun
Copy link

guyajun commented Jun 12, 2015

ERROR StatusLogger Invalid URL c:/elasticsearch-jdbc-1.6.0.0-dist/elasticsearch-
jdbc-1.6.0.0/bin/log4j2.xml java.net.MalformedURLException: unknown protocol: c
at java.net.URL.(URL.java:593)
at java.net.URL.(URL.java:483)
at java.net.URL.(URL.java:432)
at java.net.URI.toURL(URI.java:1089)
at org.apache.logging.log4j.core.config.ConfigurationFactory.getInputFro
mUri(ConfigurationFactory.java:296)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.get
Configuration(ConfigurationFactory.java:395)
at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfigur
ation(ConfigurationFactory.java:254)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext
.java:419)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
138)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:207)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:41)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:160)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:492)
at org.xbib.tools.Importer.(Importer.java:61)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.xbib.tools.Runner.main(Runner.java:25)

@guyajun
Copy link
Author

guyajun commented Jun 12, 2015

I am upset with the URL problem!Thank you!

@jprante
Copy link
Owner

jprante commented Jun 12, 2015

This is Windows problem, please add file:// to the log4j.configurationFile parameter, like this

 -Dlog4j.configurationFile=file://${bin}/log4j2.xml \

I can not test on Windows, so maybe other things are broken. I am grateful for working examples.

@guyajun
Copy link
Author

guyajun commented Jun 15, 2015

Thanks ,you are handsome!

@danieljue
Copy link

I can confirm in Windows 7 that setting the parameter to
-Dlog4j.configurationFile="file://%BIN%/log4j2.xml"
in the batch file does fix the logging error.

@guyajun
Copy link
Author

guyajun commented Jun 18, 2015

Thank you very much!

@danieljue
Copy link

Actually, I'm sorry, I have to edit my confirmation -- it said logging was going fine but then it crapped out and gave a similar error. It seems that %BIN% is being set to "%DIR%..\bin*" and the "*" is messing up the path to the log4j file.

I finally seemed to have gotten around it by using an explicit path like

"file://c:\esplugins\something\bin\log4j2.xml"

@guyajun
Copy link
Author

guyajun commented Jun 18, 2015

Oh, You are a kind-hearted person. Well,Did you solve this problem. I search many talks, most of them says that there is no answers to it. TKS!
http://stackoverflow.com/questions/21260086/elasticsearch-river-jdbc-mysql-not-deleting-records

@danieljue
Copy link

Edit: Everything seemed to work properly (ES1.6, Windows 7) when I used these instructions instead:
http://blog.pluralsight.com/elasticsearch-and-sql-server
Just substitute the river jar to version 1.5.0.5 (or later) and it worked with ES 1.6. No need to muck with paths and logger files, or unzipping anything, other than your particular jdbc driver.

@rbogushevich
Copy link

I had same problem with elasticsearch-jdbc-1.5.2.0.
See my comment #694 (comment)

@koushikckm
Copy link

Thats solves!!! Thnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants