facebook

MyEclipse 10 JBoss 7.x – Append to Classpath Option

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #323341 Reply

    JRVS
    Member

    Hi,
    I downloaded a trial version of MyEclipse 10 and was setting up JBOSS 7.x to give it a try. My application uses properties file and i was able to set this up in Winow->Preferences->MyEclipse->Servers->JBOSS->JBOSS 6.x->Paths->Append to Classpath
    This will make the property file available for the application on JBOSS 6 and loads fine. When I try this option for JBOSS 7 it doesn’t work and the app fails with error unable to load properties file. Any thoughts?

    Thanks in advance!
    Sekar

    #323368 Reply

    support-joy
    Member

    Sekar,

    I am able to reproduce this issue. I have filed a PR for the dev team. I shall get back to you on this.

    Sorry for the inconvenience.

    #332992 Reply

    JRVS
    Member

    Hi Joy,
    Just thought of following up for an update. Did you hear back from your Dev team on this? Are there any workarounds for this problem? Please advise

    #332997 Reply

    support-swapna
    Moderator

    Sekar,

    The issue has been fixed. We tested for JBoss 7.1 and it works fine for us.

    Can you please update to the latest version of MyEclipse i.e 10.7 and check ?
    You can update to 10.7 from the MyEclipse Configuration Center or download the MyEclipse 10.7 installer and install 10.7 to a different location.

    If you are still seeing issues, then please let us know the exact version of JBoss you are working with.

    #333018 Reply

    JRVS
    Member

    Hi Swapna,
    I downloaded 10.7 and tried it with no luck. I am using jboss-as-7.1.0.Final

    Just trying to load external properties into JBOSS classpath using Winow->Preferences->MyEclipse->Servers->JBOSS->JBOSS 7.x->Paths->Append to Classpath

    The properties is in external folder and its not loading into JBOSS classpath. Please advise.

    Thanks!
    Sekar

    #333038 Reply

    support-swapna
    Moderator

    Sekar,

    I could not replicate the issue at my end with JBoss 7.1.1. JBoss 7.x class loading is different from earlier versions.

    Make sure you migrate your project to be compatible with JBoss 7.x. :
    https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7

    Attached is the sample project which works for me for your reference. Import the project, copy the .properties file to an external folder and check.

    Let us know how it works for you.

    Attachments:
    You must be logged in to view attached files.
    #333541 Reply

    JRVS
    Member

    Hi Swapna,
    Sorry for the delayed response. Yes, your example works. I will analyze this further at my end.

    Thanks again!
    Sekar.

    #333580 Reply

    JRVS
    Member

    In your example, you have done the following

    InputStream inputStream = this.getClass().getClassLoader().getParent()
    .getResourceAsStream(“myApp.properties”);

    Our project has the resource loading in following way

    RepositoryHelper.class.getClassLoader().getResourceAsStream(searchFileName)

    without the getParent() on classloader. The above code would work fine as it is if I try to do with JBoss way of adding external resources as modules into classpath for AS7.

    Does that mean to get this working in MyEclipse I have to end up changing the code your way? I would expect it to work as it is and not end up changing the resource loading logic. Please correct me if I miss something.

    Thanks!
    Sekar.

    #333639 Reply

    support-swapna
    Moderator

    Sekar,

    The class loading design is changed in JBoss 7.1.
    Take a look at this link :
    https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7

    Does your code work the JBoss way in JBoss 7.1 final or JBoss 7.0.x ?

    #333651 Reply

    JRVS
    Member

    Hi Swapna,
    Thanks for the response.

    What I understand is that the way of loading external properties in JBoss Classpath is different in AS7.

    Following is the link
    https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath

    My code (resource loading logic) works fine as it is in JBoss AS7.1 Final.

    But, what I am trying to ask is that why would not the code work as it is in MyEclipse when I do Append to Classpath – looks like it works only when I do getParent on the ClassLoader.
    Which means I have to end up changing the resource loading logic to make it work on MyEclipse which is not JBoss enforcement.

    Can you try your sample with out the getParent on ClassLoader and see if the option of Append to Classpath in MyEclipse works?

    Thanks in advance!
    Sekar

    #333659 Reply

    support-swapna
    Moderator

    Sekar,

    I could replicate the issue at my end without the getParent on the logic.
    I have filed a PR for the dev team to look into it.

    Sorry for inconvenience caused.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: MyEclipse 10 JBoss 7.x – Append to Classpath Option

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