Configuring IntelliJ 14 to debug an externally deployed Glassfish application - java

Hi All IntelliJ IDEA experts,
I seek help (if possible please with screenshots) on how to configure IntelliJ IDEA 14 to just debug a Glassfish 3.1 EAR and WAR
App deployed externally. I mean mvn build and deploy via Glassfish
Admin console and only debug from IntelliJ .
I go to set a local debug config in Glassfish and it insists on deployment of artifacts (which I do not want to do via IntelliJ)
Reason for not deploying via IntelliJ is that 2 WAR files depend on the
EAR to be deployed before hand and currently I think IntelliJ (as of version 14) does not let you juggle / or manually sort the deployment order and sorts deployment artifacts by name-wise in the natural sort order (A limitation)
Please help with externally configured artifacts based debug configuration help!
Screenshots for local debug config attached herewith

Just setting local Glassfish debug configuration is enough. There is no difference if the wars/ears are deployed via IDEA or externally.
The message you refer to "No artifacts marked for deployment" is actually a warning, not an error (although the red color of the icon is confusing). ALthough it appears, it does not stops you from running the debug configuration (just hit OK when the message appears).

Delete password in admin configuration.
like this

Related

How to correctly debug a GWT application with Jetty Runner in IntelliJ IDEA

I'm trying to migrate some legacy GWT applications from eclipse to IntelliJ. Oh man, what a nightmare. I've come very near to a dead end with my research. I'm at the point where there is simply no related page or documentation that I have not seen, not to mention the information on this topic is very, very sparse.
My setup is as follows:
IntelliJ IDE
GWT 2.9 plugin
Jetty Runner that is using Jetty v11.0.7
Here are my GWT and Jetty debug configuration settings:
When I navigate to the jetty server URL I always get "Error 404 Not Found" message.
Now, when I navigate to the "Debug" directory that is specified in the GWT configuration I do see that there is no RSS.html which is a problem but even the "blank.html" is not able to be navigated to. One potential issue is maybe I am somehow not compiling the debuggable version of the GWT application correctly?
My other guess is that I have to somehow point to an actual .war file. I do have an ant build script that works just fine and generates a .war that works correctly in production. Below is a screenshot of the generated war file as well as the directory used to build the war archive.
In summation, how do you correctly debug a GWT application in IntelliJ using the GWT configuration with a Jetty Runner server?
I can promptly provide any additional info that I may have left out.
EDIT
I would like to add that this How to get GWT Super Dev Mode to work with IntelliJ question is very similar to what I am asking here and it was never edited with the correct answer, also since this was posted super dev mode was added. It would be great to get a clear solution documented for myself and others. To reiterate the answer needs to achieve these three things,
Use a Jetty Runner configuration (to enable use of different Jetty versions as there can be a cascade of conflicts depending on your codebase)
Use a GWT configuration to run a code server with the Jetty Runner instance so debugging is possible.
Use IntelliJ IDEA

Intellij IDEA (Ultimate) with Glassfish 5.0 (Local) Debugger Settings

I have a Java Web Application and a web container Glassfish 5.0 with some custom java agent attached to the container.
I want to Debug my application as well as attach a Remote Debugger to Debug my Agent code simultaneously.
I am using Intellij IDEA Ultimate.
Now in the Intellij Run Configuration for Glassfish, I do the usual settings with some domain name. For Debug options "-agentlib:jdwp=transport=dt_socket,address=9100,server=y,suspend=n"
I want to make 'servey=y, suspend=y' , NO COMPROMISE ON THAT.
I try doing that by changing the 'domain.xml' but when I open my intellij glassfish configuration setting it gives me 'Warning : Debugger Settings are Invalid...' , I click Fix and the domain.xml is changed back to default with 'server=n,suspend=y'.
I tried changing from the Glassfish Administration console as well, both the default-config and server-config, but no luck.
WORKAROUND : I can deploy a WAR / Exploded WAR of my Application in glassfish domain folder, and customize 'domain.xml' and run the domain in debug mode ./asadmin start-domain --debug domain1, then I can successfully attach a Remote Debugger. BUT THIS ALLOWS TO ONLY DEBUG MY AGENT CODE and NOT MY APPLICATION
I suppose this is a problem with Intellij IDEA. Does anyone have a fix for this ?

