Results 1 to 3 of 3
  1. #1
    Ken
    Ken is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Default getResource returns null in Plugin project

    Hello everyone!

    I looked so many days for the solution, but still canīt fix my problem.

    I have this code:
    view plaincopy to clipboardprint?
    Note: Text content in the code blocks is automatically word-wrapped

    Java Code:
            ResourceSet resSet = new ResourceSetImpl();  
            String test=  "/C://Users/Jim/Desktop/text.xml";  
            URI uri= URI.createURI(test, true);  
            Resource resource = resSet.getResource(uri, true);

    This works perfectly in a java project.

    I tried it now in a Plugin Project, but the resource varible is always null!
    Please, can someone help me?

    Best regards
    Ken

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,185
    Rep Power
    20

    Default Re: getResource returns null in Plugin project

    Can you explain what classes we're looking at here?
    Saves us having to Google to find out what framework you;re talking about.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Ken
    Ken is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Default Re: getResource returns null in Plugin project

    Hi,

    maybe I can explain a bit better, I think I know where the error comes, but not how to prevent it.
    My Plugin Project opens a second workspace.
    There I can right click on a project and choose my own menu.
    After clicking on this menu, the code (above) will running.
    So it seems the code makes problem because I call it from a second workspace.
    Any idea?

Similar Threads

  1. ClassLoader.getSystemResource() returns null
    By SVENeRGy in forum New To Java
    Replies: 10
    Last Post: 01-07-2012, 04:06 PM
  2. ArrayList returns null
    By aborgeld in forum New To Java
    Replies: 6
    Last Post: 04-01-2011, 02:32 PM
  3. XML and SAX - class returns 'null'
    By Laffel in forum Advanced Java
    Replies: 2
    Last Post: 03-07-2011, 10:14 PM
  4. Splashscreen returns null
    By Charlie161 in forum AWT / Swing
    Replies: 2
    Last Post: 03-04-2011, 02:25 PM
  5. getImplementationVersion() returns null
    By newbiejava in forum New To Java
    Replies: 22
    Last Post: 09-12-2010, 10:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •