java

Handle large data structure in Java

Hi, I'm working on a Java application that needs working on very large matrices. For example multiplying two 10 million * 10 million matrices! Of course the Java heap does not have enough space even for storing one of these matrices. What should I do? Should I use databases to store my matrices and bring to memory every needed part and ...

JavaScript (Rhino) use library or include other scripts

In JDK6, is there a way to load multiple scripts, each in a file, and have the one script reference a method of another script? Sort of like "include"? ...

Servlet Program as a service

Hi, I have a Java servlet program which it starts when tomcat starts. I have mentioned the program as load at startup. I am not using any HTTP request or response. What I need is I need to run the program as a service or need to have auto refresh at certain interval of time. How to do that? Can someone assist me! Thanks, Gopal. ...

Why did I get “Error commiting response java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcher.write0(Native Method)” with SSL

I encounter this exception when i do a page redirect from http to https. And the strange thing is that i can access https in the first 10 to 20 requests. But subsequent requests that i encounter this broken pipe issue Below is the full exception Error commiting responsejava.io.IOException: Broken pipe at sun.nio.ch.FileDispatcher.write...

404 after autodeploying servlet to glassfish

Hi Chaps, I tried to deploy a servlet I have created to Glassfish application server, and I seem to have hit a bit of a stumbling block. The code deploys fine to the auto deploy folder, and once it's deployed the following is written to the log file: [#|2009-03-16T13:41:29.303+0000|INFO|sun-appserver2.1|javax.enterprise.system.tools.dep...

What Java versions are commonly installed on browsers, is it safe to assume 1.4?

Is there any site/analysis about what Java version most people are using on WWW ? It seems this data is not available on webserver logs (vs. Flash versions) Can we safely set e.g. Java 1.4.2 as minimum requirement for our applet, or are there still many users using Java 1.1 (MS one) or Java 1.2-1.3 ? It's still a bit of a complicated p...

JSF tutorials

Are there any good JSF tutorials? Let's say I'm new to JSF. Any way that my skills would get up to speed? Any good sites? ...

JPA tutorials

Let's say that I'm new to JPA, is there a way to get my skills up to speed? Are there any good tutorials? ...

Hibernate tutorials

Let's say that I'm new to Hibernate, is there a way to get my skills up to speed? Are there any good tutorials? ...

Null pointer exception JLabel

Why do I get a null pointer exception when I try and run this on a label: JLabel player1CurrentScore = new JLabel("" + matchPlay.returnPL1GamesWon(), JLabel.CENTER); Is it because I cannot have two strings concatenated like this? Ideally, I am trying to set the label as the score of the player ...

In Eclipse RCP, how do I disable a save toolbar button according to the "dirty" property in editor

In my eclipse RCP 3.3 application, I would like to enable or disable a 'save' toolbar button according to current editor dirty flag. I'm trying to use the <enabledWhen> tag but I can't make it work. Here's the portion of code in plugin.xml : <command commandId="org.acme.command.save" icon="icons/save.png" id="org.acme.command.save...

Spoofing Java UDP Packets

I am looking to spoof UDP packets using Java. Are there any good Java libraries out there that allow you to create your own RAW SOCKETS? Sorry, forgot the Java stuff. ...

Are there any benefits to developing Java in a virtual machine?

I'm coming from the .Net camp where virtualization was much more prevalent do to the need to run on server software and system-wide entities such as the GAC. Now that I'm doing Java development, does it make sense to continue to employ virtualization? We were using VirtualPC which, IMO, wasn't the greatest offering. If we were to move...

Lock Ordering in C3p0

I am trying to log the creation and destruction of database connections in our application using c3p0's ConnectionCustomizer. In it, I have some code that looks like this: log(C3P0Registry.getPooledDataSources()) I'm running into deadlocks. I'm discovering that C3p0 has at least a couple objects in its library that use synchronized m...

Change test name of parameterized tests?

Is there a way to set my own custom test case name when using Parameterized tests in Junit4? I'd like to change the default "[Test class].runTest[n]" to something meaningful... ...

Jar file size differences

I am reorganizing our java code base and wanted to compare our resultant jar files. When I build in the old source tree, I get a jar file size of 3360081. In the new source tree it is 3360128. I do a "jar tvf jarfile" and then strip the dates out of the file. The listing looks like this: 0 Mon Mar 16 10:41:16 EDT 2009 META-INF/...

Setting up JDBC Authentication in Jetty

I need to setup basic jdbc authentication using jetty. can anyone throw me some pointers (article, tutorial or even some simple solutions) ...

Java XML Node Edit without Node.getTextContents()

I'm using an old version of the JRE (1.4) where Node.getTextContents() and Node.setTextContents() are not available. Is there a long way to do these actions still? Example XML: <MyEle>4119<MyEle/> Java: //myEleNode is a Node found while traversing String nodeString = myEleNode.getTextContent(); if(nodeString.equals("4119")){//do so...

When Should I Use Java in my ColdFusion Application?

Responders to the question know, of course, that ColdFusion is a Java EE application and can access all underlying Java classes, supports JSP custom tag libraries, etc. But what I want to know is when to write code in Java, compile it as a JAR, and reference it in CFML. This is all in the context of a CF MVC app written in a framework l...

ClassNotFoundException in Java Applet using <object> tag

Hi there. I'm trying to embed a Java Applet using the <OBJECT> tag, which is the XHTML Strict way of doing it. After browsing lots of sites, I tried this example which seems to work pretty well: <!--[if !IE]> Firefox and others will use outer object --> <object classid="java:Sample2.class" type="application/x-java-applet"...