I am using springboot's sample project from: https://github.com/spring-guides/gs-spring-boot#run-the-application. This is the command I used to run the built jar file:
java -jar build/libs/gs-spring-boot-0.1.0.jar -
Dcom.sun.management.jmxremote -
Dcom.sun.management.jmxremote.port=12348 -
Dcom.sun.management.jmxremote.authenticate=false -
Dcom.sun.management.jmxremote.ssl=false -
Dcom.sun.management.jmxremote.rmi.port=12348 -
Djava.rmi.server.hostname=192.168.7.119
Then I tried to use jmxterm to connect:
java -jar ~/Downloads/jmxterm.jar -l localhost:12348
But getting connection refused error.
The -Dcom.sun... arguments must come before the -jar thing.jar . Anything after the -jar thing.jar are considered arguments to your application, and are passed into main.
Related
Similar to https://answers.sap.com/questions/12675326/sap-dbtech-jdbc-708-receive-of-connect-fail.html
Connection to SAP Hana Cloud fails with the error "RTEException: -708 Receive of connect failed."
Steps to reproduce:
java -version
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)
java -jar ngdbc.jar -V
package package com.sap.db.jdbc, Java Platform API Specification, version 1.4, SAP HANA JDBC Driver, SAP SE, 1.120.05-8c23c50e159e9883edab0e2ebdd4e02c5919cd08
java -jar ngdbc.jar -u DBADMIN,PASSWORD -n BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443 -d test -o encrypt=true -o validatecertificate=false
(the certificate is imported, and the error occurs even without the parameters encrypt and validatecertificate)
Contents of trace log:
ClassLoader: jdk.internal.loader.ClassLoaders$AppClassLoader#55054057
Process-ID: 320850
package package com.sap.db.jdbc, Java Platform API Specification, version 1.4, SAP HANA JDBC Driver, SAP SE, 1.120.05-8c23c50e159e9883edab0e2ebdd4e02c5919cd08 on Java 11.0.15
---- Thread 1eb44e46 main Timestamp: 2022-09-29 09:50:03.162
new Connection 'jdbc:sap://BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443'
password=****
databaseName=test
host=BIG-IDENTIFIER....
options=
cmd=Select top 1 42 as "connect test" fro...
user=DBADMIN
HOSTLIST: [BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443,]
new RTEException: -708 Receive of connect failed.
whereAmIjava.lang.Throwable
at com.sap.db.util.Tracer.whereAmI(Tracer.java:280)
at com.sap.db.rte.comm.RTEException.(RTEException.java:51)
at com.sap.db.rte.comm.BasicSocketComm.receiveInfoRequest(BasicSocketComm.java:587)
at com.sap.db.rte.comm.BasicSocketComm.doInfoRequest(BasicSocketComm.java:84)
at com.sap.db.rte.comm.BasicSocketComm.connectDB(BasicSocketComm.java:187)
at com.sap.db.rte.comm.SocketComm$1.open(SocketComm.java:47)
at com.sap.db.jdbc.topology.Topology.getSession(Topology.java:88)
at com.sap.db.jdbc.Driver.openByURL(Driver.java:1216)
at com.sap.db.jdbc.Driver.connect(Driver.java:313)
at com.sap.db.jdbc.Driver.main(Driver.java:858)
using null
=> FAILED
any thoughts on the why and how to solve it?
Since this is HANA Cloud Trial, I don't think, that you should use -d to specify a tenant database name. Please try to remove this parameter as you may be trying to connect to a non-existing tenant database. You can also refer to this tutorial.
Second thing to consider is the allowlist for IP addresses. Per default connections are blocked if you have not added your client ip to the allowlist. More details can be found in this blog.
Last but not least, please check if your are using the latest version of ngdb.jar. It can be obtained on this site.
I'm trying to build a jib based container with gradle.
I'm getting a 503 error when it tries to GET an xml file from jfrog.org.
+ eval set -- '"-Xmx64m"' '"-Xms64m"' '"-Xdock:name=Gradle"' '"-Xdock:icon=/Users/username/VSCode/globality-karate-testing/media/gradle.icns"' '"-Dorg.gradle.appname=gradlew"' -classpath '"/Users/username/VSCode/globality-karate-testing/gradle/wrapper/gradle-wrapper.jar"' org.gradle.wrapper.GradleWrapperMain ''\''jibDockerBuild'\'' \
'
++ set -- -Xmx64m -Xms64m -Xdock:name=Gradle -Xdock:icon=/Users/username/VSCode/globality-karate-testing/media/gradle.icns -Dorg.gradle.appname=gradlew -classpath /Users/username/VSCode/globality-karate-testing/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain jibDockerBuild
+ exec /Users/username/.sdkman/candidates/java/current/bin/java -Xmx64m -Xms64m -Xdock:name=Gradle -Xdock:icon=/Users/username/VSCode/globality-karate-testing/media/gradle.icns -Dorg.gradle.appname=gradlew -classpath /Users/username/VSCode/globality-karate-testing/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain jibDockerBuild
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'karate-base'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve org.jfrog.buildinfo:build-info-extractor-gradle:4.+.
Required by:
project :
> Failed to list versions for org.jfrog.buildinfo:build-info-extractor-gradle.
> Unable to load Maven meta-data from https://repo.jfrog.org/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/maven-metadata.xml.
> Could not get resource 'https://repo.jfrog.org/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/maven-metadata.xml'.
> Could not GET 'https://repo.jfrog.org/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/maven-metadata.xml'.
Received status code 503 from server: Service Unavailable: Back-end server is at capacity
This appears to be a problem with the jfrog.org server.
It only seems to happen if this is the first time someone has built the project.
Another engineer was able to replicate my error, who had not built this prior.
An engineer who had built the project earlier does not have problems. Seems to be an initialization file.
Heard back from Jfrog support.
The repo https://repo.jfrog.org/artifactory/ has been deprecated.
Replace it with: https://repo1.maven.org/maven2
How to run tomcat with debug from idea on mac, getting error:
/Users/konrad/Applications/apache-tomcat-9.0.12/bin/catalina.sh run
[2018-10-25 01:56:13,230] Artifact Gradle : com.test : MyService.war: Waiting for server connection to start artifact deployment...
Error occurred during initialization of VM
Could not find agent library jdwp:transport on the library path, with error: dlopen(libjdwp:transport.dylib, 1): image not found
Disconnected from server
VM options:
-DprofileName=dev -agentlib:jdwp:transport=dt_socket,server=y,address=8000, suspend=n
I'm using InteliJ and Tomcat 9 with debug on Mac
Hi I try to use this awesome Gradle plugin: https://github.com/bmuschko/gradle-docker-plugin
I use the following URL obtained from my docker-machine / kitematic installation on osx:
docker-machine url default
tcp://192.168.99.100:2376
However using:
url = "tcp://192.168.99.100:2376"
results in the error:
org.apache.http.conn.UnsupportedSchemeException: tcp protocol is not supported
When I change the tcp to httpI get a different error:
INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[pool-4-thread-1] ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
org.apache.http.client.ClientProtocolException
in case the gradle dockerBuildImage task is run.
But manually building the Dockerfile created by gradle works without any problems.
The following code can be used to replicate the problem. https://github.com/geoHeil/lab04/blob/master/build.gradle
Docker-machine enables TLS by default. I Switching to the TLSmode should be a good solution:
url = 'https://192.168.59.103:2376'
certPath = new File(System.properties['user.home'], '.boot2docker/certs/boot2docker-vm')
I am using intellij idea and jboss server.
When I run it it works fine but when I debug it it gives me:
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Disconnected from server
What is the problem?
Make sure the jboss vm is running with the parameters Idea shows in Debug dialog - specifically the port number seems incorrect to me.
If you're running on OS X Mountain Lion you could try popping -d64 into the VM options, that seemed to work for me. Not passing the variables, I think, will just prevent you from debugging.
For more information check here.
Unchecking the pass variables didn't work for me. What I ended up doing running the jBOSS separately and using 'Remote jBOSS' configuration in intelliJ.
To make debugging work I ened up adding the following lines to the "standalone.sh"
DEBUG_JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:62307,suspend=n,server=y "
JAVA_OPTS="${DEBUG_JAVA_OPTS} $JAVA_OPTS"
The value of DEBUG_JAVA_OPTS has to be copy and pasted from IntelliJ dialog box. These lines have to be inserted into the script right after the place where script sets up "JAVA_OPTS"
Update:
Looks like IDE generates a new port number for each project. So you have to edit the standalone.sh file every time you switch project. Hopefully somebody can suggest a fix for it.
Another option might be to comment out the 'if' statement in standalone.conf as below.
Note the first $JAVA_OPTS is added (it is the one passed in from IntelliJ). This way there is no need to remember to change the port number for every project.
#Specify options to pass to the Java VM.
#
#if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="$JAVA_OPTS -Xms64m -Xmx512m -XX:MaxPermSize=256m - Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djboss.server.default.config=standalone.xml"
#else
#echo "JAVA_OPTS already set in environment; overriding default settings with val ues: $JAVA_OPTS"
#fi