One of the memory leaks I've discovered in our application is the java.awt.Window.allWindows private static field, which keeps track of every Window instantiated. We have dialog boxes that are created, used, and then forgotten, and the expectation was that these would go away and be garbage collected. This private field keeps them in s...
For some reason one of my eclipse installations is ignoring incorrectly set @Override annotations. For example, if I put @Override on a method that isn't overriden, it just completely ignores it.
Any ideas on how to bring it back to a state where it will display an error for an incorrectly annotated method?
...
i have color= #12FFFF . that is color in this format where 12FFFF are hexadecima numbers.Now i want to get the each of indepenent R,G,B componetents in decimal.
How do i do it in java?
...
Recently, we deployed our web-application to a new set of servers.
AppServer: Websphere 6.1
Environment: Java 5, JSF, SOAP
Linux:
There is a 'form' on a web-page that contains a 'TextArea' and a 'Submit' button that submits to a servlet 'ServiceInterfaceServlet'. User puts the request XML in the textarea and hits the submit button to...
I'm trying to stream video to a server from another machine using Java and for starters, I'm just trying to transfer a file using a raw socket connection and a byte stream. However, things aren't showing up the same way. If I transfer a file this way, a 3MB file on my machine ends up being 5MB on the server. I'm trying this with a vi...
I need to generate a ZIP file with data on the fly from a servlet. I pass the ServletOutputSream to the ZipOutputStream constructor, and it does and send the ZIP to the client correctly. When the ZIP result is large, the servlet takes to answer a lot. I suppose that first creates the ZIP and after send it.
I make a helper class that w...
Hi,
If I have a simple Groovy class such as
class Address {
Integer streetNumber
String streetName
String state
String zip
Country country
}
Although I could write (or use an IDE to generate) hashCode and equals methods like:
boolean equals(o) {
if (this.is(o)) return true;
if (!o || getClass() != o.class) re...
I am curious if anyone knows if it is possible for a single portlet to contain multiple pages, let's say JSP pages. Furthermore is it possible to link to these different pages within the same portlet?
For example. Let's say I have a single portlet. And in this portlet I want the initial view to be a JSP page with just 5 links on it to 5...
We are creating an app for a client that has hundreds of megabytes of HTML in SQLite databases. We have implemented a way to query this data and scroll through it all in a reasonably fast manner. The issue is that some of the databases have very large queries (20,000+ rows) and we are seeing errors when we are growing the queries as the ...
We are looking into silent printing of PDF documents from within Java. The printing will be invoked from the desktop and not through a browser so we cannot use JavaScript. PDF Renderer is an operational solution but their rendering quality is not acceptable. iText does not seem to be pluggable with the Java print service. There are s...
When trying to setup a lock (pessimistic), with the following code:
em.lock(controlnumbers, LockModeType.WRITE);
em.refresh(controlnumbers);
I am getting the following exception:
[#|2009-09-10T15:42:48.324-0400|INFO|sun-appserver2.1|javax.enterprise.system.container.ejb|_ThreadID=31;_ThreadName=httpSSLWorkerThread-8080-19;|
javax.ejb...
Hi guys,
I'm in doubt about using roles for different scopes for my seam components. For example:
My project has a table called Parameter that stores all global parameters for the project as URLs, admin e-mail and etc ... For this table there is a simple CRUD interface for administration.
So, reading the seam 2.1.2 documentation i un...
Hi,
I'm using ehcache (via the Grails plugin). The method that adds objects to the cache requires the keys to be serializable, so a typical usage would be:
def key = 22
def someObject = new Object();
cacheService.cache(key, true, someObject)
(The boolean param indicates whether the object should be added to a distributed or local cac...
I have a home grown web server in my app. This web server spawns a new thread for every request that comes into the socket to be accepted. I want the web server to wait until a specific point is hit in the thread it just created.
I have been through many posts on this site and examples on the web, but cant get the web server to proceed...
Architecture:
A bunch of clients send out messages to a server which is behind a VIP. Obviously this server poses an availability risk.
The client monitors a resource and the server is responsible to take action based on the what status the majority of the clients report to it and hence the need for only 1 server/leader.
I am thinking...
I have logged in to the ORKUT by using WATIJ jar file in java.
All orkut pages has one small chat window in the bottom-left of the page so when I try to get the source code through ie.html() it returns the source code of that small chat window and I want the source code of the page on which that chat window appears.
How can I get the d...
I have a standalone Java application below that is:
Generating a random line
Applied to a 2D grid where each cell value is the distance along the line perpindicular to the line
Finds the rise/run and attempts to calculate the original linear equation from the grid
Applies new line to another grid and prints out the greatest difference ...
I'm not really sure how I can explain this, but here goes:
I want to be able to "insert" some commands into parts of my code which will be loaded from external files. To parse and execute these commands, I presumably have to use some scripting like BeanShell's eval method. The problem is that it doesn't seem to recognize the instance/me...
I am writing an OutputStream, just noticed this in the OutputStream interface,
public abstract void write(int b) throws IOException;
This call write one byte to the stream but why it takes integer as an argument?
...
I want to be notified of mouse events (specifically the mouse entered and exited events) on my JFrame. But when i add a mouselistener to it i get the events on the borders of the frame not the entire frame with it's contents.
Any ideas as to why?
EDIT : Or at least do you have an alternative? I want a "gloabal" way to catch mouse even...