SlideShare a Scribd company logo
1 of 22
Download to read offline
JAVA CLASSLOADERS 
GO SIMON MAPLE 
@SJMAPLE
ABOUT ME 
SIMON MAPLE 
@SJMAPLE 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
BACKGROUND: JREBEL 
• Hooked into class loading on the JVM level 
• Integrated with the class loading mechanism in more than 20 
different servers 
• Solved hundreds of issues connected to class loading 
• Learned a lot more about class loaders than we wanted to ☺ 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
PLAN 
• Basics 
• What is class loading? 
• How was it meant to work? 
• Problems and solutions 
• How do class loaders leak? 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
BASICS 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
JAVA.LANG.CLASSLOADER 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
EXAMPLE 0 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
EXAMPLE 0 
Causes a call to 
A.class.getClassLoader().loadClass(“B”); 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
CL HIERARCHY 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
INTENTIONS 
• Class loaders have a parent class loader 
• The parent is usually consulted first 
• However in a Java EE web module local classes are searched first 
• Each WAR module of EAR gets a classloader 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
PROBLEMS 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
NOT ENOUGH CLASSES 
• ClassNotFoundException 
•NoClassDefFoundError 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
TROUBLESHOOTING 
• IDE class lookup (Ctrl+Shift+T in Eclipse) 
• find *.jar -exec jar -tf '{}' ; | grep MyClass 
• URLClassLoader.getUrls() 
• Container specific logs 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
ALIEN CLASSES 
• IncompatibleClassChangeError 
• AbstractMethodError 
•NoSuch(Method|Field)FoundError 
• ClassCastException, IllegalAccessError 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
TROUBLESHOOTING 
• -verbose:class 
• ClassLoader.getResource() 
• javap -private MyClass 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
MORE CLASSES 
THAN YOU NEED 
• LinkageError (class loading constraints violated) 
• ClassCastException, IllegalAccessError 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
TROUBLESHOOTING 
• -verbose:class 
• ClassLoader.getResource() 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
new Util3() Factory3.instanceUntyped(); 
Util3 u = (Util3) Factory3.instanceUntyped(); 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
CLASSLOADER LEAKS 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
CLASSLOADER LEAKS 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
TAKE AWAY 
• Validate assumptions 
• Leaking ClassLoader is easy 
• Isolation works for processes 
• JREBEL rocks! 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
ELSE 
www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116

More Related Content

Viewers also liked

Java EE Pattern: Entity Control Boundary Pattern and Java EE
Java EE Pattern: Entity Control Boundary Pattern and Java EEJava EE Pattern: Entity Control Boundary Pattern and Java EE
Java EE Pattern: Entity Control Boundary Pattern and Java EEBrockhaus Consulting GmbH
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Ryan Cuprak
 
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 201450 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014Ryan Cuprak
 
20091020 JPA2
20091020 JPA220091020 JPA2
20091020 JPA2lyonjug
 

Viewers also liked (6)

Java EE Pattern: Entity Control Boundary Pattern and Java EE
Java EE Pattern: Entity Control Boundary Pattern and Java EEJava EE Pattern: Entity Control Boundary Pattern and Java EE
Java EE Pattern: Entity Control Boundary Pattern and Java EE
 
Java EE Pattern: The Boundary Layer
Java EE Pattern: The Boundary LayerJava EE Pattern: The Boundary Layer
Java EE Pattern: The Boundary Layer
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
 
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 201450 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
 
20091020 JPA2
20091020 JPA220091020 JPA2
20091020 JPA2
 
Jpa(1)
Jpa(1)Jpa(1)
Jpa(1)
 

More from JAXLondon2014

GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita IvanovGridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita IvanovJAXLondon2014
 
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang GottesheimPerformance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang GottesheimJAXLondon2014
 
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...JAXLondon2014
 
Conditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean ReillyConditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean ReillyJAXLondon2014
 
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim RemaniFinding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim RemaniJAXLondon2014
 
API Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul FremantleAPI Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul FremantleJAXLondon2014
 
'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh Long'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh LongJAXLondon2014
 
The Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh LongThe Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh LongJAXLondon2014
 
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniThe Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniJAXLondon2014
 
Dataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel WinderDataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel WinderJAXLondon2014
 
Habits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn VerburgHabits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn VerburgJAXLondon2014
 
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly CumminsThe Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly CumminsJAXLondon2014
 
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris GollopTesting within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris GollopJAXLondon2014
 
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...JAXLondon2014
 
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad MalikovSqueezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad MalikovJAXLondon2014
 
Spocktacular Testing - Russel Winder
Spocktacular Testing - Russel WinderSpocktacular Testing - Russel Winder
Spocktacular Testing - Russel WinderJAXLondon2014
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeJAXLondon2014
 
Reflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzReflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzJAXLondon2014
 
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha GeeRapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha GeeJAXLondon2014
 
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...JAXLondon2014
 

More from JAXLondon2014 (20)

GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita IvanovGridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
GridGain 6.0: Open Source In-Memory Computing Platform - Nikita Ivanov
 
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang GottesheimPerformance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
Performance Metrics for your Delivery Pipeline - Wolfgang Gottesheim
 
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
 
Conditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean ReillyConditional Logging Considered Harmful - Sean Reilly
Conditional Logging Considered Harmful - Sean Reilly
 
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim RemaniFinding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
Finding your Way in the Midst of the NoSQL Haze - Abdelmonaim Remani
 
API Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul FremantleAPI Management - a hands on workshop - Paul Fremantle
API Management - a hands on workshop - Paul Fremantle
 
'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh Long'Bootiful' Code with Spring Boot - Josh Long
'Bootiful' Code with Spring Boot - Josh Long
 
The Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh LongThe Full Stack Java Developer - Josh Long
The Full Stack Java Developer - Josh Long
 
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim RemaniThe Economies of Scaling Software - Josh Long and Abdelmonaim Remani
The Economies of Scaling Software - Josh Long and Abdelmonaim Remani
 
Dataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel WinderDataflow, the Forgotten Way - Russel Winder
Dataflow, the Forgotten Way - Russel Winder
 
Habits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn VerburgHabits of Highly Effective Technical Teams - Martijn Verburg
Habits of Highly Effective Technical Teams - Martijn Verburg
 
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly CumminsThe Lazy Developer's Guide to Cloud Foundry - Holly Cummins
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
 
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris GollopTesting within an Agile Environment - Beyza Sakir and Chris Gollop
Testing within an Agile Environment - Beyza Sakir and Chris Gollop
 
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...
 
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad MalikovSqueezing Performance of out of In-Memory Data Grids - Fuad Malikov
Squeezing Performance of out of In-Memory Data Grids - Fuad Malikov
 
Spocktacular Testing - Russel Winder
Spocktacular Testing - Russel WinderSpocktacular Testing - Russel Winder
Spocktacular Testing - Russel Winder
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David Delabassee
 
Reflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzReflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz Kabutz
 
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha GeeRapid Web Application Development with MongoDB and the JVM - Trisha Gee
Rapid Web Application Development with MongoDB and the JVM - Trisha Gee
 
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
Pushing Java EE outside of the Enterprise: Home Automation and IoT - David De...
 

Recently uploaded

Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatmentnswingard
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Delhi Call girls
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Baileyhlharris
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIINhPhngng3
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoKayode Fayemi
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 

Recently uploaded (20)

Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 

Do You really get Class Loaders - Simon Maple

  • 1. JAVA CLASSLOADERS GO SIMON MAPLE @SJMAPLE
  • 2. ABOUT ME SIMON MAPLE @SJMAPLE www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 3. BACKGROUND: JREBEL • Hooked into class loading on the JVM level • Integrated with the class loading mechanism in more than 20 different servers • Solved hundreds of issues connected to class loading • Learned a lot more about class loaders than we wanted to ☺ www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 4. PLAN • Basics • What is class loading? • How was it meant to work? • Problems and solutions • How do class loaders leak? www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 5. BASICS www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 6. JAVA.LANG.CLASSLOADER www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 7. EXAMPLE 0 www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 8. EXAMPLE 0 Causes a call to A.class.getClassLoader().loadClass(“B”); www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 9. CL HIERARCHY www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 10. INTENTIONS • Class loaders have a parent class loader • The parent is usually consulted first • However in a Java EE web module local classes are searched first • Each WAR module of EAR gets a classloader www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 11. PROBLEMS www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 12. NOT ENOUGH CLASSES • ClassNotFoundException •NoClassDefFoundError www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 13. TROUBLESHOOTING • IDE class lookup (Ctrl+Shift+T in Eclipse) • find *.jar -exec jar -tf '{}' ; | grep MyClass • URLClassLoader.getUrls() • Container specific logs www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 14. ALIEN CLASSES • IncompatibleClassChangeError • AbstractMethodError •NoSuch(Method|Field)FoundError • ClassCastException, IllegalAccessError www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 15. TROUBLESHOOTING • -verbose:class • ClassLoader.getResource() • javap -private MyClass www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 16. MORE CLASSES THAN YOU NEED • LinkageError (class loading constraints violated) • ClassCastException, IllegalAccessError www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 17. TROUBLESHOOTING • -verbose:class • ClassLoader.getResource() www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 18. new Util3() Factory3.instanceUntyped(); Util3 u = (Util3) Factory3.instanceUntyped(); www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 19. CLASSLOADER LEAKS www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 20. CLASSLOADER LEAKS www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 21. TAKE AWAY • Validate assumptions • Leaking ClassLoader is easy • Isolation works for processes • JREBEL rocks! www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116
  • 22. ELSE www.zeroturnaround.com support@zeroturnaround.com 1 (857) 277-1199 545 Boylston St., 4th flr. Boston, MA, USA, 02116