Debug java application in eclipse without using debugger - java

I am working on project that is not having debug options in eclipse.
I would like to understand the flow of execution from within Java classes across workspace.
Is there a method to understand the flow of execution. I am working on struts application and I have configured all dependant java files accordingly. But while running the application, new field added is not persisting to database and remains blank.
Any help is much appreciated.

lazy way of debugging is by adding a print statement for every line you want to follow.
The right way would be using debug logs with Log4j

Related

JSP debugging in IntelliJ with spring-boot

I want to be able to debug jsp templates in IntelliJ.
I'm using Spring-Boot
Project is without web.xml file. Made with Annotations.
I'm launching app via Spring Boot run Configuration in IntelliJ
When I launch the app, breakpoints become gray crossed circles, indicating that no class associated with it.
Jsp location is /webapp/WEB-INF/jsp
Now, before I get marked for duplicate:
This question is quite old and only suggest using web.xml + Tomcat and plugin. Pluggin doesn't seem to work and switching to web.xml is going to be a real pain in the bottom. Would be nice to stay with annotations and not include web.xml
Tried launching via maven command as suggested in this answer, but for unknown reason, after launching, the process detaches from intellij and I'm not able to launch it again (have to destroy process in the process task first) and it doesn't resolve the issue either.
Other answers, suggesting launching Tomcat directly fail as it won't launch without web.xml.
How can I keep an ease and speed of launching Spring-Boot application, have an ability to hot-swap the code, debug java and jsp templates while avoiding web.xml configuration all at the same time?

How can i setup end to end code debugging for JBPM application

Project uses bpmn files for handling main part of the flows.Currently i have set up code debugging for java part which this way is useless for bpmn files because hundreds of lines embedded to script tasks iniside bpmns.If i set up debug for bpmns it would be useless for java part.Question is to find some way to setup debugging for both.Thanks
This might depend on the jBPM version but jBPM Eclipse Plugin 6.0 comes with debugging capabilities as explained in 18.2 Debugging, however:
Note that we currently don't allow you to put breakpoints on the nodes within a process directly. You can however put breakpoints inside any Java code you might have (i.e. your application code that is invoking the engine or invoked by the engine, listeners, etc.) or inside rules (that could be evaluated in the context of a process). At these breakpoints, you can then inspect the internal state of all your process instances.
If installing Eclipse plugin is not possible you would have to debug through the Java code of jBPM engine. It's doable, but not pleasant experience.

Flow execution in Ejb project in java

Hi am working on very very old projects which contain 10 to 15 dependencies am very curious to know any tool or some utility to track flow execution of java class,method,lines,return type,get query executed while operation ..etc
for example:
if am calling soap request from SoapUI its goes into #WebService() and flow goes on..
How do I trace methods calls in Java? i have seen this link not sure how to incorporate and execute in existing project am doing manual job right now by debug with eclipse.kindly help on if way to write code or tool which i can see executions
JPDA. any decent IDE will connect to your container via JDPA protocol and allow you to debug from inside the container. you have to configure the container using some configuration switches (which get passed onto the JVM at startup time). check the documentation for you app server for how it prefers to be configured for JPDA.

Step into not working in the debugging mode Eclipse

I am working on a project of java. I opened the project in debugging mode, and goes through the program. One thing where I got stuck is that, if I step into a specfic function, it dont go into it. Instead if I put a breakpoint inside that function then program goes upto that point. I am using Eclipse 3.7.2. I dont know why eclipse is showing such a behaviour. Any help will be appreciaed.
dystroy already said in a comment what I was planning to say in this answer: the most common cause for me experiencing this is when the actual runtime class instance is a dynamic proxy, usually from either hibernate, or Spring, or a mock object framework (when testing) such as Mockito. In those cases, you generally have to do exactly what you have done, and put a breakpoint inside the method being stepped into.

How do I tell a remote debugger to actually suspend at some point?

I'm using IntelliJ Idea debugger and I have some 3rd party app with its sources (shouldn't matter, but it's hyperic). I need to see when some methods are being executed and trace the execution process. I've successfully connected to the app using remote application debug but can't figure what to do next. O_o
It is possible to suspend the app, but how to attach sources and tell it when exactly to suspend (method call/line of code/etc)?
EDIT: Alternatively I could use eclipse (doesn't matter what to use if it's working).
EDIT2: It's not one of my projects/modules/whatever.
Open the source code in an editor and set a break point.
The debugger should be smart enough to figure out what you want to achieve.
[EDIT] Create a small project which contains the sources and all the JARs. That should compile without error and allow you set breakpoints.
In Eclipse, you can attach sources to JARs. That way, you can set breakpoints.
To debug the remote application you need it's sources in your eclipse (whatever IDE) project. And then just set breakpoints and launch remote debugger with appropriate port.
Is it possible that the source code is out of sync with the code being executed? I've had this happen before so that the breakpoint I set was actually on a non-executable line (whitespace, comment) according to the remote machine's version of code.
The only other time I've seen something like that was when the remote machine was running several JVMs and I accidentally connected to the wrong port (and thus the wrong JVM).
When you are debugging the red dot that represents the breakpoint should change slightly, what does it look like while you are debugging? For example, if the line is non-executable I think there will be an X on top of the dot.

Categories

Resources