You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Frank Haferkorn <F....@RST-Automation.de> on 2013/08/27 16:40:04 UTC

problems log4j.properties: "the system cannot find the given path"

Hallo All,

 

I just am trying to migrate from jena-incubator-2.7  to apache-jena-2.10.1

 

I have Windows 7 on a 64 bit platform. 

I use additionally cygwin on my platform à This makes problems with arq.

 

I extracted the zip file and put it into: C:\Jena 

I use this shell variables:

JENA_CP=C:\Jena\lib\*;

JENA_HOME=C:\Jena

 

C:\Jena\bat and  C:\Jena\bin are in the PATH.

 

 

Under Win32 shell (command.exe) the command 

arq -version 

is running without any problem!

 

 

BUT I get some problems under the BASH / cygwin enviroment.

 

$ arq --version

log4j:ERROR Could not read configuration file from URL
[file:/cygdrive/c/Jena/jena-log4j.properties].

java.io.FileNotFoundException: \cygdrive\c\Jena\jena-log4j.properties (Das
System kann den angegebenen Pfad nicht finden)

        at java.io.FileInputStream.open(Native Method)

        at java.io.FileInputStream.<init>(Unknown Source)

        at java.io.FileInputStream.<init>(Unknown Source)

        at sun.net.www.protocol.file.FileURLConnection.connect(Unknown
Source)

        at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown
Source)

        at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:5
24)

        at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.j
ava:483)

        at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)

        at
org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)

        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253)

        at com.hp.hpl.jena.query.ARQ.<clinit>(ARQ.java:52)

        at arq.cmdline.CmdGeneral.<clinit>(CmdGeneral.java:34)

        at arq.arq.main(arq.java:34)

log4j:ERROR Ignoring configuration file
[file:/cygdrive/c/Jena/jena-log4j.properties].

log4j:WARN No appenders could be found for logger
(com.hp.hpl.jena.util.FileManager).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more
info.

Jena:       VERSION: 2.10.1

Jena:       BUILD_DATE: 2013-05-11T22:05:51+0100

ARQ:        VERSION: 2.10.1

ARQ:        BUILD_DATE: 2013-05-11T22:05:51+0100

RIOT:       VERSION: 2.10.1

RIOT:       BUILD_DATE: 2013-05-11T22:05:51+0100

 

The german message (Das System kann den angegebenen Pfad nicht finden)

translates to "the system cannot find the given path"

 

Has anybody similar problems?

It looks like the correct path is mixed up under Unix/Win32 

 

\cygdrive\c\Jena\jena-log4j.properties 

 

Should have slashes '/' instead of backslashes '\' .

 

The file file:/cygdrive/c/Jena/jena-log4j.properties 

is available and readable as expected.

BUT certainly NOT \cygdrive\c\Jena\jena-log4j.properties.

It should be C:\Jena\jena-log4j.properties. with  "C:" instead of
"\cygdrive\c"

 

Can anybody help me on this issue?

 

Yours,

F.Haferkorn

 

 

 

 

 

-----------------------------------------------------------------------------

RST Industrie Automation GmbH * Carl-Zeiss-Str. 51, D-85521 Ottobrunn 

Tel. +49-89-9616018-20 * Fax +49-89-9616018-10 * http://www.rst-automation.de
<http://www.rst-automation.de> 

 

Geschäftsführer: Dipl.-Ing.(FH) Robert Schachner 

Amtsgericht München: HRB 103 626 * ID-Nr. DE 811 466 035

----------------------------------------------------------------------------

 


Re: problems log4j.properties: "the system cannot find the given path"

Posted by Andy Seaborne <an...@apache.org>.
On 27/08/13 15:40, Frank Haferkorn wrote:
> Hallo All,
>
>
>
> I just am trying to migrate from jena-incubator-2.7  to apache-jena-2.10.1
>
>
>
> I have Windows 7 on a 64 bit platform.
>
> I use additionally cygwin on my platform à This makes problems with arq.
>
>
>
> I extracted the zip file and put it into: C:\Jena
>
> I use this shell variables:
>
> JENA_CP=C:\Jena\lib\*;
Unnecessary - the scripts set this themselves

