[Gridsphere-users] properties file

Fotis Aisopos el02135 at mail.ntua.gr
Sun Oct 21 05:39:32 PDT 2007


Any ideas? :-)

> Hello,
> I tried to place the .properties file in Catalina-home\shared\lib
> but once again it was not visible by the JobSubmissionService.
> So what is desired is placing the file in a folder so that
> it can be accessed by a code similar to this one:
> 
> InputStream is =
>
JobSubmissionServiceImpl.class.getClassLoader().getResourceAsStream("XX.properties");
> 
> Unfortunately the code cannot be changed so I need to find out the 
> classpath of the JobSubmissionService in order to copy the file there..
> Thanx,
> 
> Fotis
> 
> Oliver Wehrens <wehrens at gridsphere.org> said:
> 
> > The services are places in shared/lib to enable other webapps
> > accessing them. The portlets for GridPortlets are in the webapps
> > gridportlets and therefore have another classloader.
> > 
> > Oliver
> > 
> > On 10/9/07, Fotis Aisopos <el02135 at mail.ntua.gr> wrote:
> > > Hello Marc,
> > > Thanx for the tip but unfortunately I can not access
> > > the code that uses the properties file, as it is placed
> > > in a jar file..
> > > So my problem still remains whether the portlets have a
> > > different classpath from the grid portlet services?
> > > I would appreciate any help.
> > >
> > > cheers,
> > >
> > > Fotis
> > >
> > >
> > > Marc de Palol <marc.depalol at bsc.es> said:
> > >
> > > > Hi Fotis,
> > > >
> > > > I've been able to find a solution:
> > > >
> > > >
> > > > String propsFile =
> > > >
config.getServletContext().getRealPath("/WEB-INF/classes/be14.properties");
> > > >
> > > >
> > > > InputStream is = new FileInputStream(new File(propsFile));
> > > > prop = new Properties();
> > > > prop.load(is);
> > > > is.close();
> > > >
> > > > where the config is a PortletServiceConfig object.
> > > >
> > > > Hope it helps!!
> > > >
> > > > Marc
> > > >
> > > > Fotis Aisopos wrote:
> > > > > I have exactly the same problem in Gridsphere 3.0.8 and GP4.
> > > > > Can anyone please help?
> > > > >
> > > > > Thanx,
> > > > > Fotis
> > > > >
> > > > > Marc de Palol <marc.depalol at bsc.es> said:
> > > > >
> > > > >
> > > > >> Hello all,
> > > > >>
> > > > >> I'm using some properties files in a gridsphere project and I've got a
> > > > >> problem,
> > > > >>
> > > > >> I try to open a properties file, using:
> > > > >>
> > > > >> ==================
> > > > >> InputStream is =
> > > > >>
> > >
> BEUserServiceImpl.class.getClassLoader().getResourceAsStream("be14.properties");
> > > > >> Properties prop = new Properties();
> > > > >> prop.load(is);
> > > > >> is.close();
> > > > >> String xmlFile = prop.getProperty("users");
> > > > >> ==================
> > > > >> being the file in
> > > > >> /.../apache-tomcat/webapps/myportal/WEB-INF/classes/be14.properties
> > > > >>
> > > > >> this code works fine in a class whichs inherits from portlet. But when
> > > > >> the code is used in a class which inherits from
PortletServiceProvider (
> > > > >> a service )
> > > > >> I get a null pointer exception when i try to load the property files.
> > > > >>
> > > > >> Do the portlets have a different classpath from the services using
> > > > >> gridsphere 2.2.X ?
> > > > >>
> > > > >> thanks in advance,
> > > > >>
> > > > >> --
> > > > >> Marc de Palol Martínez
> > > > >>
> > > > >> BSC-CNS
> > > > >> Barcelona Supercomputing Center
> > > > >> Centro Nacional de Supercomputación
> > > > >> e-mail: marc.depalol (at) bsc.es
> > > > >> phone : +34-93 4137946
> > > > >>
> > > > >> _______________________________________________
> > > > >> Gridsphere-users mailing list
> > > > >> Gridsphere-users at gridsphere.org
> > > > >> http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Marc de Palol Martínez
> > > >
> > > > BSC-CNS
> > > > Barcelona Supercomputing Center
> > > > Centro Nacional de Supercomputación
> > > > e-mail: marc.depalol (at) bsc.es
> > > > phone : +34-93 4137946
> > > >
> > > > _______________________________________________
> > > > Gridsphere-users mailing list
> > > > Gridsphere-users at gridsphere.org
> > > > http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
> > > >
> > >
> > >
> > >
> > > --
> > >
> > >
> > >
> > > _______________________________________________
> > > Gridsphere-users mailing list
> > > Gridsphere-users at gridsphere.org
> > > http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
> > >
> > 
> > _______________________________________________
> > Gridsphere-users mailing list
> > Gridsphere-users at gridsphere.org
> > http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
> > 
> 
> 
> 
> -- 
> 
> 
> 
> _______________________________________________
> Gridsphere-users mailing list
> Gridsphere-users at gridsphere.org
> http://lists.gridsphere.org/mailman/listinfo/gridsphere-users
> 



-- 





More information about the Gridsphere-users mailing list