java

Tracking down undesirable network accesses from Eclipse IDE

A few of my various Eclipse 3.5 (actually SpringSource ToolSuite 2.2) workspaces are painfully slow when building, and I have a suspicion this is because they are continuously grabbing network resources from over the internet (e.g. schemas), whereas other workspaces, with similar content, are fine. Tracking these down is problematic. Do...

How to trace SOAP message on Glassfish 3

I would like to save to a server log SOAP envelopes for web service deployed on Glassfish version 3. I know that I can use Wireshark or similar net sniffing tool, but I would prefer to have the messages stored in Glassfish log. ...

Confusion: Abstraction and encapsulation are the same?

The definitions of "abstraction" and "encapsulation" seem very similar to me. I always confuse these terms. Please, clarify the difference by showing examples. ...

StringIndexOutOfBoundsException: String index out of range: 0

I am getting a weird exception code. The code that I am trying to use is as follows: do { //blah blah actions. System.out.print("\nEnter another rental (y/n): "); another = Keyboard.nextLine(); } while (Character.toUpperCase(another.charAt(0)) == 'Y'); The error code is: Exception in thread "main" java.lang.StringIn...

Improving JBoss 5 slow startup

We upgraded from JBoss 4 (and JDK 5) to JBoss 5 (and JDK 6). The problem is that the start time has gone from 1.5 minutes (on JBoss 4) to more than 4 minutes. 18:53:35,444 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 3m:9s:262ms It seems like the component that is ta...

#define in Java

Hi, I'm beginning to program in Java and I'm wondering if the equivalent to the C++ #define exists. A quick search of google says that it doesn't, but could anyone tell me if something similar exists in Java? I'm trying to make my code more readable. Instead of myArray[0] I want to be able to write myArray[PROTEINS] for example...

Why do I get "Not enough storage is available to process this command" using Java MappedByteBuffers?

I have a very large array of doubles that I am using a disk-based file and a paging List of MappedByteBuffers to handle, see this question for more background. I am running on Windows XP using Java 1.5. Here is the key part of my code that does the allocation of the buffers against the file... try { // create a random access file an...

why are RTOS coded only in c?

Is it necessary to code RTOS in C language always? Why can't that be coded in java or some other technology..?? Is that because of the absence of pointer concept in java? ...

How to use generated and encoded key in jce

If I generate a key like this: SecretKey aesKey = KeyGenerator.getInstance("AES").generateKey(); Then decode it: System.out.println("used key: " + aesKlic.getEncoded()); And now I want to use it for decryption(after exiting program and starting again). Obviously, something like this does not work: SecretKey aesKey = javax.cr...

Choosing Java tools (IDE and compiler) for beginners

I stumbled across this: http://en.literateprograms.org/Vending_Machine_%28java%29 It is a java vending machine, I want to read it and also follow along, write the same code. What's the fastest way to get java setup such that I can just start coding the java vending machine as I read along? I was in the process of downloading the Jav...

Padding error - when using AES Encryption in Java and Decryption in C

I have a problem while decrypting the xl file in rijndael 'c' code (The file got encrypted in Java through JCE) and this problem is happening only for the excel files types which having formula's. Remaining all file type encryption/decryption is happening properly. (If i decrypt the same file in java the output is coming fine.) While i...

Loading PNGs into OpenGL performance issues - Java & JOGL much slower than C# & Tao.OpenGL

I am noticing a large performance difference between Java & JOGL and C# & Tao.OpenGL when both loading PNGs from storage into memory, and when loading that BufferedImage (java) or Bitmap (C# - both are PNGs on hard drive) 'into' OpenGL. This difference is quite large, so I assumed I was doing something wrong, however after quite a lot o...

Webservice call through proxy server

I need to make a webservice call to a secured link(https:\). It is a two way SSL enabled link. So to access that link for making a webservice call, i need to set proxy server to the webservice link .Is there a sample code available for this ? ...

Java classes inheritance

Here, it says that: This gives MountainBike all the same fields and methods as Bicycle, yet allows its code to focus exclusively on the features that make it unique. This makes code for your subclasses easy to read. However, you must take care to properly document the state and behavior that each superclass defines, since that code ...

Richfaces:same trees in separate windows (or tabs) being in sync?

Hi all, I have a newbie question in JSF, and particular in Richfaces. I need my JSF application to have two pages showing the same tree, meaning that: The two trees should be showing the same data If I change something in one of the trees (i.e. open/close/add a node) the second tree should be automatically updated. Is this possible...

looking for GSM / CDMA call detail record structure

i am creating a program in java which will work on call detail records of GSM / CDMA. i am looking for standard structure of Call detail records used for GSM / CDMA. Can someone help me ? basically what are all the columns in a call detail record database of GSM / CDMA ...

Is is possible to build java code using JDK 1.6 to run on JRE 1.5?

PS: I am new to Java. ...

Is to possible to submit two forms simultaneously?

Is to possible to submit two forms simultaneously with either javascript or a submit button? Form structure is ok something like this: <form name="form1" method="post"> ......... </form> <form name="form2" method="post"> ......... </form> And get the data from the two in a array? ...

How to read Lotus Notes mail archives (*.nsf)

Does anyone know how to read these files without using the interops or COM interaction? Just the direct way. Is there any spec of this format or reverse engineered stuff that could help on this? Thanks. ...

Formatting Date on Java

Hi there. I have a String with the following format: january_2005 (MMMMMMM_yyyy) and i want to convert it to a mysql acceptable date value to insert it on the database. I need to do it on Java. Does anyone knows how to do it? Thanks ...