Exception in remote debugging for SpringBoot Application - java

I have a SpringBoot Application which internally communicate with the JMS and activeMQ. I have a .cmd file to start that application. I have added arguments to enable remote debugging, so I can debug the application in eclipse. The cmd file as below:
set JAVA_CP=./;./config;./lib/*
set JAVA_JMX=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10090 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
set JAVA_CL=com.myapp.test.server.TestServer
set JAVA_OP=-Xmx280m -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8090,suspend=n %JAVA_JMX%
"%JAVA_HOME%\bin\java" %JAVA_OP% -cp "%JAVA_CP%" %JAVA_CL%
Now when I start ActiveMQ and then my application with above .cmd file. I got following error:
18:27:53.234 [main] ERROR [o.a.coyote.http11.Http11NioProtocol] Failed to start end point associated with ProtocolHandler ["http-nio-8080"]
java.net.BindException: Address already in use: bind
If I remove the debugging arguments(-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8090,suspend=n) from .cmd file, it works fine.
I search about this and found that it may possible that two instances are running, but I verified that also. Can you please help?

Related

Problem encountered while remote debugging java application as a service

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)

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.

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

Jmx remote connection to Openshift WildFly

I trying to connect remote jvm, used jvisualvm.
I started server with this parameters:
-Dcom.sunmanagement.jmxremote=true
-Dcom.sun.management.jmxremote.port=15001
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
and i have this error:
Error: Exception thrown by the agent : java.lang.NullPointerException
when i removed this parameters:
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
i have another error, like this:
Error: Password file not found: /var/lib/openshift/5406e3aa500446a793000178/
wildfly/usr/lib/jvm/jdk1.8.0_05/jre/lib/management/jmxremote.password
Question. How configure server for jmx remote connetion?
I used action hooks for init java parameters.
May be exists another tools for monitoring jvm?
My guess is that trying to use jmx remoting bind per default to 0.0.0.0 (aka all network interfaces). However, on Openshift you can only bind to $OPENSHIFT_INTERNAL_IP. The error seems cryptic, but that might be caused by https://bugs.openjdk.java.net/browse/JDK-8048050.

Not able to debug webservice code in IntelliJ

I have a window service that I have installed.I have the source code of the application opened in Intelli J.
I made configuration IntelliJ as following
I checked the PID of the service and port it is using.
While running Remote config in Intelli J it is giving following error
4:09:18 PM Error running Remote: Unable to open debugger port : java.net.ConnectException "Connection refused: connect"
Can someone please shed some light on how to debug window service in IntelliJ. It is a job schedule application.
The installService.cmd is as follows
set HOME_DIR=%~dp0
set SERVICE="Service_Name"
SET JAVA_OPTIONS=-Xms256m -Xmx256m
#echo Service name is Service_Name
"pathname\Service_Name.exe" -install %SERVICE% %JVM% %JAVA_OPTIONS% -Djava.class.path="pathname\Service_Name.jar" -Dorg.quartz.properties="pathname/Service_NameScheduler.properties" -start com.org.st.Service_Name -stop com.org.st.Service_Name -out "D:/core_log\Service_Name_service_out.log" -err "D:/core_log\Service_Name_service_error.log" -current "pathname\apps"
set JVM="C:/Program Files/Java/jdk1.6.0_29/jre/bin/server/jvm.dll"
Check the port number. It should be same as in JAVA_OPTIONS & Intellij Idea Debugger remote configuration under port no.
Please append the command line arguments from the IntelliJ debug configuration to the SET JAVA_OPTIONS line, it will be something like
SET JAVA_OPTIONS=-Xms256m -Xmx256m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=51211
And reinstall the service.
Make sure whatever port you're listening on isn't blocked by a firewall.

Categories

Resources