java

Hibernate HQL and Date

I have a MySQL table with one of the column type as Date. In my hibernate mapping file I have mapped this column to type java.util.Date. Now in HQL while trying to retrieve objects based on date equality I do not get any results if I set the Date using new Date(). If I normalize the date by setting hours, minutes and seconds to zero I ge...

Android:how to validate an e-mail address

What's the best practice to validate an e-mail address (e.g. from an user input field) in Android? org.apache.commons.validator.routines.EmailValidator doesn't seem to be available. Are there any other libraries doing this which are included in Android already or would I have to use RegExp? ...

What is this exception: Cipher buffering error in JCE provider JsafeJCE

We are getting this error when trying to change a password in ColdFusion through LDAP. Despite the error, everything seems to be completing as requested. The stack trace ends at the start of a thread so I can't tell the exact trigger point. EDIT: We started getting these errors when we moved from CFMX7 to ColdFusion 9. Here is the s...

Play video in java from InputStream

Hello. Does anyone know what I should use to play a video in Java, from an InputStream? I get the video from a SOAP message, and I don't want to save it to the hard disk, I just want to play it once and then release it. I have tried using JMF, I downloaded it, but it doesn't even install. What other free (open-source) alteratives are t...

How much thread-safety is too much?

I've been reading Java Concurrency in Practice lately – great book. If you think you know how concurrency works, but then most of the time you face the real issues, it feels like SWAG is the most you can do, then this book will certainly shed some light on the topic. It's sort of scary how many things can actually go wrong when you try t...

Trying to understand what snmp4jAgentJMX does and if it suits what I need.

Hi, I been trying to write an snmp wrapper agent for my JMX Enabled application which will translate all the information that is layd out in JMX MBeans into SNMP attributes. I'm a bit at loss in trying to understand where to start and what to use. From what I've read, snmp4j is probably the go to snmp library for Java but I couldn't man...

Open-source p2p videoconferencing in Flash or Java?

I want to build a community website with videoconferencing functionality integrated. I would prefer to provide this from within the browser, so I'm looking for a Java- or Flash-based solution. Also, it would be nice to spare bandwidth by having the clients stream their audio and video data without using a central server (like the way Sk...

Java: Exception in a child thread

in Java, if i start a thread T, from a main method in class A, and an exception occurs in T, how will the main method in A know about this. If im not wrong, an instance of Class A and the thread T will be present in two separate stacks, right, so, how does the parent of the thread get to know about the exception ? ...

How do I correct this silent failure to write files using Java IO?

I am encountering a strange issue with the commons-io/java-io. Essentially my file creation is failing silently without an exception. FileUtils.writeLines(file, collectionOfStrings); I've looked through the commons code to try and figure why this failing silently, but to me it looks like it should be throwing an exception. (See lines ...

Hibernate Spring Transactions

Hi there, I'm trying to get my spring DAOs to work but I only get this exception PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'sessionFactory' threw exception; nested exception is org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation...

Struts 1.2.9 Action Chaining

I'm having trouble calling a method in one Struts action from a method in another Struts Action (I've been told that this is possible). I'm working with two Struts DynaValidatorForms - one is used to create an entry, the other is used purely for viewing the action (plus editing, deleting etc). I have two seperate Struts Action files: C...

How to stop Jetty webserver in Google App Engine

If you are doing local development I want to know how we can stop/kill Jetty webserver? I have to close my Eclipse IDE whenever I need to do that. Is there any other way to do it? Or we have to kill the process? Thanks. ...

Find if InputStream of DataHandler is empty

In my application I develop web service that get attached file. The file is mapped to DataHandler object via JaxB, and I have access to the file via DataHandler.getInputStream() My problem is this: When the file attribute exist in the web service request, but no file is attached, I still get the DataHandler object, and its getInputStrea...

Call javascript interpreter from a script

I've written some scripts in Javascript under Rhino 1.7, one of them starts a minimal http server and accepts JS commands in input. Now, if I call (from within Rhino): engine = ScriptEngineManager().getEngineByName("JavaScript"); I get the builtin JS engine (from Java 1.6), that is an older version of Rhino, and lacks some functions ...

Expose a web service (wsdl) as a webform

Hello all, Just wanted to ask if anyone knows of a reliable & easy way to expose a webservice (wsdl) as a webform to end-users. Our team develops a lot of software for external contacts, which often involve creating a web service and exposing it as both a wsdl and a website. We'd like to automate this last step as much as possible (esp...

Connecting points to make a triangle

If I have a set of 3d points (AKA point cloud) what is the best way to determine the groups of 3 points (triangles) I should make, to create a surface reconstruction? ...

How to resolve a maven build error when a plugin (gwt-maven-plugin) descriptor fails to load?

I'm attempting to start a fresh project that hopes to use GWT 1.7.1, the Google Plugin for Eclipse, and Maven 2. I inferred that the best way to do this would be to setup the project using the Mojo gwt-maven-plugin's archetype from this question. All was going well until I attempted a build. The archetype adds a generateAsync goal, and ...

Interrupting a thread that waits on a blocking action?

I am running a thread whose main action is to call on a proxy using a blocking function , and wait for it to give it something. I've used the known pattern of a volatile boolean and the Interruption , but I'm not sure it will work: When I tried to add a catch block for "InterruptedException" , I get the error "Unreachable catch block ...

which version of eclipse to use with app engine java?

Sorry for being a MS dev :) what version of eclipse do I need to use with app engine (java)? http://www.eclipse.org/downloads/ ...

Distributed Application Environment and Web Services - What/How to learn?

I want to learn how to create distributed application environments and web services using spring, aspectj, hibernate, etc. rather than EJBs. Can anyone recommend a book or set of books that can help me (a single all-in-one book would be preferable)? Also, any advice regarding learning/creating distributed app environments and web serv...