Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Jayanath Amaranayake

Greenhorn
+ Follow
since Dec 06, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jayanath Amaranayake

Hi,
I have some set of utility java classes. They use commons bean utils and some other third party jar files. I created a jar of my utility classes (This jar is NOT executable as it contains only some utility classes that can be used by others) and added the Class-Path attribute to the manifest file at the time of the Jar file creation. However when another application is trying to use my utility classes jar, it fails with a ClassNotFound as my utility classes failed to find its dependencies.
May be I have missed something here. But below is a generic example of my scenario.

Utility.jar - has some utility classes and has no entry point with a main method
Dependancy1.jar - used in Utility.jar
Dependancy2.jar - used in Dependancy1.jar

Now, how should I create the Utility.jar properly, with all the dependencies.

Appreciate your help and many thanks for your time.
9 years ago
Ivan, Thanks very much for the quick reply!!
I downloaded the PDF and just started to read it.

Thanks again.
10 years ago
Hi folks,
I'm trying to get in to the world of JAX-WS with Metro and looking for a good tutorial for the contract first approach.
Most of the tutorials that I found were based on the code first approach.

Thanks in advance for any suggestions / help on this.
10 years ago
If you debug your code, you will find that you are not getting a Console object, hence c is null.

According to the API doc for java.io.Console class.


Whether a virtual machine has a console is dependent upon the underlying platform and also upon the manner in which the virtual machine is invoked. If the virtual machine is started from an interactive command line without redirecting the standard input and output streams then its console will exist and will typically be connected to the keyboard and display from which the virtual machine was launched. If the virtual machine is started automatically, for example by a background job scheduler, then it will typically not have a console.



I believe you tried this using some IDE. If you execute the same code using the command prompt, then you will not get a null pointer.
10 years ago
I did my exam few days back and I used the following resources, hope they would help you too.

1) Head First Servlets and JSP, make sure to get the second edition
2) Enthuware , less expensive than the Wizlabs but more than enough to practice for the exam
3) About the exam objectives and other details

Good luck!
Thanks for all the replies. I'm going to use the ServletContext to hold my map and that prevents me loading the map again and again.
Bear, I looked in to <fmt:message> tag, but couldnt figure out how it would help me to solve the same problem. If you could elaborate it a little bit, that would be great.

Thanks again for your time.
10 years ago
Hi all,
I have few jsp pages that need to display some selected values (key value pair) from a properties file at each page load. I thought I'm going to try something like below.
1- Have a servlet with overridden init method to read the file and load the key value pairs in to a hash map
2- Access the map from each page.
The problem is I couldn't figure out how to share the map to the jsp pages.

If I use a java class to load the key value map and return values when needed, I will have to read the property file, each time I create an instance of that class.

Thanks in advance for any suggestions / help to resolve this problem.
10 years ago