Skip to Content.
Sympa Menu

grouper-dev - RE: [grouper-dev] System property java.io.tmpdir deleted

Subject: Grouper Developers Forum

List archive

RE: [grouper-dev] System property java.io.tmpdir deleted


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Arnaud Deman <>
  • Cc: Grouper Dev <>
  • Subject: RE: [grouper-dev] System property java.io.tmpdir deleted
  • Date: Wed, 1 Feb 2012 13:19:50 +0000
  • Accept-language: en-US

> Yes, I think there would be problems if other processes are using the tmp
> dir at the same time... not sure what we do about it... it would be nice if
> each ehcache controller didn’t require its own tmp dir, or if grouper could
> only use one ehcache controller.
Whay can't you do that, just curious?


Its just not done that why, maybe at some point we could look into this...


It generally better if you can use the grouper client instead of the API,
which methods are missing from the client to make that happen?
>
In fact, we are using the groupStore for uPortal which uses the
grouperClient but the web service instances are running in the same tomcats as
uPortal ones.


Ok, right. Well, a workaround is to run in separate tomcats which has other
advantages (its not difficult to change if you are already fronting with
apache).


Thanks,
Chris


Thanks,
Arnaud.

> Thanks,
> Chris
>
> -----Original Message-----
> From: Arnaud Deman
> [mailto:]
>
> Sent: Wednesday, February 01, 2012 4:28 AM
> To: Chris Hyzer
> Cc: Grouper Dev
> Subject: Re: [grouper-dev] System property java.io.tmpdir deleted
>
> Hello Chris,
>
> The versions are : Grouper 1.6.3, Java Sun jdk 64 bits 1.6.0_24 and Tomcat
> 6.
>
> The correction I made was to delete the static member ORIGINAL_TMP_DIR
> in the class EhcacheController and to use a local variable instead in
> the methods :
> EhcacheController::initialize()
> and
> Hib3DAO::initHibernateIfNotInitted()
>
> With this correction the property is not deleted but if I have well
> understood
> these methods are called when the Grouper API (via web service in ou case)
> is used at the first time.
> So I wonder if there is not still a problem if another processus uses the
> java.io.tmpdir
> property at the same time.
>
> Thanks,
> Arnaud.
>
> Example for EhcacheController::initialize() :
>
> public void initialize() {
> if (this.mgr == null) {
> synchronized(EhcacheController.class) {
> final String prevTmpDir = System.getProperty(JAVA_IO_TMPDIR);
> if (this.mgr == null) {
> URL url = this.getClass().getResource("/grouper.ehcache.xml");
> if (url == null) {
> throw new RuntimeException("Cant find resourse
> /grouper.ehcache.xml, " +
> "make sure it is on the classpath");
> }
>
> //trying to avoid warning of using the same dir
> try {
> String newTmpdir = StringUtils.trimToEmpty(prevTmpDir);
> if (!newTmpdir.endsWith("\\") && !newTmpdir.endsWith("/")) {
> newTmpdir += File.separator;
> }
> newTmpdir += "grouper_ehcache_auto_" + GrouperUtil.uniqueId();
> System.setProperty(JAVA_IO_TMPDIR, newTmpdir);
>
> synchronized(CacheManager.class) {
> //now it should be using a unique directory
> this.mgr = new CacheManager(url);
> }
> } finally {
> //put tmpdir back
> if (prevTmpDir == null) {
> System.clearProperty(JAVA_IO_TMPDIR);
> } else {
> System.setProperty(JAVA_IO_TMPDIR, prevTmpDir);
> }
> }
>
> }
> }
> }
> }
>
>
>
> Le mardi 31 janvier 2012 à 05:43:57, Chris Hyzer a écrit :
> > Can you tell me which version and which lines of code you changed from
> > what to what?
> >
> > Thanks,
> > Chris
> >
> > -----Original Message-----
> > From:
> >
> >
> > [mailto:]
> > On Behalf Of Arnaud Deman
> > Sent: Tuesday, January 31, 2012 12:35 PM
> > To: Grouper Dev
> > Subject: [grouper-dev] System property java.io.tmpdir deleted
> >
> > Hello,
> >
> > I have noticed that the system property java.io.tmpdir is deleted by
> > the Grouper API. I think it occures because the static member
> > ORIGINAL_TMP_DIR in the
> > class EhcacheController is null. I have removed the references of this
> > member in EhcacheController and Hib3DAO and it seems to correct the pb.
> >
> > We are using the grouper web service, uPortal and many portlets in the
> > same tomcat and it caused very stange bugs. For instance the apache
> > library commons-fileupload uses this system property to create temp
> > files and the result was java IO exceptions.
> >
> > Best regards,
> > Arnaud.
> >
> >
> > --
> > Arnaud Deman
> > 04 91 28 85 25
> > DOSI - Aix Marseille Université
> > Avenue Escadrille Normandie-Niemen
> > 13397 MARSEILLE CEDEX 20
> >
>
> --
> Arnaud Deman
> 04 91 28 85 25
> DOSI - Aix Marseille Université
> Avenue Escadrille Normandie-Niemen
> 13397 MARSEILLE CEDEX 20
>

--
Arnaud Deman
04 91 28 85 25
DOSI - Aix Marseille Université
Avenue Escadrille Normandie-Niemen
13397 MARSEILLE CEDEX 20




Archive powered by MHonArc 2.6.16.

Top of Page