java

Comparing scalable web-app architecture on Java and .NET

What are the recommended steps for creating scalable web/enterprise applications in Java and .NET? I'm more interested in what it takes to go from a low volume app to a high volume one (assuming no major faults in the original architecture). For example, what are the options in each platform for clustering, load-balancing, session manage...

renaming DLL functions in JNA using StdCallFunctionMapper

I'm trying to use JNA with a DLL in Windows, so far I was able to successfully call a function called c_aa_find_devices(). But all the functions start with c_aa and I would like to rename it to find_devices(). From what I gather the way to do this is with StdCallFunctionMapper but I can't find the documentation of how to use it in an ex...

Hibernate HQL with list getters

I have a Hibernate entity, with a getter that is mapped as a @OneToMany: @Entity class Parent extends BaseParent { @OneToMany(cascade = {CascadeType.ALL}, mappedBy = "parent") public List<Child> getChildren() { return super.children; } public void setChildren(List<Child> list) { super.children = list; ...

Talking to a Microsoft Geneva server from Java

Has anyone tried to interact with a Microsoft Geneva Server from Java? Can it be done easily, using some combination of generally available libraries? If so: What are the important Java libraries/frameworks to look into? ...

getting boolean properties from objects in jsp el

Hello, I have an instance of the following object in the jsp page context: Class User{ private boolean isAdmin; public boolean isAdmin(){return isAdmin} } How can I query the isAdmin property from the EL? This doesn't seem to work: ${user.admin} nor does this: ${user.isAdmin} thanks! -Morgan ...

Is it possible to pass the X Display name to the JVM

Is it possible to specify which X display the JVM is to launch it's windows on through the JVM? I am thinking something like this java -DISPLAY=THE_DISPLAY_I_WANT:0.1 -jar my.jar I looked at the man pages and I can't find anything. or do I need to wrap my call to the jvm in a shell script like this #/bin/sh export DISPLAY=THE_DISPL...

Keeping a DCOM object alive from Java server on a REST invocation

Hi, I'm implementing a REST API for my Java server. One of the of the resources obtained through the API is actually creating a C++ DCOM object and reflecting its values. The Java to COM bridge I'm using is J-Integra. The problem is that I need to keep that DCOM object alive for subsequent REST calls, but the object is alive just as lo...

JSlider question: Position after leftclick

Whenever I click a JSlider it gets positioned one majorTick in the direction of the click instead of jumping to the spot I actually click. (If slider is at point 47 and I click 5 it'll jump to 37 instead of 5). Is there any way to change this while using JSliders, or do I have to use another datastructure? ...

Best Way to Access MS Analysis Services Cube from Java

I want to issue MDX against a MSAS cube from a Java client. What connectivity approaches have proven to be reliable for this? ...

Consequences of these Pointer Errors in C++ vs Managed

I'm making this a community wiki in order to better understand the semantic differences between these errors and their runtime or compiled consequences. Also, I've coded on Java far too long and I want to learn pointers better in C++ -- so I need other people to do it. Edit2: I am refactoring this question. The distinction I am trying...

The best way to store and access 120,000 words in java

Hello, I'm programming a java application that reads strictly text files (.txt). These files can contain upwards of 120,000 words. The application needs to store all +120,000 words. It needs to name them word_1, word_2, etc. And it also needs to access these words to perform various methods on them. The methods all have to do with S...

How do I get a simple, Hello World Java applet to work in a browser in Mac OS X?

I'm using Java SE 1.6 on Mac OS X 10.5.6. The code for my applet is as follows: import java.awt.Graphics; import javax.swing.JApplet; public class HelloWorld extends JApplet { public void paint( Graphics g ) { super.paint( g ); g.drawString( "Hello World!", 25, 25 ); } } I compiled this to a .class ...

Unexpected multithreaded result

I wrote a couple of Java classesSingleThreadedCompute and MultithreadedComputeto demonstrate the fact (or what I always thought was a fact!) that if you parallelize a compute-centric (no I/O) task on a single core machine, you don't get a speedup. Indeed my understanding is that parallelizing such tasks actually slows things down because...

Separate INFO and ERROR logs from java.util.logging

I'm configuring the logging for a Java application. What I'm aiming for is two logs: one for all messages and one for just messages above a certain level. The app uses the java.util.logging.* classes: I'm using it as is, so I'm limited to configuration through a logging.properties file. I don't see a way to configure two FileHandlers d...

Would you use Metro instead of Axis2?

For a starting project, why would you use Metro instead of Axis2? What should be considred? Performace? Easiness? Tools/IDE/Plugins availability? ...

Is null a Java keyword?

Is null is a keyword in Java? ...

Doubt in JavaMail program

Hi to all, I have created a java mail program to send mails. It was working fine yesterday.. All the mails were received in inbox folder but today mails are not received in inbox and all the mails are storing in junk box folder. Can anyone know why it happens? and what should i do to receive it in inbox? ...

Applying the MVP pattern to JDialogs

I'm writing a Swing application, and further to my previous question, have settled on using the Model-View-Presenter pattern to separate the user interface from the business logic. When my application starts up, it executes the following code: Model model = new BasicModel(); Presenter presenter = new Presenter(model); View view = new S...

Java "params" in method signature?

In c# if you want a method to have an indeterminate number of parameters you can make the final parameter in the method signature a "params" which to the method looks like an array but allows anyone using the method to put in as many parameters of that type as the want. I'm fairly sure java supports similar behaviour, but I cant find ou...

Why is compareTo on an Enum final in Java?

An Enum in Java implements the Comparable interface. It would have been nice to override Comparable's compareTo method, but here it's marked as final. The default natural order on Enum's compareTo is the listed order. Does anyone know why a Java Enum has this restriction? ...