ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to get shared-classes path in java class

Post new topic  Reply to topic
 How to get shared-classes path in java class « View previous topic :: View next topic » 
Author Message
sudhanshus
PostPosted: Thu Feb 13, 2014 8:20 am    Post subject: How to get shared-classes path in java class Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Feb 13, 2014 8:28 am    Post subject: Re: How to get shared-classes path in java class Reply with quote

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
View user's profile Send private message
sudhanshus
PostPosted: Thu Feb 13, 2014 8:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Feb 13, 2014 8:46 am    Post subject: Reply with quote

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
View user's profile Send private message
sudhanshus
PostPosted: Thu Feb 13, 2014 7:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gralgrathor
PostPosted: Thu Feb 13, 2014 11:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
zpat
PostPosted: Fri Feb 14, 2014 12:31 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Feb 14, 2014 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to get shared-classes path in java class
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.