Problem encountered while remote debugging java application as a service - java

I followed this SO post:
What are Java command line options to set to allow JVM to be remotely debugged?
and was able to remotely debug my Java app that runs as a windows service through prunsrv / procrun.
When I run the service with option suspend=n, I am able to connect remote debugger through eclipse:
myservice.exe //US//myservice --JvmOptions "-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:8111,server=y,suspend=n"
but when I give option suspend=y, I get the following error:
Commons Daemon procrun failed with exit value: 5 (Failed to start
service)
any idea why suspend=y is resulting in this error. (Unfortunately detailed logs for prunsrv are not generated)

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).

Youtrack 6 reboot fails on Fedora and Java Service Wrapper

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.

Error while starting GoldFish server: Ubuntu 13.10

I consulted here and here but could not get my problem solved.
When I type this on terminal /opt/glassfish4/glassfish/bin/asadmin start, I get the following result:
Remote server does not listen for requests on [localhost:4848]. Is the server up?
Unable to get remote commands.
Closest matching local command(s):
restart-domain
restart-local-instance
start-database
start-domain
start-local-instance
Command start failed.
Similarly, when I type this /opt/glassfish4/glassfish/bin/asadmin --port 5656 start-domain, I get
java.io.IOException: Couldn't get lock for /opt/glassfish4/glassfish/domains/domain1/logs/server.log
at java.util.logging.FileHandler.openFiles(FileHandler.java:389)
at java.util.logging.FileHandler.<init>(FileHandler.java:287)
at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(GFLauncherLogger.java:98)
at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:191)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.createLauncher(StartDomainCommand.java:220)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.executeCommand(StartDomainCommand.java:117)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:321)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:360)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:298)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:56)
Waiting for domain1 to start .Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Launching GlassFish on Felix platform
Exception in thread "main" java.lang.RuntimeException: the domain directory is not writable.
at com.sun.enterprise.glassfish.bootstrap.MainHelper.verifyDomainRoot(MainHelper.java:244)
at com.sun.enterprise.glassfish.bootstrap.MainHelper.findInstanceRoot(MainHelper.java:347)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:78)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Command start-domain failed.
I sense there is something problem in path /opt/glassfish4/glassfish/bin/asadmin. I am working on my first JSF web application and cannot run glassfish server. I am using Netbeans and ubuntu 13.10.
Can anyone show me the way?
Thank you!
The error messages
java.io.IOException: Couldn't get lock for
/opt/glassfish4/glassfish/domains/domain1/logs/server.log
and
Exception in thread "main" java.lang.RuntimeException: the domain
directory is not writable.
indicate that the user account you use to start the server doesn't have write permissions in your Glassfish domain folder.
To solve the problem either change the permissions or start the asadmin command with a user who has sufficient permissions.
If this doesn't solve the problem, there may be another process which has a lock on your server.log file, but I guess you would have noticed that. To make sure you can run
lsof /opt/glassfish4/glassfish/domains/domain1/logs/server.log
to see if any process is using the file.
See also:
Failed to start glassfish server because Couldn't get lock for /opt/glassfishv3/glassfish/domains/domain1/logs/server.log

Is it possible to start Play framework in test mode on heroku

I want to be able to start my play application in test mode on Heroku is this possible?
I added this Procfile:
web: play test --http.port=$PORT $PLAY_OPTS
But when I start the server I can see this in the Hereoku logs.
←[32m2012-01-15T19:11:04+00:00 heroku[web.1]:←[0m State changed from crashed to created
←[32m2012-01-15T19:11:04+00:00 heroku[web.1]:←[0m State changed from created to starting
←[32m2012-01-15T19:11:16+00:00 heroku[web.1]:←[0m Starting process with command `play test --http.port=19429 --%prod -Dprecompiled=true
`
←[32m2012-01-15T19:11:17+00:00 app[web.1]:←[0m Listening for transport dt_socket at address: 8000
←[32m2012-01-15T19:11:18+00:00 app[web.1]:←[0m 19:11:18,040 INFO ~ Starting /app
←[32m2012-01-15T19:11:18+00:00 heroku[web.1]:←[0m Error R11 (Bad bind) -> Process bound to port 8000, should be 19429 (see environment
variable PORT)
←[32m2012-01-15T19:11:18+00:00 heroku[web.1]:←[0m Stopping process with SIGKILL
←[32m2012-01-15T19:11:18+00:00 app[web.1]:←[0m 19:11:18,048 INFO ~ Module scala is available (/app/modules/scala-0.9.1)
←[32m2012-01-15T19:11:19+00:00 heroku[web.1]:←[0m State changed from starting to crashed
←[32m2012-01-15T19:11:19+00:00 heroku[web.1]:←[0m Process exited
I guess it's because play uses jpda.port=8000 by default and Heroku crashes with default parameters. Their documentation does not comment on test mode at all what I have seen so have anyone successfully started play in test mode on Heroku? I think I would need something like --jpda.port=$PORT2 in the procfile
An application on Heroku can only open one port (The one provided in the $PORT variable). Unfortunately this means that Play! test mode can't open up the second port that it would need for remote debugging.

remote debugging a jnlp application with IntelliJ

I'm trying to debug a web start application using IntelliJ 10 (running on Win7).
I read both SO:
remote debugging a jnlp application with eclipse
How can I debug applications under Java Web Start (JNLP) ?
It seems like I'm missing something.
I've tried to run it from command line, or adding the arguments into the jnlp file but no matter what I do I get an Unable to open debugger port : java.net.ConnectException "Connection refused: connect" Error.
How can I debug a web start app?
I know it's stupid, but once I changed the port from 5000 to 5005 it all works.

Categories

Resources