Spent 20 minutes wondering why my Spring Boot app was not reading environment variables The code looked fine @Value("${DATABASE_URL}") private String dbUrl; application properties had nothing wrong But dbUrl was always null The problem was I set the environment variable after starting the IDE IntelliJ caches environment variables at startup so it never picked up the new one The fix was just restarting IntelliJ One restart and everything worked Spring Boot reads environment variables correctly but your IDE might not refresh them automatically What simple issue has wasted your time lately #Java #SpringBoot #Debugging #BackendDevelopment #IntelliJ
Spring Boot Env Var Issue: IntelliJ Cache Gotcha
More Relevant Posts
-
Here’s a quick demo of my Neighborhood Library system built in Java through the Year Up United Application Development program. This video shows the application in action — handling book checkouts, returns, and user interaction through a simple menu-driven interface. Great experience turning concepts into a working program. GitHub: https://lnkd.in/eFMAECUg #YearUpUnited #Java #SoftwareDevelopment #TechJourney
To view or add a comment, sign in
-
Spring Boot Bean Lifecycle — Most developers ignore this 🔥 Do you know what happens before your bean is ready? Here’s the flow 👇 1️⃣ Bean Instantiation 2️⃣ Dependency Injection 3️⃣ @PostConstruct runs 4️⃣ Bean is ready to use ✅ And before shutdown: 👉 @PreDestroy is called 💡 Why it matters: ✔ Resource initialization ✔ Cleanup logic ✔ Better control over application lifecycle ⚠️ Mistake: Putting heavy logic inside constructors ❌ 👉 Use @PostConstruct instead Understanding lifecycle = writing smarter Spring Boot apps 🚀 #SpringBoot #Java #BackendDeveloper
To view or add a comment, sign in
-
🧠 After learning Dependency Injection, I had one big question 👀 Who actually creates these objects in Spring Boot, and when? Today I explored the Spring Bean Lifecycle 🚀 Simple flow 👇 1️⃣ Spring container starts 2️⃣ Bean object is created 3️⃣ Dependencies are injected 4️⃣ Bean becomes ready to use 5️⃣ Bean is destroyed when the app shuts down What made this even more interesting 👇 ✅ @PostConstruct → runs after bean creation ✅ @PreDestroy → runs before bean cleanup 💡 My takeaway: Spring doesn’t just inject dependencies — it also manages the entire lifecycle of the object. The more I learn this framework, the more beautifully engineered it feels ⚡ #Java #SpringBoot #BeanLifecycle #BackendDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
80 lines of TypeScript. That is what it took to give Claude Code full terminal access inside IntelliJ. Wrote up the code, the patterns, and the 2 AM lesson about why terminal naming matters more than you think. https://lnkd.in/eAkXHZqG #MCP #AIAgents #TypeScript
To view or add a comment, sign in
-
-
🔍 Post 1/3 — How to Actually Explore Spring Boot Dependencies (Beyond Ctrl+Click) Most developers stop at: 👉 Ctrl + Click on a dependency That’s useful… but shallow. If you want to understand what’s REALLY inside your Spring Boot app, go deeper 👇 🧠 What’s happening behind the scenes? When you add: spring-boot-starter-web You’re not just adding a library. You’re pulling in: Embedded server Servlet container Dozens of transitive dependencies Example: spring-boot-starter-web └── spring-boot-starter-tomcat └── tomcat-embed-core 👉 That’s how Apache Tomcat gets into your app. 🔧 Tools you should actually use ✔️ IDE shortcuts Ctrl + Click → Source Ctrl + Alt + B → Implementation Dependency diagram → Full view ✔️ Maven (MUST KNOW) mvn dependency:tree ✔️ Maven Central Search artifacts and inspect full dependency chains 💡 Why this matters If you don’t understand dependencies: You can’t debug conflicts You can’t optimize startup/performance You don’t know what’s running in production 👉 Backend engineering is NOT just writing APIs It’s understanding the runtime stack. Next post: What exactly is a “Servlet Request” and who creates it? #SpringBoot #Java #BackendDevelopment #SoftwareEngineering #Maven #Developers #Programming #TechDeepDive #JavaDevelopers
To view or add a comment, sign in
-
𝗖𝗹𝗼𝗻𝗶𝗻𝗴 𝗮 𝟱𝟬𝟬𝗠𝗕 𝗿𝗲𝗽𝗼 𝗳𝗼𝗿 𝗼𝗻𝗲 𝘂𝘁𝗶𝗹𝗶𝘁𝘆 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗶𝘀 𝗹𝗶𝗸𝗲 𝗯𝘂𝘆𝗶𝗻𝗴 𝗮 𝗵𝗼𝘂𝘀𝗲 𝗷𝘂𝘀𝘁 𝘁𝗼 𝘂𝘀𝗲 𝘁𝗵𝗲 𝗺𝗶𝗰𝗿𝗼𝘄𝗮𝘃𝗲. 🏠🚫 We’ve all done it: 1. 𝙜𝙞𝙩 𝙘𝙡𝙤𝙣𝙚 2. Wait forever. 3. Dig through 20 folders. 4. Copy-paste one file. 5. Fix broken imports. 6. Delete the repo. I built 𝗚𝗲𝘁𝗚𝗿𝗮𝗯𝗞𝗶𝘁 to end this madness. 🚀 𝗜𝘁’𝘀 𝗮 𝘀𝘂𝗿𝗴𝗶𝗰𝗮𝗹 𝗖𝗟𝗜 𝘁𝗼𝗼𝗹 𝗳𝗼𝗿 𝗚𝗶𝘁𝗛𝘂𝗯: ✅ Browse any repo in a clean Terminal UI. ✅ Preview code before downloading. ✅ 𝙎𝙢𝙖𝙧𝙩 𝙂𝙧𝙖𝙗: Automatically pulls local dependencies for you. 𝗡𝗼 𝗯𝗹𝗼𝗮𝘁. 𝗡𝗼 𝗺𝗮𝗻𝘂𝗮𝗹 𝗳𝗶𝘅𝗶𝗻𝗴. Just the code you need. Try it now: 𝙣𝙥𝙢 𝙞𝙣𝙨𝙩𝙖𝙡𝙡 -𝙜 𝙜𝙚𝙩𝙜𝙧𝙖𝙗𝙠𝙞𝙩 𝗟𝗶𝗻𝗸𝘀 🌐 𝗛𝗤: https://lnkd.in/gZcirkyp 📦 𝗡𝗣𝗠: https://lnkd.in/g2vtPmXS 😻 𝗣𝗛: https://lnkd.in/gvybBJ-w 𝗦𝘁𝗼𝗽 𝗰𝗹𝗼𝗻𝗶𝗻𝗴. 𝗦𝘁𝗮𝗿𝘁 𝗴𝗿𝗮𝗯𝗯𝗶𝗻𝗴. 🧲 GitHub Google Video Credits : Shravan Kumar Nalacherla #buildinpublic #devtools #nodejs #opensource #programming #clitool,#github, #nodejs, #developertools, #terminalui, #opensource, #productivity ,#best_dsa_course ,#codeprep ,#coding #dsa ,#programming #powershellscripting #agent
To view or add a comment, sign in
-
Reentrant lock: it allows you call lock multiple times and .getHoldCount() ; help you know how many times lock called on the same object. recommended to use lock always in try , catch , finally or try finally because if it will through any exception lock never will unlock. Example: private sataic ReentrantLock= new ReentrantLock=(){ lock.lock(); // access the resources lock.unlock(); } public static vod main (String [] atgs) { Thread t1= new Thread (() -> accessResources()); t1.start(); Thread t2= new Thread (() -> accessResources()); t2.start(); Thread t3= new Thread (() -> accessResources()); t3.start(); Thread t4= new Thread (() -> accessResources()); t4.start(); } in a movie theatres are application is multi threaded so we are allowing multiple users each having the single thread to access te application simultaneously, now if twi thred try to access and book the same seat it going to be an issue one of the solution of this problem we allow only allowe only o e thread to book a seat at a time and for this we can use lock. Above example even if all thread t1 -t4 call this same time but only one will get the lock and remaining are in waiting state and t1 will proceed and remaining will in waiting state. And the difference between synchronise and lock is synchronise is implicit and lock is explicit meaning we are not create new field or new variable . But in lock we have to create a ne w variable. In case of local for example we have 4 lock we can acquire in any order and release in any order but this not possible in synchronise because it work on the method. #TechStack #Java #SpringBoot #MySQL #DeveloperCommunity #SoftwareEngineering #multiThreading #Java #BackendDevelopment #SoftwareEngineering #MultiThreading #Concurrency #JavaPerformance #CodingTips #Programming #SystemDesign
To view or add a comment, sign in
-
I started this as a quick experiment; however, it turned into a month-long side project. Repo: https://lnkd.in/gn77nZuh I wanted to create a distributable Java application as a single desktop executable that does not expose underlying JARs. The goal was to package a JavaFX app with Spring, which has a contrasting lifecycle, into a native binary for faster startup. Most importantly, it provides a cleaner way to distribute the application without exposing raw source code. Along the way: • JavaFX and Spring lifecycle mismatches needed manual coordination • GraalVM native builds forced explicit configuration, especially around reflection • JPA became a major roadblock due to heavy runtime behavior and reflection requirements I ended up avoiding JPA for this setup and keeping things simpler to make native compilation viable. I also chose not to use higher-level tooling or frameworks to avoid adding another layer of abstraction and extra overhead to the already complex setup. I am sharing this as a resource for anyone who has gone down a similar rabbit hole.
To view or add a comment, sign in
-
🧠 After exploring singleton and prototype, I discovered a very practical Spring Boot scope today 👀 Request Scope 🌐 Here’s the simple idea 👇 ✅ A new bean object is created for every HTTP request ✅ Different requests never share the same object ✅ Perfect for request-specific processing This makes it super useful for 👇 🔹 request tracing IDs 🔹 temporary request metadata 🔹 audit logging helpers 🔹 request-level user context The cleanest way to use it 👇 @RequestScope 💡 My takeaway: Scope is not just about memory — it directly shapes how safely your web app handles request data ⚡ #Java #SpringBoot #RequestScope #BackendDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
Learnt about basic setup of a spring boot project. How we can create a spring boot project, how we can run it, whats each file in the starter project for, whats pom.xml, what are application properties, how to hook up spring boot web starter pack for dependencies using maven central, What a controller is, how can we create a basic controller etc. #BACKEND #JAVA #SPRINGBOOT #SOFTWAREENGINEER
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
This also happens with Docker containers if you update env variables without rebuilding the container