Nadeem Awad

Ranch Hand
+ Follow
since Jan 09, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nadeem Awad

I suggest that you take a look at the Swing Timer. It's really easy to use and has many features.
Hi all,
We have an application deployed on JBoss 4.0.4. Some parts of the application depend on accessing some web services. We are using Apache Axis 1.4 for that.
We had a need to deploy another version of a running application on the same server. After doing so, I noticed that the EJB classes are loaded in a shared class loader, which caused the web application to call the wrong EJBs. Consequently, we�ve changed the JBoss configuration to isolate EAR deployments as follows:

Then the two applications were successfully deployed on the same server. However, since then we�ve started receiving some unexpected exceptions from the server, when the application is trying to access any of the web services using the Axis client. The problem is that the exception message is not descriptive at all, and there�s no specific scenario to trigger them. When we first start up the JBoss, everything works fine. After a certain period of time, this exception happens and we have to restart the JBoss again to resolve it.
The exception stack trace is as follows:

Any help about this urgent issue will be highly appreciated
16 years ago

Originally posted by Henry Wong:

What are these one byte files? And even if they were one megabyte files, why would you need this? What does it matter if you have a one megabyte of unused disk space in a 4.6 gigabyte disk?


I didn't understand what one byte files are you talking about.

Anyway, I found what I've been looking for. It's a well-known problem called Bin Packing Problem. I've found many solution for it in the Source Forge as well.

Thanks a lot.
16 years ago

Originally posted by Henry Wong:
How about just a brute force recursive algorithm? You can try out every possible combination (done recursively), and then save the ones that uses the least amount of CDs.


Don't you think that this might take a huge amount of time? Especially in a scenario that we have - let's say - a 13 GB of data that I want to distribute over three (4.6 GB) DVD's.
16 years ago
My problem is as follows:
I have a bunch of files that I would like to copy to a CD. The total size of these files let's say needs four to five CD's, depending on the way that you arrange the files. I need an algorithm that takes the sized of these files, and distribute them on the Maximum capacity of each CD, in a way to utilize the space of each CD.

Let's say a CD can contain 20 MB.
(A) 10
(B) 5
(C) 4
(D) 3
(E) 2

if you sort the files based on their size - like above - most likely you'll choose the files as follows:
(A) 10, (B) 5, (C) 4, the total will be 19 MB and there will be 1 MB unused.

However, if you replace (C) with (D) and (E), you'll fill the remaining unused space efficiently.

Of course, this example is very easy to solve manually with a glance. But in case of more complicated scenarios with many files with different sizes, that task will be much harder.

So, any help?
16 years ago
I found out that it's an old bug in Axis, and it seems that there's no workaround for it.

It seems that I need to upgrade to Axis2, or find another WS provider.

16 years ago
Hi all,
I have three web services to be accessed from my machine. The first two are located on a node that is connected to same LAN that my machine is connected on. And the third one is reachable over the internet and is used to send SMS messages.
In order to reach the third message, I have to set the http proxy settings for the web service client using the following code:

Whereas the first two services doesn't need this proxy setting because they're already reachable on the network.

My problem is as follows:
If I call one of the first two services (with no proxy setting) and then call the third one (with proxy setting), then everything works fine, and any subsequent calls to any of the three services works perfectly.

On the other hand, if I call the third service first (the one with the proxy setting), and then call one of the other two, the Axis client tries to call these services with the same proxy setting, even if I remove the proxy setting from the System properties and AxisProperties:

The problem in this case is that if the proxy server is unavailable for any reason, I can't access the other two services because the proxy setting is stuck somehow in the Axis Engine instance. So eventually I'm getting this exception:

Is there a way to resolve this?
16 years ago

Originally posted by Kelly Dolan:

That exception occurs when the WAR file includes any EJB-related classes, either in WEB-INF/lib or WEB-INF/classes folder. Remove any EJB-related JARs/Classes from the WAR and it should work fine.

For more info, check this link:
17 years ago

Originally posted by Ulf Dittmer:
Why do you consider it troubling to have a log field in all classes where you want to do logging?

I really find it better to create a wrapper class for the Logger and declare some static methods to be accessed directly from the methods, rather than creating a Logger object in each class. I believe the old fashin is a bit messy, that's why I decided to create the wrapper.

Anyway, for more info check out this thread:
I've been using Log4j, and I found it a little troublesome to declare an instance variable everywhere and pass the class name to it; like this:

So I thought I could create a wrapper class to encapsulate the logger. For instance:

But I also didn't like passing the class object every time I want to log a message. So the following came to my mind:

So the other classes do the following:

My question is, is this approach efficient? especially that the ex.fillInStackTrace() method is synchronized, so it might be a bit costly.

Any ideas?
[ February 04, 2007: Message edited by: Nadeem Awad ]
I finally got it
I found some code on the java forums and I modified it to do what wanted.

17 years ago
Hi All,
I've always been curious about the term "engine" that we use in computer software. We often hear a "Database Engine" or a "Search Engine". My question is, what is really called an "Engine"?
Is it just a term to describe how complicated and intricate an algorithm is? Or are there some particular specifications that the algorithm should have so we can call it an "engine"?

Best regards,
18 years ago