- This topic has 10 replies, 3 voices, and was last updated 11 years, 11 months ago by support-swapna.
-
AuthorPosts
-
JRVSMemberHi,
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
support-joyMemberSekar,
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.
JRVSMemberHi 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
support-swapnaModeratorSekar,
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.
JRVSMemberHi Swapna,
I downloaded 10.7 and tried it with no luck. I am using jboss-as-7.1.0.FinalJust 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
support-swapnaModeratorSekar,
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+AS7Attached 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.
JRVSMemberHi Swapna,
Sorry for the delayed response. Yes, your example works. I will analyze this further at my end.Thanks again!
Sekar.
JRVSMemberIn 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.
support-swapnaModeratorSekar,
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+AS7Does your code work the JBoss way in JBoss 7.1 final or JBoss 7.0.x ?
JRVSMemberHi 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/HowToPutAnExternalFileInTheClasspathMy 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
support-swapnaModeratorSekar,
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.
-
AuthorPosts