Debugging web service with Intellij - java

I work with a web service (SOAP) that is installed on a remote server (Websphere). Since I do not fully understand its operation, I would like to use debugging to understand the code step by step. I want to use the local instance Intellij (ultimate). My problem is that due to little experience I do not know how to do it. I have questions:
to check the operation of WS I want to send queries to the server using SOAPUI. Is there a possibility for me to look at Intellij (using breakpoints) what values are returned at a given stage?
how to connect it all together?
is there a different, better way to check the code?

First, make sure that debug is enabled on your remote server. This can probably be configured in Websphere. Then, in IntelliJ select the "run configurations" dropdown and "Edit Configurations". Hit the "+" and select remote. Set the correct host and port, and click "OK". Then, start the run configuration in debug mode, add some breakpoints and debug away!

Related

503 Service Unavailable in Mule

I am getting 503 Service Unavailable when call in Mule application... Call is not reaching to HTTP Listener I think and beside of HTTP Listener there is Set Variable... to Set Variable also not reaching call... Till day before yesterday it was working in all work spaces but suddenly it is not reaching to listener when I was trying after putting debug mode. But for other developer is not having any issue and he is able to receive call to Listener and other components. Current configurations everything is good. Can you please suggest what needs to check.
I had the same problem when I added an autodiscovery configuration for my application. Adding this to VM arguments folved my issue.
-Danypoint.platform.gatekeeper=disabled
I faced the same problem.
Everything was working, and suddenly (don't know why) I received the same 503 response.
I tried a lot to figure out what was going on.
Added new listeners and tested existing flows, which all went well.
Only my particular listener with the APIKit was never getting reached anymore.
I also disabled 'the gatekeeper' as suggested in the following article :
API-returns-503-Service-Unavailable-error-to-clients
Run -> Run configurations -> tab Arguments
I exported the project to a deployable archive file, with the checkbox 'only export project sources' selected. Tested this application on different PC's which went well.
Created a new workspace on my PC, imported the file , and the application failed again.
After a few other try & errors, I enabled the 'clear application data' -> 'prompt' selection box, and I disabled the 'APIKit settings' -> 'Show APIKit consol'.
I'm not sure if that consol had something to do with it, but after restarting the application and select YES on Clear application data , it worked well again.
Run configurations
I re-enabled the 'show APIKit consol' again, and it still worked fine.
This should solve your problem as well.
This is basically the same answer as the answer provided by user15476634, but with a visual description, and reasons why this error may occur.
For those who are wondering where to find Clear Application Data, please see below screenshot.
Most usual suspects in these type of issues is corrupted Application data due to following issues:
Trying to open multiple test consoles at a time
Working on huge payload and not enough memory allocated
Accidentally selecting the multiple run configurations and/or debug configurations at once
when you try to re-run the same app while an instance is already
running by disregarding the prompt/warning window (Do you want to stop the running application and start ...?)
For me, I had the same experience, the 503s appeared out of nowhere. Clearing application data did not work for me, setting
-Danypoint.platform.gatekeeper=disabled
did not work for me. I had to remove this xml tag from my global config
<api-gateway:autodiscovery ... />
It happened to me after turning on autodiscovery in order to deploy, so i had to remove these lines (autodiscovery) temporary then test then return these lines back in order to deploy

How to run Jprofile with weblogic 10.x managed server?

Question:
How to make Jprofile 9.1 collect data from specific manged server and not from admin server?
Details:
By going with Jprofile wizard (Profile application server) I am able to attached Jprofile to the running Admin server but I am unable to find any option that allow me to monitor specific manged server.
In this question How can I connect Jprofiler with weblogic managed servers?
one of the answer says the following:
You're profiling the wrong server in that case. The VM parameter for JProfiler (-agentpath:...) has to be added to the JVM on which your application is executed.
The answer trying to point to some parameter changes to be done but it is not clear how to do it.
Here is a question that talks about setting JVM parameters for weblogic servers.
custom arguments to set in weblogic JVM
In the Domain Structure pane, expand the Servers node.
Click the name of the server that you want to configure.
In the right pane, click Server Start. Select Lock & Edit.
In the Arguments text box, provide the JVM options. After inserting your options, click Save.
Then click Activate Changes.
Restart the server so that the new
settings are used.
You should be able to set the relevant agentLib argument use the above described procedure.
Note, you need to copy the agent libraries onto the host that has the managed server.

Running a Web Service without opening Eclipse or any IDE

I want to develop a Java based Webservice on my laptop. This webservice will take one input parameter, query my SQL Server database and will fetch information and will return it back.
I know, I do not need a webservice here. But, right now, I am just testing my android application which will call this webservice and will show return data on my device.
So, I have developed a java program which connects my SQL Server Database (which is present on my laptop) and returns a value against the parameter passed. I have made it a webservice by creating endpoints and publishing it from another class.
For reference, something like answer on this thread
So, when I run it from my Eclipse, I can go to a browser and run my webservice, pass parameter and get result.
But, once I close my eclipse, its no more accessible. I am new to this and after studying I am guessing that I will need IIS to host it on my laptop.
I want to ask, whether it is possible to run/publish it locally on my laptop as a background process so that I can test my android app by calling the same?
Future scope -
I am going to deploy this webservice in my company which will connect my database. Both webservice and sql server will be on same machine. I am going to call this webservice remotely over internet from my android device to show the results.
I guess, I will need IIS in future right? Is there any other way to fulfill this requirement? Please provide some ideas.
If, within Eclipse, you can get your web application deployed so that it is accessible via a browser, then you definately can do it without eclipse.
Eclipse uses plugins like Tomcat or Glassfish to run your webserver. These programs are available outside of Eclipse as standalone services. You can install these and run them as background processes at the command line.
Just figure out which one you are using in eclipse (or which one you want to use) and look for a standalone copy on the web.
Here's Tomcat, btw.
I am done with this.
What I did is, I went to Eclipse, selected my Project-> Right Click -> Export -> Under General -> Ant Buildfiles
This created, Build.xml in my Project directory.
I deleted all the class files and recompiled them using ant command.
In my case, target name was build-project which compiles all the java files.
So, I did ant build-project
Note - This was done as Eclipse was using different JDK version.
Now, I called my publish class to publish my webservice with
ant publish
This was half done as this was running in interactive mode.
Then I created a bat file with following command -
"path_for_ant_bin_directory\ant" -buildfile "path_to_build_file\build.xml" publish
This was opening up the command box. So, I created a vb script to run the bat file in background
Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
strArgs = "cmd /c path_to_bat_file\my_bat.bat"
oShell.Run strArgs, 0, false
And, now it nicely runs in background and I can access my webservice.
Hope it helps someone with similar requirement.

google app engine local server doesn't work run after multiple times in eclipse

After running app-engine java project multiple times in eclipse, app-engine local server doesn't work. I am getting error "This webpage is not available" in Google chrome. But eclipse console says that "dev App Server is now running". But using dev_appserver.cmd works fine, it is too difficult when developing the project. Any ideas to solve this?
PS: rerunning is done after stopping the current execution of the server.
Choose 'Automatically select an unused port' in debug configuration.
Local server will start every time on different port, but it should solve your problem.
try to change the configuration by "run as" or "debug as" and check server and port no.
Also ensure that in Windows>>preference>>java>>jre a path to jdk (not jre) is selected.
Please provide more details of the problem if it is still there.

GWT force Update on Server during development mode

I am getting a really annoying problem. In my application, whenever i need to change client code, the refresh make the new fix works
However, when editing server code, i need to stop the current application and run again. When the application is big, this takes a little time.
Is there a way to force update the current running server code???
i need to stop the current application and run again
[...]
Is there a way to force update the current running server code???
Absolutely! It's not necessary to stop the server when you need to refresh the server side code: In the "Development Mode" view (in Eclipse), click the icon with the two yellow arrows. This application reload is much quicker than a server restart.
If you are using Eclipse run your back-end application in debug mode instead of run mode and that usually gets you a little closer due to its incremental compiler.
Check this out on how to use an external server with GWT http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT's
Run your server side code in some other server like tomcat. And start the gwt application in noserver mode. But if you change any rpc related classes in client side you have redeploy the code in tomcat server.

Categories