Debug Rest API in Eclipse - rest

I am writing a program to connect with JIRA and create tickets automatically.
For this i used JIRA rest API. The code is done in Eclipse-Kepler using java as a stand alone program.
For some request, this program is throwing "Bad Request" and response code "400".
I want to debug what is wrong with a particular request. Is there any plug in to debug that?
I tried using Rest client in eclipse, but its asking for URL to hit in this tool.
I want if I run my program as Java, some tool can show me the required debug statements.
Thanks,
Arfeen.

Related

How to debug rust web server in vs code

I am building a web server using tide framework and I want to debug api function when server receive the request. However,when I click debug button on vs code, and using the curl command from terminal to send request to server, the terminal said "Failed to connect to port 3000,Connection refused". Does anyone know how to debug the rust web server on vscode?
I also had the same issue when I tried the code on this documentation page https://docs.rs/tide/latest/tide/. I'm going to assume that's what you're trying to debug?
I went to the github repository and there is a readme with a similar, but different example https://github.com/http-rs/tide. It works for me, and I could debug without any further issue using the rust-analyzer and CodeLLDB extensions.
Note: I had to restart my computer. After the first example failed I thought I'd try the curl command with a Node Express server to make sure there wasn't something blocking the request. After restarting this went away.

wso2 debugging a handler in eclipse

I am new to WSO2. I need to write a new handler.
Is it possible to debug the handler inside the eclipse?
I saw the documents of WSO2 Developer Studio here at a glance, but
it seems the documents are not suitable for beginners and I'm not sure that's about what I mean.
Thanks
You can remotely debug the code from Eclipse. Please follow https://medium.com/#anuradha.15/remote-debugging-wso2-products-using-intellij-idea-ide-c0e828abd700
You need to do the following.
Write the handler
Engage the handler
Start the WSO2 server as mentioned in the above blog.
When your code gets hit, you can debug in the Eclipse.

My REST API calls to Salesforce work through RunScope (an API debugging site) but not directly to Salesforce

So right now I'm trying to make a bunch of REST API calls to Salesforce from my WebSphere server, but every time I make a request, I get a "500 Server Error" error message in my logs. I then tried to run my API calls through RunScope to try and debug what was going wrong. As soon as I sent my API calls through RunScope to Salesforce, the 500 Error went away and everything worked. I instantly thought it was some kind of SSL Protocol issue since Salesforce apparently doesn't support SSL3.0. So I checked my WebSphere configuration and noticed that it supports both SSL and TLS protocols (I'm not 100% sure which protocol it's using though, if anyone knows of a way to test that, that would be helpful). Now I'm pretty stumped. I know it's not a certificate issue because i installed the needed certificates on my WebSphere server. Anyone else have any ideas why the API calls work through RunScope to Salesforce but not directly to Salesforce? Any help is appreciated.
I figured it out. My issue was that my WebSphere server was running TLS1.0 which isn't supported anymore by Salesforce. If you're running into the same issues as me, make sure your server is running TLS 1.1 or higher.

Debugging in eclipse using large URLs

I was debugging my application in eclipse on tomcat server by using the URL sent from browser to server (from app logs). However after some change in application the URL formed is pretty large thus I am not able debug it anymore. (I am using GET method).
Is there any way I can make it work ?

Where does GWT's Hosted Mode Jetty Run From?

I'm trying to call a web service in my back end java code when it's
running in hosted mode. Everything loads fine, the GWT RPC call works
and I can see it on the server, then as soon as it tries to call an
external web service (using jax-ws) the jetty falls over with a
Internal Server Error (500).
I have cranked the log all the way up to
ALL but I still don't see any stack traces or cause for this error. I just get one line about the 500 Error with the request header and response.
Does anyone know if the internal jetty keeps a log file somewhere, or
how I can go about debugging what's wrong?
I'm running GWT 1.7 on OS X 10.6.1
Edit: I know that I can use the -noserver option, but I'm genuinely interested in finding out where this thing lives!
From the documentation:
You can also use a real production
server while debugging in hosted mode.
This can be useful if you are adding
GWT to an existing application, or if
your server-side requirements have
become more than the embedded web
server can handle. See this article on
how to use an external server in
hosted mode.
So the simplest solution would be to use the -noserver option and use your own Java server - much less limitations that way, without any drawbacks (that I know of).
If you are using the Google Plugin for Eclipse, it's easily set up in the properties of the project. Detailed information on configuration can be found on the official site.
Edit: you could try bypassing the Hosted Mode TreeLogger, as described here: http://blog.kornr.net/index.php/2009/01/27/gently-asking-the-gwt-hosted-mode-to-not):
Just create a file called
"commons-logging.properties" at the
root of your classpath, and add the
following line:
[to use the Log4j backend]
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
[to use the JDK14 backend]
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
[to use the SimpleLog backend]
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
Edit2: the trunk of GWT now also supports the -logfile parameter to enable file logging, but it probably won't help in this case, since the problem lies in the way the Hosted Mode treats the exceptions, not the way it presents them.