WebSphere Application Server - Where's my EAR file?

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > March 2007 > Where's my EAR file?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Where's my EAR file?

2007-03-22, 1:30 pm

When I interrogate Thread.currentThread().getContextClassLoader().getResources("") on Websphere 6.0.x it finds the EAR file of the current application. When I do the same on 6.1.x, the EAR file is nowhere to be seen. Where has it gone, and how do I find
it now?

This is desperately urgent!

Thanks in advance
Ben_

2007-03-22, 1:30 pm

For desperate cases, place a call to IBM Support.

Don't forget this is a newsgroup with gentle contributors, not an official
support channel.

Now for your problem, why are you looking into the Thread's classloader and
not the current object's, i.e.
this.getClass().getClassLoader().getResource() ?

2007-03-22, 1:30 pm

Thanks for your reply.

It's a long, long time since I originally wrote this code so I can't remember exactly why I had to use the thread's ClassLoader, but I think it was because the method you suggest wasn't bringing back the desired results, but the thread's ContextClassLoade
r was. Anyway, since this problem reared it's head, I tried that method and no joy either.
Randy Schnier

2007-03-22, 7:26 pm

It's entirely possible that this technique just no longer works. WAS changed over to an OSGi-based classloader structure in 6.1, so code that relies on the internals of how WAS is implemented might no longer work on 6.1.

alasdair.peacock@parkgroup.co.uk wrote:
> Thanks for your reply.
>
> It's a long, long time since I originally wrote this code so I can't remember exactly why I had to use the thread's ClassLoader, but I think it was because the method you suggest wasn't bringing back the desired results, but the thread's ContextClassLoa

der was. Anyway, since this problem reared it's head, I tried that method and no joy either.

2007-03-23, 7:28 am

Is there a technique that would work then, or am I doomed?
Ben_

2007-03-23, 7:28 am

Maybe.

What resource are you trying to retrieve and where is it located ?

You could also check if the Classloader Viewer find the resource.

http://publib.boulder.ibm.com/infoc...oad_viewer.html

2007-03-23, 7:28 am

Basically, what I'm after is the actual EAR file of the application (i.e. when I upload myapp.ear via the WAS console, a class within that EAR needs to know where it was installed to, so that it can open it up, look in all WARs and JARs contained within,
and determine what classes are available).

So, the ClassLoader in 6.0 would have /opt/IBM/Websphere/.../installedApps/xxxNodexCell/myapp.ear in its list of resources, but 6.1 doesn't.

2007-03-23, 1:23 pm

When I go to use the ClassLoader Viewer service on 6.1, the "WAS Module - Jar Class Loader" sees the JAR files contained within the EAR/WAR files I'm trying to get a handle to.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com