java

finding class name conflicts and jar file version discrepancies and redundancies

Most of the time , the developers will be having hard time to debug the issues related to class loading issues for the reasons like 1 . the class path might have two different jars with the same class having different version. 2. class loading issues. Although we could use jar utility to delve into each and every jar , it is going ...

How to handle a static final field initializer that throws checked exception

Hello all, I am facing a use case where I would like to declare a static finalfield with an initializer statement that is declared to throw a checked exception. Typically, it'd look like this: public static final ObjectName OBJECT_NAME = new ObjectName("foo:type=bar"); The issue I have here is that the `ObjectName` constructor may thr...

Warning: validation was turned on but an org.xml.sax.ErrorHandler...

Any idea why this error is happening and how to fix it? I'm getting this error when trying to parse/load a config file: Error Warning: validation was turned on but an org.xml.sax.ErrorHandler was not set, which is probably not what is desired. Parser will use a default ErrorHandler to print the first 10 errors. Please call the 'setEr...

How to query google through desktop java app?

I 'm trying to write a simple java desktop app to query google and get the results.I 've read so many articles in the past few days.I know that I have to do it through the gwt (google web toolkit) ,the api that google offers to programmatically query its search engine.My problem is that the gwt seems to be usefull only to construct ajax ...

convert asc to java

how can i convert my main.asc's code( server side of video conference with flash media server) to application.java (server side of video conference with Red5) ? ...

path problem in jsp

In my application, I am using jsp include as :- <jsp:include page="/jsp/selectRoom/listRoom.jsp" /> That's working fine, but when I include the same jsp in my servlet as :- RequestDispatcher rd = getServletContext().getRequestDispatcher("//jsp//selectRoom//listRoom.jsp") ; rd.include(request, response) ; That's not working. Am I ma...

Is there a mono (.Net) equivalent to the Scanner-class in Java

In Java there is a nice class called Scanner for reading strings and streams of a certain format to data-structures like integers, floats,... Is there any equivalent in Mono? In .Net there is a binary-reader, but it reads the data as binaries. I want a class that read the data by parsing it from a string. EDIT: reaction on the current a...

Storing data when an jsp call (no submit) an action.

Hi at all... I need some help about a little question. I make a pagination by db for my survey application. I divided my list of questions in six page. Before the pagination, when the user submit the vote, the action check a hashmap and return error on key where the resp is not present. Now, with the pagination, I call the pages by ...

BufferedReader problem in Java

Hello, me and my buddy are working on a program for our Object Oriented Programming course at college. We are trying to write text into a file as a database for information. The problem is that when we try to read the corresponding lines with BufferedReader we can't seem to figure out how to read the correct lines. The only functions ava...

PKI verification across Java and Python

I am trying to implement a PKI verification scheme, where a message string is signed with a private key on server, the signature is stored on the client along with the message string. The client then verifies the signature using a public key. The restrictions of my environment are, the server is Google App Engine and the client is a Jav...

Using alternative of Library loaded by Java Bootstrap class loader

I need use the both jars local_policy.jar and US_export_policy.jar with unlimited key size strength. The JRE comes bundled with versions of the jars, with limited key size strength. But I can't replace the original jars in the $JAVA_HOME/lib/security (insufficient rights), so i need them to override (at runtime?) somehow. Any ideas? ...

How to parse time stamps with Unicode characters in Java or Perl?

I'm trying to make my code as generic as possible. I'm trying to parse install time of a product installation. I will have two files in the product, one that has time stamp I need to parse and other file tells the language of the installation. This is how I'm parsing the timestamp public class ts { public static void main (String[]...

Is it possible to use JSF to build clean CSS layouts without using tables?

I want to look at using JSF but I'm put off by what appears to be the liberal use of html tables for layout by many components. How do you go about using JSF to develop css-based layouts? [edit] I seem to be labouring under a misaprehension here, but every JSF tutorial I've seen ends up producing table-based html layouts. I've also lo...

Picking in java 2d

I am using java2d to draw a simple graph at the moment I have implemented picking by calling contains(MousePoint) for each object/shape, this works but scales linearly. Is there a more efficient method for picking in java2d? ...

Using hibernate tools to reverse engineer pojos from Postgres

Hi - I am trying to reverse engineer pojos (using hibernate tools plugin v3.2.4x in eclipse 3.4.2) from a database that I have created in Postgres but my tables are being ignored. It works if I specify 'public' as the value for the 'hibernate.default_schema' property in my hibernate.cfg.xml file but if I try to specify a different schema...

How to overcome neatly the fact that static attributes can't be overrriden?

I want to implement an aplication where I have various Objects that can be interpreted as XML Strings. First I thought of making an interface which made each object implement two methods: public abstract Element toXML(); public abstract void fromXML(Element element); The first one turns the object information into the an DOM Element a...

Construct Network Topology

Hi All, We are trying to develop a Topology Map of available devices in a network. I have the details of the system, like IP, Device Name. All I need to do is to populate them on the graph and show it graphically, the problem is that we need to do it in JSP. Is there another way, like show using Flex, where I would pass IP/Device Nam...

Writing Triggers or implementing actions by programming?

I am a newbie. I am writing an application in Java which connects to Oracle 9i database. I need to enforce some rules in my application like: Chair of Committee A must be added/deleted as a Member in Committee B. There are around 10 such rules that need to be enforced. I am in a dilemma whether to enforce these rules by writing trigger...

Java and Silverlight together forever

I want to display a silverlight web page inside my java desktop application. Does anyone know of a plugin or browser control that I can use to do this? ...

How to match the word exactly with regex?

Hi, I might be asking this question incorrectly but what I would like to do is the following: Given a large String which could be many 100s of lines long match and replace a word exactly and make sure it does not replace and match any part of any other String. For example : Strings to Find = Mac Apple Microsoft Matt Damon I.B.M. Hur...