java

Reading JCS_YCCK images using ImageIO

I'm using ImageIO.read to process uploaded image files. The code is similar to BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(image.getContents())); I've managed to solve most of the issues, but this one has left me clueless. The uploaded image has a JCS_YCCK profile, as defined in com.sun.imageio.plugins.jpeg.JPE...

Where are these icons as a java resource?

I've got a custom tree cell renderer that I'm using to render custom icons a JTree, and I really like the warning icon and the error icon that JOptionPane displays for both warning messages and error messages respectively. Obviously I can use the following code to get the icons for my own use, but this is way heavy handed and requires me...

How can it be determined whether a network adapter is wireless?

There are a number of ways to obtain a machine's network adapters & related info such as Sigar & java.net's getNetworkInterfaces(). However, using either of these means, I am unable to determine whether a certain adapter is wireless (unless the name/description explicitly says so). Are there any ways to determine this through code? (I'...

Error calling SOAP method: Error deserializing message

I have a shipping module created with java that uses soap. When trying to ship a package I get the following error message that prevents fedex shipping rates to display: Sorry, there was an error in processing this form action. Please report the error or try again later. (Error calling SOAP method: Error deserializing message: Can't loc...

Prepared Statement Failing

I'm using a prepared statment that should (using SQL & JDBC) insert data into a dataTable. I am using one that deletes data that works fine, but the insert one is not inserting any data into the data table and does not produce an error or warning. What could cause a prepared statement to fail in this way? Could inserting a null value int...

Break-even point for OSGi

It seems that OSGi is a hot term these days. Many benefits are invoked: Reduced Complexity Reuse Easy deployment Versioning (etc) I'm asking for a very specific use case - small to medium-sized web applications. What benefits would OSGi bring for those? It is actually worth it? ...

Prepared Statement Failing (With an Error Message!)

I am getting this error when trying to insert data into a data table Error Saving data. [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect I looked at the appropriate data table and there does not exist a field called COUNT either hidden or not hidden. Is this some SQL terminology that I should be familiar with? An Extens...

Getting a call hierarchy in java

I am having real trouble tracking down a bug and it would help be a lot to know which method called a certain method. Is there an easy way to get a call hierarchy from java? Java is a small part of the app so I cannot compile and run the whole app in eclipse/net beans so I don't have access to an IDE debugger's call hierarchy. ...

How to properly format a SOAP message envelope using a custom SOAPHandler

I have a class that implements the SOAPHandler interface. The handleMessage is defined as: public boolean handleMessage(SOAPMessageContext context) { SOAPMessage msg = context.getMessage(); SOAPPart part = msg.getSOAPPart(); SOAPEnvelope envelope = part.getEnvelope(); // add namespaces SOAPElement envelope.addNamespaceDecla...

How do make an infinite jscrollpane?

I've implemented drag scroll before, but what's the best way to go about creating an infinite scroll pane? Of course there won't be any scrollbars and I will implement drag scroll. What I am trying to do is implement dynamic loading on an infinite surface. EDIT Of course it wouldn't actually be infinite. I am asking how to fake it. ...

Tomcat Session Eviction to Avoid OutOfMemoryError

We are running a vendor-supplied webapp in Tomcat 5.5 using the StandardManager for sessions (in memory). As sessions can get quite large (20M+), running out of heap space is a serious concern. Users want to keep sessions around for a couple of hours if possible but would rather evict sessions than run out of heap space. It does not a...

displaying links in java's JTextPane without html

I need to take text from a source as plain text and display it in a JTextPane or JEditorPane. The source text is not HTML but will contain URLs between square brackets which need to be displayed and function as hyperlinks. I've considered setting the pane's content type to text/html and surounding the url in html tags but that ends up i...

Java error: Implicit super constructor is undefined for default constructor

I have a some simple Java code that looks similar to this in it's structure: abstract public class BaseClass { String someString; public BaseClass(String someString) { this.someString = someString; } abstract public String getName(); } public class ACSubClass extends BaseClass { public ASubClass(String someS...

Java: why are multiple objects showing up with runhprof output?

I was curious about the runhprof output? I am mainly concerned about the memory section. It looks like there are multiple entries of the same class. Why would that be. Is there a way to get hprof to print how much memory a particular class(the instances of that class) take up in memory. One value for each class. Also, what tools do...

Retrieve POST parameters only (Java)

Does anyone know of a way to get only POST parameters from an HttpServletRequest object? IE, PHP has the $_POST superglobal and Perl's CGI.pm will only retrieve POST parameters if the HTTP method is POST (by default). HttpServletRequest.getParameter(String) will include the GET URL parameters even if the HTTP method is POST. ...

Why is Java frequently used for enterprise applications?

Hi! As a Java newbie I'm wondering: of all the languages in the world, why is Java frequently used for enterprise applications? What makes it that way compared to the other languages? Will it continue to be this way in the upcoming years? I'd appreciate your insights. Thanks in advance :) ...

Best 3D Java Engine

Looking for an easy to use 3D Java Engine API (i.e. not wrapper) that has a good community and good development. Extra features (i.e. audio, input, etc.) are not necessary but nice. List of the most popular Java 3D graphics APIs I found: Wrappers / Low Level Jogl - Strong community / Good support / Active Java3D - Abandoned (or slowl...

How to run external testcase(Class,junit) in java program?

How to run external testcase(Class,junit) in java program? ...

Can't debug Java Windows Services with jhat, jps, jstack

I frequently showcase the jhat, jps, and jstack tool set to developers on Linux and Mac. However, a developer recently indicated that these are unusable in Windows if the Java app in question is running as a Windows Service. A Sun-filed bug says something very similar, but was closed due to inactivity. I have tested this out for mysel...

Suitable Design Pattern for a Simple Chat Application.

Hi. I am designing a simple chat application (just for the kick of it). I have been wondering of a simple design for that chat application. To give you overview.. here are the rules: Anonymous user enter chat just with a nickname. (User id) is presumably assigned by system in background. They can join in (subscribe to) a chat conversa...