>
> JENA_HOME=C:\Jena
>
>
>
> C:\Jena\bat and  C:\Jena\bin are in the PATH.

Don't do that - either one or the other.

> Under Win32 shell (command.exe) the command
>
> arq -version
>
> is running without any problem!
>
> BUT I get some problems under the BASH / cygwin enviroment.
>
> $ arq --version
>
> log4j:ERROR Could not read configuration file from URL
> [file:/cygdrive/c/Jena/jena-log4j.properties].
>
> java.io.FileNotFoundException: \cygdrive\c\Jena\jena-log4j.properties (Das
> System kann den angegebenen Pfad nicht finden)

You seem to have JENA_HOME as /cygdrive/c/Jena/ (cygwin style)  The unix 
scripts don't reset JENA_HOME if already set so I don't see where it 
comes from (it's been a while since Iused cygwin).

The problem is that when running on Window/Cygwin, the java is windows 
java, and windows filenames, and is not cygwin aware.

The script does:

LOGGING="-Dlog4j.configuration=file:$JENA_HOME/jena-log4j.properties"

JENA_HOME is /cygdrive/c/Jena/ then windows can not find that file.

	Andy



>
>          at java.io.FileInputStream.open(Native Method)
>
>          at java.io.FileInputStream.<init>(Unknown Source)
>
>          at java.io.FileInputStream.<init>(Unknown Source)
>
>          at sun.net.www.protocol.file.FileURLConnection.connect(Unknown
> Source)
>
>          at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown
> Source)
>
>          at
> org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:5
> 24)
>
>          at
> org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.j
> ava:483)
>
>          at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
>
>          at
> org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
>
>          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253)
>
>          at com.hp.hpl.jena.query.ARQ.<clinit>(ARQ.java:52)
>
>          at arq.cmdline.CmdGeneral.<clinit>(CmdGeneral.java:34)
>
>          at arq.arq.main(arq.java:34)
>
> log4j:ERROR Ignoring configuration file
> [file:/cygdrive/c/Jena/jena-log4j.properties].
>
> log4j:WARN No appenders could be found for logger
> (com.hp.hpl.jena.util.FileManager).
>
> log4j:WARN Please initialize the log4j system properly.
>
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more
> info.
>
> Jena:       VERSION: 2.10.1
>
> Jena:       BUILD_DATE: 2013-05-11T22:05:51+0100
>
> ARQ:        VERSION: 2.10.1
>
> ARQ:        BUILD_DATE: 2013-05-11T22:05:51+0100
>
> RIOT:       VERSION: 2.10.1
>
> RIOT:       BUILD_DATE: 2013-05-11T22:05:51+0100
>
>
>
> The german message (Das System kann den angegebenen Pfad nicht finden)
>
> translates to "the system cannot find the given path"
>
>
>
> Has anybody similar problems?
>
> It looks like the correct path is mixed up under Unix/Win32
>
>
>
> \cygdrive\c\Jena\jena-log4j.properties
>
>
>
> Should have slashes '/' instead of backslashes '\' .
>
>
>
> The file file:/cygdrive/c/Jena/jena-log4j.properties
>
> is available and readable as expected.
>
> BUT certainly NOT \cygdrive\c\Jena\jena-log4j.properties.
>
> It should be C:\Jena\jena-log4j.properties. with  "C:" instead of
> "\cygdrive\c"
>
>
>
> Can anybody help me on this issue?
>
>
>
> Yours,
>
> F.Haferkorn
>
>
>
>
>
>
>
>
>
>
>
> -----------------------------------------------------------------------------
>
> RST Industrie Automation GmbH * Carl-Zeiss-Str. 51, D-85521 Ottobrunn
>
> Tel. +49-89-9616018-20 * Fax +49-89-9616018-10 * http://www.rst-automation.de
> <http://www.rst-automation.de>
>
>
>
> Geschäftsführer: Dipl.-Ing.(FH) Robert Schachner
>
> Amtsgericht München: HRB 103 626 * ID-Nr. DE 811 466 035
>
> ----------------------------------------------------------------------------
>
>
>
>