Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

pradeep gamage

Ranch Hand
+ Follow
since Aug 03, 2009
pradeep likes ...
Eclipse IDE Java Spring
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 pradeep gamage

I am using UUID Random number as a primary key of Object when i save object in Database. So this generated UUID number should be unique. This way i got random number.
. Can this generated number unique for any generated number?

Give me idea.
5 years ago
I have done it like this way .
.
Its seem work fine.

Thanks for answer...
5 years ago
I am developing java application and in this i wanted to run some method periodically. I have used java schedule to run that method periodically. This is my Cron Expression.

.
This works fine. Now I wanted to stop running this scheduler for one hour per day. How I can write Cron Expression to do it? Give me a idea.

Thanks in advance
5 years ago
Thanks Mahesh. Your idea was very helpful for me... Thanks again....
5 years ago
I have put log4j.properties file in class path. then Load using following code. Now Log4j Logger is working.

5 years ago
After i add following code example, log file created when jar file run with command prompt.



How I can give relative path instead of exact path ?
5 years ago
This is my Student class that used to test log4j.



This is my log4j.properties file




when i run using eclipes MyLogExample.log file created. then after i created jar file and run using command prompt. but when i run jar file log file is not created.

in console i can see this error.

log4j:ERROR Could not read configuration file [log4j.properties].
java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified)

Give me idea why is this log file is not create with jar file.

Thanks in Advance...
5 years ago
How i can set relative path to log4j.properties file
5 years ago

when i run on command prompt its give following error. but when i run project with eclipes log is created.

log4j:ERROR Could not read configuration file [log4j.properties].
java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified)

give me idea why is this probleam
5 years ago
I havent get any error. but log is not created.
5 years ago
I have added log4j into my java project.when i run the project log file is created and i can see log detail in created log file. but when i create jar file and run it log file is not created. Please give me some valuable idea.

Thanks in Advance
5 years ago
thank you for valuable reply.
5 years ago
I am developing jasper report. So i have created abc.jasper file by using iReport. Then i have put it into /WEB-INF/reports/ . Then I have loaded abc.jasper file as below. but it doesn't work.


if I put Exact path intesed of Relative path above code is working fine. So Can any one suggest me how to load abc.jasper file by giving relative path?

Thanks in advance
5 years ago