How to enable Hot deployment in JBoss using Redhat server connector extension in VSCode

I have made a small maven based web application in VSCode and trying to deploy it on JBoss using the Redhat Server Connector Extension.
But the hot deployment of the class files does not work in simple running JBoss server.
But Hot deployment does work in debug mode as 'Hot Code Replace' by setting the property 'java.debug.settings.hotCodeReplace' to 'auto'.
My inputs are from below links:
https://devblogs.microsoft.com/visualstudio/hot-code-replacement-for-java-comes-to-visual-studio-code/
and other SO links like:
How do I get Java "hot code replacement" working in JBoss?
Hot deploy on JBoss - how do I make JBoss "see" the change?
But it couldn't help.
Can you suggest something more about how it is simply possible in running JBoss?
(PS: Auto Build feature in VSCode is already enabled.
And It works fine in eclipse).
Hot deployment of web applications in VSCode's integrated RedHat Server connector can occur in following ways:
Exploded war folder: A folder is extracted from the original war and deployed to JBoss using the Exploded option. Here, the static changes like change in jsps and HTML are automatically reflected in the running application.
Hot code Replacement: Hot code replacement (HCR) is a fast debugging technique in which the Java debugger transmits new class files over the debugging channel to another JVM.
HCR only works when the class signature does not change; you cannot remove or add fields to existing classes when using HCR. However, HCR can be used to change the body of a method.
(source: https://devblogs.microsoft.com/visualstudio/hot-code-replacement-for-java-comes-to-visual-studio-code/)
Maven Install/build: It is actually not a preferred technique which someone will want but it is useful also. In this technique, you run maven: install which builds the project again and install it onto the server again.
Currently, VSCode for java and the server connector extension are new as compared to already available IDEs like Eclipse. So, we might expect more powerful functionality in coming future.

Publishing webapp into local Liberty Stuck from Eclipse

I have a Dynamic Web App in Eclipse deploying into a WebSphere Liberty pluging.
It was deploying fine until I create an Ant file to build an EAR file.
After that automatic Deploy Stuck on 80% of the publishing process
Stay with Msg:
Publishing : myEAR: Waiting for application status from the server.
I remove the ant file but anyway.
What can I do to make Eclipse work as before.
If stuck at about 80% eclipse is usually waiting for the server to print a message saying that the application was started. Do you see a message in the console view similar to the following?
[AUDIT ] CWWKZ0001I: Application Web2EAR started in 0.048 seconds.
If not is there anything in the console view or in the server logs to indicate what might have gone wrong with the application deployment?
I was able to fix this problem by double clicking on the server and unchecking the "run Applications Directly From Workspace" option.
My environment is slightly different. My project is both a Maven Project and a Dynamic Web Project. And I added the Maven dependencies to the Deployment Descriptor.

Unable to install breakpoint in Eclipse: Absent Line Number Information

I have a Java 1.6.0 web application that I am developing using a Kepler Version 2 Eclipse development environment. I am using an Oracle Weblogic Server Administration Console 12c.
I'm running the app locally - and trying to debug it. Instead of stopping at any of the breakpoints I've set - I get the following error:
When I installed the application to Weblogic, I ran the Weblogic console and then installed the application by adding the ear file.
I thought I did everything exactly the same as previous web applications I've done this way - but I was always able to debug those applications.
Also - one other thing that is different. When make any changes and re-build the ear file - I actually have to delete and reinstall from the Weblogic console for the changes to take place. I'm thinking this might be related.
Any suggestions?
Thanks!
Have a jar file added to a build path in any of the projects that
include the classes in your project

Categories