apache / jena

Apache Jena
https://jena.apache.org/
Apache License 2.0
1.12k stars 653 forks source link

Reconfiguration failed when running Apache Jena Binary Distribution #1911

Closed larisa1995 closed 1 year ago

larisa1995 commented 1 year ago

Version

apache-jena-4.8.0.zip

What happened?

When running Apache Jena Binary Distribution I get a reconfiguration error. Jena seems to work fine, meaning I get the expected result when running SPARQL queries. Still, I would be grateful if you could tell me how to fix an error.

PS C:\jena> sparql.bat --version ERROR StatusLogger Reconfiguration failed: No configuration found for '2a139a55' at 'null' in 'null' Jena: VERSION: 4.8.0 Jena: BUILD_DATE: 2023-04-20T08:38:51Z

Relevant output and stacktrace

No response

Are you interested in making a pull request?

None

afs commented 1 year ago

Hi @larisa1995

Yes, the Jena command will continue and work. The error is about setting up logging.

Where is sparql.bat installed in the filing system? Are you setting any of the environment variables JENA_HOME, JENAROOT or LOGGING? Did you previously use a version of Jena where this message did not appear?

larisa1995 commented 1 year ago

Dear @afs

Thank you for the tool and prompt reply.

First I have to apologise and fix myself. I use "apache-jena-4.8.0.zip" not "apache-jena-fuseki-4.8.0.zip".

I followed "Setting up your Environment on Windows" guide [1] and the one by Richard Cyganiak [2].

Where is sparql.bat installed in the filing system?

I unzipped Jena directly to C: disc so that the path does not include any spaces. Jena path is "C:\jena" bat path is "C:\jena\bat"

Are you setting any of the environment variables JENA_HOME, JENAROOT or LOGGING?

I set variables not with the command line as in [1] but directly in the System Properties window of Windows as in [2]. I created JENA_HOME environment variable "C:\jena" and added "C:\jena\bat" to paths. Being a newbie, I did not find any tutorials regarding the "LOGGING" variable so far.

Did you previously use a version of Jena where this message did not appear?

I used Jena CLI a bit several years ago on the very other PC and did not have this issue. But this seems to be not related to the present.

[1] https://jena.apache.org/documentation/tools/ [2] http://richard.cyganiak.de/blog/wp-content/uploads/2013/09/jena-sparql-cli-v1.pdf

afs commented 1 year ago

(I'm not a MS Windows user, so I'm hoping someone who does use that OS can help.)

Minor : Ref [2] is out of date - use JENA_HOME is preferred.

Not setting LOGGING is normal.

Would you be able to change the bat file and printout the value of %LOGGING% just before the java line at the end?

larisa1995 commented 1 year ago

Dear @afs

Please see the changed sparql.bat code and the command line output below. I hope this fits your request.


@rem Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0

if "%JENAROOT%" == "" goto :rootNotSet
set JENA_HOME=%JENAROOT%
:rootNotSet

if NOT "%JENA_HOME%" == "" goto :okHome
echo JENA_HOME not set
exit /B

:okHome
set JENA_CP=%JENA_HOME%\lib\*;
set LOGGING=file:%JENA_HOME%/log4j2.properties

echo %LOGGING%

@rem JVM_ARGS comes from the environment.
java %JVM_ARGS% -Dlog4j.configurationFile="%LOGGING%" -cp "%JENA_CP%" arq.sparql %*
exit /B


C:\apache-jena-4.8.0>sparql.bat --version
file:C:\apache-jena-4.8.0/log4j2.properties
ERROR StatusLogger Reconfiguration failed: No configuration found for '5b37e0d2' at 'null' in 'null'
Jena:       VERSION: 4.8.0
Jena:       BUILD_DATE: 2023-04-20T08:38:51Z
rvesse commented 1 year ago

Looks like an erroneous forward slash instead of a backslash in the definition of the bat script where LOGGING is defined

Could you try changing that to use a backwards slash instead and see if that resolves the problem?

Also could you double check whether you actually have a log4j2.properties file in your JENA_HOME directory?

afs commented 1 year ago

What might be confusing log4j is the file: part in conjunction with the C: and \. The documentation for log4j2 says that log4j.configurationFile takes either a URL, or a file name. file:C:\ is a mixture.

In which case removing the file: may help:

set LOGGING=file:%JENA_HOME%/log4j2.properties to set LOGGING=%JENA_HOME%\log4j2.properties

or set JENA_HOME to /apache-jena-4.8.0 (no drive letter, assuming everything is on C:)

larisa1995 commented 1 year ago

Dear @rvesse

Please see below the changed bat (forward slash changed to backward one) file, the output and a screenshot of directory to answer your third question.


@echo off
@rem Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0

if "%JENAROOT%" == "" goto :rootNotSet
set JENA_HOME=%JENAROOT%
:rootNotSet

if NOT "%JENA_HOME%" == "" goto :okHome
echo JENA_HOME not set
exit /B

:okHome
set JENA_CP=%JENA_HOME%\lib\*;
set LOGGING=file:%JENA_HOME%\log4j2.properties

echo %LOGGING%

@rem JVM_ARGS comes from the environment.
java %JVM_ARGS% -Dlog4j.configurationFile="%LOGGING%" -cp "%JENA_CP%" arq.sparql %*
exit /B

PS C:\jena> bat\sparql.bat --version
file:C:\jena\log4j2.properties
ERROR StatusLogger Reconfiguration failed: No configuration found for '2a139a55' at 'null' in 'null'
Jena:       VERSION: 4.8.0
Jena:       BUILD_DATE: 2023-04-20T08:38:51Z

image
larisa1995 commented 1 year ago

Dear @afs

Setting _LOGGING=%JENAHOME%\log4j2.properties helped. Thank you.

Yet, I do not know whether .bat files should be updated in github. This problem happened to other users as well.