I'm having trouble debugging my jbehave tests. I cannot get maven to start the jbehave tests and stop at a breakpoint. I have this in my pom:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<version>2.0.1</version>
</plugin>
</plugins>
</pluginMa...
Socket programming inside a servlet acting as server, is it a good solution to start a sort of server pushing environment?
...
I'm having trouble using the Netbeans 6.5 profiler to profile the memory usage of a java web app, remotely.
I have followed the steps in the tutorial, and was able to customize a Tomcat instance to start with the profiling agents. I can also attach the Netbeans profiler to the running server: for some seconds, the profiler shows graphs ...
I have a web service that returns an array of bytes and my intention is to convert said array to a .wav in the client (a handheld such as Blackberry). However I really have no idea of how to do that, I tried just making an FileOutputStream but of course that wouldn't play. So I am once again without knowing what to do. Any ideas?
...
I have a base class that has an abstract getType() method. I want subclasses to be able to implement this method and provide the actual class to use.
In code, something like the following:
public abstract class A {
public static interface Tile;
protected abstract Class<Tile> getTileClass();
}
public class B extends A {
p...
I was reading item #6.10 on http://www.cafeaulait.org/javafaq.html and I began wondering how the big players go about creating their own implementation of a JVM. Would an experimental something or another be possible (and feasible) for one guy?
...
In Java, when should static non final variables be used?
For example
private static int MY_VAR = 0;
Obviously we are not talking about constants here.
public static final int MY_CONSTANT = 1;
In my experience I have often justified them when using a singleton, but then I end up needing to have more than one instance and cause myse...
Is there a well-established approach for documenting Java "properties" file contents, including:
specifying the data type/contents expected for a given key
specifying whether a key is required for the application to function
providing a description of the key's meaning
Currently, I maintain (by hand) a .properties file that is the de...
How do you read and display data from .txt files?
...
Hi there.
I'm running Java web app using tomcat and I want to read a properties file that's located in my WEB-INF folder. How can I get an InputSteam to this properties file so I can read it?
...
How to compute accurately the time it takes a Java program to write or read a number of bytes from/to a file ?
It is really important that the time is being measured accurately. (The time should be computed by the program itself).
...
I'm using Graphics2D.drawImage to draw an image into a BufferedImage.
Then I Use ImageIO.write() to output this to a PNG. Often I don't see certain images that I painted this way.
I assume this is because drawImage is an asynchronous operation and I need to wait for it to complete. I've tried implementing an ImageObserver but without s...
I have been working on a small web app using the Stripes framework. Now that the Google App Engine has added support for Java, I am wondering if I can convert it to run in the Google App Engine to save costs on hosting.
...
Hi All: I'm trying to set up my build file to be run for deployment on JBossAS 5.0.1, and I need to find the servlet jar file that I should use for the build..
All of the web pages I've looked at seem to indicate that the file is javax.servlet.jar and it should be in the C:\< install dir >\server\default\lib directory. I'm looking in th...
I have an android application that plays music from a site, however to authenticate to the stream, you need to send a cookie first I.E:
http://example.com/site/content?id=SOMEID = mp3 formatted stream
If you access the url without a cookie, you'll get a Server 500 error.
If you have a cookie, then you'll get the stream.
For the life o...
Since JBoss 5.0.0, jbossall-client.jar only contains a manifest that points to all the jars in the client directory. Is there any way to create a jbossall-client.jar that contains all of these classes instead of having to put the 70 or so individual jars on the classpath?
...
I have a hierarchy of three interfaces, grandparent, parent and child. Parent and child have a method "add", which requires different input parameters in the child. While it's no problem to add the required signature in the child, the inherited method will be pointless, so is there a way to not have it in there at all? The other methods ...
Which is the best Java memcached client, and why?
...
Are there any issues with using a byte[] as a primary key in a JPA Entity?
I want to use a UUID as my primary key, but stored as a string I feel it will be too large.
I was thinking of doing something like this to store the ID as a byte[] and set it as my Entity's ID:
public static byte[] byteArray(UUID uuid) {
long lsb = uu...
What is the best way to monitor memcached from a Java application on a Linux machine? I would like information such as:
1) Memory used by each object
2) Number of items evicted for reclaiming memory
3) etc..
...