Archive for December, 2013

Java update 7u51 Web Start Security update workaround

The new Java update on January, the 14th won´t make your applets work unless you get them signed from a certificate Authority. However you might just make a workaround if you can make your users import your own certificate.

The steps to follow are:

1. In every jar edit the MANIFEST.MF file. The “Permissions” attribute must be provided. To grant all the permissions add the following line:
Permissions: all-permissions

2. Edit the java web start file (*.jnlp). Although the latest documentation says it´s no longer necessary to include the security tag, to make it work with your self-signed jars the element must be included. For example, if you set “all-permissions” in the manifest, in the jnlp file you must insert:


The “Codebase” attribute in the jnlp file must match the hosting server name including the port number (ex. http://localhost:8080/”).
Once you have packed all the jars, you can sign them with your own keystore. The steps to execute are the following:

3.Make a new keystore (ex. “demoStore”) with an alias (ex. “demoAlias”):
keytool -keystore demoStore -genkey -alias demoAlias
It will ask to insert some information (name, firm, country, etc.)

4.Make a self-signed certificate (valid for 3650 days):
keytool -selfcert -alias demoAlias -genkey -keystore demoStore -validity 3650

5.Sign all the jars like:
jarsigner -keystore demoStore FileName.jar demoAlias
After running the command, the console will display ”The signer certificate will expire in six months”.

6.Export the keystore certificate:
keytool -export –keystore demoStore -alias demoAlias -file demoStore.csr

7.Import the self-signed certificate.
In MS Windows you need import certificate. Open the Java Control Panel , navigate to Security -> Manage Certificates, select Certificate Type: Signer CA  and import the new *.csr (ex. demoStore.csr) certificate.
Now you can run you Java Web Start application without warnings. You should see the following dialog :

Arquillian testing with Maven in Eclipse: Deployment scenario issue (Glassfish embedded example)

To run a test with Arquillian using Maven you might consider embedded, local or remote containers. You can set them all in your pom.xml file and specify deployment profiles like the following:





The container must be configured in the arquillian.xml file. A simple one might look like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<arquillian xmlns:xsi=""
   <!--  this is only needed if you want to override AS7  -->
   <!--  <defaultProtocol type="Servlet 3.0"/> -->
   <container qualifier="arquillian-glassfish-embedded">
   		<property name="bindHttpPort">9090</property>
   <container qualifier="tomcat">
   		<property name="user">tomcat</property>
   		<property name="pass">tomcat</property>

Setting the container in the pom.xml and the arquillian.xml files is not enough to run the test in Eclipse.
You would get the following error:

org.jboss.arquillian.container.test.impl.client.deployment.ValidationException: DeploymentScenario contains a target (_DEFAULT_) not matching any defined Container in the registry.
Please include at least 1 Deployable Container on your Classpath.
          at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.throwNoContainerFound(
          at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.throwTargetNotFoundValidationException(
          at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.validate(
          at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(
          at java.lang.reflect.Method.invoke(
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(
          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(

To make the test run you need to set the active maven profiles in Eclipse. Simply right click on the project and select Properties>Maven and add “arquillian-glassfish-embedded” in the Active maven profiles textbox.