Bugs item #780914, was opened at 2003-07-31 08:18
Message generated for change (Settings changed) made by starksm
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=780914&group_id=22866
Category: JBossMX
>Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Srivatsan (srivatsanp)
Assigned to: Scott M Stark (starksm)
>Summary: ClassLoader resource issue with unpacked archives
Initial Comment:
Hi,
In JBoss 3.2.1, if any of the compressed deployment
archive contains any resource present in a
directory(say dtd/), then when some other archive has
some resource in the same "dtd/" directory, it is not
accessible.
For e.g.,
Consider the following packaging structure:
Test.sar
--dtd/Test.dtd
Application1.ear
--dtd/Test1.dtd
Application2.ear
--Test.sar
(This service is not able to access the Test1.dtd
present in Application1.ear).
The dtd is accessed using
this.getClass().getClassLoader().getResource("dtd/Test1.dtd");
If Test.sar is deployed as an unpacked archive, the
Test1.dtd is accessible.
This is due to a bug in indexing in ClassLoaderUtils.java
If the deployment unit is unpacked, it indexes the
package names of the class file only.
If the deployment unit is a compressed archive, it
indexes all the entries present in the archive. This
results in indexing of the dtd directory present in
Test.sar. So when getResource("dtd/Test1.dtd") is
performed, the dtd is searched only in Test.sar.
----------------------------------------------------------------------
>Comment By: Scott M Stark (starksm)
Date: 2003-08-05 07:44
Message:
Logged In: YES
user_id=175228
The .class filter has been removed as this was preventing
indexing of directories without any class files. As an
intermediate workaround put an empty x.class file in the
resource directory. The test now finds all resources:
07:41:47,300 INFO [MyTest] Starting
07:41:47,310 INFO [STDOUT] startService**************
07:41:47,320 INFO [STDOUT]
URL============1jar:file:/C:/cvs/JBoss3.2/jboss-3.2/build/output/jboss-3
.2.2RC3/server/780914/tmp/deploy/tmp24002ear1.ear!/conf/testing.xml
07:41:47,340 INFO [STDOUT]
URL============2file:/C:/cvs/JBoss3.2/jboss-3.2/build/output/jboss-3.2.2
RC3/server/780914/deploy/ear2.ear/conf/test.xml
07:41:47,360 INFO [STDOUT]
URL============2file:/C:/cvs/JBoss3.2/jboss-3.2/build/output/jboss-3.2.2
RC3/server/780914/deploy/ear3.ear/conf/aatesting.xml
07:41:47,391 INFO [STDOUT] Context classloader =
[EMAIL PROTECTED]
url=file:/C:/cvs/JBoss3.2/jboss-3.2/build/output/jboss-3.2.2RC3/server/780914/deploy/ear4.ear/
,addedOrder=30}
07:41:47,411 INFO [MyTest] Started
----------------------------------------------------------------------
Comment By: Srivatsan (srivatsanp)
Date: 2003-08-03 22:32
Message:
Logged In: YES
user_id=687037
Please find the attached zip which contains four ears:
ear1.ear -- compressed archive
ear2.ear, ear3.ear, ear4.ear -- unpacked deployments
The ear4.ear contains a service which gets the Resources using,
this.getClass().getClassLoader().getResource("conf/testing.xml")
this.getClass().getClassLoader().getResource("conf/test.xml")
this.getClass().getClassLoader().getResource("conf/aatesting.xml")
The source for the service is also attached.
Deploy the ears in the order: ear1.ear, ear2.ear, ear3.ear,
ear4.ear.
----------------------------------------------------------------------
Comment By: Scott M Stark (starksm)
Date: 2003-08-01 13:03
Message:
Logged In: YES
user_id=175228
I have updated the resource loading unit test to include
exactly the configuration you indicate and I have no problem
loading the dtd resource with 3.2.1. Reopen with a testcase
that demonstrates the issue and look at the
org.jboss.test.classloader.test.UnifiedLoaderUnitTestCase.testUnpackedResources
case.
----------------------------------------------------------------------
Comment By: Srivatsan (srivatsanp)
Date: 2003-08-01 01:01
Message:
Logged In: YES
user_id=687037
Is there any workaround for this? Is there a configuration
for ignoring the indexing mechanism?
----------------------------------------------------------------------
Comment By: Srivatsan (srivatsanp)
Date: 2003-07-31 22:29
Message:
Logged In: YES
user_id=687037
Forgot to mention that Application1.ear and Application2.ear
are unpaccked deployments.
Application1.ear/
dtd/Test1.dtd
Application2.ear/
Test.sar
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=780914&group_id=22866
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development