Error running a java program that uses log4j - java

So i am trying to run a java file launch.bat sdoc(launch is a small script that have the jar used, but if necessary i can post it here) and i get this error.
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: C:Users
ennasDesktopwebstorelogsvolume-server.sdoc.log
My config file is:
log4j.appender.dest.File=C:\Users\nennas\Desktop\webstore\logs\volume-server.sdoc.log
log4j.appender.dest.layout=org.apache.log4j.PatternLayout
log4j.appender.dest=org.apache.log4j.RollingFileAppender
log4j.rootCategory=INFO, dest
log4j.appender.dest.layout.ConversionPattern=%d - %m%n
I already try some solution like changing \ to / and running as admin, the path is the absolute path. The folder exist but the strange thing is that in the error the url appears all together, by the way i am using windows 7. Ty for the help

Change this
log4j.appender.dest.File=C:\Users\nennas\Desktop\webstore\logs\volume-server.sdoc.log
by
log4j.appender.dest.File=C://Users//nennas//Desktop//webstore//logs//volume-server.sdoc.log
You can try also this
log4j.appender.dest.File=C:\\Users\\nennas\\Desktop\\webstore\\logs\\volume-server.sdoc.log
There is a lot of time since I donĀ“t work with windows, but i remember similar problems with windows path and log4j

Related

Cannot open sever.jar file

