I'm using VAJ and the IBM Websphere test Environment for testing. The system requires a property file to be loaded
in when a servlet starts in order to resolve all system specific values. (i.e. IP addresses of machine, LDAP servers, etc). This allows for ease of portability when deploying onto various platforms. When I run the application via the Servlet Launcher, the class called to load in the properties file throws an exception indicating that the properties file can not be found. The class that loads the properties file does not have a hard codes path. (ie. The code just looks for
Don Yantzi, one of our VisualAge for Java developers, provided the following:
The "default" folder you are mentioning for the WebSphere Test Environment is the resource directory for the VisualAge for Java project which contains your servlet. For example, if your servlet are in a VisualAge for Java project called "Intranet Application" then you would put the .properties files in the directory <vajava install>ideproject_resourcesintranet application , where <vajava install> is the directory where VisualAge For Java is installed. If you are using WebSphere Development Tools for AS/400 this would be c:wdt400vajava by default.
Background information: You setup the CLASSPATH for the WebSphere test environment by specifying other VisualAge for Java projects that contain your servlets, JavaBeans, etc... In VisualAge for Java 3.02 this is done by setting the CLASSPATH for the Servlet Launcher class. In version 3.5 this is performed via the WebSphere Test Environment Control Center. Adding a VisualAge for Java project to the CLASSPATH automatically adds its associated project resources directory. The Java Virtual Machine (JVM) uses the CLASSPATH to locate .properties files.
Dig deeper on iSeries Java programming
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.