java

Strategies/techniques for crash reporting in Java

I'm developing a new Java desktop application and would like to include a crash reporting facility - you know the kind of thing - program crashes, box pops up asking user to click okay to send it, etc. I'm comfortable with how the error will be sent back to our servers - probably via a simple web service. What I'm more unsure about is ...

EDI to XML Conversion

Hi, I'm searching for a free EDI to XML converter in Java. I need to convert EDI 940 to xml and convert XML to EDI 945. The catch is that this will be used for a commercial project, I've found some projects on sourceforge but they are under GNU General Public License which if I read it correctly means I would need to pay to use it for ...

Read data from Java and show it in Flex

Hello folks, well i am a little confused about the use of Flex and java, this is my problem: My java application must read two .zip files from an online server. These classes will load and parse the data in a Thread and perform certain actions depending on such info. The problem occurs when my flex application calls the java method that ...

spring security, tomcat, getRemoteUser method

hi! i've got two applications in same tomcat. one of those applications uses spring security for authentication. i would like method getRemoteUser to return valid user name in second application when logged into first one. is there easy way to achieve this? can u please point me out to simplest possible solution which will do that? th...

JVM crash while memcpy during class load

My JVM crashed the and the hs_err file showed that it crashed while attempting to load a class. Specifically while trying to memcpy ([libc.so.6+0x6aa2c] memcpy+0x1c). I looked at the .class file and was able to determine what class was being loaded. But can any one tell me what could cause this or how i could determine more about t...

Struts2 dynamic parameter name in redirect-action

I'm successfully using a redirect-action for one of my struts2 mapping files as follows: <action name="setAsCurrentCart" class="com.fmp.MyAction"> <result name="success" type="redirect-action"> <param name="actionName">myOtherAction</param> <param name="foo">${foo}</param> </result> <interceptor-ref name="defaultComponentS...

In the Eclipse Debugger (for Java), is there a way to inspect arbitrary values?

I'm wondering if there is a way to look at the values of non-declared variables as they get passed into a function, after that function has been executed. For example, if I am debugging and the line foo.setBar(baz.getBar()); has already been passed (but is still within scope), how can I see the value of what got passed in to setBar()?...

Why is conhost.exe being launched?

I'm launching a Java process ("java.exe") from .Net. using Process.Start(). In addition to the Java process, another process called conhost.exe is launched somehow. I am redirecting the output from the Java process to the .Net process. Why is conhost.exe even launched? How do I track it from .Net? I want to track this specific instance...

What is the name of the design pattern used in AWT/Swing that handles events?

I have heard that there are 2 ways that we can set the PLAF in Swing. What is the real meaning of PLAF, and what are those 2 ways? ...

Inconsistent date parsing using SimpleDateFormat

I'm really scratching my head on this one. I've been using SimpleDateFormats with no troubles for a while, but now, using a SimpleDateFormat to parse dates is (only sometimes) just plain wrong. Specifically: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Date date = sdf.parse("2009-08-19 12:00:00"); System.out.prin...

GAE can't serve my image

I need help fixing the following error when I run my webapp: com.google.appengine.tools.development.LocalResourceFileServlet doGet WARNING: No file found for: /images/banner.jpg I've already setup the config file to include that folder in web-inf: <static-files> <include path="/images/**.jpg" /> </static-files> I am ...

Is there any way to accept only numeric values in a JTextField?

Is there any way to accept only numeric values in a JTextField? Is there any special method for this? ...

ehcache auto-discovery (via multicast) between 2 instances on the same host

Hello I run 2 tomcat instances on the same host. Each instance runs the same web application which tries to communicate some ehcache caches via RMI replication. I use the autodiscovery configuration in ehcache so I don't have to explicitly define which are the hosts and which are the caches I want to replicate. The ehcache instances do ...

How do I get a list of tables from MySQL using Java's DatabaseMetaData?

DatabaseMetaData metadata = con.getMetaData(); metadata.getTables(catalog, schemaPattern, tableNamePattern, types); What fields are required to get a list of tables? ...

Flipping a gui Component in the x-z plane

I would like to know the respective graphics transformations ..in creating a flipping effect of a ui component about the x-z plane. It needs to be done only using 2d since the swing toolkit only supports 2d affine transformations. http://www.verysimple.com/flex/flipcard/ .... is an example of the effect to be achieved . ...

Q about HTMLDocument, HTMLEditorKit, and blank spaces

When I run the following code: import java.io.IOException; import java.io.Reader; import java.io.StringReader; import javax.swing.text.BadLocationException; import javax.swing.text.EditorKit; import javax.swing.text.Element; import javax.swing.text.html.HTMLDocument; import javax.swing.text.html.HTMLEditorKit; . . . St...

Is it possible to return multiple items in one call?

is it possible for the following element to return multiple items in one call ( i.e. two GRects) private GObject getColidingObject(){ if(getElementAt(ball.getX(), ball.getY()) != null){ return getElementAt(ball.getX(), ball.getY()); }else if(getElementAt(ball.getX() + BALL_RADIUS *2, ball.getY()) != null){ return getElementAt(...

Parsing FLV header (duration) of remote file in Java

I'm looking for an example of parsing an FLV header for duration specifically in Java. Given the URL of an FLV file I want to download the header only and parse out the duration. I have the FLV spec but I want an example. Python or PHP would be OK too but Java is preferred. ...

Simulating nested loops

In a beginner's programming book (free licence) there was the following code, dynamically creating nested loops in Java: import java.util.Scanner; public class RecursiveNestedLoops { public static int numberOfLoops; public static int numberOfIterations; public static int[] loops; public static void main(String[] args) { S...

Best place to save program config file on Windows and OS X using Java?

I have a SWT Java app that runs on Windows XP / Vista / 7 and Mac OS X. I'm currently saving a config file to: System.getProperty("user.home") + filename With the changes in security in Windows Vista and Windows 7 this doesn't seem to be the best place to save it anymore. This file saves information such as registration key info and i...