facebook

MatisseClassLoader issue when loading resources

  1. MyEclipse Archived
  2.  > 
  3. Matisse/Swing UI Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #287848 Reply

    Alastair
    Member

    Hi,

    We are experiencing an issue when adding an instance of one of our classes to an existing form in Matisse at design time.
    The problem occurs because when our class is loaded it tries (unsuccessfully) to load some resource files. The method that is being called indirectly is

    ClassLoader.getResources(String)

    which returns an empty enumeration. Nevertheless we can see the first applicable resource file by calling the

    ClassLoader.getResource(String)

    method so we know that the resources can be found. We suspect therefore there is a problem with the MatisseClassLoader as this is the classloader in use at the time. When the same code is run in different environments in which either the standard OSGI classloader or the jBoss classloader is being used we do not experience the same problem.

    Please note that the overall environment is a multi-project setup in which each project is an eclipse plug-in (OSGI bundle). We’re not sure if this is related to the problem.

    A simplified sample project structure is given below to aid clarity:

    Project A (OSGI bundle)
    Project B (OSGI bundle)
    Project C (OSGI bundle)

    Dependencies:
    Project B has a dependency on Project C
    Project A has a dependency on Project B and C

    At runtime when a class from project A is loaded, matching resources from both bundle B and C should be returned from the function call to

    ClassLoader.getResources(String)

    but an empty enumeration is returned. However the resource defined in B is returned by

    ClassLoader.getResource(String)

    Any feedback on this issue would be much appreciated.

    Alastair.

    #287885 Reply

    Riyad Kalla
    Member

    Alastair,
    This is definitely a more complex classloading setup than we have typically tested before. I’ll add a note for the developers to look into this when going over the Matisse TODO list; sorry about the trouble.

    In the mean time I can’t think of a workaround besides maybe trying to add the literal JAR of the dependent project to the project that needs the reference and see if it resolves.

    #287902 Reply

    Alastair
    Member

    Hi Riyad,

    Thanks for the feedback, and I appreciate you forwarding the request through to the developers.

    Alastair.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: MatisseClassLoader issue when loading resources

You must be logged in to post in the forum log in