java

Releasing a java application on different OS

Hi I have a java application that I want to release as an exe or dwg etc so that users on different platforms can double click it and get it to start running. But for my code to work really well I need it to work as a windows service and whatever the equivalent of this in other OS are. Using Java web start is not a solution because...

How to handle multiple languages in java?

I am writing a program use jsp and java, how can i use properties files to support multiple languages ? and by the way, there are always something like \u4345, What's this ? How do they come ? ...

Accessing a remote MBean server

I am running a client/server application using JBoss. How can I connect to the server JVM's MBeanServer? I want to use the MemoryMX MBean to track the memory consumption. I can connect to the JBoss MBeanServer using JNDI lookup but the java.lang.MemoryMX MBean is not registered with the JBoss MBeanServer. EDIT: The requirement is for ...

Exceptions and web services

Im using the standard java ws implementation shipped with e.g. java6 (javax.jws.*). I have the following: import javax.jws.*; @WebService(name="Widget") public interface Widget { @WebMethod public @WebResult String getGadget(@WebParam(name = "id") long id) throw MyOwnException; } Is this possible? Do I have to annotate ...

Set Java environment variable problem on ubuntu

I got a message "No Java virtual machine could be found from your PATH environment variable. You must install a VM prior to running this program." Does anyone know how set up it correctly? Thanks! ...

Component based composition

Hello, Can anyone assist me to implement a component-based project? I have designed two components i.e calculator and engine (source codes below) which need to be inside any of the swing components (either JList , JTree, or any). Then there should be an ability of dragging any of the two components (calculator or engine) unto the editor ...

Schedule-based execution in a J2EE Web Application

I'd like advice regarding scheduling execution within a Java web application. (currently running on Tomcat, but I'd like to avoid anything tomcat-specific). I think the following defines the aspect of my problem I'm interested in. Consider an application that polls a set of files for updates periodically. I'd like to provide a user int...

How to retrieve/compute an X509 certificate's thumbprint in Java?

I have a java client that is calling a web service operation which takes a certificate "thumbprint" as a parameter. I believe the thumbprint is some kind of SHA1 hash, in hexadecimal string format, of the cert's public key, but I'm not sure. The .NET framework seems to include a simple way to get this value (X509Certificate2.Thumbprint ...

How to get a Struts form bean in an Action class using AJAX

Hi guys, I'm currently developing with Struts 1 a web application. I've recently started to use AJAX technology and I'm stuck with something. I call an action method (via AJAX) to validate my form but no values are changed in the form bean when it gets to the action method. I suppose this is because calling the action via AJAX doesn't ...

Passing a String by Reference in Java?

I am used to doing the following in C: void main() { String zText = ""; fillString(zText); printf(zText); } void fillString(String zText) { zText += "foo"; } output: foo However, in Java, this does not seem to work; I assume because the String is copied instead of passed by referenced. I thought Strings were O...

Reading and writing on webcam stream

Is it possible to use java to write into a webcam stream? I've tried JMF and got it to capture the image but couldn't find a possibility to write into the stream. ...

Initiating a commandline tool from GUI

I want to fire a commandline exe with the parameters entered in GUI. The Process class can be used to fork my required commandline process from the java application. And I used the getInputStream() method of Process object to get the result and got it displayed in the GUI. private void confirmActionPerformed(java.awt.event.ActionEvent ...

Sync JMenu ButtonGroups with JToolbar ButtonGroups

Hi, Imagine I'm making a simple Word Processor with Java Swing. I've got a set of Actions written to perform text justification. On the MenuBar I've got a menu: View Left Justify Center Jusitfy Right Justify This consists of JRadioButtonMenuItems and a ButtonGroup to ensure only one item is selected at any one time. Also, ima...

How do i check if inputstream contains no data?

Hi, I am using the javax.comm package to perform read and write operations on the SerialPort. I have created an object of type InputStream as InputStream in; My question is .... Irrespective of data availibility on the SerialPort, in.available() always returns a zero due to which I am not able to decide whether bytes are available o...

How to use a java package on a asp.net site

My Bank has givien me the option of using a COM component, Java (JAR) package or a plain C dll to interface with thier payment gateway. Given that I'd rather chew my arm off before installing their COM component on my server (Which I've spent the last 5 years eradicating of asp and com components) I'd like to host/convert the Java packa...

Can jmockit be used as a independant development tool for incremental developement

I am trying to use Jmockit API for indepentant use with out any framework for our incremental development. But I am not able to initialize the proxy for mocked class So I have two question. Can we use JMockIt for independantly of any test framework. If yes how to use it Thanks, Ashish ...

How do i check if inputstream contains no data?

Hi, I am using the javax.comm package to perform read and write operations on the SerialPort. I have created an object of type InputStream as InputStream in; My question is .... Irrespective of data availibility on the SerialPort, in.available() always returns a zero due to which I am not able to decide whether bytes are available o...

Liferay - Serve static content

Hi, How can I serve some static content in liferay? I have a directory structure with htmls, css, etc and I would like to serve it with an address like http://localhost:8080/myStaticContent/index.html and so on. I don't want to use a front-end http server like apache. ...

Two struts2 webapps fail to start together

I have problems getting two different struts2 webapps to start together in tomcat. But each of the webapps start correctly when placed independently inside webapps folder of tomcat. I get the following in catalina.out logs- SEVERE: Error filterStart Aug 13, 2009 3:17:45 PM org.apache.catalina.core.StandardContext start SEVERE: Context ...

PHP's gzuncompress function in Java?

I'm compressing a string using PHP's gzcompress() function: http://us2.php.net/manual/en/function.gzcompress.php I'd like to take the output from the PHP compression function and decompress the string in Java. Can anyone send me down the right path? Thanks so much! ...