java

Thread.getId() global uniqueness question

If multiple Java applications are running on a system, is each Thread ID unique relative to all other Java threads, regardless of what application they are running in? Java applications are supposed to be sand-boxed relative to other Java applications so I thought it might be possible for Thread IDs to collide. If the Thread IDs are un...

Where to get Flex - Java DS (Blaze) training material?

Hi all, I was wondering if any of you out there knows where I can get really good training material (videos, examples, etc) on Flex - Java Data Services (BlazeDS would be ideal) besides the ones offered directly by Adobe. I'm thinking on something like David Tucker's blog ...

how to get rid of double-scrollbars on internal frame of GWT app

As part of porting a legacy application to GWT, we need to embed our existing JSPs inside of our GWT app. Many of these pages are quite long, resulting in a double scrollbar- one for window of the main app, and a second one for the content of the frame. I'd like to get rid of the internal scrollbar, and just have the normal browser scr...

ImageIO.write not saving out as gif, but works for jpgs and pngs?

I suspect the solution here is probably really simple, but I'm stumped... // Create the buffered image. BufferedImage bufferedImage = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB); ... //fill image data (works fine) ImageIO.write(bufferedImage, "JPG", f1); // works fine ImageIO.write(bufferedImage, "PNG", f2); //works fine Image...

Inject an array of Objects in Guice

Hi, I would like to achieve something similar to the following in Guice: public MyClass { private final InjectedObject[] injectedObjects; @Inject public MyClass(InjectedObject[] injectedObjects) { this.injectedObjects=injectedObjects; } } ie I would like to be able to create a certain number of instances of ...

CMD file copy from Java

I am looking to open up a command prompt and pass in a copy command, some switches, and the source file plus destination. I've tried the code below but nothing appears to be happening. What am I not seeing? What could I be doing wrong? String line; line = "cmd COPY /Y C:\srcfolder\112.bin C:\destfolder"; Process p = Runtime.getRuntime...

How do I set the format of toString methods with ToStringBuilder in commons-lang?

how do I configure the setting of the format for toString ...

Asynchronous IO in Java?

What options for async io (socket-based) are there in java other then java.nio? Also does java.nio use threads in the backround (as I think .NET's async-socket-library does, maybe it's been changed) or is it "true" async io using a proper select call? ...

How to exclude certain class/packages/public members from javadoc

I have created java api -ported from C# to be more specific- which aside from public interface, contains a lot of internal stuff that I don't want a user to know about. In C#, I have used doxygen to generate documentation. I presume javadoc has similar features to exclude certain public members, classes, even packages. Would someone s...

Eclipse plugin development resources

I'm looking for good resources on creating Eclipse plugins. Can anyone point me to must-read books, articles or tutorials on the subject? Update: added recommended books and links Books Eclipse Plug-ins (3rd edition), Eric Clayberg Professional Eclipse 3 for Java Developers, Berthold Daum Links Eclipse Corner Articles (Plug-ins...

Access a SharePoint website fom a java Application with Kerberos authentication

I am trying to access a SharePont website fom a java Application. The SharePoint server prefers Kerberos authentication. Can you please provide an example for just the implementation of Kerberos authentication? ...

Get the amount of bytes read in by javax.xml.stream.XMLStreamReader

Is there any way to get the amount of bytes read in by the XMLStreamReader, I am using a java.io.FileReader which is passed into the factory that creates the xml reader. I'm doubting this is possible with the XMLStreamReader but any work around is great. ...

Generating a Faces Context manually

I have two systems I'm trying to integrate. One is built on raw servlets, the new one is build on JSF with IceFaces. I'm trying to facilitate cross-system sign on. The idea is that I have a button in the old system that POSTs the appropriate information to the new site and logs them on. Well, ideally, I'd like to use just a regular old...

How do I interpret this JVM fault?

I have a Java app that makes use of some native code, and it's faulting. I want to find out where it's faulting, but I'm not sure how to read the hs_err_pid dump file: Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x256cbc] V [libjvm.so+0x25df69] V [libjvm.so+0x25dbac] V [libjvm.so+0x2...

Deploying .jar file: Why can't I load icon files?

I'm exporting a simple java project that includes two directories; src and Icons. Icons is a directory that contains three .png files. I'm exporting to an executable .jar file using File -> Export. The export works properly and the .jar file contains the Icon directory. But I can't get the correct path for the .png files when the projec...

Java AWT - BufferedImage problems when using J2ME and J9

Hey, I'm trying to use the BufferedImage class in AWT. I'm using J2ME on IBM's J9 virtual machine. When I try and call the BufferedImge.getRastor() method I get the following exception: Exception in thread "main" java.lang.NoSuchMethodError: java/awt/image/BufferedImage.getRastor()Ljava/awt/image/WritableRaster; Now, from what I kn...

Why can't I use my Jython class in an imported module?

I have a couple of Jython modules living in the same directory. One of them defines the following class: from java.lang import Runnable class MyTask(Runnable): def __init__(self, params): Runnable.__init__(self) self._params = params def run(self): # do stuff print "Done doing stuff" I can ins...

Is a "master preferences" class a good idea?

I have a class that manages user preferences for a large software project. Any class in the project that may need to set or retrieve a user preference from a persistent store is to call the static methods on this class. This centralized management allows the preferences to be completely wiped programmatically - which would be impossibl...

What are the OSS .net/java projects which has utilised most SOLID Principles in a rightway?

I would like to see/learn how solid principles are utilized in a right way in a real projects. Or there is none? ...

What rules are used for type inference when using Generics

Does anyone know where I can find a discussion on how type inference works when using Generics in Java. ...