DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Elevate your data management. Join a lively chat to learn how streaming data can improve real-time decision-making, and how to reduce costs.

Platform Engineering: Enhance the developer experience, establish secure environments, automate self-service tools, and streamline workflows

Build Cloud resilience. High-profiled cloud failures have shown us one thing – traditional approaches aren't enough. Join the discussion.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Related

  • Authentication With Remote LDAP Server in Spring WebFlux
  • Authentication With Remote LDAP Server in Spring Web MVC
  • How to Implement Specific Distributed System Patterns Using Spring Boot: Introduction
  • Integrate Spring With Open AI

Trending

  • Ten Dos and Don'ts of Threat Modeling
  • Wow, pnpm, You’re Really Fast
  • Why React Router 7 Is a Game-Changer for React Developers
  • Advanced CI/CD Pipeline Optimization Techniques Using GitHub Actions
  1. DZone
  2. Coding
  3. Frameworks
  4. Remote Debugging on the Last Day of - Day 10: Building DDTJ

Remote Debugging on the Last Day of - Day 10: Building DDTJ

The second week is finally over and while I built a working DDT proof of concept. I wasn’t able to complete a fully working MVP. A proof of concept shows something working, an MVP needs to do something useful.

By 
Shai Almog user avatar
Shai Almog
DZone Core CORE ·
Jan. 01, 22 · Opinion
Likes (2)
Comment
Save
Tweet
Share
4.0K Views

Join the DZone community and get the full member experience.

Join For Free

Article Image

Yesterday the DDT PoC started working, today is the last day of my two-week “hack fest” on DDTJ… Here's where we stand.

The second week is finally over and while I built a working DDT proof of concept. I wasn’t able to complete a fully working MVP. The difference is that a proof of concept shows something working, an MVP needs to do something useful. DDT has yet to be realistically useful.

Making DDT useful is my main goal right now. To facilitate that, I’m trying to get it to work with a Spring Boot application. So far this isn’t going great, but I’m making iterative progress. Running the application like we do a “hello world” just doesn’t work. The backend is blocked and the launch method never returns. 

Spring Boot has a relatively elaborate bootstrap loading phase which causes issues with debuggers. The approach is to bind a remote debugger that wasn’t supported by DDTJ, so I added that support.

With remote debugging and some command-line magic for spring boot, I was able to connect to the spring boot VM and got the whole thing working.

Weird Bugs

Right now I’m in a bug squashing phase. Run the spring boot pet clinic app with remote debugging. Launch the backend. Connect them and find a bug. Fix, rinse, repeat. 

This is tedious, but mostly running smoothly. 

Unfortunately, I seem to run into issues that are very hard to debug. E.g. Unexpected JDWP Error: 32 which is thrown by the JDI implementation. This seems like an issue with stack frames, but I can’t figure out why it’s happening.

Another problem is that on a method entry event, the stack seems to be occasionally “corrupted”. Where the current method isn’t at the top of the stack. As far as I can tell, this isn’t something that should ever happen. But I might have missed a documentation nuance.

Attaching a Debugger

We can attach a debugger using the process id with a command like:

java -jar target/CLI-0.0.6-SNAPSHOT-shaded.jar -pid=62604


Or we can use a socket. Notice the socket always connects to localhost as remote debugging is a danger over JDWP:

java -jar target/CLI-0.0.6-SNAPSHOT-shaded.jar -attach=8000


Notice that the backend should have been running before and the pet clinic demo. I used the following command for the pet clinic:

java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -jar spring-petclinic-2.5.0-SNAPSHOT.jar -Dagentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000


Which might have been a bit much, but it took me forever to get the damn thing to connect through JDWP.

Upcoming PR and Where do we go Next?

This code is in a PR that still isn’t running the spring boot pet clinic. As such, I don’t want to commit it yet or create a PR. Unfortunately, the two-week vacation is over and I have other duties.

I’ll reduce my work pace on DDT for now as I have a lot of catching up to do at work. But I plan to bring it to MVP status within 2-4 weeks. I think the slower pace might help me digest some of these issues. So overall, it’s probably a good thing to take a bit of a break.

I made a lot of mistakes in the past two weeks, but I think I’m too close to it right now. I’ll try to write a post-mortem post next week to cover what I did well and what I can improve. This won’t be a summary, as I think my opinions on this will evolve further as I rethink some of my stances.

I suggest watching the DDTJ project to see when it gets updated with a new PR. You can also follow me on Twitter to keep up to date with the latest developments. 

I have some great ideas for the core technology of DDT that go well beyond testing alone. There’s a lot of untapped potentials here that we need to explore.

Spring Framework workplace Spring Boot

Published at DZone with permission of Shai Almog, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Authentication With Remote LDAP Server in Spring WebFlux
  • Authentication With Remote LDAP Server in Spring Web MVC
  • How to Implement Specific Distributed System Patterns Using Spring Boot: Introduction
  • Integrate Spring With Open AI

Partner Resources


Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: