Issue remotely debugging java cloud application with vscode - java

I figured i'll post the question on stackoverflow as well. https://github.com/Microsoft/vscode-java-debug/issues/450
I'm having issue remotely debugging an azure function that is deployed to azure. I'm following the following instruction https://github.com/Microsoft/vscode-docs/blob/master/docs/java/java-azurefunctions.md.
I'm using https://www.npmjs.com/package/cloud-debug-tools which successfully connects, but I get an exception when i try to remotely connect to the debug port via vscode.
Thanks,
Derek

Looks like this question is already getting traction on GitHub: https://github.com/Azure/azure-functions-host/issues/2986. I suggest following up there since the product team is already investigating.

Related

PostgreSql connecting locally to remote server GCP

I am trying to connect locally by using pgAdmin or sql developer to the remote database. Database is on GCP however I dont know what I am missing.
On the screenshot
It is configured in GCP as a Cloud SQL instance and the problem is that initially It did not have public IP only private IP. So I exposed one by following the instruction from: https://cloud.google.com/sql/docs/postgres/authorize-networks#authorized-networks
This is how currently looks like (I am using username and password from the application.properties of a java project that is in VM instance to connect to sqlDeveloper):
screen of the configuration of CloudSql
And the configuration of the sql developer:
sqlDeveloper setup
There is definitely something missing or I am doing it wrong.
Can someone help me with connecting locally to the database.
I am totally new to GCP. I am used to configuration files like in tomcat context.xml
If you haven't a public IP, you can't connect your instance from outside GCP. So you can't (easily) from your local environment.
I wrote an article on this. Have a look, you will understand what's the problem and how to solve it (the hard way!)

Debugging Apache Spark clustered application from Eclipse

I am trying to debug Spark application running on eclipse in clustered/distributed environment but not able to succeed.
Application is java based and I am running it through Eclipse. Configurations to spark for Master/worker is provided through Java only.
Though I can debug the code on driver side but as the code flow moves in Spark(i.e call to .map(..)), the debugger doesn't stop. Because that code is running in Workers JVM.
Is there anyway I can achieve this ?
I have tried giving following configurations in Tomcat through Eclipse :
-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=7761,suspend=n
and setting respective port in Debug->remote java application.
But after these settings I get the error: Failed to connect to remote VM. Connection Refused
If anybody has any solution to this, please help.
I was facing the same issue while configuring the spark debugging on remote master. But after that I've installed the spark on my Ubuntu machine then it worked fine. If you really want to debug, my suggestions are
1- configure spark on your testing machine then you can easily debug applications.
2- use IntelliJ IDEA, I've used it for for debugging if I've to use remote spark.
EDITED:
If you are going to use IntelliJ IDEA then you can easily configure remote debugging as explained here. Debugging Apache Spark Jobs

Deploying webservice on remote machine

This might sound a very basic question for the N/W gurus so please try to help me here.
I have developed a simple Webservice in Java and deployed it on a local machine using Eclipse/Ant. The path looks like this -
http://localhost:8284/myws?wsdl
Now, I have provided a static IP for the local machine say XX.XX.XXX.XX and I can ping it from any remote machine over internet.
In my Java program, I have provided endpoint name as -
"http://localhost:8284/myws" and it works fine on local machine and opens the wsdl just fine in a browser.
Now, I want to deploy this webservice in a way that, I can access it remotely using my static IP i.e XX.XX.XXX.XX
Problem 1:
When I try to assign the endpoint as
"http://XX.XX.XXX.XX:8284/myws" my Java program gives error saying
Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
Problem 2:
If I deploy it as "http://localhost:8284/myws", I am not able to access it over internet using URL like http://XX.XX.XXX.XX:8284/myws?wsdl.
Things I have did so far - -
a. Turned off the firewall
b. Created 2 rules inbound/outbound with port 8284 allowed.
My question is, will I need a router to do a port-forwarding thing? Or will I need an IIS to deploy it?
I really want to ignore both of them. If there is any simple way to do that please let me know. Am I missing something? I am able to ping the IP and can also connect through RDC.
Info -
Machine is on Windows 7.
Any help will be greatly appreciated.
Thanks.
I got it solved. I used http://0.0.0.0:8284/cal while binding and not localhost:8284/cal
Works like a gem now! Hope it helps someone.
Regards,
Bhushan.

Dynamic Webservices project -- can only connect over localhost

I'm running a RESTful webservice created in Eclipse Java EE using TomCat 7.0. I test it using a web browser. It will connect over the localhost, but not with the remote IP. It used to work with an IP, and then I moved my project to a Git repository so I could upload it to Github. Now it's not working for an IP. Not really sure what's up.
Any ideas? Firewalls are off too.
Bonus: I also have the small red x error icon on my project. I can't find any errors and it compiles fine and works fine as long as it's localhost. How the heck do I get rid of the x icon?
Edit: Works with a local IP. I was testing this on a college network earlier. Now I'm on a home network. Any comments?
Hope the following article helps :
www.sitepoint.com/accessing-localhost-from-anywhere
Incase you also have trouble accessing via localhost refer to all the answers for this post:
stackoverflow.com/questions/2280064/tomcat-started-in-eclipse-but-unable-to-connect-to-http-localhost8085
The question is missing many details like logs.. url and configuration for tomcat to give you a specific answer

Unable to connect to server database from java desktop application

I created a java desktop application. I am trying to connect this application to mysql
server database. But it is throwing socket exception. I tried in all the ways to solve this issue
but none of them worked for me. The problem which I got is mentioned in this link http://ubuntuforums.org/archive/index.php/t-849637.html
Please help me in this regard.
Will be really thankful..
According to your respnose on Oct 3'12 at 10:27, you already found out this is not Java related.
Fix your network problem:
ensure MySQL is really running
ensure you use correct IP/port
ensure no firewall is blocking traffic

Categories

Resources