Methods invoked:
1. Struts Action
2. Service class method (annotated by @Transactional)
3. Xfire webservice call
Everything including struts (DelegatingActionProxy) and transactions is configured with Spring.
Persistence is done with JPA/Hibernate.
Sometimes the webservice will throw an unchecked exception. I catch this exception a...
I wrote a Hibernate interceptor :
public class MyInterceptor extends EmptyInterceptor {
private boolean isCanal=false;
public boolean onSave(Object entity, Serializable arg1, Object[] arg2, String[] arg3, Type[] arg4) throws CallbackException {
for(int i=0;i<100;i++){
System.out.println("Inside MyInterceptor(onSave) : "+entity.toS...
I'm trying to convert "\something\" into "\\something\\" using replaceAll, but I keep getting all kinds of errors. I thought this was the solution:
theString.replaceAll("\\", "\\\\");
But this gives: Exception in thread "main" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
...
Hi all,
I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, especially as the order of dependencies may be important and needs to be preserved from the order in the ivy config.
Has anyone done this ...
I'm trying to zip a stream from .Net that can be read from Java code.
So as input I have a byte array, which I want to compress and I'm expecting to have a binary array.
I've tested with SharpZipLib and DotNetZip to the compressed byte array,
but unfortunately I always get an error when trying to uncompress it using the java.util.zip.De...
I'm trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application.
I'm seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, as the size of my application is around 3Mb, and I can't make my customers re-download the application every time.
The problem is that, du...
Using Apache POI, I am trying to process a large amount of numeric data. I am checking for the cell type, for instance
case HSSFCell.CELL_TYPE_NUMERIC:
value = String.valueOf(cell.getNumericCellValue());
break;
Is there a way I can determine what type of numeric value the cell holds? For instance,...
One of the built-in Checkstyle checks is RequireThis, which will go off whenever you don't prepend this. to local field or method invocations. For example,
public final class ExampleClass {
public String getMeSomething() {
return "Something";
}
public String getMeSomethingElse() {
//will violate Checkstyl...
hi, am using this connection string to connect to mysql from java:
jdbc:mysql://localhost:3306/db?noDatetimeStringSync=true&useUnicode=yes&characterEncoding=UTF-8
is it possible to set the session variable in the string so that SET UNIQUE_CHECKS=0; would be executed upon connecting to server? the obvious
jdbc:mysql://localhost...
I have problem with AspectJ. Has anyone have encountered anything similar? I have listing:
../src/java/com/ws/db/Logging.aj
../src/java/com/ws/db/Db.java
And aspect:
public aspect Logging {
pointcut prepareCall(String statement): call(* java.sql.Connection.prepareCall(String)) && args(statement) &&
within(com.w...
I am using a third-party PDF Java print API that uses the Java Print API. The API is used in a WebLogic 10.2 server runtime environment. My problem is that after the server has been running for a day or so, the API is no longer able to see the printers that are set up on a local print server. Issuing lpstat -a from the command line retur...
I am having difficulty connecting my java code to sql server database. I can connect from App server just fine..but now I want to try to connect with app server out of the picture and using InitialContext with some env properties. So a stand alone java class connecting to sql server using InitialContext
I have mssqlserver.jar in my pro...
Does the ExecutorService guarantee thread safety ?
I'll be submitting jobs from different threads to the same ThreadPoolExecutor, do I have to synchronize access to the executor before interacting/submitting tasks?
...
Hi,
A library that my java application uses needs looks for a file (log4j.xml) in the class path. I use netbeans to manage my project, but I can't find a way to include the lib/ folder.
Netbeans automatically creates a MANIFEST.MF file inside the application jar and also creates a folder called lib/ which includes all dependencies. Thi...
What's up with JNDI names? I'm trying to get a javax.sql.DataSource using the new annotations feature of Java 5. It's not working for me, so I want to ask...
I have a in my web.xml, inside of it is an element. I'm switching between "jdbc/MyDB" and "MyDB". Neither makes my class-based DataSource work (it's always null) but in another e...
What is the easiest way to convert a 2D array of Strings into a HashMap?
For example, take this:
final String[][] sheetMap = { /* XSD Name, XSL Sheet Name */
{"FileHeader", "FileHeader"},
{"AccountRecord", "AccountRecord"},
{"DriverCardRecord"...
Hi,
On extracting some html from a web page, I have some elements containing text that end in an unknown or non-matching whitespace character (ie does not match "\\s"):
<span>Monday </span>
In java, to check what this character is, I am doing:
String s = getTheSpanContent();
char c = s.charAt(s.length() -1);
int i = (int) c;
and t...
Hello everyone !
For almost a year know, i developped applications in EJB3/JPA for persistence and business and Seam/JSF for presentation.
I had an idea for a desktop app, but i don't know what to use.
Using an embedded jboss would be the easy thing, because i don't have to change the way i code, but it's not realistic, and i don't th...
I can't seem to find a way to listen for new producer and consumer connections (or connection interrupts) in ActiveMQ (Java Version). I want to be able to tell the consumers (or they can find out themselves) that the producer's connection dropped. The other way around (the producer finding out that a certain consumer disconnected) is als...
I am working on Jikes RVM. I want to know how to modify the present stop the world mark sweep garbage collector into on the fly mark and sweep garbage collector.
I know there are some handshaking mechanism used to implement on the fly, but i do not understand from where i should start, Which packages i need to modify.
...