java

How many multiple "Eclipse Projects" is considered too excessive for one actual development project?

I'm currently working on a project that contains many different Eclipse projects referencing each other to make up one large project. Is there a point where a developer should ask themselves if they should rethink the way their development project is structured? NOTE: My project currently contains 25+ different Eclipse projects. ...

REST web service accepting a POST using Restlet - Best Practice

I have my resource and they typical overridden method to handle POST requests. public void acceptRepresentation(Representation rep) { if (MediaType.APPLICATION_XML.equals(rep.getMediaType())) { //Do stuff here } else { //complain! } } What I want to know is the best practice to handle my packet of XML. I see a lo...

Why is Java Swing serializable?

When I create Swing apps for remote users, I just create jar files and create a WebStart file to let users download the app and then run it. I haven't heard of application servers serving up JFrames, etc, like JSPs. Was that the original intent? ...

Why Java needs Serializable interface?

We work heavily with serialization and having to specify Serializable tag on every object we use is kind of a burden. Especially when it's a 3rd-party class that we can't really change. The question is: since Serializable is an empty interface and Java provides robust serialization once you add implements Serializable - why didn't they...

JavaBeans alternatives?

I hate the JavaBeans pattern with a passion that burns like the fire of a thousand suns. Why? Verbose. It's 2009. I shouldn't have to write 7 LOC for a property. If they have event listeners then hold on to your hat. No type-safe references. There is no type-safe way to reference a property. The whole point of Java is that it is type s...

Unknown exception while deserializing using simple XML

I am deserializing data using Simple XML in Java, but i get an exception telling me: protokolsimulering.model.Terminal.<init>() This is my serializing code: public void saveSimulationState(String simulationFile) { try{ Strategy strategy = new CycleStrategy("id", "ref"); Serializer serializer = new Persister(strate...

How to embed a Java control on a C# winforms control?

Can I put a Java control (SWT, Swing, ...) on a C# control? I know it's possible with web controls but I don't like this way. ...

About Memory Management in Java and C++.

Well, I've been given an assignment to basically figure out how memory allocation works for whatever language I'll be using. After some research, I have some questions and doubts which I'd like to get some insight in. For example: I read here that Java specifies exactly how the stack contents are organized. Looking at the JVM spec struc...

How much time it saves code generators?

My question seems easy but is little more theoretical than it looks. There are Code Generation software or application building software that gets done without the use of a programming language. Application like VE Server and VE Designer from Intelliun should accomplish this task. My question is, in reality have someone out there trac...

Java "Virtual Machine" vs. Python "Interpreter" parlance?

It's seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time. Both interpret byte codes, why call one a virtual machine and the other an interpreter? ...

Is there a working real world project using Clojure that take advantage of multi-core system that I can take a look?

Is there a working real world project using Clojure that take advantage of multi-core system that I can take a look? I want to if Clojure is still in a toy-language phrase or it's really "happening soon". ...

Need help handling documents using dom4j

import java.util.Iterator; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.dom4j.io.XMLWriter; public class Main { public static void main(String[] args){ Company cp17 = new Company(); Person ps1 = new Person("Barry","15900000000"); Person ps2 = new Person("Andy","15...

Is there a way to draw UML in Visio for Java?

I have Visio2007 and I really like it. However, it doesn't seem to have UML model/datatypes for Java. Is there some template I can download for Java? Or should I just forget about Visio altogether and get an Elipse plugin? Thanks! ...

Eclipse: Accessing a editor template from plugin code

Let's say I have a editor template (which inserts some arbitrary snippet of code) defined in my editor preferences. I'd like to access that template programmatically. How do I do this? I know the classes TemplateStore, TemplatePreferencesPage, and TemplatePersistentData exist, but I haven't been able to put them together into anything...

Should Java break backwards compatibility in future versions for the benefit of a cleaner language?

Are primitives worth keeping? Should all the deprecated stuff be deleted? Do we need 2 GUI frameworks? ... ...

Finding the number of documents in a lucene index

Using Java how would you find out the number of documents in an lucene index? ...

Solving JPA query finding the last entry in connected list

Following class structure is given: class Job { String description; Collection<JobHistory> history; } class JobHistory { Date assignDate; User jobOwner; } class JobOwner { String name; String id; } This class-structure is accessible on the db via JPA. In the DAO-Layer I can write queries in JPA syntax. The...

How to install JDK 1.5 for Solaris 10

I been trying to install but keep on getting file is corrupted when unpacking the file after accepting the license agreement. Anyone have any advice. http://java.sun.com/javase/downloads/index_jdk5.jsp I installing this jdk-1_5_0_17-solaris-sparc.sh ...

Android HTTP Connection

Can anybody tell my why this doesn't work in the Android emulator? From the browser I have access and the server is internal. All I can think of is that I'm missing some configuration on my app so it can access the network layer. try { InetAddress server = Inet4Address.getByName("thehost"); //Doesn't work either //or InetAdd...

How do I represent an XML file as a Java object using commons-digester?

Following on from my recent question regarding parsing XML files in Java I have decided to use the commons-digester library. I am now familiar with this process and now want to create a Java class representing the XML file, so that when a user instantiates a new object of that class, all of the data from the XML file will be available. ...