java

Best Way to Launch External Process from Java Web-Service?

I've inherited a Java web-services code-base (BEA/Oracle Weblogic) and need to start/launch an external background application from a web-service. I've already tried: ProcessBuilder pb = new ProcessBuilder(arg); pb.start(); as well as: Runtime.exec(cmdString); But am experiencing strange behaviors when launching applications in th...

CSV file validation with Java

I'm reading a file line by line, like this: FileReader myFile = new FileReader(File file); BufferedReader InputFile = new BufferedReader(myFile); // Read the first line String currentRecord = InputFile.readLine(); while(currentRecord != null) { currentRecord = InputFile.readLine(); } But if other types of files are upload...

Does JPA support mapping to sql views?

I'm currently using Eclipselink, but I know now days most JPA implementations have been pretty standardized. Is there a native way to map a JPA entity to a view? I am not looking to insert/update, but the question is really how to handle the @Id annotation. Every entity in the JPA world must have an ID field, but many of the views I have...

large virtual lists in Swing using AbstractListModel -- limit at 119,000,000 items?

I've got my "virtual list" in swing working well, but it seems to fail when I exceed some particular number of items. By "fail" I mean that the scroll bar magically vanishes when the number of items is > Nmax, and it comes back when the number of items is <= Nmax; Nmax seems to be somewhere around 119,304,000 on my system. What am I ru...

Are there any Java Frameworks for binary file parsing?

My problem is, that I want to parse binary files of different types with a generic parser which is implemented in JAVA. Maybe describing the file format with a configuration file which is read by the parser or creating Java classes which parse the files according to some sort of parsing rules. I have searched quite a bit on the internet...

Does Hibernate EntityManager include Core?

I'm using Hibernate's implementation of JPA. My Maven pom.xml references hibernate-entitymanager. My question is, does Hibernate EntityManager (called "Standard Java Persistence API for Java SE and Java EE" on Hibernate's home page) depend on or use the Hibernate Core code? I've discovered a bug with Hibernate that is documented and fix...

How do I test the availability of the internet in Java?

I don't want to tell the hard way that the internet is unavailable when I catch an exception from url.openStream(). Is there a simple way to tell if the computer is connected to the internet in Java? In this scenario, "connected to the internet" means being able to download data from a specific url. If I try to download from it and i...

How can I overlay images over one another in Java?

So I have been posting all over and have yet to get a solid answer: I have created an image resizing class, with a crop method. The cropping works great. The issue that I am having is the background color that I specify in the drawImage function of Graphics is not working correctly. It defaults to black as the background regardless of w...

Hibernate Core daily/weekly build Maven repository

I'm looking for a Maven repository that contains daily or weekly builds of Hibernate Core. More specifically I'm trying to get a hibernate-core build that contains a bug fix which was checked-in on December 9, 2008. Unfortunately the most recent hibernate-core is 3.3.1GA built during September, 2008. ...

Calling a Java method with the implicit Graphics parameter, like repaint() or accessing the Graphics in a JPanel.

When you call repaint(), for example, repaintComponent(Graphics) gets called, and then you can call it from outside the class without the parameter Graphics. I'd like to have a function that takes more parameters I'm using, but I still want to be able to draw with it, so I need to be able to make a call like that (eg repaint() calls rep...

java.rmi.NoSuchObjectException: no such object in table

I am writing a very simple RMI server, and I am seeing intermittent java.rmi.NoSuchObjectExceptions in the unit tests. I have a string of remote method calls on the same object, and while the first few go through, the later ones will sometimes fail. I am not doing anything to unregister the server object in between. These error do not...

Establishing communication between Java client and .NET server

Hi, I would like to create a server using .NET and Java client (Android application). The client will be connected to the server through mobile network so it's impossible to use tcp socket for two-way communication. I would like to develop a logic for client login: The client sends username and password to the server and server repli...

Which do you prefer: Java Web Start, or Java Applets?

Which do you think is better as a programmer, and as a end user, and why? ...

Has Java just not kept up?

I code C# all day, but recently made a jump to Java for hobby stuff, like writing for the BlackBerry and Android platforms. All this time I assumed that as far as language features go, Java and C# were twins of each other. Anyway, I discovered that Java is the equivalent of C# 1.1 or something like that. In Java, I have to write twi...

Providing a facility to add callouts(i.e.diffrent shapes in which you can add text) in java

I am doing a java project.In this I want to provide a facility to the user that user can add diffrent shapes on JPanel & also can add text to that sahpe.User should also be able to resize that shape. In short I want to provide a similar facility as that of the Microsoft word. Can anybody please help me?? ...

How to improve productivity when developing JEE based web applications.

I'd like to know how you address the seemingly low productivity of JEE-based web application development compared to other technology stacks (Seaside, Ruby on Rails, etc). The constraints are: The finished web application must be deployable on JEE compliant application containers If possible, previous investment in Java-based solution...

How to deliver a Java program locally through a browser

Hello, I want to write an application that runs entirely locally on one machine - there is no need for connection to the internet or to any external machines. I was thinking that it would be a good idea to use a web browser as the platform for this application so that I would not have to mess around with lots of UI stuff - I could just...

Java Web Services video tutorials

Are there video tutorials for Java Web Services with the same caliber as asp.net and windowsclient.net Learn section? ...

Problem with ImageTools plugin in Grails

Hi guys, i have a grails project with an Image Domain Class and Controller. I just installed the grails ImageTools 1.0.4 Plugin and i would like to generate thumbnails for images wich will be uploaded. My Image-Domain-Class: class Image { byte[] data //String name byte[] thumbnail static constraints = { //name() data() } } ...

How can I tell if a Java integer is null?

Greetings, I'm trying to validate whether my integer is null. If it is, I need to prompt the user to enter a value. My background is Perl, so my first attempt looks like this: int startIn = Integer.parseInt (startField.getText()); if (startIn) { JOptionPane.showMessageDialog(null, "You must enter a number between 0-16....