I have to inquire why you are performing init() operations in the
constructor?
Did you move your operations from the constructor to a separate init() as
earlier suggested?
Also.. ensure your startup initialisation file 'pam.properties' is located
in the same folder as your Pam class (or optionally locate pam.properties on
the classpath)
HTH
M-
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "Thomas Polliard" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, April 12, 2007 9:40 PM
Subject: getResourceAsStream returning blank (NOT NULL)
I have the following code:
package net.digitalassembly.auth;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.io.InputStream;
import java.io.IOException;
import net.digitalassembly.auth.PamModule;
import net.digitalassembly.auth.PamHibernateModule; // May need to have
this in the config file to make it plugable
import org.apache.log4j.Logger;
public class Pam {
private Properties pamProperties = new Properties();
private List<PamModule> pamModules = new ArrayList<PamModule> ();
private static Logger logger = Logger.getLogger(Pam.class);
private static Pam instance = new Pam();
private Pam() {
logger.debug("Pam private constructor called");
try {
InputStream inputStream =
instance.getClass().getClassLoader()
.getResourceAsStream("/pam.properties");
// I have also tried "this.getClass().getClassLoader()......
// It too returns blank (NOT NULL)
logger.debug("CLASS: " + inputStream);
When the logger writes out its output the inputStream is empty. Why
would this be. I have looked at a couple of resources online and this
looks like the ticket that I need.
Please help :(
Thomas
---------------------------------------------------------------------
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]