java

Building java from MSBuild

We are using MSBuild to run our build which compiles and outputs a number of .NET projects/assemblies. Now we are faced with the need to also include a java version of on of our assemblies and are unsure how we should go about integrating the building of this java source into MSBuild. There is always the option to shell out to a command...

Simulation in WEKA

Can Weka do simulations? I need to transform random subsets of values for a particular attribute and re-do analysis to figure out the variability for a particular coefficient. I guess I don't need Weka per se, just a Java implementation where I can specify the column and transform random subsets of the values repeatedly. ...

Java Open Source Pdf Viewer Library

I'm trying to display already created PDF in a browser without having Acrobat Reader installed, using a Java Applet, not Flash (there's http://stackoverflow.com/questions/785492/open-source-flash-pdf-reader-viewer for that). This topic is simlar to Java PDF viewer with FDF JPedal: http://www.jpedal.org/open_source_pdf_viewer_download.p...

How to serve a socket from a J2EE application?

We would like to serve some client requests within our J2EE application server (JBoss 4.2.3). I read that the J2EE spec doesn't allow opening a socket from an enterprise bean. But the spec suggests no alternatives. Specifically, enterprise beans should not: listen on, accept connections on, or multicast from a network socket...

How can I tell at runtime that a Java 1.4 type or member is deprecated?

In Java 6 I can use a technique like this: @Deprecated public final class Test { public static void main(String[] args) { System.out.println(Test.class.isAnnotationPresent(Deprecated.class)); } } to decide if a type is deprecated. Is there any way at all to do this in 1.4 with the old style (Javadoc-based) depreca...

Should a class implement a constants-only interface?

Today I looked at the ZipEntry class and found the following: public class ZipEntry implements ZipConstants, Cloneable ZipConstants does not define any methods - only constants (static final int LOCHDR = 30) It then occurred to me that implementing the interface with constants lets you access those constants directly, as if they were...

How to get list of aspects in the systems

Does one can recommend me how to get list of aspects in alfresco using java web-service API. Thank you. ...

ServicesSearch an error comes in java as symbol not defined in netbeans

package com.intel.bluetooth.javadoc.ServicesSearch; import java.io.IOException; import java.io.OutputStream; import javax.microedition.io.Connector; import javax.obex.*; //import java.util.Vector; public class ObexPutClient { public static void main(String[] args) throws IOException, InterruptedException { String serverURL = null;...

Spring Tests : transaction not rolling back after test method executed

Hi ! I'm trying to create integration tests for a legacy application deployed on Weblogic 8.1 using a subclass of AbstractTransactionalJUnit4SpringContextTests. My test method has the following annotations : @Test @Rollback(true) public void testDeployedEJBCall throws Exception {...} My test class also references beans of type org.s...

When we have wrappers classes, why primitives are supported?

We have wrapper classes in java like Interger, Float.. why it is still supportng primitives which is stoppting java to be fully object oriented language? ...

Java Panel Double Buffering

Hey everyone, wondered if anyone could point me in the right directon, i have developed a pong game and it needs double buffering due to flickering. Iv tryed some of the post on here to try and make it work, but im still a beginner with the swing awt suff, any help would be amazing thanks. public class PongPanel extends JPanel implemen...

Maximum URI length in Grizzly (GlassFish) and Tomcat

Is there a maximum length (not default value) for URIs in Tomcat and in Grizzly (GlassFish 3)? I want to create a RESTful API which should be able to receive big GET requests. ...

Facebook sharing feature on seam

Good morning all. I'm developing a web application, using Seam. I have the following problem: I have my site with Locale set to "en". I'm trying to share a specific page: ../pt/news.xhtml?id=8 The first portion of this url (/pt/) "tells" the webserver that the article displayed on news.xhtml page with id=8 must be in portuguese. To do...

[Java > ScriptEngine] Validate JavaScript-Code

Hello, I use Java's ScriptEngine to execute JavaScript Code. I use the Invocable Interface, so that I can use the Script Code as a normal Java Object implementing a Java Interface. If the JavaScript Code is invalid does not follow the interface (missing methods, wrong return type, throws an exception etc.) I get an internal Excepti...

Java RAD components/architecture - advice for a .NET developer?

I am new to Java (but have a fair bit of .NET experience). I need to get a Java application up and running quickly, so what I am looking for here is advice on components that will simplify or reduce the pain of common tasks and whose payoff will either be immediate or at least come with minimal investment in time spent learning how to ...

Why Sun Java on Solaris take more than twice RSS memory ?

Hi, I've got a problem on my Solaris servers. When I launch a Sun Java process with restricted memory it takes more than twice the ressources. For example, I have 64 Go of memory on my servers. 1 is on Linux, the others are on Solaris. I ran the same softwares on all servers (only java). When servers starts they took between 400Mb and...

I dont know how to make dropdown in java

Hi. (using netbeans and java) I have the following 1 text field named input 1 (named x5) 1 text field named input 2 (named plus10) 1 text field named input 3 (named plus5perc) 1 answer field (an uneditable text field) 1 button When a number is placed into either input a calculation is done when the calculate button is pressed e.g. ...

Which of those two pieces of code is better/faster/uses less memory?

Which one is more optimal or is there any difference at all? String s = methodThatReturnsString(); int i = methodThatReturnsInt(); thirdMethod(s, i); or thirdMethod(methodThatReturnsString(), methodThatReturnsInt()); By optimal I mean optimal in the terms of memory usage etc. ...

How can I use java.lang.instrument in an Eclipse RCP application?

In order to use the instrumentation features introduced in JDK 5, you can use the -javaagent flag passed to the JVM. This will inject an instance of an Instrumentation class into the static premain method. For example in a class like this: public class MyClass { public static Instrumentation inst; public static void premain(Stri...

Is Log4j being abandoned in favor of Slf4j?

It seems that log4j has some class loading issues (among others) and it seems to me the trend is to move out of log4j toward slf4j. (Hibernate stopped using the first in favor of the latter) Is it true? What are the main issues in log4j that slf4j solves? Is slf4j the final word or is there even a better "the next next log4j" industry ...