Project

General

Profile

« Previous | Next » 

Revision 7743

use relative path for oa4mp_client.xml (within servlet context). https://projects.ecoinformatics.org/ecoinfo/issues/5936

View differences:

lib/web.xml.tomcat6
293 293
	<servlet>
294 294
        <servlet-name>startRequest</servlet-name>
295 295
        <servlet-class>edu.ucsb.nceas.metacat.portal.StartRequest</servlet-class>
296
        <load-on-startup>1</load-on-startup>
296
        <load-on-startup>0</load-on-startup>
297 297
    </servlet>
298 298
    <servlet-mapping>
299 299
        <servlet-name>startRequest</servlet-name>
......
303 303
    <servlet>
304 304
        <servlet-name>ready</servlet-name>
305 305
        <servlet-class>edu.ucsb.nceas.metacat.portal.SuccessServlet</servlet-class>
306
        <load-on-startup>1</load-on-startup>
306
        <load-on-startup>0</load-on-startup>
307 307
    </servlet>
308 308
    <servlet-mapping>
309 309
        <servlet-name>ready</servlet-name>
......
313 313
    <servlet>
314 314
        <servlet-name>error</servlet-name>
315 315
        <servlet-class>edu.ucsb.nceas.metacat.portal.FailureServlet</servlet-class>
316
        <load-on-startup>1</load-on-startup>
316
        <load-on-startup>0</load-on-startup>
317 317
    </servlet>
318 318
    <servlet-mapping>
319 319
        <servlet-name>error</servlet-name>
......
331 331
	<!-- TODO: make relative path if possible -->
332 332
	<context-param>
333 333
        <param-name>oa4mp:client.config.file</param-name>
334
        <param-value>/var/lib/tomcat6/webapps/knb/WEB-INF/oa4mp_client.xml</param-value>
334
        <param-value>/WEB-INF/oa4mp_client.xml</param-value>
335 335
    </context-param>
336 336
    
337 337
    <!-- end MyProxy section -->
src/edu/ucsb/nceas/metacat/restservice/D1ResourceHandler.java
136 136
        try {
137 137
  
138 138
        	// check for session-based certificate from the portal
139
        	String configurationFile = servletContext.getInitParameter("oa4mp:client.config.file");
140
        	PortalCertificateManager portalManager = new PortalCertificateManager(configurationFile);
139
        	String configurationFileName = servletContext.getInitParameter("oa4mp:client.config.file");
140
        	//String configurationFilePath = servletContext.getResource(configurationFileName).getPath();
141
        	String configurationFilePath = servletContext.getRealPath(configurationFileName);
142

  
143
        	PortalCertificateManager portalManager = new PortalCertificateManager(configurationFilePath);
141 144
        	X509Certificate certificate = portalManager.getCertificate(request);
142 145
	    	PrivateKey key = portalManager.getPrivateKey(request);
143 146
	    	if (certificate != null && key != null) {

Also available in: Unified diff