java

Java - Scheduling a daily task

I'm looking for an effective way to execute a method everyday at 3PM regardless of when the application was initially run or how long it has been running. This must be done entirely from the application with no OS intervention (ex. Windows Task Scheduler) I have been experimenting with java.util.Timer in varies configurations but I hav...

MyEclipse+Hibernate does not order property sets by ID?

I use Hibernate with Java. I have two tables which are associated with foreign keys. Table: country Fields: ID, Name POJO class name : Country POJO class properties: id, name, cities Table: city Fields: ID, Name, CountryID POJO class name : Country Then I use "hibernate reverse engineering" of MyEclipse. It creates DAOs, abstracts ...

Feed java with characters/string/bytestream from a c# class

I want to have a java app running, using a function/method (with as little delay as possible I hope!) in a c# class... The c# function takes a string from the java app, and returns a string.. Had to do it in c# to make a OleDbConnection in windows.. Thanks :) ...

java anonymous classes and synchronization and "this"

hi all, I am dealing with a race condition, I believe, in my JAVA GUI. I have some methods that create an "anonymous method" inside an anonymous class like this: synchronized foo() { someMethod(new TimerTask() { public synchronized run() { //stuff } }; } QUESTION: is that...

how do i add a custom startup class to tomcat?

I need to tweak some things inside Tomcat 6.0 before any web applications or listeners are started. What's the standard method for doing this? I can't do this from a web application or servlet init() since it is too late by the time it is loaded. ...

"static checking" for SQL calls in Java/Eclipse?

Writing Java in Eclipse, I've recently been bitten by a few trivial bugs where my SQL syntax has been off (e.g., not properly quoting a constant). Are there any tools I could use to help myself catch these as I write them? ...

Where do I find a test http server for simulating timeouts and error codes

I am thinking that this would be an Apache server with some custom pages, or possibly a java application. Used for browser or http client testing, it should give me a variety of 500 errors when a specific page is requested. Give me a page that responds in 5 seconds, 10, 30 or whatever. Give me a page where the first byte does not come...

How can I decode a PKCS#5 encrypted PKCS#8 Private Key in Java

I have a PKCS#5 encrypted PKCS#8 RSA private key stored in a disk file (originally generated by SSLPlus, circa 1997), for example: -----BEGIN ENCRYPTED PRIVATE KEY----- MIICmDAaBgkqhkiG9w0BBQMwDQQIybM2XFqx4EwCAQUEggJ4MKg/NE+L6NJgbOf4 ... 8QnGu4R7lFlweH/VAK8n0L75h3q2g62MKLJqmKLtAILNve4zymnO+LVZ4Js= -----END ENCRYPTED PRIVATE KEY----- F...

Libraries / tutorials for manipulating video in java

I need to do some simple video editing within a Java application, but the frameworks I've found (JMF and FMJ) appear to be quite stale, and thus far I haven't found any evidence that either can actually edit video. The type of operations I need are: cropping, redacting sections, and extracting clips. I've never worked with video in any...

Java vs Javascript Regex problem

Hello, I am having a problem with my regular expression: <a.*href=[\"'](.*?)[\"'].*>(.*?)</a>. It is, as you can probably tell, supposed to take all the links from a string of HTML and return the link text in group 2, and the link target in group 1. But I am having a problem. If I try it in Javascript (using http://www.regextester.com/, ...

What does the servlet <load-on-startup> value of 0 (zero) signify

Hi, I am getting a bit confused here. In our application we are having a few servlets defined. Here is the excerpt from the web.xml for one of the servlets: <servlet> <servlet-name>AxisServlet</servlet-name> <display-name>Apache-Axis Servlet</display-name> <servlet-class>com.cisco.framework.axis2.http.FrameworkServl...

Splitting a String into Smaller Parts based on Parens

Using java I am trying to develop a method using recursion to analyze a String of the form: (PART0(PART1(PART2)(PART3))) I want the method to split apart the relevant Strings. I want this method to give me the ability to perform some logic on each part of the String without the parentheses being involved in this order: PART2 PART3 P...

How To Read Context Parameters From a Restlet?

When using Restlets, how can I read configuration parameters passed in through web.xml? With servlets, context-param can be used. How do I read context parameters from within a Restlet? ...

How to keep updated libraries in MAVEN?

On the development shop I work for, we have an internal MAVEN repository, to keep our libraries (proprietary & open-souce). A common problem that we face is that, sometimes, the open-source libraries in our local MAVEN repository gets obsolete. Is there an automatic way to keep all the open-source libraries I use in my MAVEN repository a...

inter jvm communication

I am looking for an inter-process communication library in Java. I am looking to send small messages between JVMs and would like to do it using shared memory if I could. ...

Putting bat file inside a jar file

I have a java class that uses a bat file to execute commands. However I developed it in Eclipse IDE. It works fine in there. But as I export it in a jar file, it fails to find the bat file that was included.(gives me an IOException) The file structure in eclipse is as follows : Project1 ---->src ------>com.myproj -------->BatFileRead....

HEAD GET decoded requests

Hi, We run a service on jboss. Sometimes we receive requests that have params completely decoded. Below is the apache access log entries. Look at the redirect_url params in following urls. For such urls to work the params need to be encoded. Urls that we post are encoded. Either somebody is explictly decoding stuff before it reaches us,...

Recommendations for java captcha libraries

I'm looking for a replacement for JCaptcha, which doesn't seem to be maintained any more, and isn't very good to begin with. The replacement has to integrate nicely with JavaEE webapps. As I can see it, there are three options: JCaptcha - No longer maintained, crude API SimpleCaptcha - much nicer API, nicer captchas, but seems to be J...

sorting objects in java

i want to do nested sorting . I have a course object which has a set of applications .Applications have attributes like time and priority. Now i want to sort them according to the priority first and within priority i want to sort them by time. ...

Is it worth switching to IBM Jikes (java) compiler

I just read in some Liferay documentation that IBM's Jikes (java) compiler is faster and more descriptive with compile time errors. I would like to know whether the community agrees, and whether the switch makes any noticeable improvement in your productivity. ...