Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to reset application classloader

 
shailesh pandit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i want reset the application classloader in weblogic.

when i tried following code in one of the servlet:



it gave output like this:

Hello, world

ClassLoader I am using :: 'weblogic.utils.classloaders.ChangeAwareClassLoader@16a8e18( finder: weblogic.utils.classloaders.CodeGenClassFinder@103d792, annotation: war@war, parent: weblogic.utils.classloaders.GenericClassLoader@13ec1db( finder: weblogic.utils.classloaders.CodeGenClassFinder@ff42c9, annotation: war@, parent: weblogic.utils.classloaders.GenericClassLoader@793536( finder: weblogic.utils.classloaders.CodeGenClassFinder@16e523d, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@3cbb4b( finder: weblogic.utils.classloaders.CodeGenClassFinder@1d93f39, annotation: null, parent: sun.misc.Launcher$AppClassLoader@53ba3d))))'
System ClassLoader :: 'sun.misc.Launcher$AppClassLoader@53ba3d'

when i changed the servlet class and refreshed the page it gave following output:

Hello, world1

ClassLoader I am using :: 'weblogic.utils.classloaders.ChangeAwareClassLoader@1cb4cb5( finder: weblogic.utils.classloaders.CodeGenClassFinder@5c0662, annotation: war@war, parent: weblogic.utils.classloaders.GenericClassLoader@13ec1db( finder: weblogic.utils.classloaders.CodeGenClassFinder@ff42c9, annotation: war@, parent: weblogic.utils.classloaders.GenericClassLoader@793536( finder: weblogic.utils.classloaders.CodeGenClassFinder@16e523d, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@3cbb4b( finder: weblogic.utils.classloaders.CodeGenClassFinder@1d93f39, annotation: null, parent: sun.misc.Launcher$AppClassLoader@53ba3d))))'
System ClassLoader :: 'sun.misc.Launcher$AppClassLoader@53ba3d'

see just the ChangeAwareClassLoader with annotation: war@war was reset i.e. got the new instance..
is there any way i can reset the application classloader with annotation: ApplicationClassLoader?

thanks in advance.

the purpose is to reload the any changed application class..
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should go for an exploded deployment in order to automatically have the changed app deployed. The change aware classloader does that. The classloader should aldo be able to pick up changes to the EAR and auto deploy if needed.

Coding specific changes that depend on weblogic or class loader hierarchy can be dangerous
 
shailesh pandit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my weblogic 9 is in dev mode and the ear is exploded then also it does not pick the APP-INF/classes changes.
i guess the ApplicationClassLoader being not changeawareclassloader causing this..
(weblogic.utils.classloaders.GenericClassLoader@793536( finder: weblogic.utils.classloaders.CodeGenClassFinder@16e523d, annotation: ApplicationClassLoader@)

is ther some configuration change which will solve this..

or can you please give details of the coding method..

 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a coding related change. Some EARs are known to have problems with exploded deployment. You will have to consult the weblogic user guide for more details. Coding / config changes to class loader hierarchy are a bad idea. It is hard enough trying to guess what classes weblogic loads at runtime since V 9.2
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic