java

Debugging Messaging Exception

We have a batch program that incorporates JavaMail 1.2 that sends emails. In our development environment, we haven't got the chance to encounter the above mentioned exception. But in the client's environment, they had experienced this a lot of times with the following error trace: javax.mail.MessagingException: 550 Requested action not ...

Container a=new getContentPane()

What is mean 'Container a=new getContentPane()" ? ...

Widgets in JAVA

What is Widget in java? ...

RMI: What change needs a recompiled impl class

I have two application which communicates by using RMI objects. I do have an interface, an implementation class and the generated stub class. I recognized, that some changes in the impl class take me to create a new stub class. My question is, what changes i can make without re-compiling the stub again? As far as What i know: I can ...

How to inline few java lines inside an Ant script?

How to inline (here-document) few java code lines into a Ant script ? Please an example ? ...

enabling debugging for web browser (as external tool ) in eclipse

I am developing APPLET and I have eclipse set up to launch web browser (firefox). I have now External tool that starts up FIREFOX and my applet. I have a separate Remote debug option configured ok. However, debugger needs to be launched separately. How can I combine these two to same hotkey? Now I press ctrl+f11 to run external tool(f...

How to create resource ref for a JBoss MBean

A have application deployed to JBoss. It contains Inside it I register Quartz MBean wich trigger scheduled task. How can I create reouce ref for that MBean to access resource by java:/comp/env/* and not java:/* in my task code. ...

Can there be more than one AWT event queue?

I've got a thread dump of an applet running on JVM 1.6.0_12 in Opera 9.64 Build 10487 - and it shows three event queues! As far as I know the Java Swing event handling is single threaded - did this change in any recent update? My problem is, that multiple event queues will tend to cause deadlocks since I've got some more locks than only...

Does anyone know how to convert a datefield to a string in java j2me?

I need to get the data from a datefield calender and be able to display it in a string and later store it in a recordstore. I tried the toString() method but i had an error once run. StartDate = new DateField("Start Date ", DateField.DATE); StartDate.setDate(Calendar.getInstance().getTime()); I now have this code ...

How to make a color transparent in a BufferedImage and save as PNG

I have been searching the web for this, but I havent found any decent help. I have a BufferedImage, which I have read in with ImageIO. Now I would like to make a certain color in that image to transparent, and save the image as PNG. I know I cannot just "paint" the transparent color for obvious reasons, so I am guessing I need some kin...

Find unused classes in a Java Eclipse project

I have a large Eclipse project in which there exist several classes which, although they ceased to be used anywhere, were never marked @Deprecated. How can I easily find all of these? ...

How can I perform a threadsafe point-in-time snapshot of a key-value map in Java?

In my application, I have a key-value map that serves as a central repository for storing data that is used to return to a defined state after a crash or restart (checkpointing). The application is multithreaded and several threads may put key-value pairs into that map. One thread is responsible for regularly creating a checkpoint, i. e...

compiling java from the command line

I have a package called studentServer which contains two sub packages student and common. The common folder has references to the student package and i would like to be able to compile this. How could i do this? javac student\*.java - compiles the student package but when i try something similar with the common package errors are thro...

RabbitMQ C# client not talking to Apache Qpid Java Broker

I've installed the M4 release of the Apache Qpid Java broker on a Windows box, and started it using the out-of-the-box configuration (via the qpid-server.bat script). I'm now trying to publish a message to a queue using the RabbitMQ C# client library (version 1.5.3, compiled for .NET 3.0); my code is: public void PublishMessage(string ...

Imported Java applet project into netbeans won't work, Netbeans refuses to identify or even find main class even when manually set

Hi everyone, I'm trying to set the main class in netbeans to be the main class it was in the last environment it was in, however the program insists it can't find the main class itself and when I set it as the name of the main class in project properties it says the class does not exist (even though it does). When I right click on the ...

Deep clone utility recomendation

Is there any utility for deep cloning for java collections: Arrays Lists Maps NOTE: prefer some solution without usage of serialization, but with use of Object.clone() method. I can be sure that my custom object will implement clone() method and will use only java-standard classes that are cloneable... ...

Any way to share session state between different applications in tomcat?

We want to split a working application in two different wars in order to be able to update one app without affecting the other. Each webapp will have different ui, different users and different deploy schedule. The easiest path seams to be sharing the same session, so if app A set session.setAttribute("foo", "bar") app B will be able t...

Why does ant think I have an old version of Java?

I am trying to build Groovy from source (on RH Linux) using ant, but for some reason it thinks that my Java version is 1.4, and not 1.6, and thus it won't compile. The offending lines seem to be <condition property="groovy.build.vm5"> <not> <contains string="${ant.java.version}" substring="1.4"/> </not> </condition> i...

OpenMicroBlogging-library for Java?

Can anyone recommend to me a library to communicate via OpenMicroBlogging? It should be in Java and Open Source. Update: As there seem to be no OMB-library for Java, I have created a request on cofundos. So if you are able to create such a library, go catch the money. ...

In an Eclipse RCP editor, what is the best way to handle missing mandatory fields ?

On an Eclipse RCP application, I'm building an Editor in which some fields are mandatory. If the user saves the editor with theses fields not filled, what is the best way/practice to handle this ? (my first guess is to show an error dialog if theses fields are empty in doSave() method but I'm not sure it's the "eclipse" way to deal wit...