Author |
Message
|
sudhanshus |
Posted: Thu Feb 13, 2014 8:20 am Post subject: How to get shared-classes path in java class |
|
|
Novice
Joined: 28 Oct 2013 Posts: 19
|
hi,
In my java class, I want to find out the location of the shared-classes path.
Is there any pre-defined variable through which I could access it?
Or I will have to create an environment variable and set the path?
Thanks in advance. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 13, 2014 8:28 am Post subject: Re: How to get shared-classes path in java class |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sudhanshus wrote: |
In my java class, I want to find out the location of the shared-classes path. |
Why? What value does this give you? What requirement does this meet?
sudhanshus wrote: |
Is there any pre-defined variable through which I could access it? |
Yes, or at least you can infer it from the workpath. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sudhanshus |
Posted: Thu Feb 13, 2014 8:39 am Post subject: |
|
|
Novice
Joined: 28 Oct 2013 Posts: 19
|
I have put log4j.properties in shared-classes folder and I want to find out the absolute path of the file. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 13, 2014 8:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sudhanshus wrote: |
I have put log4j.properties in shared-classes folder |
Why? Why not put it in a less sensitive location that allows safer and more secure editing of the properties?
sudhanshus wrote: |
I want to find out the absolute path of the file. |
Why? What's wrong with using the CLASSPATH? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sudhanshus |
Posted: Thu Feb 13, 2014 7:55 pm Post subject: |
|
|
Novice
Joined: 28 Oct 2013 Posts: 19
|
You mean it's okay if I put log4j.properties file in
MQSI\9.0.0.0\bin folder? |
|
Back to top |
|
 |
Gralgrathor |
Posted: Thu Feb 13, 2014 11:44 pm Post subject: |
|
|
Master
Joined: 23 Jul 2009 Posts: 297
|
sudhanshus wrote: |
You mean it's okay if I put log4j.properties file in
MQSI\9.0.0.0\bin folder? |
Never. Put it somewhere else in your classpath, preferably a folder created especially for custom properties files. A safe place. Safe from people trying to add, edit or remove files in application binaries directories, that is.
Alternatively, why not use user defined properties? |
|
Back to top |
|
 |
zpat |
Posted: Fri Feb 14, 2014 12:31 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
The usual place for the JAR files is /var/mqsi/shared-classes, however you can also have execution group scope shared-classes like this
/var/mqsi/config/<brokername>/<EGname>/shared-classes
For the properties file you should put it somewhere else which is more application specific. Or you could symlink from the EG reference to somewhere else.
Don't put application configuration data in system directories though. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 14, 2014 5:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Gralgrathor wrote: |
sudhanshus wrote: |
You mean it's okay if I put log4j.properties file in
MQSI\9.0.0.0\bin folder? |
Never. Put it somewhere else in your classpath, preferably a folder created especially for custom properties files. A safe place. Safe from people trying to add, edit or remove files in application binaries directories, that is. |
There's more in the classpath than the bin folder. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|