java

Hibernate JPA Sequence (non-Id)

Is it possible to use a DB sequence for some column that is not the identifier/is not part of a composite identifier? I'm using hibernate as jpa provider, and I have a table that has some columns that are generated values (using a sequence), although they are not part of the identifier. What I want is to use a sequence to create a new...

Java 6 language compared with C# 3.0 language

There exists a very good talk about C# vs. Java where H.Mössenböck compares the two languages. That's from 2003, C# 2.0 compared with Java 1.5. Can be found in German here: http://dotnet.jku.at/ What good resources exist, where actual language versions are compared? Or maybe post a comparison right here? My interests are: Advantages/...

JDK Download problem: Your download transaction cannot be approved. Contact Customer Service.

I tried to download the JDK last friday and then again today and was "greeted" with the following message: "Your download transaction cannot be approved. Contact Customer Service." Does anyone else get the same message? Is there any workaround for this issue? Apparently this error appears when you are in one of the following countries:...

Java XML: how to output the namespace of child elements ?

I'm using Java's Transformer class to process an XML Document object. This is the code that creates the Transformer: import javax.xml.transform.TransformerFactory; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setO...

Loading a list on an EJB

I have a remote EJB with a method that validates an object (returning true or false). I want to be able to pass it an ArrayList object and have the EJB load it with the errors encountered during validation, while still receiving true/false as result. How can I do this? So far, I can send it the list, and it's affected on server side, bu...

WCF and Java

What is the functional equivalent of Windows Communication Foundation in Java 6? ...

Best way to read structured binary files with Java

I have to read a binary file in a legacy format with Java. In a nutshell the file has a header consisting of several integers, bytes and fixed-length char arrays, followed by a list of records which also consist of integers and chars. In any other language I would create structs (C/C++) or records (Pascal/Delphi) which are byte-by-by...

displaytag, grouping and blank lines

I'm looking for a way to do grouping with displaytag but with the group title separated from the detail. It's probably not all that clear, so here is an example : If I just add groups to a displaytag table, I end up with something like : | group1 | item1 | | | item2 | | | item3 | | group2 | item4 | | | item5 | I ...

How do I add a spotlights to an image

I have an image that I want to show some 'spotlights' on, like they do on TV. The rest of the image should be darker than the original, and the person that I'm spotlighting should be normal. I have the x,y and radius of the spotlight, but I'm not sure how to change the brightness at that location. Also, if I have two spotlights and ...

Java applet/Firefox incompatibility problem

I've written a Java applet. A user reports that he tried to run it in Firefox 3.0.3 on OS X 10.5.5 but no go. It wants him to download a plug-in, but when he tells it to install missing plug-ins it can't find the appropriate installer... What is going wrong here? ...

Most efficient way to move an image from a C program to Java and shown on the screen?

Background I am capturing video using the video4linux 2 spec. It is captured using a C program in real-time. I also have a Java frontend that can run both locally and remotely. The remote side was easy, I just compress the images to JPEG and ship them over a mini-http server to the client that decompresses them and shows them on the ...

wsdl2java Error: Emitter failure. Invalid endpoint address in port

I am trying to run the wsdl2java command on a WSDL file that was given to me from another group in my company. I know wsdl2java works because I can run the examples but when I try it on the wsdl given to me it fails. The one big difference is that the WSDL given to me uses SSL. I’m using Java 1.4 (checked it a few time) and made sure ...

How to learn Spring Framework fast?

Please recommend some good resources(especially must have books) about spring framework? ...

List of dependency jar files in Maven

Using Maven 2, is there a way I can list out the jar dependencies as just the file names? mvn dependency:build-classpath can list the jar files, but that will include the full path to their location in my local repository. What I need is essentially just a list of the file names (or the file names that the copy-dependencies goal copie...

java mp3/audio editing/trimming library

I am looking for a java library that will allow me to "trim" an audio file so that I can pull out and save X amount of seconds of an audio file. Ideally, I am looking for something that would be like a substr for an audio file. If I want from 123 seconds in to 153 seconds in I would be able to do: coollib.load('bigfile.mp3'); coolli...

Getting started with Websphere portal 6.1 ....

Okay, my company is a bank. The upper management is dead set on a websphere IBM portal. Apparently IBM is tossing them a bone they can't refuse. We're also a very big IBM shop anyhow with A LOT of LotusNotes applications. In my experience with IBM, they generally make you go through them to learn their stuff. I'm having to sort of jump ...

Dot Net and Java Culture Codes

I've been tasked with the awesome job of generating a look-up table for our application culture information. The columns I need to generate data for are: Dot Net Code Version Culture Name Country Name Language Name Java Country Code Java Language Code Iso Country Code Iso Language Code I have found the globalization name space, but ...

merge with hibernate causing error with dirty objects

I'm using Hibernate with Spring in my application. I have been consistently using detached objects and reattaching them whenever I need to make calls to the database. I'm using hibernate template to take care of managing the connections for me. My data structure is as follows: classA: <one-to-many name="classB" inverse="true" casca...

JVM Launched via CreateProcess() Loses Classpath Library

I launch the following command line (process) from a Windows VC++ 6 program using CreateProcess (or _spawnv()): java -cp c:\dir\updates.jar;c:\dir\main.jar Main and class updates in updates.jar (overiding some in main.jar) are not read or found. It is as if the updates.jar library cannot be found or read. If I launch the same line ...

Calling java from PHP exec

Hello, I am doing the following in PHP: exec('java -jar "/opt/flex3/lib/mxmlc.jar" +flexlib "/opt/flex3/frameworks" MyAS3App.as -default-size 360 280 -output MyAS3App.swf'); When I run this from the command line, it runs fine and finishes in a second or two. When I run this command from PHP exec, the java process takes 100% CPU and ...