Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java.util.Properties.load() not loading all properties

807598May 26 2006
Hi,
I'm trying to load the following properties into my Properties class. However, Im only able to load SOME properties not ALL (11 to be precise)

This is my properties file :
~~~~~~~~~~~~~~~~~~~~~

gds.host=chissd235.bankofamerica.com
gds.datasource=gds.310.fob1
its.dataSource=gds.310.fob1
adv.dataSource=adv.310.fob1
gds.port=9650
gds.dataType=FpML
maxNumberOfConnectors=1000
itsConnectionMethod=ejb

advDB.driverToUse=jConnect2
advDB.userName=advDev1User
advDB.password=advDev1User
advDB.databaseName=advDev1
advDB.serverName=chisdd30.bankofamerica.com
advDB.port=2910
its.user=derivuser

This is my java code snippet:
~~~~~~~~~~~~~~~~~~~~~~~

private void loadProperties()
{
try
{
GDSConfigurationAdapter adapter = new GDSConfigurationAdapter();
String configurationResource = adapter.getConfigurationPropertiesResource();
load(loadStream(configurationResource));
String eventingPropsResource = adapter.getEventingPropertiesResource();
load(loadStream(eventingPropsResource));
} catch (IOException e)
{
throw new RuntimeException("Could not load GDS/Eventing properties");
}
}

private InputStream loadStream(String propFile) throws IOException
{
InputStream propStream = ResourceLocator.getResourceAsStream(propFile);
if (propStream == null)
{
logger.warning("could not find in JAR! Looking in classpath: " + propFile);
propStream = ResourceLocator.getResourceAsStream(propFile);
}
if (propStream == null)
{
IOException t = new IOException("Failed to load property file: " + propFile);
logger.throwing(getClass().getName(), "loadProperties", t);
throw t;
}
return propStream;
}

Any help will be appreciated.

Thanks
Bjork
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 23 2006
Added on May 26 2006
0 comments
329 views