When you start messing around with Spring's auto-proxy stuff, you often run into this behaviour as documented:
Classes that implement the
BeanPostProcessor interface are
special, and so they are treated
differently by the container. All
BeanPostProcessors and their directly
referenced beans will be instantiated
on start...
Hi,
I'm currently working on a Java trading card game, similar to the old Pokémon one. What I now want to do is to define all the cards in some way, but because there's a lot of fields that need to be initialized, I'm thinking of alternative ways, because a constructor will be very long and hardly readable for each card. I also have to i...
I know that == has some issues when comparing two Strings. It seems that String.equals() is a better approach. Well, I'm doing JUnit testing and my inclination is to use assertEquals(str1, str2). Is this a reliable way to assert two Strings contain the same content? I would use assertTrue(str1.equals(str2)), but then you don't get th...
I have never been a fan of the windows command line. I have tried tools like powercmd and liked them, but most are not distributed for free and I don't relish the thought of paying for something that I think I could write myself. I want to write my own command line wrapper similar to powercmd that allows for these properties:
Custom fo...
In Java I can write:
public class Foo {
public static Foo DEFAULT_FOO;
static {
DEFAULT_FOO = new Foo();
// initialize
DEFAULT_FOO.init();
}
public Foo() {
}
void init() {
// initialize
}
}
How can I get the same functionailty in C# (where static members are initialized ...
I remember, not too long ago, somebody post a link on how to specify the global rendering hints to use anti-alias in java.
Unfortunately I can't find the question.
How can I specify the rendering hint to use anti-alias in swing?
...
I'm writing an application that will have multiple threads running, and want to throttle the CPU/memory usage of those threads.
There is a similar question for C++, but I want to try and avoid using C++ and JNI if possible. I realize this might not be possible using a higher level language, but I'm curious to see if anyone has any idea...
How is ThreadLocal implemented? Is it implemented in Java (using some concurrent map from ThreadID to object), or does it use some JVM hook to do it more efficiently?
...
A Java application I support that runs on JRE 1.4.2_12 is hanging near midnight every night. I'd like to try and record as much profiling information as I can to discover if there is an issue in the JVM or external to the app.
I'd like to use HPROF to collect as much information as possible.
Is there a way to have HPROF dump its cpu s...
Problem:
I'm getting a thrown error from javax.net.ssl.SSLHandshakeException (see attached picture)
Is it possible for Java to have a corrupt or missing CA cert? If so how can I repair or resolve this issue/error?
Things I've Tried:
I have removed all versions of JRE from the PC and installed the latest version of JRE (1.6.14).
Cl...
Inside an SWT Table I have many TableItems.
I want to move one of them from index X to index Y.
Is there a way to do that? How?
Thanks.
...
I have a few already but wanted to merge them into one public domain oauth code library for twitter, facebook, friendfeed (and let other developers improve the library for their preferred connections).
I'm having a tough time just debugging mashing friendfeed and twitters oauth into one friendly python program running on the Google App ...
We use Axis2 to generate web service response of which the body is a xml message that generated from a system using windows 1252 as encoding. Our Axis2 system, will wrapped this body inside a soap message using utf8. The message is then send to the caller. However, the caller keep reject the message with "Invalid byte 1 of 1-byte UTF-8...
How do I easily mock out a static method in Java?
I'm using Spring 2.5 and JUnit 4.4
@Service
public class SomeServiceImpl implements SomeService {
public Object doSomething() {
Logger.getLogger(this.class); //a static method invoked.
// ...
}
}
I don't control the static method that my service needs to invoke so I...
I'm trying to parse a well formed xhtml document.
I'm having problems during the nodes iteration.
My xHtml has a structure like
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>...</head>
<body>
...
<form>
...
<div class="AB"> (1 or 2 times)
...
<div class="CD">
...
<tab...
I'm working with a legacy database and corresponding Java Domain Classes. I'm trying to add Spring Security to the app and I'd like to use Java Domain Classes for that too, just to be consistent and keep everything together. Grails has no problem using both POGOs and POJOs, btw.
So, starting with a new, empty database and a new empty gr...
I'm trying to deploy an ear to JBoss. The application.xml has entries looking like:
<module id="Core_JavaModule">
<java>APP-INF/lib/core.jar</java>
</module>
<module id="Public_WebModule">
<web>
<web-uri>public.war</web-uri>
<context-root>/</context-root>
</web>
</module>
The core.jar is read in OK, but when it tries to read...
Currently we use jtds for connecting to our SQL Server databases. I've always taken it for granted that we use it due to performance and reliability reasons, however, it's usage pre-dates my employment.
All of that being said, we are now playing with the idea of moving to SQL Server 2008, which jtds has limited support for. Initial tes...
I'd like to connect a Flash Player instance (AMF3) to a Java LocalConnection. I know how to implement the AMF3 spec, since I've done a lot of work with Red5, but I'm unsure how to navigate building the actual LocalConnection interface. There is C code provided here, but I can't speak C to save my life. Does anyone know of a Java implemen...
Very newbie (to Java) question:
I opened an Rserve connection (http://www.rforge.net/Rserve/) on localhost, and I would like to use the REngine client (src/client/java-new in the Rserve package) to connect to it.
What do I need to do to get the "RTest.java" (located in src/client/java-new/Rserve; pasted below) to compile?
I gather tha...