java

Ant Script Example

I would like to make a very simple ant script that does 1 thing, which is to bulid a jar file. But when I try to use a very simple example, it fails due to dependancies on jars that my source depends on. So, How you you specify jars that there are jars that need to be in the class path when building an Ant target. <project name="proje...

Does using compilers from different JDK versions on the same source file break (de-)serialization?

I have a distributed application. The client and the servers share some common libraries. The client has to be compiled with a JDK 5 compiler or with target=1.5 (run anywhere also on PowerPC and CoreDuo Macs). But I would like to use SE 6 features in the server-only code. Is it ok to compile the common libraries twice - once with a JDK ...

Performance problem on Java DB Derby Blobs & Delete

Hi, I’ve been experiencing a performance problem with deleting blobs in derby, and was wondering if anyone could offer any advice. This is primarily with 10.4.2.0 under windows and solaris, although I’ve also tested with the new 10.5.1.1 release candidate (as it has many lob changes), but this makes no significant difference. The prob...

Is there a way to display a HSSFWorkbook Object in a JSP page?

Is there a way to Display a HSSFWorkbook Object in a JSP page without having an output file in the server side. In the code below I am providing the template file and the beans required for net.sf.jxls.transformer.XLSTransformer.transformXLS(InputStream is, Map beanParams) to return me a HSSFWorkbook object. I now need a way to use this ...

jpa inheritance and a OneToMany Relation

Hi all, I have written the following code: @Entity @Table(name="person") @Inheritance(strategy=InheritanceType.JOINED) public class Person { private Long id; protected String email; private String firstName; private String lastName; @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long getId() {...

What's FIX protocol

Any idea of FIX protocol ? Thanks ...

Why does my Java class fail to compile when compiled from inside the package directory?

I have made a directory called "middle" and inside it another directory called "tier" and inside the "tier" directory are OrderManager.java which is an interface and OrderManagerImpl.java having its implementation. The problem is when I try to compile OrderManagerImpl.java from outside the package middle.tier it compiles but when I do t...

Oracle Forms/Applications in Internet Explorer 8 using JInitator

Has anyone been able to get Oracle Forms running JInitator to loan in Internet Explorer 8 yet? I have tried removing all add-ons, various version of Java, add the domain to the trusted sites using wildcards, and using compatibility mode to no avail. I am looking to get our Oracle guys to kick there Internet Explorer 6 habit. This is r...

How Do You Install the source for the java libraries in Eclipse?

How do you install the source for the java libraries in Eclipse? ...

How do I turn a conditional chain into faster less ugly code?

I have 9 different grammars. One of these will be loaded depending on what the first line of txt is on the file it is parsing. I was thinking about deriving the lexer/parser spawning into sep. classes and then instantiating them as soon as I get a match -- not sure whether that would slow me down or not though. I guess some benchmarkin...

Java - How to find out whether a File name is valid?

In my Java application I am renaming files to a file name provided in a String parameter. There is a method boolean OKtoRename(String oldName, String newName) which basically checks whether the newName isn't already taken by some other file, as I wouldn't want to bury existing ones. It now occurred to me that perhaps the newName Stri...

How do I override Currency symbols in Java?

I'm trying to print prices in Turkish Liras (ISO 4217 currency code TRY) with Java. When I do Currency curr = Currency.getInstance("TRY"); Locale trLocale = new Locale("tr", "TR"); System.out.println(curr.getSymbol(trLocale)); the output is: "YTL". However, the currency symbol for Turkish Lira has recently changed from "YTL" to "TL"...

Tomcat 6: Importing utility class from WEB-INF/classes

Hi All, (I've removed client name because of NDA) Java/JSP newbie here. I have a JSP site and I have a 'Functions' class in WEB-INF/src/client/project/Functions.java In the Functions.java, the package is com.client.util This is compiled and ends up as WEB-INF/classes/client/project/Functions.class WEB-INF/classes/client/project/Func...

Eclipse Plugin - Get outer method?

Hi, I have been developing a plugin for Eclipse. The plugin has a couple of views that need to update when the caret moves in the active editor to reflect the outer method. Currently, I am getting an ASTNode that represents the outer method using the ASTParser class on the whole source for the file and then traversing its hierarchy unt...

Printing headers and footers in color?

I am trying to create colored headers and footers when printing a JTable. Specifically, I am looking at getPrintable() in javax.swing.JTable, but MessageFormat does not give me the option to specify the color of the header or footer. How can I do it? clarification I am interested in setting the header/footers while printing. For exam...

What hash algorithm does .net utilise? What about java?

Regarding the HashTable (and subsequent derivatives of such) does anyone know what hashing algorithm .net and Java utilise? Are List and Dictionary both direct descandents of Hashtable? ...

Why and how is serialization used in Java web applications?

I've been working on a Java web application where the framework insists that everything is Serializable. I assume that this isn't specific to the framework but to web applications in Java in general and my question is: what is the framework / server / whatever doing that is serializing things? Does it have to do it? Note: I don't know...

How to disable pretty-printing(white space/newline) in XStream?

This is how I create XStream instance for XML: XStream xstream = new XStream(); This is for JSON: private final XStream xstream = new XStream(new JsonHierarchicalStreamDriver() { public HierarchicalStreamWriter createWriter(Writer writer) { return new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE); } })...

Real time code coverage viewer tool for inspecting live Java apps?

I've been looking for a code coverage viewer aimed at inspecting live Java applications, mostly webapps running inside an application container like Tomcat. Sure, there are a number of decent tools for getting automatic reports of unit test coverage, but my aim is more like learning in real time what an unfamiliar Java app does e.g. on a...

What is the best approach to schedule Callables which may time out in a polling situation?

I have several Callables which query for some JMX Beans, so each one may time out. I want to poll for values lets say every second. The most naive approach would be to start each in a separate thread, but I want to minimize the number of threads. Which options do I have to do it in a better way? ...