java

Please post some tutorials links on charts4j.

I have to generate charts on my Web application, and after getting the answer of Is there any free library which can be used to generate Graphs in J2EE environment?, i chose Chart4j for this purpose. The reason behind picking this api over JFreeChart is, its ease of use, and also i am tempted with chartle, which is using Chart4j. But the...

How do I encrypt/decrypt a string of text using 3DES in java?

How do I encrypt/decrypt a string of text using 3DES in java? ...

how to read mp3 file tags

Hi all, I want to have a program (might be an idea for simple program), to read metadata from a Mp3 file. My program should also able to edit these meta data. what can i do? I got to search out for some open source code. But they have code; but not simplified idea for my job they are going to do. When i read further i found there ar...

Help With TreeCache (Jboss Cache) configuration for 2 entity manager

Hi guys, I'm in a big trouble at moment. I need to configure a cluster cache for my seam application, but i'm having problem beacuse i have 2 entity managers, one for oracle and other one for mysql. If i remove mysql persistence-unit and entity manager, everything works fine, but when it is active the following error is displayed: org...

video recording from web browser

Hi there, i have asked to create a module that will record video messages form the web browser it self. what technologies, i should look at. and how should i start. please give me some pointers. A sample code will be appreciated. :) ...

Spring (Java) - register vs list

I have the following: List<Color> acceptableColors; Using Spring, would it be best to instantiate this list this way: <bean> <list> <value ref="orange" /> <value ref="yellow" /> .... </list> </bean> Or, is there a way to do a register scheme, where we use Spring to perform the following Java code: ColorRegister...

Java: How to paste (append) an image on clipboard to a word document.

Hi, Is there a way in Java, to copy the contents of the clipboard (an image in my case) to the end of a word document? I want to have a program that will - * Take a filename (word file) as a parameter * Whenever this program is run - it will open the word file and paste the contents of the clipboard to the end of the document. I am d...

Fetching join using @JoinTable with SQLQuery

I have a mapped entity with a property "latestHistory", which is mapped through a join table, like: class Record { @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, optional = true) @JoinTable(name = "latest_history_join_view", joinColumns = { @JoinColumn(name = "record_id")...

LRU LinkedHashMap that limits size based on available memory

I want to create a LinkedHashMap which will limit its size based on available memory (ie. when freeMemory + (maxMemory - allocatedMemory) gets below a certain threshold). This will be used as a form of cache, probably using "least recently used" as a caching strategy. My concern though is that allocatedMemory also includes (I assume) u...

Issue with encoding UTF-8 when FTPing files

I am able to have my application upload files via FTP using the FTPClient Java library. (I happen to be uploading to an Oracle XML DB repository.) Everything uploads fine unless the xml file has curly quotes in it. In which case I get the error: LPX-00200: could not convert from encoding UTF-8 to UCS2 I can upload what I believe to b...

Android - Including custom component causes it to be hidden behind main view

Hi folks, The app I'm working on has 4 tabs, 3 of which share many features, including a navigation bar a the bottom with Back, Edit, and Map buttons. There is exactly the same xml in all 3 layouts, so I'm trying to DRY this out by extracting that xml into a separate component, including it, and then going from there. Previously I had...

Class teardown in junit 3?

We have a lot of integration tests written using JUnit 3, though we're now running them with 4.4. A few of these have a need for a tearDown method that runs after all the tests in the class are complete (to free some common resources). I see that this can be done in junit 4 with @AfterClass (org.junit). However, mixing this into exist...

local host network monitor and httpservlet request

I have two Tomcat servers on my machine that communicate with one another. 1) Can someone recommend on a good (free) network sniffer so I'll be able to monitor the requests/ response that being sent between them? 2) How can I inspect the request in java code? to see what the header and the body consists and their structures? thanks a...

JDBC: What is the correct JDBC URL to connect to a RAC database

Hi, We were connecting to Oracle from our code with a simple (custom) JDBC connector class. This class reads the connection properties from a resource file and tries to make a connection to Oracle (thin connection). However, recently the database have moved to a RAC and now the application is unable to connect to the DB. Here is the ...

Converting a JBOSS WAR folder to an executable JAR

I have an ANT build script that deploys a WAR folder into my JBOSS deploy directory. Can I convert that into an executable WAR/JAR file and run it as well? For example if my folder is called: MYAPP.WAR, can I generate: NEWAPP.WAR where NEWAPP.WAR is an executable file. If i just place it in the Jboss directory and start JBOSS will it pi...

Is it possible to programmatically generate JUnit test cases and suites?

I have to write a very large test suite for a complex set of business rules that are currently captured in several tabular forms (e.g., if parameters X Y Z are such and such, the value should be between V1 and V2). Each rule has a name and its own semantics. My end goal is to have a test suite, organized into sub test suites, with a tes...

Capture coordinates of the click in a web browser window on Windows machine

I am not sure if we need our own custom browser for this. If we do, what is your recommendation for open source browser? We need application that is able to capture location of user clicks on the web page in the browser on Windows machine (cross-platform would be a huge plus). Store the coordinates in the file. Later be able to open b...

Using an input string in a textbox

I am trying to have the user input a number, and then that number is used to populate a text field on a jform. However it keeps giving me errors. If I have the textfield call the str it gives me a numberformatexception, if I have it call the int variable it says it has to be a string... public static String prePaidstr = ""; public st...

Java command line option using @ symbol.

When invoking the 'java' process, I'm almost certain there is a way to have Java expand the contents of a file into a set of additional command-line arguments using the "@" symbol. Something like: java @myfile -cp foo -Dbar=baz com.mydomain.MyApp And then the contents of "myfile" will be used as additional parameters. It doesn't seem...

Long text input from user and PDF generation

I have built a web application that can be seen as an overcomplicated application form. There are bunch of text areas with a given character limit. After the form submission various things happen and one of them is PDF generation. The text is queried from the DB and inserted in the PDF template created in iReports. This works fine but t...