Java

Java Programmatic Browser

At times you need to visit web sites, login, navigate through pages, select portions of HTML, click on links, check for the existence of a form, submit the form,.... and do all these things programmatically. So you need a programmable web browser that can execute and have a cup of tea while it will do the job.

Java programmatic browser

Sample X.509 certificate collection with public/private keys (for Java)

If you want to test your Java application which requires digital certificates, here's a collection of such certificates with associated public/private keys in .jks format (the Java standard format - Java Key Store).

For example, you can use these to test Web services or enable SSL support of a Java server (and clients - if you want).

Java client connecting to an https resource via a proxy server that needs authentication

This doesn't look to be something trivial that you can simply do by passing the URL, proxy server host, port, user name and password to an already available class and getting the connection established.

Validating an XML document against a given XML Schema in Java

Many XML validators exist. Here's how you may implement an XML validator in Java. At times you may need to take a programmatic approach like this.

Best way to use JPA in web-tier

JPA (Java Persistence Architecture) greatly simplifies the persistence implementation of Java applications. In web-tier, the following forces/constraints exist:

Spring JPA web applications (JTA transactions, JBoss 5)

With Spring 3.x, you can develop JPA applications very easily. Here you find guidelines in creating such an application with the following features:

JAX-WS Web services in JBoss 5 do not work (JDK 1.6, Eclipse IDE)?

Environment: JDK 1.6, JBoss 5.1, Eclipse 3.5 (Galileo)

I came across the following JBoss error when a JAX-WS Web service was accessed:

11:15:18,008 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
    at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:441)
    at org.jboss.ws.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:87)

Configuring a JBoss + Spring + JPA (Hibernate) + JTA web application

Updated version available: If you are looking for how JPA can be used in JBoss 5 and Spring 3.x versions, look at "Spring JPA web applications (JTA transactions, JBoss 5)". What you find below is a workaround to use JTA transactions in JBoss 4.x versions.

Here's how one might go about deploying a Spring application in JBoss (4.something) that uses JPA with Hibernate as the provider for persistence and JTA for transaction demarcation.

jkscertgen : Generate a full set of CA, service and client keys and certificates in Java keystores

You are into Java security. You want to generate some X.509 certificates to test your application (or use in your production environment). Here's a simple X.509 certificate generator script that makes your life very simple. Download and execute, it will do all the following and you get the keys and signed certificates.