So I was trying to make a 1.17.1 minecraft server on my mac. I couldn't open my 1.17.1_server.jar with Java 8 so I download Java 16.0.2.
Unfortunately, everytime I was opening the 1.17.1_server.jar file, I got
"The Java JAR file "1.17._server.jar" could not be launched." .
I first thought that it was because the file was launch by Java 8 instead of 16.
So I went into the terminal and run :<path to java> -jar 1.17.1_server.jar
I then got this : Error: Unable to access jarfile 1.17.1_server.jar
Finally i tried to put the path of the jar file in the command...
So I've run : path to java -jar path to server
and got this :
[main/ERROR]: Failed to load properties from file: server.properties
[15:57:35] [main/WARN]: Failed to load eula.txt
[15:57:35] [main/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
So why I have to agreed Eula if i've never launched it ? Does it think that he already been launched ?
As stated in the error message
[15:57:35] [main/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
You have to open the file and check yes
Okay find the solution: my eula and server properties file were in my user folder dk why (never moved them so...)

Wix pre-processor rejecting class files with `$anon$` in them from a Scala application

I'm trying to automate the build process of my Scala application for producing a msi installer.
When doing so, windows claims that certain files cannot be found. Here is the command that gets run
[21:39:01.842] Running C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe in C:\Users\RUNNER~1\AppData\Local\Temp\jdk.jpackage6105194214114584024\images\win-msi.image\krystalbull
and further down, i start seeing errors like this:
C:\Users\runneradmin\AppData\Local\Temp\jdk.jpackage6105194214114584024\config\bundle.wxf(56) : error LGHT0103 : The system cannot find the file 'C:\Users\RUNNER~1\AppData\Local\Temp\jdk.jpackage6105194214114584024\images\win-msi.image\krystalbull\app\classes\com\krystal\bull\gui\FileMenu$anon$2.class'.
C:\Users\runneradmin\AppData\Local\Temp\jdk.jpackage6105194214114584024\config\bundle.wxf(71) : error LGHT0103 : The system cannot find the file 'C:\Users\RUNNER~1\AppData\Local\Temp\jdk.jpackage6105194214114584024\images\win-msi.image\krystalbull\app\classes\com\krystal\bull\gui\dialog\ViewEventDialog$anon$10$anon$21$anonfun$lessinit$greater$1.class'.
C:\Users\runneradmin\AppData\Local\Temp\jdk.jpackage6105194214114584024\config\bundle.wxf(81) : error LGHT0103 : The system cannot find the file 'C:\Users\RUNNER~1\AppData\Local\Temp\jdk.jpackage6105194214114584024\images\win-msi.image\krystalbull\app\classes\com\krystal\bull\gui\SettingsMenu$anon$5.class'.
You can see more instances of this error in the build log here:
https://github.com/bitcoin-s/krystal-bull/runs/2697961906?check_suite_focus=true#step:8:11
My question is this:
What are the limitations in the windows file system or the program candle.exe that prevent the pre-processor from reading Scala files that include things like $anon$
Is there a valid syntax guide somewhere?
Will I need to manually rename all of these files?

Getting FlywayException: SP2-0310: unable to open file - when sqlpus # is used with file path

I am using flyway pro with oracleSqlplus enabled. I created a folder structure to organize scripts based on objects. Trying to use # (with path) in the flyway version scripts, which is not working.
folder structure,
topFolder
-folderA
-AScript.sql
-folderB
-BScript.sql
-folderCommon
-AScript.sql
-V1__ASCRIPT.sql
-V2__BSCRIPT.sql
-V3__ASCRIPT.sql
Content of:
V1__ASCRIPT.sql
#AScript.sql -> Which correctly executes topFolder/folderA/Ascript.sql
V2__BScript.sql
#BScript.sql -> Which correctly executes topFolder/folderB/Bscript.sql
V3__ASCRIPT.sql
#topFolder/folderCommon/AScript.sql -> Which is throwing me below error,
org.flywaydb.core.api.FlywayException: SP2-0310: unable to open file "topFolder/folderCommon/AScript.sql"
I tried almost all possible combinations,
with absolute path,
with "#../../topFolder/folderCommon/AScript.sql"
tried setting SQLPATH varible
with ##
which didnt work.
Just giving the file name alone in #, works. But I want to specify the path, so that file names can be re-used and it is less error prone.
I expect the relative path should work with flyway + oraclesqlplus option.
Thanks in advance.
looks like you start the path from the point where fly flyway.locations=filesystem: ends is where your path begins.
Example:
flyway.locations=filesystem:/opt/app/sql
where you scripts are /opt/app/sql/appadb/script.sql
inside masterscript would be
##appadb/script.sql

java.lang.UnsatisfiedLinkError: ars3wapi32 still after updating path variable

I am trying to set up On Demand Server in my local machine and when ever I am deploying the application on tomcat server I am getting below error message on browser. I have updated the PATH variable also.
root cause
java.lang.UnsatisfiedLinkError: ars3wapi32 (Not found in java.library.path)
java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1007)
java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:971)
java.lang.System.loadLibrary(System.java:470)
com.ibm.edms.od.ArsWWWInterface.<clinit>(ArsWWWInterface.java:15)
java.lang.J9VMInternals.initializeImpl(Native Method)
java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
com.ibm.edms.od.ODServer.<init>(ODServer.java:45)
com.ibm.edms.od.ODServer.<init>(ODServer.java:61)
com.uklife.web.ondemand.utils.DownloadUtils.getAFPDocumentFromOnDemand(DownloadUtils.java:80)
com.uklife.web.ondemand.utils.Utils.getDocument(Utils.java:288)
com.uklife.web.ondemand.servlet.OnDemandDocAccess.doGet(OnDemandDocAccess.java:81)
javax.servlet.http.HttpServlet.s`enter code here`ervice(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722
)
Here is a guide the solution (for Windows and OnDemand V9.5).
First of all, you need to install ODWEK on the machine where you want to run your java app. Please install in the default folder, this whole thing is tricky enough as it is...
Set the environment variable "PATH" in Windows, add "C:\Program Files\IBM\OnDemand\V9.5\bin"
Set CLASSPATH in your development environment - point out the ODApi.jar file and ALSO point "Native library..." to the \bin folder above. (You can also call the program and setting the CLASSPATH in the call as a parameter: -Djava.library.path="C:\Program Files\IBM\OnDemand\V9.5\www\api\ODapi.jar"
Copy the file ars3wapi64.dll from C:\Program Files\IBM\V9.5\www to C:\Program Files\IBM\OnDemand\V9.5\bin
Ensure that all of these files are in the bin-catalog above:
**ars3wapi64.dll**
icudt53.dll
icuin53.dll
icuio53.dll
icule53.dll
iculx53.dll
icuuc53.dll
arsgsk64.dll
If you are getting the error "java.lang.UnsatisfiedLinkError: ars3wapi32 (Not found in java.library.path)" one of the above is most likely incorrect.
OR you could be using different versions of ODWEK and OnDemand.
More on how to set CLASSPATH in Eclipse: How to set the java.library.path from Eclipse

Distributedfilesystem class use local instead of distributed classes

I have this line in my code:
DistributedFileSystem.get(conf).delete(new Path(new URI(otherArgs[1])), true);
otherArgs[1] has this value: hdfs://master:54310/input/results
I receive this exception:
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS:hdfs://master:54310/input/results, expected: file:///
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:354)
at org.apache.hadoop.fs.RawLocalFileSystem.pathToFile(RawLocalFileSystem.java:55)
at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:367)
at org.apache.hadoop.fs.ChecksumFileSystem.delete(ChecksumFileSystem.java:430)
at <package>.<classname>.main(Degree.java:137)
Note: I tried to use new Path(otherArgs[1]) without URI but got the exact same error !
Thanks,
-K
It looks like you have not set fs.default.name in core-site.xml.
check this link
If you have already set that, make sure the config files are in classpath
You can also set the fs.default.name property from your driver
conf.set("fs.default.name", "hdfs://yourserver:port");
It turns out that I was running my jar using "hadoop -jar " instead of "hadoop jar ". All conf files are correct and in place.
Problem solved but i still have no idea why using "-jar" made it run as a local (pseudo distributed) !

Categories