java

Lazy loading property and session.get problem

In Hibernate we have two classes with the following classes with JPA mapping: package com.example.hibernate import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity publ...

How to convert a Reader to InputStream and a Writer to OutputStream ?

Is there an easy way to avoid dealing with text encoding problems? ...

java package cycle detection: how to find the specific classes involved ?

What tool would you recommend to detect java package cyclic dependencies, knowing that the goal is to list explicitly the specific classes involved in the detected 'across-packages cycle' ? I know about classycle and JDepend , but they both fail to list the classes involved in a cyclic package dependency. Metrics has an interesting grap...

read/write to Windows Registry using Java

Is it possible to read/write to windows registry using java? ...

Middleware API Best Practices, What are they?

We are developing a middleware SDK, both in C++ and Java to be used as a library/DLL by, for example, game developers, animation software developers, Avatar developers to enhance their products. What I would like to know is this: Are there standard "Best Practices" for the development of these types of API? I am thinking in terms of us...

Knowing which java.exe process to kill on a windows machine

When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe processes in hope t...

How to update large XML file

Rather than rewriting the entire contents of an xml file when a single element is updated, is there a better alternative to updating the file? ...

Facebook java integration

I have looked in vain for a good example or starting point to write a java based facebook application... I was hoping that someone here would know of one. As well, I hear that facebook will no longer support their java API is this true and if yes does that mean that we should no longer use java to write facebook apps?? ...

tomcat5 fails to start on CentOS 5 with NoClassDefFoundError exception

Tomcat fails to start even if i remove all my applications from the WEBAPPS directory leaving everything just like after the OS installation. The log (catalina.out) says: Using CATALINA_BASE: /usr/share/tomcat5 Using CATALINA_HOME: /usr/share/tomcat5 Using CATALINA_TMPDIR: /usr/share/tomcat5/temp Using JRE_HOME: Created MBea...

How can I get Axis 1.4 to not generate several prefixes for the same XML namespace?

I am receiving SOAP requests from a client that uses the Axis 1.4 libraries. The requests have the following form: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; <soa...

How to create J2ME midlets for Nokia using Eclipse

Hi, Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant. I want to know what does it take to make a simple Hello-World? (I already found out myself, so this is a Q&...

Saving Java Object Graphs as XML file

What's the simplest-to-use techonlogy available to save an arbitrary Java object graph as an XML file (and to be able to rehydrate the objects later)? ...

Accessing a bean with a dot(.) in its ID

In a flow definition, I am trying to access a bean that has a dot in its ID (example: <evaluate expression="bus.MyServiceFacade.someAction()" /> However, it does not work. SWF tries to find a bean "bus" instead. Initially, I got over it by using a helper bean to load the required bean, but the solution is inelegant and uncomfortable. ...

Has anyone used the Hessian binary remoting protocol to bridge applications using Java and .NET?

Hessian is a custom binary serialization protocol, (which is open-source - I think), that forms the basis for a binary cross platform remoting framework. I'd like to know if anyone here has used it, and if so, what sort of performance can we expect from a solution that bridges a Java app on one side with a C# app on the other. (Let us co...

BufferedImage in IKVM

What is the best and/or easiest way to replace the missing BufferedImage functionality for a Java project I am converting to .NET with IKVM? I'm basically getting "cli.System.NotImplementedException: BufferedImage" exceptions when running the application, which otherwise runs fine. ...

How do I learn Java5 or Java6?

I'm a very experienced Java programmer who has spent my entire time working with Java 1.4 and earlier. Where can I find a quick reference that will give me everything I need to know about the new features in Java5 and later in a quick reference? ...

What's the best way to build a string of delimited items in Java?

While working in a Java app, I recently was needing to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could come up with off the top of my head was something like this: public String appendWithDelimiter( String original, String addition, St...

Find all available JREs on Mac OS X from Java application installer

If Java application requires certain JRE version - how can I check its availability on Mac OS X during installation? ...

Calling function when program exits in java

Hi I would like to save the programs settings everytime the user exits the program. So I need a way to call a function when the user quit the program. How do I do that? I am using java 1.5. ...

Should I use clone when adding a new element? When should clone be used?

I want to implement in Java a class for handling graph data structures. I have a Node class and an Edge class. The Graph class maintains two list: a list of nodes and a list of edges. Each node must have an unique name. How do I guard against a situation like this: Graph g = new Graph(); Node n1 = new Node("#1"); Node n2 = new Node("#...