Youtrack 6 reboot fails on Fedora and Java Service Wrapper - java

I have followed http://confluence.jetbrains.com/display/YTD6/Linux.+YouTrack+JAR+as+a+Service on Fedora server. Starting Youtrack 6 as "youtrack" user by
/etc/init.d/youtrack start
command starts properly. I have added youtrack service wrapper on boot by
/sbin/chkconfig --add youtrack
command. But after server reboot Youtrack application is not running.
journalctl -xn
command gives me only this hint
systemd[4000]: Failed at step EXEC spawning /etc/rc.d/init.d/youtrack: Exec format error
I have fixed my permissions like in this thread ''
Starting YouTrack as a service fails without error message''
But error still occurs. I have pasted default template from the tutorial '/etc/rc.d/init.d/youtrack' with only one change:
#export JAVA_HOME=/usr/java/jdk1.6.0_21
export JAVA_HOME=/usr/java/latest
/usr/java/latest points to Oracle JDK 8.

youtrack_initd.template
from youtrack tutorial is missing
#!/bin/sh
on the top of the file. After adding this line "Exec format error" does not occur anymore.

Related

Apache Livy : Could not find or load main class org.apache.livy.server.LivyServer

I am trying to start Apache Livy 0.8.0 server on my windows 10 machine for spark 3.1.2 and hadoop 3.2.1. I am taking help from here.. I have successfully built apache livy using maven (I have attached a of it) But I am not able to run the livy server. When I run it I get the following error -
> starting C:/AmazonJDK/jdk1.8.0_332/bin/java -cp /d/ApacheLivy/incubator-livy-master/incubator-livy-master/server/target/jars/*:/d/ApacheLivy/incubator-livy-master/incubator-livy-master/conf:D:/Program_files/spark/conf:D:/ApacheHadoop/hadoop-3.2.1/etc/hadoop: org.apache.livy.server.LivyServer, logging to D:/ApacheLivy/incubator-livy-master/incubator-livy-master/logs/livy--server.out
ps: unknown option -- o
Try `ps --help' for more information.
failed to launch C:/AmazonJDK/jdk1.8.0_332/bin/java -cp /d/ApacheLivy/incubator-livy-master/incubator-livy-master/server/target/jars/*:/d/ApacheLivy/incubator-livy-master/incubator-livy-master/conf:D:/Program_files/spark/conf:D:/ApacheHadoop/hadoop-3.2.1/etc/hadoop: org.apache.livy.server.LivyServer:
Error: Could not find or load main class org.apache.livy.server.LivyServer
full log in D:/ApacheLivy/incubator-livy-master/incubator-livy-master/logs/livy--server.out
I am using Git bash. If you need more information I will provide
The error got resolved when I used Windows Subsystem for Linux (WSL).

Running Tomcat9 with dedicated tomcat user: Startup fails with JAVA_HOME or 500 in localhost:8080

I have just installed Apache Tomcat9 on my machine, following mostly these instructions, but I am really stuck with user management here.
My enviroment: Ubuntu 20.04, Java 11 (There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-oracle/bin/java).
Few exceptions: I neither have JAVA_HOME, nor the java home directory in my PATH environment variable.
I also have created a symlink at /opt/tomcat/latest/ for pointing to the right folder for all tomcat files.
Now I want to let tomcat run as a service as user 'tomcat'.
This is how my tomcat.service file looks like:
[Unit]
Description=Tomcat 9 servlet container
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/usr/lib/jvm/java-11-oracle/bin/java"
# Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true"
Environment="CATALINA_BASE=/opt/tomcat/latest"
Environment="CATALINA_HOME=/opt/tomcat/latest"
Environment="CATALINA_PID=/opt/tomcat/latest/tomcat.pid"
# Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
ExecStart=/opt/tomcat/latest/bin/startup.sh
ExecStop=/opt/tomcat/latest/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
Now, when I comment out the line for the JAVA_HOME environment variable, the startup of the tomcat service fails (journalctl -xe):
Okt 27 17:43:52 my-user startup.sh[7714]: Tomcat started.
Okt 27 17:43:52 my-user shutdown.sh[7737]: PID file found but either no matching process was found or the current user does not have permission to stop the process. Stop aborted.
Okt 27 17:43:52 my-user sudo[7690]: pam_unix(sudo:session): session closed for user root
So there is something running as root, what I don't get.
But when I comment out this line, tomcat runs happily, but on localhost:8080 I am getting this 500:
Message org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
or this 404
Message JSP file [/index.jsp] not found
It is similar like here and here.
I also did sudo chown -R tomcat /opt/tomcat/latest/work/Catalina/localhost, but this did not help.
Any help is appreciated.
Now it works and I'm going to list my changes here, but I'm not sure, which one was crucial and which was unnecessary.
JAVA_HOME in tomcat.service changed to: Environment="JAVA_HOME=/usr/lib/jvm/java-11-oracle"
CATALINA_PID in tomcat.service changed to: Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
give write access to other users to folders work, temp, logs, webapps. Sources here and here.
using this guide: https://www.interserver.net/tips/kb/install-apache-tomcat-on-ubuntu-18-04/

Karaf command not found exception how to troubleshoot?

Downloaded karaf 4.0.9 just following getting started doc but keep getting this
org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: feature:install
whenever i try to do feature:install wrapper from shell
Finding it very difficult to find any help or doc how to trouble shoot? is it a permissions thing? I chowned everything to the same user for simplicity...
Is distribution missing a library? Where do i get it/put it?
New to karaf... Following this: http://karaf.apache.org/manual/latest/#_installation
Just trying to get some basic JDBC/JMS stuff working, install drivers, recieve some msgs, query db, etc
Spent a few hours of reading docs + trial and error to figure this out:
ssh karaf#localhost -p 8101
Will get you full admin shell, apparently this isn't available if you just ./shell from KARAF_HOME/bin
You can check your configurations in users.properties in karaf/etc folder .
Open karaf shell using admin rights.
Start Karaf shell from its bin folder.
Now run karaf console using below command.
ssh username#localhost -p8101
now you can run any command of karaf shell.

Running SOLR on a desktop application

**while running solr 4.10.3 solr\examples i ran following command on cmd java -jar start.jar
after this when i go on http://localhost:8983/ i got this error
Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:
/solr ---> o.e.j.w.WebAppContext{/solr,null},D:\solr-4.10.3\exampleD:/solr-4.10.3/example/webapps/solr.war
try http://localhost:8983/solr. By this you are provding the web application within which it might need to find index.* i.e. welcome file.

java - Solr localhost:8983 Not Found

I am new to solr. Following the tutorial from here i Can't Get Past Step 2 in the Tutorial. After running java -jar start.jar and then connecting to http://localhost:8983/solr/
i get this error page which says:
HTTP ERROR: 404
Problem accessing /solr/. Reason:
Not Found
Powered by Jetty://
I changed the port from 8983 to 8080 but the problem persisted.
On running ant ant example i get this error message build.xml does nto exist
I am working with windows 7 and the downloaded version of solr is solr-4.9.0.zip.
Please check wheather the port(8983) is already in use or not. You can start solr in alternate port(like 4983) by using the following command
java -Djetty.port=4983 -jar start.jar
And now hit your browser with your doamin name or localhost:port as shown below:
http://yourdoamin.com:4983/solr
If you are still unable to start solr ,then solr log at the follwoing path
../solr-4.9.0/example/logs
Can you please post your solr.log?
Also when you start the solr with: java -Djetty.port=4983 -jar start.jar
Are you able to see server started in the console from where you are executing this?
How are you changing jetty port in solr? Through commands i mentioned above or by changing jetty.xml.
Note: changing port in jetty.xml dont work properly.

Categories

Resources