java

Why does synchronized notifyAll result in a IllegalMonitorStateException?

Why does this test program result in a java.lang.IllegalMonitorStateException? public class test { static Integer foo = new Integer(1); public static void main(String[] args) { synchronized(foo) { foo++; foo.notifyAll(); } System.err.println("Success"); } } Result: Exception...

Java benchmarking tool

I have written a small java application for which I need to obtain performance metrics such as memory usage, running time etc., Is there any simple to use performance measurement tool available? ...

Linear Programming Tool/Libraries for Java

I'd like to set up a large linear programming model to solve an interesting problem. I would be most comfortable in Java. What tools/libraries are available? ...

Matisse in Eclipse

I have just installed Eclipse 3.4 and found out that there is not a plugin to create Swing applications yet. I also have found that there is a Matisse implementation in MyEclipse IDE, but I'd like to now whether there is such a Matisse plugin for free. ...

Message Driven Bean with a Datasource

My question is how do I configure an EJB 3.0 style message driven bean to use a configured JMS datasource in jboss. For example, my MDB looks something like: @MessageDriven(mappedName = "ExampleMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @A...

How can I make Java back-end development faster? Or can I?

Hi, I started web programming with raw PHP, gradually moving on to its various frameworks, then to Django and Rails. In every framework I've used, pretty much everything I need to do with a database (even involving relatively complex things like many-to-many relationships) could be taken care of by the automatically generated database A...

Abstract class constructor in Java

Can an abstract class have a constructor? If so, how it can be used and for what purposes? ...

Is there an easy way to clone the structure of a table in Oracle?

If I have a table like: CREATE TABLE FRED ( recordId number(18) primary key, firstName varchar2(50) ); Is there an easy way to clone it's structure (not it's data) into another table of a given name. Basically I want to create table with exactly the same structure, but a different name, so that I can perform some functionality on it. ...

Is there an easy way to add a "Choose" option to a Tapestry PropertyModel dropdown

I have a Tapestry PropertyModel for gender. Right now the dropdown just shows Male and Female because those are the only values in my model. I'd like to add a "Choose an Option" option. Is there a standard way to do this without having to add a fake value to my model? I'd also like it to be smart enough to know that if the field is re...

Abstract class constructor access modifier

So a abstract class can only be used as a base class which is extended by some other class, right? So the constructor(s) of an abstract class can have the usual access modifiers (public, protected, and private (for internal use)). My question is what is the correct one to use between protected and public since the abstract type seems...

Access session of another web application

Is it possible to configure two separate web apps (WAR) in a J2EE application (EAR) to access a shared session context? Further info: I ended up creating a shared class from the EAR which stored the required information in static members. This did the trick, even if it seemed like a dirty hack. ...

Canoo WebFunctionalTest / Selenium, features comparison

For features comparison of Web Canoo Web Functional Test and Selenium software, it would be good have an assessment, in terms of integration to Java platform applications, speed, how quick is it to deploy Tests, execute, and analyze results, JavaScript support etc. I am using Canoo project, it is pretty good. Tatyana ...

Where can I see the Sun Java source code?

I want to have a look at how Java implements LinkedList. Where should I go to look at the source code? ...

Resizable Java component

I would like to have a Java component which has a resize icon on the bottom right of the component so that when I drag that icon, the component will automatically resize with it. By resize icon, I mean the following: The above image contains the resize icon in the Google Talk messenger's main window. Is there any Java component which...

What is missing in the current and planned standard Java class library?

When looking through the JDK, I often think to myself, "Why isn't this included in the JDK?" I know there's Apache Commons and various other libraries, but there are somethings that are just so fundamental that I feel it should be added to the JDK. What are some things missing that you think should be added to the JDK? ...

How do I get rid of Java child processes when my Java app exits/crashes?

I launch a child process in Java as follows: final String[] cmd = {"<childProcessName>"}; Process process = Runtime.getRuntime().exec(cmd); It now runs in the background. All good and fine. If my program now crashes (it is still in dev :-)) the child process still seems to hang around. How can I make it automatically end when the pa...

Userland autoboxing?

Is it possible to implement autoboxing for your own classes? To illustrate my example, this is what I might want to write: Foo foo = "lolcat"; And this is what Java would do (as per my own definitions, somewhere, somehow), under the hood: Foo foo = new Foo(); foo.setLolcat("lolcat"); So, is this possible somehow, or is it a JVM-fe...

How to insert the symbol 'Infinite' in Excel programmatically?

Hi, How can I create the "Infinite" symbol in an excel sheet programmatically? Preferably from Java...but other tips are also welcome. Thx. ...

How can I access the ServletContext from within a JAX-WS web service?

I want to share an object between my servlets and my webservice (JAX-WS) by storing it as a servlet context attribute. But how can I retrieve the servlet context from a web service? ...

Mapping multi-Level inheritance in Hibernate

Currently I have a structure like this: A | +--B | +--C It's mapped with one table per subclass using joined tables. For historic reasons I also use a discriminator, so the current situation is as described in Section 9.1.3 of the Hibernate manual. Question: How do I extend the mapping for a structure like this: A | +--B | | | D |...