http://wiki4.caucho.com/api.php?action=feedcontributions&user=Cowan&feedformat=atomResin 4.0 Wiki - User contributions [en]2024-03-29T13:27:53ZUser contributionsMediaWiki 1.18.0http://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-07T15:49:31Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that includes all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to your pom.xml. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the included version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<pre><br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.ejb</artifactId><br />
<version>3.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations included with Resin (check /lib directory to match version or upgrade /lib) --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...<br />
</pre></div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:55:52Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that includes all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to your pom.xml. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the included version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<pre><br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations included with Resin (check /lib directory to match version or upgrade /lib) --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...<br />
</pre></div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:55:08Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that includes all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to your pom.xml. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<pre><br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations included with Resin (check /lib directory to match version or upgrade /lib) --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...<br />
</pre></div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:54:16Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that includes all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<pre><br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations included with Resin (check /lib directory to match version or upgrade /lib) --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...<br />
</pre></div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:53:13Z<p>Cowan: /* Resin 4 Maven Dependencies */</p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<pre><br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations included with Resin (check /lib directory to match version or upgrade /lib) --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...<br />
</pre></div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:50:44Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations included with Resin (check /lib directory to match version or upgrade /lib) --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...</div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:43:57Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the JEE6 WebProfile javax APIs are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...</div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:43:35Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
All the javax API are included with Resin in javaee-16.jar located in the lib directory. For basic development (without Maven), it is simplest to add this jar as a dependency to your IDE project, which will provide you with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...</div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:39:14Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
Resin provides it's own implementations of most JavaEE 6 WebProfile libraries. <br />
<br />
It does not provide implementations of javax.validation, javax.persistence, or javax.faces. For these, the reference implementation is included with Resin.<br />
<br />
All the javax API are included with Resin in javaee-16.jar located in the lib directory. For basic development, it is simplest to add this jar as a dependency which will provide your IDE with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
Since Resin provides all these during runtime, the scope should always be set to provided. This will prevent the API jars from being included in your war file which would be unnecessary and could cause issues.<br />
<br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
...</div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:36:45Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
Resin provides it's own implementations of most JavaEE 6 WebProfile libraries. <br />
<br />
It does not provide implementations of javax.validation, javax.persistence, or javax.faces. For these, the reference implementation is included with Resin.<br />
<br />
All the javax API are included with Resin in javaee-16.jar located in the lib directory. For basic development, it is simplest to add this jar as a dependency which will provide your IDE with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html. Then add a dependency on it to your pom.xml.<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/ to your pom.xml<br />
<br />
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual WebProfile API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.ejb</groupId><br />
<artifactId>ejb-api</artifactId><br />
<version>3.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency></div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:34:01Z<p>Cowan: </p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
Resin provides it's own implementations of most JavaEE 6 WebProfile libraries. <br />
<br />
It does not provide implementations of javax.validation, javax.persistence, or javax.faces. For these, the reference implementation is included with Resin.<br />
<br />
All the javax API are included with Resin in javaee-16.jar located in the lib directory. For basic development, it is simplest to add this jar as a dependency which will provide your IDE with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
1. Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html<br />
<br />
2. Add a dependency on the javax.javaee-web-api bundle available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/<br />
<br />
Note: this bundle is convenient since it is a single dependency that include all the EE6 WebProfile APIs, but you can't "mix and match" and you can't exclude API. It also prevents you from upgrading individual APIs. This can can lead to odd and confusing issues between development and runtime since the runtime implementation often depends on a newer API version.<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
3. Add all the individual API dependencies to maven. This is the most flexible but more verbose choice. Also, Caucho works to update included libraries as we release Resin, but the included reference implementations of validations, persistence, and faces may not always be the latest available. In this case you should include the API that matches the implementation version, or download the latest implementation and update the jar in Resin's lib directory.<br />
<br />
<dependencies><br />
<br />
<!-- API's --><br />
<dependency><br />
<groupId>javax.servlet</groupId><br />
<artifactId>javax.servlet-api</artifactId><br />
<version>3.0.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp</groupId><br />
<artifactId>javax.servlet.jsp-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.el</groupId><br />
<artifactId>javax.el-api</artifactId><br />
<version>2.2.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.servlet.jsp.jstl</groupId><br />
<artifactId>jstl-api</artifactId><br />
<version>1.2</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.transaction</groupId><br />
<artifactId>transaction-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.enterprise</groupId><br />
<artifactId>cdi-api</artifactId><br />
<version>1.1</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.annotation</groupId><br />
<artifactId>jsr250-api</artifactId><br />
<version>1.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.validation</groupId><br />
<artifactId>validation-api</artifactId><br />
<version>1.1.0.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>javax.cache</groupId><br />
<artifactId>cache-api</artifactId><br />
<version>0.8</version><br />
<scope>provided</scope><br />
</dependency><br />
<br />
<!-- Reference implementations --><br />
<dependency><br />
<groupId>org.eclipse.persistence</groupId><br />
<artifactId>eclipselink</artifactId><br />
<version>2.5.0</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.hibernate</groupId><br />
<artifactId>hibernate-validator</artifactId><br />
<version>4.3.1.Final</version><br />
<scope>provided</scope><br />
</dependency><br />
<dependency><br />
<groupId>org.glassfish</groupId><br />
<artifactId>javax.faces</artifactId><br />
<version>2.2.2</version><br />
<scope>provided</scope><br />
</dependency></div>Cowanhttp://wiki4.caucho.com/Resin_4_Maven_DependenciesResin 4 Maven Dependencies2014-03-06T17:24:55Z<p>Cowan: Created page with "{{Development}} = Resin 4 Maven Dependencies = Resin provides it's own implementations of most JavaEE 6 WebProfile libraries. It does not provide implementations of javax..."</p>
<hr />
<div>{{Development}}<br />
<br />
= Resin 4 Maven Dependencies =<br />
<br />
Resin provides it's own implementations of most JavaEE 6 WebProfile libraries. <br />
<br />
It does not provide implementations of javax.validation, javax.persistence, or javax.faces. For these the reference implementation is included with Resin.<br />
<br />
All the javax API are included with Resin in javaee-16.jar located in the lib directory. For basic development, it is simplest to add this jar as a dependency which will provide your IDE with all the required APIs to code against.<br />
<br />
For Maven development there are a few options. <br />
<br />
# Deploy javaee-16.jar to your local Maven repository, using deploy-file as described here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html<br />
<br />
# Add a dependency on the javax.javaee-web-api available from java.net here: http://download.java.net/maven/2/javax/javaee-web-api/6.0/<br />
<br />
<dependencies><br />
<dependency><br />
<groupId>javax</groupId><br />
<artifactId>javaee-web-api</artifactId><br />
<version>6.0</version><br />
<scope>provided</scope><br />
</dependency><br />
...<br />
<br />
<repositories><br />
<repository><br />
<id>java.net.m2</id><br />
<name>java.net m2 repo</name><br />
<url>http://download.java.net/maven/2</url><br />
</repository><br />
....<br />
<br />
#</div>Cowanhttp://wiki4.caucho.com/Config:_PeriodFormatConfig: PeriodFormat2013-11-08T16:38:39Z<p>Cowan: Created page with "{{Config}} = Period = Time intervals are used all over Resin configuration. {| class="gallery" |- | ms | milliseconds |- | s | seconds |- | m | minutes |- | h | hours |- ..."</p>
<hr />
<div>{{Config}}<br />
<br />
= Period =<br />
<br />
Time intervals are used all over Resin configuration. <br />
<br />
{| class="gallery"<br />
|-<br />
| ms<br />
| milliseconds<br />
|-<br />
| s<br />
| seconds<br />
|-<br />
| m<br />
| minutes<br />
|-<br />
| h<br />
| hours<br />
|-<br />
| D<br />
| days<br />
|-<br />
| W<br />
| weeks<br />
|-<br />
| M<br />
| months<br />
|-<br />
| Y<br />
| years<br />
|}</div>Cowanhttp://wiki4.caucho.com/Config:_ClusterCacheConfig: ClusterCache2013-10-18T03:34:21Z<p>Cowan: </p>
<hr />
<div>{{Config}} {{Caching}}<br />
<br />
= ClusterCache =<br />
<br />
A cache which stores consistent copies on the cluster segment.<br />
<br />
Using the cache is like using java.util.Map. To add a new entry, call <code>cache.put(key, value)</code>. To get the entry, call <code>cache.get(key)</code>.<br />
<br />
The cache configuration affects the lifetime, local caching timeouts and consistency.<br />
<br />
ClusterCache is a javax.cache.Cache (JSR 107: JCache)<br />
<br />
== Example resin-web.xml ==<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee"><br />
<br />
<resin:ClusterCache ee:Named="myCache"><br />
<name>myCache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
...<br />
<br />
</web-app><br />
<br />
ee:Named makes the cache available for injection by name<br />
<br />
== Example code using CDI Injection ==<br />
<br />
import javax.inject.*;<br />
import javax.cache.*;<br />
<br />
public class MyService {<br />
@Inject <br />
@Named("myCache")<br />
private Cache<String,String> _cache;<br />
<br />
...<br />
}<br />
<br />
== <resin:ClusterCache> Attributes ==<br />
<br />
{| class="gallery"<br />
! Name<br />
! Description<br />
! Type<br />
! Default<br />
|-<br />
| style="white-space:nowrap" | name<br />
| A name is mandatory and must be unique among open caches<br />
| String<br />
| required<br />
|-<br />
| style="white-space:nowrap" | manager-name<br />
| <br />
| String<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | cache-loader<br />
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader<br />
| Null<br />
|- <br />
| style="white-space:nowrap" | read-through<br />
| Use CacheLoader<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | read-through-expire-timeout<br />
| <br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | cache-writer<br />
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)<br />
| javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | write-through<br />
| Use CacheWriter<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | cache-reader-writer<br />
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)<br />
| An object that implements both javax.cache.CacheLoader and javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | serializer<br />
| Assign the serializer used on values. (This setting should not be changed after a cache is created)<br />
| com.caucho.distcache.CacheSerializer<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout<br />
| The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed.<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | idle-timeout<br />
| Deprecated - use accessed-expire-timeout<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout-window<br />
| Idle check window, used to minimize traffic when updating access times<br />
| Period<br />
| style="white-space:nowrap" | accessed-expire-timeout / 4<br />
|-<br />
| style="white-space:nowrap" | modified-expire-timeout<br />
| The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | lease-expire-timeout<br />
| The lease timeout is the time a server can use the local version if it owns it, before a timeout<br />
| Period<br />
| 5m<br />
|-<br />
| style="white-space:nowrap" | local-expire-timeout<br />
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms.<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | local-read-timeout<br />
| Deprecated - use local-expire-timeout<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | scope-model<br />
| <br />
| TRANSIENT or LOCAL or CLUSTER<br />
| CLUSTER<br />
|-<br />
| style="white-space:nowrap" | backing<br />
| Same effect as cache-reader-writer<br />
| com.caucho.server.distcache.CacheBacking<br />
| Null<br />
|}<br />
<br />
=== Period Format ===<br />
<br />
{| class="gallery"<br />
|-<br />
| ms<br />
| milliseconds<br />
|-<br />
| s<br />
| seconds<br />
|-<br />
| m<br />
| minutes<br />
|-<br />
| h<br />
| hours<br />
|-<br />
| D<br />
| days<br />
|-<br />
| W<br />
| weeks<br />
|-<br />
| M<br />
| months<br />
|-<br />
| Y<br />
| years<br />
|}</div>Cowanhttp://wiki4.caucho.com/Config:_ClusterCacheConfig: ClusterCache2013-10-18T03:29:39Z<p>Cowan: </p>
<hr />
<div>{{Config}} {{Caching}}<br />
<br />
= ClusterCache =<br />
<br />
A cache which stores consistent copies on the cluster segment.<br />
<br />
Using the cache is like using java.util.Map. To add a new entry, call <code>cache.put(key, value)</code>. To get the entry, call <code>cache.get(key)</code>.<br />
<br />
The cache configuration affects the lifetime, local caching timeouts and consistency.<br />
<br />
ClusterCache is a javax.cache.Cache (JSR 107: JCache)<br />
<br />
== Example resin-web.xml ==<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee"><br />
<br />
<resin:ClusterCache ee:Named="myCache"><br />
<name>myCache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
...<br />
<br />
</web-app><br />
<br />
ee:Named makes the cache available for injection by name<br />
<br />
== Example code using CDI Injection ==<br />
<br />
import javax.inject.*;<br />
import javax.cache.*;<br />
<br />
public class MyService {<br />
@Inject <br />
@Named("myCache")<br />
private Cache<String,String> _cache;<br />
<br />
...<br />
}<br />
<br />
== <resin:ClusterCache> Attributes ==<br />
<br />
{| class="gallery"<br />
! Name<br />
! Description<br />
! Type<br />
! Default<br />
|-<br />
| style="white-space:nowrap" | name<br />
| A name is mandatory and must be unique among open caches<br />
| String<br />
| required<br />
|-<br />
| style="white-space:nowrap" | manager-name<br />
| <br />
| String<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | cache-loader<br />
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader<br />
| Null<br />
|- <br />
| style="white-space:nowrap" | read-through<br />
| Use CacheLoader<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | read-through-expire-timeout<br />
| <br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | cache-writer<br />
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)<br />
| javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | write-through<br />
| Use CacheWriter<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | cache-reader-writer<br />
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader, javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | serializer<br />
| Assign the serializer used on values. (This setting should not be changed after a cache is created)<br />
| com.caucho.distcache.CacheSerializer<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout<br />
| The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed.<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | idle-timeout<br />
| Deprecated - use accessed-expire-timeout<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout-window<br />
| Idle check window, used to minimize traffic when updating access times<br />
| Period<br />
| style="white-space:nowrap" | accessed-expire-timeout / 4<br />
|-<br />
| style="white-space:nowrap" | modified-expire-timeout<br />
| The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | lease-expire-timeout<br />
| The lease timeout is the time a server can use the local version if it owns it, before a timeout<br />
| Period<br />
| 5m<br />
|-<br />
| style="white-space:nowrap" | local-expire-timeout<br />
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms.<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | local-read-timeout<br />
| Deprecated - use local-expire-timeout<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | scope-model<br />
| <br />
| TRANSIENT or LOCAL or CLUSTER<br />
| CLUSTER<br />
|-<br />
| style="white-space:nowrap" | backing<br />
| Same effect as cache-reader-writer<br />
| com.caucho.server.distcache.CacheBacking<br />
| Null<br />
|}<br />
<br />
=== Period Format ===<br />
<br />
{| class="gallery"<br />
|-<br />
| ms<br />
| milliseconds<br />
|-<br />
| s<br />
| seconds<br />
|-<br />
| m<br />
| minutes<br />
|-<br />
| h<br />
| hours<br />
|-<br />
| D<br />
| days<br />
|-<br />
| W<br />
| weeks<br />
|-<br />
| M<br />
| months<br />
|-<br />
| Y<br />
| years<br />
|}</div>Cowanhttp://wiki4.caucho.com/Config:_ClusterCacheConfig: ClusterCache2013-10-18T03:27:50Z<p>Cowan: </p>
<hr />
<div>{{Config}} {{Caching}}<br />
<br />
= ClusterCache =<br />
<br />
A cache which stores consistent copies on the cluster segment.<br />
<br />
Using the cache is like using java.util.Map. To add a new entry, call <code>cache.put(key, value)</code>. To get the entry, call <code>cache.get(key)</code>.<br />
<br />
The cache configuration affects the lifetime, local caching timeouts and consistency.<br />
<br />
ClusterCache is a javax.cache.Cache (JSR 107: JCache)<br />
<br />
== Example resin-web.xml ==<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee"><br />
<br />
<resin:ClusterCache ee:Named="myCache"><br />
<name>myCache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
...<br />
<br />
</web-app><br />
<br />
ee:Named makes the cache available for injection by name<br />
<br />
== Example code using CDI Injection ==<br />
<br />
import javax.inject.*;<br />
import javax.cache.*;<br />
<br />
public class MyService {<br />
@Inject <br />
@Named("myCache")<br />
private Cache<String,String> _cache;<br />
<br />
...<br />
}<br />
<br />
== <resin:ClusterCache> Attributes ==<br />
<br />
{| class="gallery"<br />
! Name<br />
! Description<br />
! Type<br />
! Default<br />
|-<br />
| style="white-space:nowrap" | name<br />
| A name is mandatory and must be unique among open caches<br />
| String<br />
| required<br />
|-<br />
| style="white-space:nowrap" | manager-name<br />
| <br />
| String<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | cache-loader<br />
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader<br />
| Null<br />
|- <br />
| style="white-space:nowrap" | read-through<br />
| Use CacheLoader<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | read-through-expire-timeout<br />
| <br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | cache-writer<br />
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)<br />
| javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | write-through<br />
| Use CacheWriter<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | cache-reader-writer<br />
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader, javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | serializer<br />
| Assign the serializer used on values. (This setting should not be changed after a cache is created)<br />
| com.caucho.distcache.CacheSerializer<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout<br />
| The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed.<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | idle-timeout<br />
| Deprecated - use accessed-expire-timeout<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout-window<br />
| Idle check window, used to minimize traffic when updating access times<br />
| Period<br />
| style="white-space:nowrap" | accessed-expire-timeout / 4<br />
|-<br />
| style="white-space:nowrap" | modified-expire-timeout<br />
| The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | lease-expire-timeout<br />
| The lease timeout is the time a server can use the local version if it owns it, before a timeout<br />
| Period<br />
| 5m<br />
|-<br />
| style="white-space:nowrap" | local-expire-timeout<br />
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms.<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | local-read-timeout<br />
| Deprecated - use local-expire-timeout<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | scope-model<br />
| <br />
| TRANSIENT|LOCAL|CLUSTER<br />
| CLUSTER<br />
|-<br />
| style="white-space:nowrap" | backing<br />
| Same effect as cache-reader-writer<br />
| com.caucho.server.distcache.CacheBacking<br />
| Null<br />
|}<br />
<br />
=== Period Format ===<br />
<br />
{| class="gallery"<br />
|-<br />
| ms<br />
| milliseconds<br />
|-<br />
| s<br />
| seconds<br />
|-<br />
| m<br />
| minutes<br />
|-<br />
| h<br />
| hours<br />
|-<br />
| D<br />
| days<br />
|-<br />
| W<br />
| weeks<br />
|-<br />
| M<br />
| months<br />
|-<br />
| Y<br />
| years<br />
|}</div>Cowanhttp://wiki4.caucho.com/Config:_ClusterCacheConfig: ClusterCache2013-10-18T03:27:23Z<p>Cowan: </p>
<hr />
<div>{{Config}} {{Caching}}<br />
<br />
= ClusterCache =<br />
<br />
A cache which stores consistent copies on the cluster segment.<br />
<br />
Using the cache is like using java.util.Map. To add a new entry, call <code>cache.put(key, value)</code>. To get the entry, call <code>cache.get(key)</code>.<br />
<br />
The cache configuration affects the lifetime, local caching timeouts and consistency.<br />
<br />
ClusterCache is a javax.cache.Cache (JSR 107: JCache)<br />
<br />
== Example resin-web.xml ==<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee"><br />
<br />
<resin:ClusterCache ee:Named="myCache"><br />
<name>myCache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
...<br />
<br />
</web-app><br />
<br />
ee:Named makes the cache available for injection by name<br />
<br />
== Example code using CDI Injection ==<br />
<br />
import javax.inject.*;<br />
import javax.cache.*;<br />
<br />
public class MyService {<br />
@Inject <br />
@Named("myCache")<br />
private Cache<String,String> _cache;<br />
<br />
...<br />
}<br />
<br />
== <resin:ClusterCache> Attributes ==<br />
<br />
{| class="gallery"<br />
! Name<br />
! Description<br />
! Type<br />
! Default<br />
|-<br />
| style="white-space:nowrap" | name<br />
| A name is mandatory and must be unique among open caches<br />
| String<br />
| required<br />
|-<br />
| style="white-space:nowrap" | manager-name<br />
| <br />
| String<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | cache-loader<br />
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader<br />
| Null<br />
|- <br />
| style="white-space:nowrap" | read-through<br />
| Use CacheLoader<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | read-through-expire-timeout<br />
| <br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | cache-writer<br />
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)<br />
| javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | write-through<br />
| Use CacheWriter<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | cache-reader-writer<br />
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader, javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | serializer<br />
| Assign the serializer used on values. (This setting should not be changed after a cache is created)<br />
| com.caucho.distcache.CacheSerializer<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout<br />
| The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed.<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | idle-timeout<br />
| Deprecated - use accessed-expire-timeout<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout-window<br />
| Idle check window, used to minimize traffic when updating access times<br />
| Period<br />
| style="white-space:nowrap" | accessed-expire-timeout / 4<br />
|-<br />
| style="white-space:nowrap" | modified-expire-timeout<br />
| The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | lease-expire-timeout<br />
| The lease timeout is the time a server can use the local version if it owns it, before a timeout<br />
| Period<br />
| 5m<br />
|-<br />
| style="white-space:nowrap" | local-expire-timeout<br />
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms.<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | local-read-timeout<br />
| Deprecated - use local-expire-timeout<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | scope-model<br />
| <br />
| TRANSIENT|LOCAL|CLUSTER<br />
| CLUSTER<br />
|-<br />
| style="white-space:nowrap" | backing<br />
| Same effect as cache-reader-writer<br />
| com.caucho.server.distcache.CacheBacking<br />
| Null<br />
|}<br />
<br />
=== Period Format ===<br />
<br />
{| class="gallery"<br />
|-<br />
| ms<br />
| milliseconds<br />
|-<br />
| s<br />
| seconds<br />
|-<br />
| m<br />
| minutes<br />
|-<br />
| h<br />
| hours<br />
|-<br />
| D<br />
| days<br />
|-<br />
| W<br />
| weeks<br />
|-<br />
| M<br />
| months<br />
|-<br />
| Y<br />
| years<br />
|}</div>Cowanhttp://wiki4.caucho.com/Config:_ClusterCacheConfig: ClusterCache2013-10-18T03:26:43Z<p>Cowan: </p>
<hr />
<div>{{Config}} {{Caching}}<br />
<br />
= ClusterCache =<br />
<br />
A cache which stores consistent copies on the cluster segment.<br />
<br />
Using the cache is like using java.util.Map. To add a new entry, call <code>cache.put(key, value)</code>. To get the entry, call <code>cache.get(key)</code>.<br />
<br />
The cache configuration affects the lifetime, local caching timeouts and consistency.<br />
<br />
ClusterCache is a javax.cache.Cache (JSR 107: JCache)<br />
<br />
== Example resin-web.xml ==<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee"><br />
<br />
<resin:ClusterCache ee:Named="myCache"><br />
<name>myCache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
</web-app><br />
<br />
ee:Named makes the cache available for injection by name<br />
<br />
== Example code using CDI Injection ==<br />
<br />
import javax.inject.*;<br />
import javax.cache.*;<br />
<br />
public class MyService {<br />
@Inject <br />
@Named("myCache")<br />
private Cache<String,String> _cache;<br />
<br />
...<br />
}<br />
<br />
== <resin:ClusterCache> Attributes ==<br />
<br />
{| class="gallery"<br />
! Name<br />
! Description<br />
! Type<br />
! Default<br />
|-<br />
| style="white-space:nowrap" | name<br />
| A name is mandatory and must be unique among open caches<br />
| String<br />
| required<br />
|-<br />
| style="white-space:nowrap" | manager-name<br />
| <br />
| String<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | cache-loader<br />
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader<br />
| Null<br />
|- <br />
| style="white-space:nowrap" | read-through<br />
| Use CacheLoader<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | read-through-expire-timeout<br />
| <br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | cache-writer<br />
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)<br />
| javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | write-through<br />
| Use CacheWriter<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | cache-reader-writer<br />
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader, javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | serializer<br />
| Assign the serializer used on values. (This setting should not be changed after a cache is created)<br />
| com.caucho.distcache.CacheSerializer<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout<br />
| The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed.<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | idle-timeout<br />
| Deprecated - use accessed-expire-timeout<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout-window<br />
| Idle check window, used to minimize traffic when updating access times<br />
| Period<br />
| style="white-space:nowrap" | accessed-expire-timeout / 4<br />
|-<br />
| style="white-space:nowrap" | modified-expire-timeout<br />
| The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | lease-expire-timeout<br />
| The lease timeout is the time a server can use the local version if it owns it, before a timeout<br />
| Period<br />
| 5m<br />
|-<br />
| style="white-space:nowrap" | local-expire-timeout<br />
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms.<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | local-read-timeout<br />
| Deprecated - use local-expire-timeout<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | scope-model<br />
| <br />
| TRANSIENT|LOCAL|CLUSTER<br />
| CLUSTER<br />
|-<br />
| style="white-space:nowrap" | backing<br />
| Same effect as cache-reader-writer<br />
| com.caucho.server.distcache.CacheBacking<br />
| Null<br />
|}<br />
<br />
=== Period Format ===<br />
<br />
{| class="gallery"<br />
|-<br />
| ms<br />
| milliseconds<br />
|-<br />
| s<br />
| seconds<br />
|-<br />
| m<br />
| minutes<br />
|-<br />
| h<br />
| hours<br />
|-<br />
| D<br />
| days<br />
|-<br />
| W<br />
| weeks<br />
|-<br />
| M<br />
| months<br />
|-<br />
| Y<br />
| years<br />
|}</div>Cowanhttp://wiki4.caucho.com/Config:_ClusterCacheConfig: ClusterCache2013-10-18T03:21:46Z<p>Cowan: </p>
<hr />
<div>{{Config}} {{Caching}}<br />
<br />
= ClusterCache =<br />
<br />
A cache which stores consistent copies on the cluster segment.<br />
<br />
Using the cache is like using java.util.Map. To add a new entry, call <code>cache.put(key, value)</code>. To get the entry, call <code>cache.get(key)</code>.<br />
<br />
The cache configuration affects the lifetime, local caching timeouts and consistency.<br />
<br />
ClusterCache is a javax.cache.Cache (JSR 107: JCache)<br />
<br />
== Example resin-web.xml ==<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee"><br />
<br />
<resin:ClusterCache ee:Named="myCache"><br />
<name>myCache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
</web-app><br />
<br />
== <resin:ClusterCache> Attributes ==<br />
<br />
{| class="gallery"<br />
! Name<br />
! Description<br />
! Type<br />
! Default<br />
|-<br />
| style="white-space:nowrap" | name<br />
| A name is mandatory and must be unique among open caches<br />
| String<br />
| required<br />
|-<br />
| style="white-space:nowrap" | manager-name<br />
| <br />
| String<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | cache-loader<br />
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader<br />
| Null<br />
|- <br />
| style="white-space:nowrap" | read-through<br />
| Use CacheLoader<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | read-through-expire-timeout<br />
| <br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | cache-writer<br />
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)<br />
| javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | write-through<br />
| Use CacheWriter<br />
| Boolean<br />
| False<br />
|-<br />
| style="white-space:nowrap" | cache-reader-writer<br />
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader, javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | serializer<br />
| Assign the serializer used on values. (This setting should not be changed after a cache is created)<br />
| com.caucho.distcache.CacheSerializer<br />
| Null<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout<br />
| The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed.<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | idle-timeout<br />
| Deprecated - use accessed-expire-timeout<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | accessed-expire-timeout-window<br />
| Idle check window, used to minimize traffic when updating access times<br />
| Period<br />
| style="white-space:nowrap" | accessed-expire-timeout / 4<br />
|-<br />
| style="white-space:nowrap" | modified-expire-timeout<br />
| The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get<br />
| Period<br />
| Infinity<br />
|-<br />
| style="white-space:nowrap" | lease-expire-timeout<br />
| The lease timeout is the time a server can use the local version if it owns it, before a timeout<br />
| Period<br />
| 5m<br />
|-<br />
| style="white-space:nowrap" | local-expire-timeout<br />
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms.<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | local-read-timeout<br />
| Deprecated - use local-expire-timeout<br />
| Period<br />
| 250ms<br />
|-<br />
| style="white-space:nowrap" | scope-model<br />
| <br />
| TRANSIENT|LOCAL|CLUSTER<br />
| CLUSTER<br />
|-<br />
| style="white-space:nowrap" | backing<br />
| Same effect as cache-reader-writer<br />
| com.caucho.server.distcache.CacheBacking<br />
| Null<br />
|}<br />
<br />
=== Period Format ===<br />
<br />
{| class="gallery"<br />
|-<br />
| ms<br />
| milliseconds<br />
|-<br />
| s<br />
| seconds<br />
|-<br />
| m<br />
| minutes<br />
|-<br />
| h<br />
| hours<br />
|-<br />
| D<br />
| days<br />
|-<br />
| W<br />
| weeks<br />
|-<br />
| M<br />
| months<br />
|-<br />
| Y<br />
| years<br />
|}</div>Cowanhttp://wiki4.caucho.com/Config:_ClusterCacheConfig: ClusterCache2013-10-18T03:07:44Z<p>Cowan: Created page with "{{Config}} {{Caching}} = ClusterCache = A cache which stores consistent copies on the cluster segment. Using the cache is like using java.util.Map. To add a new entry, cal..."</p>
<hr />
<div>{{Config}} {{Caching}}<br />
<br />
= ClusterCache =<br />
<br />
A cache which stores consistent copies on the cluster segment.<br />
<br />
Using the cache is like using java.util.Map. To add a new entry, call <code>cache.put(key, value)</code>. To get the entry, call <code>cache.get(key)</code>.<br />
<br />
The cache configuration affects the lifetime, local caching timeouts and consistency.<br />
<br />
ClusterCache is a javax.cache.Cache (JSR 107: JCache)<br />
<br />
== Example resin-web.xml ==<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee"><br />
<br />
<resin:ClusterCache ee:Named="myCache"><br />
<name>myCache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
</web-app><br />
<br />
== <resin:ClusterCache> Attributes ==<br />
<br />
{|<br />
! Name<br />
! Description<br />
! Type<br />
! Default<br />
|-<br />
| name<br />
| A name is mandatory and must be unique among open caches<br />
| String<br />
| required<br />
|-<br />
| manager-name<br />
| <br />
| String<br />
| Null<br />
|-<br />
| cache-loader<br />
| CacheLoader that the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader<br />
| Null<br />
|- <br />
| read-through<br />
| Use CacheLoader<br />
| Boolean<br />
| False<br />
|-<br />
| read-through-expire-timeout<br />
| <br />
| Period<br />
| Infinity<br />
|-<br />
| cache-writer<br />
| CacheWrite that the Cache can then use to save cache misses from a reference store (database)<br />
| javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| write-through<br />
| Use CacheWriter<br />
| Boolean<br />
| False<br />
|-<br />
| cache-reader-writer<br />
| Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database)<br />
| javax.cache.CacheLoader, javax.cache.CacheWriter<br />
| Null<br />
|-<br />
| serializer<br />
| Assign the serializer used on values. (This setting should not be changed after a cache is created)<br />
| com.caucho.distcache.CacheSerializer<br />
| Null<br />
|-<br />
| accessed-expire-timeout<br />
| The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed.<br />
| Period<br />
| Infinity<br />
|-<br />
| idle-timeout<br />
| Deprecated - use accessed-expire-timeout<br />
| Period<br />
| Infinity<br />
| -<br />
| accessed-expire-timeout-window<br />
| Idle check window, used to minimize traffic when updating access times<br />
| Period<br />
| accessed-expire-timeout / 4<br />
|-<br />
| modified-expire-timeout<br />
| The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get<br />
| Period<br />
| Infinity<br />
|-<br />
| lease-expire-timeout<br />
| The lease timeout is the time a server can use the local version if it owns it, before a timeout<br />
| Period<br />
| 5m<br />
|-<br />
| local-expire-timeout<br />
| The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms.<br />
| Period<br />
| 250ms<br />
|-<br />
| local-read-timeout<br />
| Deprecated - use local-expire-timeout<br />
| Period<br />
| 250ms<br />
|-<br />
| scope-model<br />
| <br />
| TRANSIENT|LOCAL|CLUSTER<br />
| CLUSTER<br />
|-<br />
| backing<br />
| Same effect as cache-reader-writer<br />
| com.caucho.server.distcache.CacheBacking<br />
| Null</div>Cowanhttp://wiki4.caucho.com/Introduction:_Java_CacheIntroduction: Java Cache2013-10-18T02:17:52Z<p>Cowan: </p>
<hr />
<div>{{Caching}}<br />
<br />
Faster application performance is possible with Java caching by saving the results of long calculations and reducing database load. The Java caching API is being standardized with jcache. In combination with Java Dependency Injection (CDI), you can use caching in a completely standard fashion in the Resin Application Server. You'll typically want<br />
to look at caching when your application starts slowing down, or your database or other expensive resource starts getting overloaded. Caching is <br />
useful when you want to:<br />
<br />
* Improve latency<br />
* Reduce database load<br />
* Reduce CPU use<br />
<br />
= Cache Performance Benefits =<br />
[[Image:ideal-cache.png|right]]<br />
Since reducing database load is a typical cache benefit, it's useful to create a micro-benchmark to see how a cache can help. This is just a simple<br />
test with mysql running on the same server and a trivial query. In other words, it's not trying to exaggerate the value of the cache, because almost any<br />
real cache use will have a longer "doLongCalculation" than this simple example, and therefore the cache will benefit even more.<br />
<br />
The micro-benchmark has a simple jdbc query in the "doLongCalculation" method<br />
<br />
"SELECT value FROM test WHERE id=?"<br />
<br />
and then to get useful data, the call to "doStuff" is repeated 300k times and compared with the direct call to "doLongCalculation" 300k times.<br />
<br />
Although the change is realistic (the 100x is a measured result with Resin Cache), this is also an ideal situation, where the item is always in cache. In other words it's an actual cache with a 0% miss ratio. <br />
<br />
<table border='1'><br />
<tr><br />
<th>Type</th><br />
<th>Time</th><br />
<th>requests per millisecond</th><br />
<th>Mysql CPU</th><br />
</tr><br />
<tr><br />
<th>JDBC</th><br />
<td>30s</td><br />
<td>10.0 req/ms</td><br />
<td>35%</td><br />
</tr><br />
<tr><br />
<th>Cache</th><br />
<td>0.3s</td><br />
<td>1095 req/ms</td><br />
<td>0%</td><br />
</tr><br />
</table><br />
<br />
Even this simple test shows how caches can win. In this simple benchmark, the performance is significantly faster and saves the database load.<br />
<br />
* 100x faster<br />
* Remove Mysql load<br />
<br />
To get more realistic numbers, you'll need to benchmark the difference on a full application. Micro-benchmarks like this are useful to explain concepts,<br />
but real benchmarks require testing against your own application, in combination with profiling. For example, Resin's simple profiling capabilities<br />
in the /resin-admin or with the pdf-report can get you quick and simple data in your application performance.<br />
<br style="clear:both" /><br />
= Improving Cache Performance =<br />
== Cache Performance Equation ==<br />
<br />
t = p_miss * t_miss + (1 - p_miss) * t_hit<br />
<br />
where <br />
<b>t</b> is the total time<br />
<b>p_miss</b> is the miss rate<br />
<b>t_miss</b> is the time taken for a miss (e.g. database time)<br />
<b>t_hit</b> is the time taken for a hit (cache implementation overhead)<br />
<br />
== 20% miss, 100ms miss time, 1ms hit time ==<br />
<br />
[[File:Cache-20-miss-changes.png|right]]<br />
<br />
If your cache might have a fairly-high 20% miss rate, it might already improve your performance by 5x. Even a terrible miss ratio of 50% can improve<br />
performance by a factor of 2x. And this might be good enough for you, because the 80/20 rule always applies. If improving that database performance<br />
by a factor of 5x is good enough, then you can move on to improving a different performance problem.<br />
<br />
But suppose you do need better performance than the 5x improvement. What changes will help? After all, there's no sense spending time trying to<br />
improve something that doesn't matter. We can take the basic cache performance equation and try some experiments:<br />
<br />
* improve the cache implementation (by asking Caucho to speed up Resin Cache)<br />
* improve the miss ratio (typically be increasing the cache size, but possibly refactoring)<br />
* improve the miss time (by speeding up the database code, optimizing queries, etc.)<br />
<br />
For each experiment, we'll see what happens if we can improve by a factor of 2: improving the miss ratio from 20% to 10%, <br />
speeding Resin Cache from 1ms to 0.5ms,<br />
and improving the database time from 100ms to 50ms.<br />
<br />
<table border="1"><br />
<tr><br />
<th>Change</th><br />
<th>Performance</th><br />
</tr><br />
<tr><br />
<th>no change</th><br />
<td>20.8ms</td><br />
</tr><br />
<tr><br />
<th>0.5ms hit time</th><br />
<td>20.4ms</td><br />
</tr><br />
<tr><br />
<th>10% miss rate</th><br />
<td>10.9ms</td><br />
<tr><br />
<tr><br />
<th>50ms miss time</th><br />
<td>10.8ms</td><br />
</tr><br />
<tr><br />
<th>disable cache</th><br />
<td>100ms</td><br />
</tr><br />
</table><br />
<br />
<b>Speeding the cache implementation: doesn't help much.</b> Even if the Caucho engineers sped up the Resin Cache by 50% in this scenario,<br />
your performance wouldn't improve by much, because the scenario is still dominated by the database miss time and the miss rate. See the next scenario (with a great 1% miss ratio) <br />
for a case where the cache performance matters more.<br />
<br />
<b>Improving the miss ratio from 20% to 10%: a big help, 2x speed up.</b> Every extra improvement in the miss ratio helps this scenario. This might mean increasing the cache memory or disk size,<br />
or extending the expire times.<br />
<br />
<b>Improving the database miss time from 100ms to 50ms: a big help, again 2x</b>. Even when your caching, improving the miss time, the database time or RPC service time, will help your performance<br />
when you have a reasonably high miss ratio like 20%. So caching helps, but you still want to write good code behind the cache.<br />
<br />
<br style="clear:both" /><br />
== 1% miss, 100ms miss time, 1ms hit time ==<br />
<br />
[[File:Cache-1-miss-changes.png|right]]<br />
<br />
<table border="1"><br />
<tr><br />
<th>Change</th><br />
<th>Performance</th><br />
</tr><br />
<tr><br />
<th>no change</th><br />
<td>1.99ms</td><br />
</tr><br />
<tr><br />
<th>0.5ms hit time</th><br />
<td>1.5ms</td><br />
</tr><br />
<tr><br />
<th>0.05% miss rate</th><br />
<td>1.5ms</td><br />
<tr><br />
<tr><br />
<th>50ms miss time</th><br />
<td>1.49ms</td><br />
</tr><br />
<tr><br />
<th>disable cache</th><br />
<td>100ms</td><br />
</tr><br />
</table><br />
<br style="clear:both" /><br />
== 20% miss, 2ms miss time, 1ms hit time ==<br />
<br />
[[File:Cache-1-miss-changes.png|right]]<br />
<br />
<table border="1"><br />
<tr><br />
<th>Change</th><br />
<th>Performance</th><br />
</tr><br />
<tr><br />
<th>baseline</th><br />
<td>1.2ms</td><br />
</tr><br />
<tr><br />
<th>0.5ms hit time</th><br />
<td>0.8ms</td><br />
</tr><br />
<tr><br />
<th>10% miss rate</th><br />
<td>1.1ms</td><br />
<tr><br />
<tr><br />
<th>1ms miss time</th><br />
<td>1ms</td><br />
</tr><br />
<tr><br />
<th>disable cache</th><br />
<td>2ms</td><br />
</tr><br />
</table><br />
<br style="clear:both" /><br />
= Cache Performance: Improving the Miss Ratio =<br />
<br />
As the previous experiments showed, improving the miss ratio is often the best way to improve your cache performance, because<br />
the more requests hit the cache, the more requests can be served quickly. There are a few general ways of improving the miss ratio, including:<br />
<br />
* increase the cache size so more items are in the cache<br />
* increase the expire time so items are valid more often<br />
* update the cache with new values instead of invalidating<br />
<br />
== Fitting in the Working Set: Cache Size ==<br />
<br />
<br />
[[File:Cache-hit-graph.png|right]]<br />
<br />
Increasing the cache size will often improve cache performance by improving the miss ratio, but once your working set is in the cache,<br />
further cache size increases will only give you minimal improvement. Some reasons that increasing the cache size might not improve performance:<br />
<br />
* the working set is already in the cache<br />
* the items are expiring before they're reused<br />
* the items are changing before they're reused<br />
<br />
The working set are the items that are most often used. The distribution of the working set varies greatly between applications. Some applications have a <br />
small working set: everyone looks at the same top 10 items in a catalog. Some applications has a large or flat working set: each social networking page is <br />
specific to a large number of users. <br />
<br />
When the cache is smaller than the working set, increasing the cache size helps performance considerably. If you only fit 5 of your 10 catalog items in the cache,<br />
increasing the cache size to 10 might improve performance almost 50%. But if your 10 items are already in the cache, even doubling the cache size might only<br />
give you a small gain.<br />
<br />
A large working set can fit into a cache if the cache is very large. For example, Resin's cache will save cache data to disk letting you store 100G of data or more. With that size,<br />
you cache becomes more like a persistent store than a cache, and for some applications, that's exactly what's needed.<br />
<br />
= The Resin ClusterCache implementation =<br />
<br />
Since Resin's ClusterCache is a persistent cache, the entries you save will be stored to disk and recovered. This means you can store lots of data in the cache without worrying about running out of memory. (LocalCache is also a persistent cache.) If the memory becomes full, Resin will use the cache entries that are on disk. For performance, commonly-used items will remain in memory.</div>Cowanhttp://wiki4.caucho.com/Using_c3p0_database_poolUsing c3p0 database pool2013-09-05T13:31:10Z<p>Cowan: </p>
<hr />
<div>[[Category:Resin:_3rd_Party_Integration]]<br />
[[Image:Share-48.png|link=Category:Resin:_3rd_Party_Integration]]<br />
<br />
= Using a c3p0 datasource in Resin, bound into JNDI =<br />
<br />
This configuration can go in resin.xml as a child of <cluster>, <host>, or <web-app>, or in resin-web.xml. Where you put it depends on how globally you want the pool to be shared between webapps.<br />
<br />
You may need to add the c3p0 jar to /var/resin/lib, the main Resin shared lib directory, since the pool will be created as a shared resource upon startup.<br />
<br />
In the top XML element, define the c3p0 namespace by adding:<br />
xmlns:c3p0="urn:java:com.mchange.v2.c3p0" <br />
<br />
Then create the pool:<br />
<br />
<c3p0:ComboPooledDataSource resin:Jndi="java:comp/env/jdbc/mysql"><br />
<driverClass>com.mysql.jdbc.Driver</driverClass><br />
<jdbcUrl>jdbc:mysql://address:3306/schema</jdbcUrl><br />
<user>user</user><br />
<password>password</password><br />
<minPoolSize>3</minPoolSize><br />
<maxPoolSize>5</maxPoolSize><br />
</c3p0:ComboPooledDataSource><br />
<br />
You can then reference the pool by the JNDI name "java:comp/env/jdbc/mysql". For eample in JPA persistence.xml:<br />
<br />
<jta-data-source>java:comp/env/jdbc/mysql</jta-data-source></div>Cowanhttp://wiki4.caucho.com/Using_c3p0_database_poolUsing c3p0 database pool2013-09-05T13:28:37Z<p>Cowan: Created page with "Category:Resin:_3rd_Party_Integration link=Category:Resin:_3rd_Party_Integration = Using a c3p0 datasource in Resin, bound into JNDI = This config..."</p>
<hr />
<div>[[Category:Resin:_3rd_Party_Integration]]<br />
[[Image:Share-48.png|link=Category:Resin:_3rd_Party_Integration]]<br />
<br />
= Using a c3p0 datasource in Resin, bound into JNDI =<br />
<br />
This configuration can go in resin.xml as a child of <cluster>, <host>, or <web-app>, or in resin-web.xml. Where you put it depends on how globally you want the pool to be shared between webapps.<br />
<br />
You may need to add the c3p0 jar to /var/resin/lib, the main Resin shared lib directory, since the pool will be created as a shared resource upon startup.<br />
<br />
In the top XML element, define the c3p0 namespace by adding:<br />
xmlns:c3p0="urn:java:com.mchange.v2.c3p0" <br />
<br />
Then create the pool:<br />
<br />
<c3p0:ComboPooledDataSource resin:Jndi="java:comp/env/jdbc/mysql"><br />
<driverClass>com.mysql.jdbc.Driver</driverClass><br />
<jdbcUrl>jdbc:mysql://address:3306/schema</jdbcUrl><br />
<user>user</user><br />
<password>password</password><br />
<minPoolSize>3</minPoolSize><br />
<maxPoolSize>5</maxPoolSize><br />
</c3p0:ComboPooledDataSource></div>Cowanhttp://wiki4.caucho.com/Java_Cache_Tutorial_with_Cache_Dependency_Injection_(CDI)Java Cache Tutorial with Cache Dependency Injection (CDI)2013-07-10T20:07:59Z<p>Cowan: </p>
<hr />
<div>{{Caching}} {{Cookbook}}<br />
<br />
<br />
Faster application performance is possible with Java caching by saving the results of long calculations and reducing database load. The Java caching API is being standardized with jcache. In combination with Java Dependency Injection (CDI), you can use caching in a completely standard fashion in the Resin Application Server. You'll typically want<br />
to look at caching when your application starts slowing down, or your database or other expensive resource starts getting overloaded. Caching is <br />
useful when you want to:<br />
<br />
* Improve latency<br />
* Reduce database load<br />
* Reduce CPU use<br />
<br />
This example defines a single local, persistent cache named "my-cache", defined in the WEB-INF/resin-web.xml (this part is Resin Application Server specific, of course.) Once the cache is defined, the standard jcache javax.cache.Cache object can be injected into your class with the standard CDI @Inject annotation and used.<br />
<br />
For a more complete discussion of caching see [[Introduction: Java Cache]].<br />
<br />
== Defining ClusterCache in XML configuration ==<br />
<br />
The definition selected the Resin ClusterCache implementation (you can also use a LocalCache for a single-server cache), gives it a javax.inject.Named name of "my-cache" and configures it. Here we only configure the name, and set the expire time to 1H. (The default is infinite expire.)<br />
<br />
''WEB-INF/resin-web.xml defining ClusterCache''<br />
<web-app xmlns="<nowiki>http://caucho.com/ns/resin</nowiki>"<br />
xmlns:ee="urn:java:ee"<br />
xmlns:resin="urn:java:com.caucho.resin"><br />
<br />
<resin:ClusterCache ee:Named="my-cache"><br />
<name>my-cache</name><br />
<modified-expire-timeout>1h</modified-expire-timeout><br />
</resin:ClusterCache><br />
<br />
</web-app><br />
<br />
== CDI inject of javax.cache.Cache ==<br />
<br />
In the MyService class, we inject the cache that we defined using the CDI @Inject and @Named annotations. Normally, CDI recommends that you create custom qualifier annotations instead of using @Named, but to keep the example simple, we're giving it a simple name.<br />
<br />
The Cache object can be used somewhat like a java.util.Map. Here we just use the get() and put() methods. Because we set the modified-expire-timeout to be 1H, the get() will return null an hour after the data was populated.<br />
<br />
''org/example/MyService.java injecting the Cache''<br />
import javax.inject.Inject;<br />
import javax.cache.Cache;<br />
<br />
public class MyService {<br />
@Inject @Named("my-cache")<br />
private Cache<String,String> _cache;<br />
<br />
public String doStuff(String key)<br />
{<br />
String cachedValue = _cache.get(key);<br />
<br />
if (cachedValue == null) {<br />
cachedValue = doLongCalculation(key);<br />
<br />
_cache.put(key, cachedValue);<br />
}<br />
<br />
return cachedValue;<br />
}<br />
<br />
public String doLongCalculation(String key)<br />
{<br />
// database, REST, XML-parsing, etc.<br />
}<br />
}<br />
<br />
Notice that all the code uses standard APIs without any need to reference Resin classes. Since only the configuration needs to select the Resin cache, your application can easily switch cache implementations.<br />
<br />
You can compare this technique with using the @CacheResult annotation described in [[Java Cache Tutorial with Method Annotations (CDI)]].<br />
<br />
== Cache Performance example ==<br />
<br />
[[Image:ideal-cache.png|right]]<br />
<br />
Since reducing database load is a typical cache benefit, it's useful to create a micro-benchmark to see how a cache can help. This is just a simple<br />
test with mysql running on the same server and a trivial query. In other words, it's not trying to exaggerate the value of the cache, because almost any<br />
real cache use will have a longer "doLongCalculation" than this simple example, and therefore the cache will benefit even more.<br />
<br />
<em>For a more complete discussion of caching see [[Introduction:_Java_Cache]].</em><br />
<br />
The micro-benchmark has a simple jdbc query in the "doLongCalculation" method<br />
<br />
"SELECT value FROM test WHERE id=?"<br />
<br />
and then to get useful data, the call to "doStuff" is repeated 300k times and compared with the direct call to "doLongCalculation" 300k times.<br />
<br />
<table border='1'><br />
<tr><br />
<th>Type</th><br />
<th>Time</th><br />
<th>requests per millisecond</th><br />
<th>Mysql CPU</th><br />
</tr><br />
<tr><br />
<th>JDBC</th><br />
<td>30s</td><br />
<td>10.0 req/ms</td><br />
<td>35%</td><br />
</tr><br />
<tr><br />
<th>Cache</th><br />
<td>0.3s</td><br />
<td>1095 req/ms</td><br />
<td>0%</td><br />
</tr><br />
</table><br />
<br />
Even this simple test shows how caches can win. In this simple benchmark, the performance is significantly faster and saves the database load.<br />
<br />
* 10x faster<br />
* Remove Mysql load<br />
<br />
To get more realistic numbers, you'll need to benchmark the difference on a full application. Micro-benchmarks like this are useful to explain concepts,<br />
but real benchmarks require testing against your own application, in combination with profiling. For example, Resin's simple profiling capabilities<br />
in the /resin-admin or with the pdf-report can get you quick and simple data in your application performance.<br />
<br />
For a more complete discussion of cache performance see [[Introduction: Java Cache]].<br />
<br />
= Cache Consistency (Updating the Cache) =<br />
<br />
When your application modifies the data in the database, you will update the Cache as well. If you consistently update the cache each time you<br />
update or delete an entry, you can improve the cache performance and consistency; your data will not be out of date. Using this pattern, your<br />
cache become more of a true storage, rather than a dated snapshot of the data.<br />
<br />
''org/example/MyService.java updating the Cache for consistency''<br />
<br />
public class MyService {<br />
@Inject @Named("my-cache")<br />
private Cache<String,String> _cache;<br />
<br />
public String getData(String key)<br />
{<br />
String cachedValue = _cache.get(key);<br />
<br />
if (cachedValue == null) {<br />
cachedValue = getFromDatabase(key);<br />
<br />
_cache.put(key, cachedValue);<br />
}<br />
<br />
return cachedValue;<br />
}<br />
<br />
public void putData(String key, String value)<br />
{<br />
_cache.put(key, value);<br />
<br />
saveIntoDatabase(key, value);<br />
}<br />
<br />
public void removeData(String key)<br />
{<br />
_cache.remove(key);<br />
<br />
removeFromDatabase(key);<br />
}<br />
<br />
public void clearCache()<br />
{<br />
_cache.removeAll();<br />
}<br />
}<br />
<br />
The Cache.removeAll() method is typically used when the database is modified outside of the application, for example if you modified<br />
the database directly with SQL.<br />
<br />
For the annotation-based configuration, you can use @CacheResult, @CachePut, @CacheRemoveEntry, and @CacheRemoveAll.<br />
<br />
<br />
= Cache Considerations =<br />
<br />
* <b>size</b>: If your data set is large, the cache size can limit how much of your data can fit, resulting in a high miss rate and poor performance. A cache that can page memory out to disk, like<br />
Resin's cache, can allow for large cache sized only limited by your disk space, not your JVM heap space.<br />
<br />
* <b>persistence</b>: Memory-only caches like memcached are cleared when a server restarts, forcing cache misses until the cache is refilled. With a persistent cache like Resin's cache, a restart loads the most recent data, saving your databases from a big performance spike.<br />
<br />
* <b>sharding</b>: With a heavily loaded cache, sharding the cache can increase the cache size and performance, by splitting the cache among multiple cache servers. With sharding, exactly one cache<br />
server "owns" a cache entry, reducing conflicts. Resin's cache automatically shards the cache across the three triad hub servers. When Resin's cache has its own cluster, the cache can be sharded across all<br />
the servers in that cache.<br />
<br />
* <b>consistency</b>: If your cache has multiple "owner" servers, for example in a non-sharded cache, a simultaneous update to two servers can cause a conflict, similar to a synchronization issue. A sharded architecture reduces this problem by allowing only one server to own the entry.<br />
<br />
* <b>near/local caches</b>: When you have a small number of frequently used and rarely changing objects, a cache can give better performance with an internal local or near cache. Since the shard will<br />
still be the primary owner, it's possible for the local cache to be slightly out-of-date by a configurable time. Writes are always written through to the primary owner.</div>Cowanhttp://wiki4.caucho.com/Application_Server:_Custom_REST_PagesApplication Server: Custom REST Pages2013-03-21T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Cookbook}} {{Integration}} {{WebServer}} <br />
<br />
= Custom REST Pages =<br />
<br />
Resin actually provides 2 REST interfaces; a newer REST service which enables administration that mirrors Resin's command-line interface, and older customizable REST pages as part of the resin-admin web application.<br />
<br />
The newer REST interface is documented thoroughly in the [http://www.caucho.com/resin-4.0/admin/resin-admin-rest.xtp Resin documentation] and [[Application_Server:_REST_Graphing|usage examples]] are on the Wiki also.<br />
<br />
== rest.php ==<br />
<br />
rest.php, located at doc/admin/rest.php is a component of resin-admin that allows you to easy extend and customize resin-admin. Resin admin actually uses it to enable part of the graphing capability.<br />
<br />
rest.php requires one parameter "q", which is the name of a rest page to display. rest pages are located in resin-admin's WEB-INF/php/ directory and named with the extension ".rest".<br />
<br />
resin-admin as packaged includes 2 .rest pages for your use, or you can add your own additional .rest pagesto this directory.<br />
<br />
== mod_status.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status]<br />
<br />
This .rest page produces output similar to Apache's mod_status.<br />
<br />
== graph.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph http://127.0.0.1:8080/resin-admin/rest.php?q=graph]<br />
<br />
This .rest page produces an interactive graph drawn using javascript. It's intended to be embeddable in your own pages or can just be used as an example of how to write .rest pages.<br />
<br />
With no parameters, graph.rest will produce no graph. The parameters are as follows:<br />
<br />
* checks: a comma separated list of Resin meter name to graph (required)<br />
* servers: a comma separated list of Resin server cluster indexes, typically 00 though xx (defaults to the local server)<br />
* width: graph width (defaults to 640)<br />
* height: graph height (defaults t 480)<br />
* canvas: name of html 5 canvas DIV on to draw on (defaults to generated named)<br />
* period: graph domain, in seconds since the current time (defaults to 60)<br />
<br />
For example, this URL will produce a graph of the number of JVM threads over the last hour for the current server:<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600 http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600]<br />
<br />
Each Resin server in a cluster actually has access to the stats from the other servers, making cluster graphing possible, as shown in this example:<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count,Resin|Thread|Thread%20Count&servers=00,01 http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count,Resin|Thread|Thread%20Count&servers=00,01]<br />
<br />
The "checks" parameter accepts the names of a Resin Meters. Resin tracks many metrics while running, and stores these in an internal database. They are named hierarchy with keys from least to most specific, separated with a "|" (pipe) character. So in the example above the metric key was "JVM|Thread|JVM Thread Count". There is also a "Resin|Thread|Thread Count". [http://127.0.0.1:8080/resin-admin/?q=meters&s=0 Refer to the Meters page in resin-admin for a more comprehensive list.]<br />
<br />
== Writing a custom REST page == <br />
<br />
resin-admin only accesses data via JMX. To gather JMX data, you'll create a custom REST page, which is just a PHP page accessing JMX. The page has the extension .rest and can be named whatever you like, e.g. mypage.rest. Put the my-app.rest page in WEB-INF/php/mypage.rest.<br />
<br />
== Location of mypage.rest == <br />
<br />
The mypage.rest can be put directly in WEB-INF/php or in a custom location given by "resin_admin_ext_path. We recommend using resin_admin_ext_path so you can keep your extensions distinct from Resin's standard pages. The resin_admin_ext_path is configured in the resin.xml like:<br />
<br />
<web-app id="/resin-admin" root-directory="${resin.root}/doc/admin"><br />
<prologue><br />
<resin:set var="resin_admin_external" value="false"/><br />
<resin:set var="resin_admin_insecure" value="true"/><br />
<resin:set var="resin_admin_ext_path"<br />
value="/var/resin/admin/php"/><br />
</prologue><br />
</web-app><br />
<br />
== mypage.rest sample code ==<br />
<br />
The code for a REST page will look like:<br />
<br />
<?php<br />
<br />
header("Content-Type: text/plain; charset=utf-8");<br />
<br />
$mbean_server = new MBeanServer();<br />
<br />
$jvm_thread = $mbean_server->lookup("java.lang:type=Threading");<br />
<br />
printf("JvmThreadCount: %d\n", $jvm_thread->ThreadCount);<br />
<br />
?><br />
<br />
The $mbean_server is a Resin's PHP interface to Java JMX MBeanServer. The lookup($name) method looks up a MBean by its ObjectName. The field reference is a JXM attribute.</div>Cowanhttp://wiki4.caucho.com/Application_Server:_Custom_REST_PagesApplication Server: Custom REST Pages2013-03-21T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Cookbook}} {{Integration}} {{WebServer}} <br />
<br />
= Custom REST Pages =<br />
<br />
Resin actually provides 2 REST interfaces; a newer REST service which enables administration that mirrors Resin's command-line interface, and older customizable REST pages as part of the resin-admin web application.<br />
<br />
The newer REST interface is documented thoroughly in the [http://www.caucho.com/resin-4.0/admin/resin-admin-rest.xtp Resin documentation] and [[Application_Server:_REST_Graphing|usage examples]] are on the Wiki also.<br />
<br />
== rest.php ==<br />
<br />
rest.php, located at doc/admin/rest.php is a component of resin-admin that allows you to easy extend and customize resin-admin. Resin admin actually uses it to enable part of the graphing capability.<br />
<br />
rest.php requires one parameter "q", which is the name of a rest page to display. rest pages are located in resin-admin's WEB-INF/php/ directory and named with the extension ".rest".<br />
<br />
resin-admin as packaged includes 2 .rest pages for your use, or you can add your own additional .rest pagesto this directory.<br />
<br />
== mod_status.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status]<br />
<br />
This .rest page produces output similar to Apache's mod_status.<br />
<br />
== graph.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph http://127.0.0.1:8080/resin-admin/rest.php?q=graph]<br />
<br />
This .rest page produces an interactive graph drawn using javascript. It's intended to be embeddable in your own pages or can just be used as an example of how to write .rest pages.<br />
<br />
With no parameters, graph.rest will produce no graph. The parameters are as follows:<br />
<br />
* checks: a Resin meter name to graph, include more than once to graph multiple statistics (required)<br />
* servers: Resin server cluster index, typically 00 though xx, include more than once to graph multiple statistics (defaults to the local server)<br />
* width: graph width (defaults to 640)<br />
* height: graph height (defaults t 480)<br />
* canvas: name of html 5 canvas DIV on to draw on (defaults to generated named)<br />
* period: graph domain, in seconds since the current time (defaults to 60)<br />
<br />
For example, this URL will produce a graph of the number of JVM threads over the last hour for the current server:<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600 http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600]<br />
<br />
The "checks" parameter accepts the names of a Resin Meters. Resin tracks many metrics while running, and stores these in an internal database. They are named hierarchy with keys from least to most specific, separated with a "|" (pipe) character. So in the example above the metric key was "JVM|Thread|JVM Thread Count". There is also a "Resin|Thread|Thread Count". [http://127.0.0.1:8080/resin-admin/?q=meters&s=0 Refer to the Meters page in resin-admin for a more comprehensive list.]<br />
<br />
== Writing a custom REST page == <br />
<br />
resin-admin only accesses data via JMX. To gather JMX data, you'll create a custom REST page, which is just a PHP page accessing JMX. The page has the extension .rest and can be named whatever you like, e.g. mypage.rest. Put the my-app.rest page in WEB-INF/php/mypage.rest.<br />
<br />
== Location of mypage.rest == <br />
<br />
The mypage.rest can be put directly in WEB-INF/php or in a custom location given by "resin_admin_ext_path. We recommend using resin_admin_ext_path so you can keep your extensions distinct from Resin's standard pages. The resin_admin_ext_path is configured in the resin.xml like:<br />
<br />
<web-app id="/resin-admin" root-directory="${resin.root}/doc/admin"><br />
<prologue><br />
<resin:set var="resin_admin_external" value="false"/><br />
<resin:set var="resin_admin_insecure" value="true"/><br />
<resin:set var="resin_admin_ext_path"<br />
value="/var/resin/admin/php"/><br />
</prologue><br />
</web-app><br />
<br />
== mypage.rest sample code ==<br />
<br />
The code for a REST page will look like:<br />
<br />
<?php<br />
<br />
header("Content-Type: text/plain; charset=utf-8");<br />
<br />
$mbean_server = new MBeanServer();<br />
<br />
$jvm_thread = $mbean_server->lookup("java.lang:type=Threading");<br />
<br />
printf("JvmThreadCount: %d\n", $jvm_thread->ThreadCount);<br />
<br />
?><br />
<br />
The $mbean_server is a Resin's PHP interface to Java JMX MBeanServer. The lookup($name) method looks up a MBean by its ObjectName. The field reference is a JXM attribute.</div>Cowanhttp://wiki4.caucho.com/Application_Server:_Custom_REST_PagesApplication Server: Custom REST Pages2013-03-21T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Cookbook}} {{Integration}} {{WebServer}} <br />
<br />
= Custom REST Pages =<br />
<br />
Resin actually provides 2 REST interfaces; a newer REST service which enables administration that mirrors Resin's command-line interface, and older customizable REST pages as part of the resin-admin web application.<br />
<br />
The newer REST interface is documented thoroughly in the [http://www.caucho.com/resin-4.0/admin/resin-admin-rest.xtp Resin documentation] and [[Application_Server:_REST_Graphing|usage examples]] are on the Wiki also.<br />
<br />
== rest.php ==<br />
<br />
rest.php, located at doc/admin/rest.php is a component of resin-admin that allows you to easy extend and customize resin-admin. Resin admin actually uses it to enable part of the graphing capability.<br />
<br />
rest.php requires one parameter "q", which is the name of a rest page to display. rest pages are located in resin-admin's WEB-INF/php/ directory and named with the extension ".rest".<br />
<br />
resin-admin as packaged includes 2 .rest pages for your use, or you can add your own additional .rest pagesto this directory.<br />
<br />
== mod_status.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status]<br />
<br />
This .rest page produces output similar to Apache's mod_status.<br />
<br />
== graph.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph http://127.0.0.1:8080/resin-admin/rest.php?q=graph]<br />
<br />
This .rest page produces an interactive graph drawn using javascript. It's intended to be embeddable in your own pages or can just be used as an example of how to write .rest pages.<br />
<br />
With no parameters, graph.rest will produce no graph. The parameters are as follows:<br />
<br />
* checks: a Resin meter name to graph, include more than once to graph multiple statistics (required)<br />
* servers: Resin server cluster index, typically 00 though xx, include more than once to graph multiple statistics (defaults to the local server)<br />
* width: graph width (defaults to 640)<br />
* height: graph height (defaults t 480)<br />
* canvas: name of html 5 canvas DIV on to draw on (defaults to generated named)<br />
* period: graph domain, in seconds since the current time (defaults to 60)<br />
<br />
For example, this URL will produce a graph of the number of JVM threads over the last hour for the current server:<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600 http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600]<br />
<br />
The "checks" parameter accepts the names of a Resin Meters. Resin tracks many metrics while running, and stores these in an internal database. They are named hierarchy with keys from least to most specific, separated with a "|" (pipe) character. So in the example above the metric key was "JVM|Thread|JVM Thread Count". There is also a "Resin|Thread|Thread Count". [http://127.0.0.1:8080/resin-admin/?q=meters&s=0 Refer to the Meters page in resin-admin for a more comprehensive list.]<br />
<br />
== Writing a custom REST page == <br />
<br />
To gather custom JMX data, you'll create a custom REST page, which is just a PHP page accessing JMX. The page has the extension .rest and can be named whatever you like, e.g. mypage.rest. Put the my-app.rest page in WEB-INF/php/mypage.rest.<br />
<br />
== Location of mypage.rest == <br />
<br />
The mypage.rest can be put directly in WEB-INF/php or in a custom location given by "resin_admin_ext_path. We recommend using resin_admin_ext_path so you can keep your extensions distinct from Resin's standard pages. The resin_admin_ext_path is configured in the resin.xml like:<br />
<br />
<br />
<resin xmlns="http://caucho.com/ns/resin"><br />
...<br />
<br />
<web-app id="/resin-admin" root-directory="${resin.root}/doc/admin"><br />
<prologue><br />
<resin:set var="resin_admin_external" value="false"/><br />
<resin:set var="resin_admin_insecure" value="true"/><br />
<resin:set var="resin_admin_ext_path"<br />
value="/var/resin/admin/php"/><br />
</prologue><br />
</web-app><br />
<br />
== mypage.rest sample code ==<br />
<br />
The code for a REST page will look like:<br />
<br />
<?php<br />
<br />
header("Content-Type: text/plain; charset=utf-8");<br />
<br />
$mbean_server = new MBeanServer();<br />
<br />
$jvm_thread = $mbean_server->lookup("java.lang:type=Threading");<br />
<br />
printf("JvmThreadCount: %d\n", $jvm_thread->ThreadCount);<br />
<br />
?><br />
<br />
The $mbean_server is a Resin's PHP interface to Java JMX MBeanServer. The lookup($name) method looks up a MBean by its ObjectName. The field reference is a JXM attribute.</div>Cowanhttp://wiki4.caucho.com/Application_Server:_Custom_REST_PagesApplication Server: Custom REST Pages2013-03-21T00:00:00Z<p>Cowan: Created page with "{{Cookbook}} {{Integration}} {{WebServer}} = Custom REST Pages = Resin actually provides 2 REST interfaces; a newer REST service which enables administration that mirrors ..."</p>
<hr />
<div>{{Cookbook}} {{Integration}} {{WebServer}} <br />
<br />
= Custom REST Pages =<br />
<br />
Resin actually provides 2 REST interfaces; a newer REST service which enables administration that mirrors Resin's command-line interface, and older customizable REST pages as part of the resin-admin web application.<br />
<br />
The newer REST interface is documented thoroughly in the [http://www.caucho.com/resin-4.0/admin/resin-admin-rest.xtp documentation] and [[Application_Server:_REST_Graphing|usage examples] are on the Wiki also.<br />
<br />
== rest.php ==<br />
<br />
rest.php, located at doc/admin/rest.php is a component of resin-admin that allows you to easy extend and customize resin-admin. Resin admin actually uses it to enable part of the graphing capability.<br />
<br />
rest.php requires one parameter "q", which is the name of a rest page to display. rest pages are located in resin-admin's WEB-INF/php/ directory and named with the extension ".rest".<br />
<br />
resin-admin includes packaged 2 .rest pages which you can use, or you can add your own to this directory.<br />
<br />
== mod_status.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status http://127.0.0.1:8080/resin-admin/rest.php?q=mod_status]<br />
<br />
This .rest page produces output similar to Apache's mod_status.<br />
<br />
== graph.rest ==<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph http://127.0.0.1:8080/resin-admin/rest.php?q=graph]<br />
<br />
This .rest page produces an interactive graph drawn using javascript. It's intended to be embeddable in your own pages or can just be used as an example of how to write .rest pages.<br />
<br />
With no parameters, graph.rest will not graph data. The parameters are as follows:<br />
<br />
* checks: (required) a Resin meter name to graph. Can be passed more than once to graph multiple statistics<br />
* servers: Resin server cluster index, typically 00 though xx (defaults to the local server)<br />
* width: graph width (defaults to 640)<br />
* height: graph height (defaults t 480)<br />
* canvas: name of html 5 canvas DIV on to draw on (defaults to generated named)<br />
* period: graph domain, in seconds since the current time (defaults to 60)<br />
<br />
For example, this URL will produce a graph of the number of JVM threads over the last hour for the current server:<br />
<br />
[http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600 http://127.0.0.1:8080/resin-admin/rest.php?q=graph&checks=JVM|Thread|JVM%20Thread%20Count&period=3600]<br />
<br />
The "checks" parameter accepts the name of a Resin "meters". Resin tracks many metrics while running, and stores these in an internal database. They are named hierarchy with keys from least to most specific, separated with a "|" (pipe) character. So in the example above the metric key was "JVM|Thread|JVM Thread Count". There is also a "Resin|Thread|Thread Count". [http://127.0.0.1:8080/resin-admin/?q=meters&s=0 Refer to the Meters page in resin-admin for a more comprehensive list.]<br />
<br />
== Custom .rest Pages ==</div>Cowanhttp://wiki4.caucho.com/SdddSddd2013-02-27T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
= sddd - OSX SD Card Imaging Script =<br />
<br />
sddd is a shell script to make writing disk images to raw devices easier, less error prone, and more informative.<br />
<br />
sddd distinguishes itself from standard "dd" because it provides constant graphical feedback while writing to the disk. dd is notorious for providing no feedback about what it's doing until complete.<br />
<br />
This makes it great for writing Raspberry Pi images to an SD card, but it should work for writing to a USB drive also.<br />
<br />
== Requirements ==<br />
<br />
* OSX<br />
* SD card reader<br />
* diskutil (included with OSX)<br />
* dd (included with OSX)<br />
* pv (NOT included with OSX, get it from the [http://www.macports.org/ MacPorts Project])<br />
<br />
To get pv install [http://www.macports.org/ MacPort]. After MacPorts is installed, install pv via 'sudo port install pv'.<br />
<br />
== Download ==<br />
<br />
<table border="1" cellspacing="0" cellpadding="10"><br />
<tr><br />
<td>[[Media:Sddd.tar.gz|sddd.tar.gz]]</td><br />
<td>v1.2</td><br />
<td>02/27/2013</td><br />
</tr><br />
</table><br />
<br />
== Instructions ==<br />
<br />
# Download and save Sddd.tar.gz to your home directory<br />
# Open command prompt and extract it (tar xvfz Sddd.tar.gz)<br />
# Make sddd executable if it's not already (chmod u+x sddd)<br />
# Execute sddd as ./sddd <disk.img> [<SD card device>]<br />
<br />
== Usage ==<br />
<br />
* '''The first parameter is the disk image file.'''<br />
* '''The 2nd parameter (optional) is the disk device to write to. If not specified, sddd will prompt you to enter the device.'''<br />
<br />
molson:~ paul$ ./sddd<br />
sddd: usage : sddd <source image> [<disk>]<br />
example : sudo ./sddd 2012-12-16-wheezy-raspbian.img disk2<br />
<br />
== Example ==<br />
<br />
molson:~ paul$ sudo ./sddd Downloads/2012-12-16-wheezy-raspbian.img<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
Enter the SD card disk (disk0/disk1/disk2/disk3) ? disk2<br />
WARNING: disk2 appears to be mounted, shall I unmount /dev/disk2 (y/n)? y<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
WARNING: Writing to the wrong device will ruin your hard drive! Make sure you have entered SD card disk!<br />
Write Downloads/2012-12-16-wheezy-raspbian.img to disk2 (y/n)? y<br />
Writing Downloads/2012-12-16-wheezy-raspbian.img to disk2...<br />
1.81GiB 0:04:10 [7.38MiB/s] [================================>] 100% <br />
0+30689 records in<br />
0+30689 records out<br />
1939865600 bytes transferred in 250.811770 secs (7734348 bytes/sec)<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful</div>Cowanhttp://wiki4.caucho.com/File:Sddd.tar.gzFile:Sddd.tar.gz2013-02-27T00:00:00Z<p>Cowan: uploaded a new version of &quot;File:Sddd.tar.gz&quot;</p>
<hr />
<div></div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-15T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will fine also, but without the valuable features in the pro edition of course.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
= Performance =<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
2. Remove unnecessary .jar files.<br />
<br />
3. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
4. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/><br />
<br />
5. Be careful about your memory limits. Resin defaults to 256Mb heap size, plus 32Mb for the Watchdog. So if you have a 256Mb version Raspberry Pi, you could go over the limit. The newer Pi's are 512Mb. You definitely don't want to start swapping to disk, so it's a good idea to set -Xmx in /etc/resin/resin.properties:<br />
<br />
jvm_args : -Xmx128M<br />
<br />
= Future Plans =<br />
<br />
The next version of Resin is currently in development, and with it we're planning a new resin-lite package. (This would be Resin 5, but we're calling it Resin 7 to match JEE7). <br />
<br />
Resin Lite will be a stripped down, single .jar, non JEE compliant version of Resin. It will target running just servlets, JSP, (and probably PHP). There will be no persistent session or internal database, so the disk access delays should be greatly reduced.<br />
<br />
I'm tracking the changes needed for it (Raspberry Pi specifically) at [[Resin Changes To Support Raspberry Pi]]. Feel free to contact us at presales@caucho.com for more information or with suggestions.</div>Cowanhttp://wiki4.caucho.com/SdddSddd2013-02-15T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
= sddd - OSX SD Card Imaging Script =<br />
<br />
sddd is a shell script to make writing disk images to raw devices easier, less error prone, and more informative.<br />
<br />
sddd distinguishes itself from standard "dd" because it provides constant graphical feedback while writing to the disk. dd is notorious for providing no feedback about what it's doing until complete.<br />
<br />
This makes it great for writing Raspberry Pi images to an SD card, but it should work for writing to a USB drive also.<br />
<br />
== Requirements ==<br />
<br />
* OSX<br />
* SD card reader<br />
* diskutil (included with OSX)<br />
* dd (included with OSX)<br />
* pv (NOT included with OSX, get it from the [http://www.macports.org/ MacPorts Project])<br />
<br />
To get pv install [http://www.macports.org/ MacPort]. After MacPorts is installed, install pv via 'sudo port install pv'.<br />
<br />
== Download ==<br />
<br />
<table border="1" cellspacing="0" cellpadding="10"><br />
<tr><br />
<td>[[Media:Sddd.tar.gz|sddd.tar.gz]]</td><br />
<td>v1.1</td><br />
<td>02/08/2013</td><br />
</tr><br />
</table><br />
<br />
== Instructions ==<br />
<br />
# Download and save Sddd.tar.gz to your home directory<br />
# Open command prompt and extract it (tar xvfz Sddd.tar.gz)<br />
# Make sddd executable if it's not already (chmod u+x sddd)<br />
# Execute sddd as ./sddd <disk.img> [<SD card device>]<br />
<br />
== Usage ==<br />
<br />
* '''The first parameter is the disk image file.'''<br />
* '''The 2nd parameter (optional) is the disk device to write to. If not specified, sddd will prompt you to enter the device.'''<br />
<br />
molson:~ paul$ ./sddd<br />
sddd: usage : sddd <source image> [<disk>]<br />
example : sudo ./sddd 2012-12-16-wheezy-raspbian.img disk2<br />
<br />
== Example ==<br />
<br />
molson:~ paul$ sudo ./sddd Downloads/2012-12-16-wheezy-raspbian.img<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
Enter the SD card disk (disk0/disk1/disk2/disk3) ? disk2<br />
WARNING: disk2 appears to be mounted, shall I unmount /dev/disk2 (y/n)? y<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
WARNING: Writing to the wrong device will ruin your hard drive! Make sure you have entered SD card disk!<br />
Write Downloads/2012-12-16-wheezy-raspbian.img to disk2 (y/n)? y<br />
Writing Downloads/2012-12-16-wheezy-raspbian.img to disk2...<br />
1.81GiB 0:04:10 [7.38MiB/s] [================================>] 100% <br />
0+30689 records in<br />
0+30689 records out<br />
1939865600 bytes transferred in 250.811770 secs (7734348 bytes/sec)<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful</div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-15T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will fine also, but without the valuable features in the pro edition of course.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
= Performance =<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
2. Remove unnecessary .jar files.<br />
<br />
3. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
4. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/><br />
<br />
5. Be careful about your memory limits. Resin defaults to 256Mb heap size, plus 32Mb for the Watchdog. So if you have a 256Mb version Raspberry Pi, you could go over the limit. The newer Pi's are 512Mb. You definitely don't want to start swapping to disk, so it's a good idea to set -Xmx in /etc/resin/resin.properties:<br />
<br />
jvm_args : -Xmx128M<br />
<br />
= Future Plans =<br />
<br />
The next version of Resin is currently in development, and with it we're planning a new resin-lite package. (This would be Resin 5, but we're calling it Resin 7 to match JEE7). <br />
<br />
Resin Lite will be a stripped down, single .jar, non JEE compliant version of Resin. It will target running just servlets, JSP, (and probably PHP). There will be no persistent session or internal database, so the disk access delays should be greatly reduced.<br />
<br />
I'm tracking the changes needed for it (Raspberry Pi specifically) at [[Resin Changes To Support Raspberry Pi]]. Feel free to contact us at presales@caucho.com for more information or with suggestions.</div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-15T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will fine also, but without the valuable features in the pro edition of course.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
= Performance =<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
2. Remove unnecessary .jar files.<br />
<br />
3. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
4. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/><br />
<br />
5. Be careful about your memory limits. Resin defaults to 256Mb heap size, plus 32Mb for the Watchdog. So if you have a 256Mb version Raspberry Pi, you could go over the limit. The newer Pi's are 512Mb. You definitely don't want to start swapping to disk, so it's a good idea to set -Xmx in /etc/resin/resin.properties:<br />
<br />
jvm_args : -Xmx128M<br />
<br />
<br />
= Future Plans =<br />
<br />
The next version of Resin is currently in development, and with it we're planning a new resin-lite package. (This would be Resin 5, but we're calling it Resin 7 to match JEE7). <br />
<br />
Resin Lite will be a stripped down, single .jar, non JEE compliant version of Resin. It will target running just servlets, JSP, (and probably PHP). There will be no persistent session or internal database, so the disk access delays should be greatly reduced.<br />
<br />
I'm tracking the changes needed for it (Raspberry Pi specifically) at [[Resin Changes To Support Raspberry Pi]]. Feel free to contact us at presales@caucho.com for more information or with suggestions.</div>Cowanhttp://wiki4.caucho.com/Resin_Changes_To_Support_Raspberry_PiResin Changes To Support Raspberry Pi2013-02-15T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}}{{Raspi}}<br />
<br />
* Reduce disk access on startup<br />
* Reduce classpath scanning<br />
* Do not default to passing -server JVM flag (DONE 4.0.34)<br />
* Startup from a single jar file<br />
* Reduce size of distribution (single jar)<br />
* What can be removed from Resin OS to make it smaller?<br />
* Compiler doesn't like -m32 (DONE 4.0.35)<br />
* Do not warn about missing native libraries<br />
* Pass jvm_mode to watchdog<br />
<br />
gcc -g -O2 -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -pthread -fPIC -fno-omit-frame-pointer -O2 -DHAS_SOCK_TIMEOUT -DHAS_SENDFILE -DHAS_SPLICE -DPOLL -DHAS_JVMTI -fPIC -m32 -DRESIN_HOME=\"/usr/local/share/resin-4.0.32\" -I/usr/include -I/usr/lib/jvm/java-7-openjdk-armel/jre/bin/../../include - I../common -DCPU=\"armv6l\" -DOS= -c -o boot.o boot.c<br />
cc1: error: unrecognized command line option -m32<br />
<br />
13-01-08 10:07:27.827 [resin-14] WARNING DynamicClassLoader - java.lang.NoClassDefFoundError: javax/faces/application/ViewHandlerWrapper<br />
while loading com.caucho.server.cdi.ConversationJsfViewHandler (in RootDynamicClassLoader[])<br />
<br />
13-01-08 10:05:22.423 [main] WARNING WebApp - java.lang.InternalError: NYI<br />
at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252)<br />
at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208)<br />
at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760)<br />
at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:842)<br />
at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:820)<br />
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:889)<br />
at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.<init>(AdapterMethodHandle.java:568)<br />
at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556)<br />
at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95)<br />
at java.lang.invoke.MethodHandles$Lookup.accessStatic(MethodHandles.java:592)<br />
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:587)<br />
at sun.invoke.util.ValueConversions$LazyStatics.<clinit>(ValueConversions.java:694)<br />
at sun.invoke.util.ValueConversions.buildArrayProducer(ValueConversions.java:1176)<br />
at sun.invoke.util.ValueConversions.varargsArray(ValueConversions.java:1164)<br />
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:888)<br />
at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.<init>(AdapterMethodHandle.java:568)<br />
at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556)<br />
at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95)<br />
at java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:963)<br />
at com.caucho.config.attribute.SetterAttribute.<init>(SetterAttribute.java:55)<br />
at com.caucho.config.type.InlineBeanType.addProp(InlineBeanType.java:892)<br />
at com.caucho.config.type.InlineBeanType.introspectMethods(InlineBeanType.java:847)<br />
at com.caucho.config.type.InlineBeanType.introspect(InlineBeanType.java:607)<br />
at com.caucho.config.type.ConfigType.carefulIntrospect(ConfigType.java:68)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:593)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.attribute.CreateAttribute.getConfigType(CreateAttribute.java:75)<br />
at com.caucho.config.attribute.Attribute.isProgram(Attribute.java:74)<br />
at com.caucho.config.xml.XmlConfigContext.configureChildNode(XmlConfigContext.java:452)<br />
at com.caucho.config.xml.XmlConfigContext.configureAttribute(XmlConfigContext.java:324)<br />
at com.caucho.config.program.NodeBuilderChildProgram.inject(NodeBuilderChildProgram.java:82)<br />
at com.caucho.config.program.ContainerProgram.inject(ContainerProgram.java:88)<br />
at com.caucho.config.program.ConfigProgram.configure(ConfigProgram.java:107)<br />
at com.caucho.env.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:480)<br />
at com.caucho.env.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:59)<br />
at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:684)<br />
at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:77)<br />
at com.caucho.env.deploy.DeployController.startOnInit(DeployController.java:538)<br />
at com.caucho.env.deploy.DeployContainer.update(DeployContainer.java:241)<br />
at com.caucho.env.deploy.DeployContainer.update(DeployContainer.java:223)<br />
at com.caucho.env.deploy.DeployContainer.add(DeployContainer.java:87)<br />
at com.caucho.server.webapp.WebAppContainer.addWebApp(WebAppContainer.java:413)<br />
at com.caucho.resin.ResinEmbed.deployWebApplication(ResinEmbed.java:581)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:380)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
<br />
java.lang.NullPointerException<br />
at com.caucho.db.block.BlockManager.getMaxMemory(BlockManager.java:135)<br />
at com.caucho.db.block.BlockManager.defaultCapacity(BlockManager.java:104)<br />
at com.caucho.db.block.BlockManager.create(BlockManager.java:89)<br />
at com.caucho.server.resin.ResinDelegate$BlockManagerMemoryFreeTask.<init>(ResinDelegate.java:396)<br />
at com.caucho.server.resin.ResinDelegate.addPreTopologyServices(ResinDelegate.java:380)<br />
at com.caucho.server.resin.Resin.preConfigureInit(Resin.java:760)<br />
at com.caucho.server.resin.Resin.<init>(Resin.java:248)<br />
at com.caucho.server.resin.ResinEmbedded.<init>(ResinEmbedded.java:46)<br />
at com.caucho.server.resin.ResinEmbeddedLite.<init>(ResinEmbeddedLite.java:41)<br />
at com.caucho.resin.ResinLite.createResin(ResinLite.java:109)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:335)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
<br />
Exception in thread "main" java.lang.UnsatisfiedLinkError: registerNatives<br />
at java.lang.invoke.MethodHandleNatives.registerNatives(Native Method)<br />
at java.lang.invoke.MethodHandleNatives.<clinit>(MethodHandleNatives.java:127)<br />
at java.lang.invoke.MemberName.<init>(MemberName.java:352)<br />
at java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:960)<br />
at com.caucho.config.attribute.SetterAttribute.<init>(SetterAttribute.java:55)<br />
at com.caucho.config.type.InlineBeanType.addProp(InlineBeanType.java:892)<br />
at com.caucho.config.type.InlineBeanType.introspectMethods(InlineBeanType.java:847)<br />
at com.caucho.config.type.InlineBeanType.introspect(InlineBeanType.java:607)<br />
at com.caucho.config.type.ConfigType.carefulIntrospect(ConfigType.java:68)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:593)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.xml.XmlBeanAttribute.<init>(XmlBeanAttribute.java:57)<br />
at com.caucho.config.xml.XmlBeanAttribute.<clinit>(XmlBeanAttribute.java:49)<br />
at com.caucho.config.type.EnvironmentBeanType.<init>(EnvironmentBeanType.java:57)<br />
at com.caucho.config.type.TypeFactory.createType(TypeFactory.java:626)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:586)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:183)<br />
at com.caucho.config.xml.XmlConfigContext.configure(XmlConfigContext.java:241)<br />
at com.caucho.config.Config.configure(Config.java:324)<br />
at com.caucho.config.Config.configure(Config.java:254)<br />
at com.caucho.server.resin.BootConfig.configureFile(BootConfig.java:132)<br />
at com.caucho.server.resin.Resin.configureFile(Resin.java:1023)<br />
at com.caucho.resin.ResinEmbed.initConfig(ResinEmbed.java:520)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:344)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)</div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-14T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will fine also, but without the valuable features in the pro edition of course.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
= Performance =<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
2. Remove unnecessary .jar files.<br />
<br />
3. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
4. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/><br />
<br />
5. Be careful about your memory limits. Resin defaults to 256Mb heap size, plus 32Mb for the Watchdog. So if you have a 256Mb version Raspberry Pi, you could go over the limit. The newer Pi's are 512Mb. You definitely don't want to start swapping to disk, so it's a good idea to set -Xmx in /etc/resin/resin.properties:<br />
<br />
jvm_args : -Xmx128M</div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-14T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will run fine also. Resin Open-Source still has some native optimizations that need to be compiled.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
= Performance =<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
2. Remove unnecessary .jar files.<br />
<br />
3. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
4. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/><br />
<br />
5. Be careful about your memory limits. Resin defaults to 256Mb heap size, plus 32Mb for the Watchdog. So if you have a 256Mb version Raspberry Pi, you could go over the limit. The newer Pi's are 512Mb. You definitely don't want to start swapping to disk, so it's a good idea to set -Xmx in /etc/resin/resin.properties:<br />
<br />
jvm_args : -Xmx128M</div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-14T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will run fine also. Resin Open-Source still has some native optimizations that need to be compiled.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
= Performance =<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
2. Remove unnecessary .jar files.<br />
<br />
3. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
4. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/></div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-14T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will run fine also. Resin Open-Source still has some native optimizations that need to be compiled.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
= Performance =<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
5. Remove unnecessary .jar files.<br />
<br />
5. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
6. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/></div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-14T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed, updated, and accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* I'll install Resin Pro, but Resin Open-Source will run fine also. Resin Open-Source still has some native optimizations that need to be compiled.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
<br />
2. Compile and install <br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
<br />
3. If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
<br />
4. Configure JVM Mode<br />
<br />
<br />
''' Oracle JDK'''<br />
<br />
There's 2 change required to run on Raspberry Pi and Oracle JDK:<br />
<br />
<br />
4.1 Modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
<br />
4.2 Modify /etc/resin/cluster-default.xml, add a <watchdog-arg> parameter to set the Watchdog's JVM mode. Search for "jvm-mode" in the <server-default> section and put it after that. Example:<br />
<br />
vi /etc/resin/cluster-default.xml<br />
<br />
...<br />
<!-- defaults for each server, i.e. JVM --><br />
<server-default><br />
<jvm-arg-line>${jvm_args}</jvm-arg-line><br />
<jvm-mode>${jvm_mode}</jvm-mode><br />
<br />
<watchdog-arg>-client</watchdog-arg><br />
...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify resin.properties and cluster-default.xml as described above. Oracle JDK won't run in -server mode on a Raspberry Pi.<br />
<br />
<br />
'''OpenJDK'''<br />
<br />
<br />
4.1 On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replaced with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors... See [Java On Raspberry Pi Performance] for testing results we did on the different VMs.<br />
<br />
<br />
5. Startup Resin!<br />
<br />
root@raspberrypi:/# resinctl start<br />
Resin/4.0.35 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.35 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
root@raspberrypi:/# ps -ef | grep java<br />
root 8558 1 25 15:16 pts/0 00:00:31 /usr/jdk1.7.0_10/bin/java -client -Dresin.watchdog=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin- 4.0.35/ -Dresin.root=/var/resin <br />
-Xrs -Xss256k -Xmx32m com.caucho.boot.WatchdogManager -root-directory /var/resin -conf /etc/resin/resin.xml -log-directory /var/log/resin start --log-directory /var/log/resin<br />
root 8609 8558 61 15:17 pts/0 00:00:57 /usr/jdk1.7.0_10/bin/java -Dresin.server=app-0 -Djava.util.logging.manager=com.caucho.log.LogManagerImpl <br />
-Djava.system.class.loader=com.caucho.loader.SystemClassLoader -Djava.endorsed.dirs=/usr/jdk1.7.0_10/jre/lib/endorsed:/usr/local/share/resin- 4.0.35//endorsed:/var/resin/endorsed <br />
-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl -Djava.awt.headless=true -Dresin.home=/usr/local/share/resin-4.0.35/ -Xss1m -Xmx256m <br />
-client com.caucho.server.resin.Resin --root-directory /var/resin -conf /etc/resin/resin.xml -server app-0 -socketwait 41515 -root-directory /var/resin -log-directory <br />
/var/log/resin start --log-directory /var/log/resin<br />
root 8674 1978 0 15:18 pts/0 00:00:00 grep java<br />
<br />
== Performance ==<br />
<br />
At the moment, Resin performance on a Raspberry Pi is less than ideal, primarily attributed to disk access. Even using a class 10 SD Card, disk reads are slow, and disk writes are really slow. Resin does a lot of disk JAR file scanning and disk access to keep it's internal database synchronized (/var/resin/resin-data).<br />
<br />
The worst performance hit is only during startup. Once Resin is up, it's mostly the disk access and compiling JSPs that is slow.<br />
<br />
'''Performance tips:'''<br />
<br />
1. Use Oracle JDK. It's [[Java On Raspberry Pi Performance|significantly faster than Open JDK]]<br />
<br />
5. Remove unnecessary .jar files.<br />
<br />
5. Use pre-expanded .war directory. You may notice periods of blocking if you are using .war files, while Resin unzips and writes the files.<br />
<br />
6. Use expand-preserve-fileset. This tells Resin to keep compiled JSPs between webapp changes.<br />
<br />
<web-app-deploy path="webapps"<br />
expand-preserve-fileset="WEB-INF/work/**"/></div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-14T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed and updated, accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 40 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].<br />
<br />
If you're getting this error when running java, "error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory", it means you're trying to run Java on hard-float Rasbian. [http://www.raspberrypi.org/downloads Get the soft-float version].<br />
<br />
== Resin ==<br />
<br />
* Download Resin 4.0.35 or later from [http://www.caucho.com/download/ www.caucho.com]. 4.0.35 was the first version to include changes necessary to compile Resin's native libraries on a Raspberry Pi<br />
* We'll install Resin Pro, but Resin Open-Source will run fine also. Resin Open-Source still has some native optimizations that need to be compiled.<br />
* Resin's native optimizations are always optional - it will run fine in pure Java mode with most features still available.<br />
<br />
1. Download, unzip, and install Resin. There's nothing different here than any other Resin installation. Just make sure Java can be found. It must either be in the path or JAVA_HOME set as an environment variable.<br />
<br />
wget http://www.caucho.com/download/resin-pro-4.0.35.zip<br />
unzip resin-pro-4.0.35.zip<br />
cd resin-pro-4.0.35<br />
./configure<br />
<br />
You should get a configuration summary that looks like this:<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.35<br />
home : /usr/local/share/resin-4.0.35<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os resin resinssl<br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/java/bin/..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/java/bin/../include -I/usr/java/bin/../include/linux<br />
CFLAGS : <br />
cflags_shlib : -fPIC<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
OPENSSL : OpenSSL 1.0.1c 10 May 2012<br />
include : /usr/include<br />
lib : <br />
libraries : -lssl -lcrypto<br />
<br />
make<br />
make install<br />
<br />
Resin will install to the standard directories /usr/local/share/resin, /var/resin, /etc/resin... <br />
<br />
If you're on Resin Pro, now is the time to copy a license file to /etc/resin/licenses<br />
<br />
cp /home/pi/10101.license /etc/resin/licenses/<br />
<br />
There's really only 1 change required to run on Raspberry Pi. On Oracle JDK you MUST modify /etc/resin/resin.properties to change the jvm_mode parameter, as Java will NOT run on Raspberry Pi in server mode! Resin automatically uses -server unless this parameter is set:<br />
<br />
vi /etc/resin/resin.properties<br />
<br />
jvm_mode : -client<br />
<br />
On OpenJDK, you have a couple choices. -server implies -zero, the [http://openjdk.java.net/projects/zero/ Zero-Assembler Project VM]. There's also -jamvm, [http://jamvm.sourceforge.net/ JamVM]. Older version of OpenJDK had [http://www.cacaojvm.org/ Cacao JVM], but that appears to have been removed in recent releases and replace with [http://oss.readytalk.com/avian/ Avain VM], although with -avian I get missing library errors...<br />
<br />
root@raspberrypi:/# resinctl start<br />
Error occurred during initialization of VM<br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
If you're seeing the message above, you need to modify /etc/resin/resin.properties and set "jvm_mode : -client". Oracle JDK won't run in -server mode on a Raspberry Pi.</div>Cowanhttp://wiki4.caucho.com/Resin_Changes_To_Support_Raspberry_PiResin Changes To Support Raspberry Pi2013-02-14T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}}{{Raspi}}<br />
<br />
* Reduce disk access on startup<br />
* Reduce classpath scanning<br />
* Do not default to passing -server JVM flag (DONE 4.0.34)<br />
* Startup from a single jar file<br />
* Reduce size of distribution (single jar)<br />
* What can be removed from Resin OS to make it smaller?<br />
* Compiler doesn't like -m32 (DONE 4.0.35)<br />
* Do not warn about missing native libraries<br />
<br />
gcc -g -O2 -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -pthread -fPIC -fno-omit-frame-pointer -O2 -DHAS_SOCK_TIMEOUT -DHAS_SENDFILE -DHAS_SPLICE -DPOLL -DHAS_JVMTI -fPIC -m32 -DRESIN_HOME=\"/usr/local/share/resin-4.0.32\" -I/usr/include -I/usr/lib/jvm/java-7-openjdk-armel/jre/bin/../../include - I../common -DCPU=\"armv6l\" -DOS= -c -o boot.o boot.c<br />
cc1: error: unrecognized command line option -m32<br />
<br />
13-01-08 10:07:27.827 [resin-14] WARNING DynamicClassLoader - java.lang.NoClassDefFoundError: javax/faces/application/ViewHandlerWrapper<br />
while loading com.caucho.server.cdi.ConversationJsfViewHandler (in RootDynamicClassLoader[])<br />
<br />
13-01-08 10:05:22.423 [main] WARNING WebApp - java.lang.InternalError: NYI<br />
at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252)<br />
at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208)<br />
at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760)<br />
at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:842)<br />
at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:820)<br />
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:889)<br />
at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.<init>(AdapterMethodHandle.java:568)<br />
at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556)<br />
at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95)<br />
at java.lang.invoke.MethodHandles$Lookup.accessStatic(MethodHandles.java:592)<br />
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:587)<br />
at sun.invoke.util.ValueConversions$LazyStatics.<clinit>(ValueConversions.java:694)<br />
at sun.invoke.util.ValueConversions.buildArrayProducer(ValueConversions.java:1176)<br />
at sun.invoke.util.ValueConversions.varargsArray(ValueConversions.java:1164)<br />
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:888)<br />
at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.<init>(AdapterMethodHandle.java:568)<br />
at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556)<br />
at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95)<br />
at java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:963)<br />
at com.caucho.config.attribute.SetterAttribute.<init>(SetterAttribute.java:55)<br />
at com.caucho.config.type.InlineBeanType.addProp(InlineBeanType.java:892)<br />
at com.caucho.config.type.InlineBeanType.introspectMethods(InlineBeanType.java:847)<br />
at com.caucho.config.type.InlineBeanType.introspect(InlineBeanType.java:607)<br />
at com.caucho.config.type.ConfigType.carefulIntrospect(ConfigType.java:68)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:593)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.attribute.CreateAttribute.getConfigType(CreateAttribute.java:75)<br />
at com.caucho.config.attribute.Attribute.isProgram(Attribute.java:74)<br />
at com.caucho.config.xml.XmlConfigContext.configureChildNode(XmlConfigContext.java:452)<br />
at com.caucho.config.xml.XmlConfigContext.configureAttribute(XmlConfigContext.java:324)<br />
at com.caucho.config.program.NodeBuilderChildProgram.inject(NodeBuilderChildProgram.java:82)<br />
at com.caucho.config.program.ContainerProgram.inject(ContainerProgram.java:88)<br />
at com.caucho.config.program.ConfigProgram.configure(ConfigProgram.java:107)<br />
at com.caucho.env.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:480)<br />
at com.caucho.env.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:59)<br />
at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:684)<br />
at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:77)<br />
at com.caucho.env.deploy.DeployController.startOnInit(DeployController.java:538)<br />
at com.caucho.env.deploy.DeployContainer.update(DeployContainer.java:241)<br />
at com.caucho.env.deploy.DeployContainer.update(DeployContainer.java:223)<br />
at com.caucho.env.deploy.DeployContainer.add(DeployContainer.java:87)<br />
at com.caucho.server.webapp.WebAppContainer.addWebApp(WebAppContainer.java:413)<br />
at com.caucho.resin.ResinEmbed.deployWebApplication(ResinEmbed.java:581)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:380)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
<br />
java.lang.NullPointerException<br />
at com.caucho.db.block.BlockManager.getMaxMemory(BlockManager.java:135)<br />
at com.caucho.db.block.BlockManager.defaultCapacity(BlockManager.java:104)<br />
at com.caucho.db.block.BlockManager.create(BlockManager.java:89)<br />
at com.caucho.server.resin.ResinDelegate$BlockManagerMemoryFreeTask.<init>(ResinDelegate.java:396)<br />
at com.caucho.server.resin.ResinDelegate.addPreTopologyServices(ResinDelegate.java:380)<br />
at com.caucho.server.resin.Resin.preConfigureInit(Resin.java:760)<br />
at com.caucho.server.resin.Resin.<init>(Resin.java:248)<br />
at com.caucho.server.resin.ResinEmbedded.<init>(ResinEmbedded.java:46)<br />
at com.caucho.server.resin.ResinEmbeddedLite.<init>(ResinEmbeddedLite.java:41)<br />
at com.caucho.resin.ResinLite.createResin(ResinLite.java:109)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:335)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
<br />
Exception in thread "main" java.lang.UnsatisfiedLinkError: registerNatives<br />
at java.lang.invoke.MethodHandleNatives.registerNatives(Native Method)<br />
at java.lang.invoke.MethodHandleNatives.<clinit>(MethodHandleNatives.java:127)<br />
at java.lang.invoke.MemberName.<init>(MemberName.java:352)<br />
at java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:960)<br />
at com.caucho.config.attribute.SetterAttribute.<init>(SetterAttribute.java:55)<br />
at com.caucho.config.type.InlineBeanType.addProp(InlineBeanType.java:892)<br />
at com.caucho.config.type.InlineBeanType.introspectMethods(InlineBeanType.java:847)<br />
at com.caucho.config.type.InlineBeanType.introspect(InlineBeanType.java:607)<br />
at com.caucho.config.type.ConfigType.carefulIntrospect(ConfigType.java:68)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:593)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.xml.XmlBeanAttribute.<init>(XmlBeanAttribute.java:57)<br />
at com.caucho.config.xml.XmlBeanAttribute.<clinit>(XmlBeanAttribute.java:49)<br />
at com.caucho.config.type.EnvironmentBeanType.<init>(EnvironmentBeanType.java:57)<br />
at com.caucho.config.type.TypeFactory.createType(TypeFactory.java:626)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:586)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:183)<br />
at com.caucho.config.xml.XmlConfigContext.configure(XmlConfigContext.java:241)<br />
at com.caucho.config.Config.configure(Config.java:324)<br />
at com.caucho.config.Config.configure(Config.java:254)<br />
at com.caucho.server.resin.BootConfig.configureFile(BootConfig.java:132)<br />
at com.caucho.server.resin.Resin.configureFile(Resin.java:1023)<br />
at com.caucho.resin.ResinEmbed.initConfig(ResinEmbed.java:520)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:344)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)</div>Cowanhttp://wiki4.caucho.com/Embedded:_Resin_On_Raspberry_PiEmbedded: Resin On Raspberry Pi2013-02-08T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
=Resin on Raspberry Pi=<br />
<br />
We are currently in the early stages of modifying Resin to run on a Raspberry Pi. <br />
<br />
Caucho Wiki Raspberry Pi Pages:<br />
<br />
* [[Java On Raspberry Pi Performance]]<br />
* [[Resin Changes To Support Raspberry Pi]]<br />
* [[Paul's Raspberry Pi Journal]]<br />
* [[sddd]] - Paul's improved dd for SD Card script for OSX<br />
<br />
= Resin on Raspberry Pi : Installation and Configuration =<br />
<br />
== Preface ==<br />
<br />
I'm going to assume you already have a working Raspberry Pi with Soft-float Raspbian Wheezy installed and updated, accessible via SSH. If not, here are some links to help get you started:<br />
<br />
* [http://www.raspberrypi.org/downloads Soft-float Debian Wheezy Download]<br />
* [http://elinux.org/RPi_Easy_SD_Card_Setup Easy SD Card Setup on the Raspberry Pi Wiki]<br />
* [[sddd|sddd - Paul's improved dd for SD Card script for OSX]]<br />
* [http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration Adafruit's First time configuration lesson]<br />
* [http://elinux.org/RPi_raspi-config raspi-config on the Raspberry Pi Wiki]<br />
<br />
I recommend you run "sudo apt-get update" and then "sudo apt-get upgrade". This will take something like 60 minutes, but it's good to have all the latest updates.<br />
<br />
== Java ==<br />
<br />
* Java 6 and 7 do not support ARMv6 hardware floating-point calculations, so you must use the Soft-float version of Raspbian<br />
* There is an [http://jdk8.java.net/fxarmpreview/ early-access JDK 8 with hard-float support], but we have not tested Resin on JDK 8 yet<br />
* Resin will run on both OpenJDK and Oracle JDK. I recommend Oracle JDK 7 for performance. See [[Java On Raspberry Pi Performance|Java On Raspberry Pi Performance for the results of performance tests of Oracle JDK and OpenJDK on Raspberry Pi with Resin]].<br />
* To install OpenJDK 7, simply run "sudo apt-get install openjdk-7-jdk". java will install in your path using [http://www.linuxalt.com/ /etc/alternatives]<br />
* To install Oracle JDK download [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 7 JDK, Linux ARM v6/v7 Soft Float ABI] from Oracle. There's nice step-by-step instructions at [http://www.savagehomeautomation.com/pi-jdk Savage Home Automation - Raspberry Pi - Installing Oracle Java Development Kit].</div>Cowanhttp://wiki4.caucho.com/Paul%27s_Raspberry_Pi_JournalPaul's Raspberry Pi Journal2013-02-08T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
<font color="black face="tahoma" size="3" color="#009"><br />
<br />
= Intro =<br />
<br />
Hi! I'm [http://www.caucho.com/about/ Paul Cowan], a software engineer at [http://www.caucho.com/ Caucho Technology]. Caucho is primarily a Java EE application server vendor. Our application server is called [http://www.caucho.com/resin-application-server/ Resin]. I mostly write Java code, but I'm also a computer hobbyist and like to tinker with anything techie.<br />
<br />
During Caucho's last engineer meeting in San Francisco (October 2012), I brought up [http://www.raspberrypi.org/ Raspberry Pi] as an avenue we could explore for Resin. It probably wouldn't directly sell Resin licenses, but it would be a great marketing vehicle. Everybody liked it, Caucho is cool like that, and so I'm off.<br />
<br />
= About Resin =<br />
<br />
Resin is a fairly light-weight for an app server and embeds well. It's really a nice platform on which to build just about anything in Java, since it can make just about any app HTTP enabled and handles all the mundane services like logging and you don't really want to have to deal with. It also provides a dependency injection container... Now you may be asking "why do I can about dependency injection when I'm just playing around with hobby projects." Well personally I pump out Java code much faster using dependency injection and just find it easier to write in that style. <br />
<br />
Resin also includes [http://quercus.caucho.com/ Quercus, a Java based PHP interpreter]. I'm not really planning to make PHP a focus of this project, but it's handy to have available just in case.<br />
<br />
= About This Journal =<br />
<br />
The Raspberry Pi platform and community certainly seems to be evolving rapidly, but it still seems like there's not enough documentation out there. In particular Java support is kinda spotty, and I haven't found anything on JEE on a Raspberry Pi. So I'm going to document my experience in hope it is useful to other Java developers getting started with Raspberry Pi. <br />
<br />
= Hardware =<br />
<br />
* [http://www.newark.com/jsp/search/productdetail.jsp?sku=43W5302 Raspberry Pi Model B] board from [http://www.newark.com/ Newark Element 14] (Upgraded from 256 Mb model for free)<br />
* Little transparent [http://www.newark.com/multicomp/mc-rp001-clr/enclosure-raspberry-pi-clear/dp/07W8936?Ntt=MC-RP001-CLR plastic enclosure] also from Newark<br />
<br />
I ordered the Pi early in October, but it was backordered by about 4 weeks. 10/15 they sent me an email my order was upgraded for free from 256 Mb to the 512 Mb model. It was delivered 10/18, so about 2 weeks early.<br />
<br />
* [http://www.monoprice.com/products/product.asp?c_id=104&cp_id=10419&cs_id=1041902&p_id=2081&seq=1&format=2 HDMI to DVI adapter] from [http://www.monoprice.com/ Monoprice]<br />
* [http://www.monoprice.com/products/product.asp?c_id=102&cp_id=10240&cs_id=1024008&p_id=3992&seq=1&format=2 HDMI cable]<br />
<br />
I use an IOGear DVI KVM so monitor and keyboard aren't a problem. In fact the KVM combines the mouse and keyboard into a single USB cable, so that leaves me a free USB port on the RasPi. However I needed an adapter and HDMI cable. Monoprice is great for this kind of stuff.<br />
<br />
* PNY 8 Gb SD card from BJ's... I think, I stolen from the family camera :) <br />
* MicroUSB cable and AC adapter from my Kindle<br />
<br />
<br />
{|<br />
|[[File:Raspi-1.gif]]<br />
|[[File:Raspi-2.gif]]<br />
|[[File:Raspi-3.gif]]<br />
|[[File:Raspi-4.gif]]<br />
|}<br />
<br />
= Getting Started =<br />
<br />
I started with [http://www.oracle.com/technetwork/articles/java/raspberrypi-1704896.html this write up from Oracle] and the [http://www.raspberrypi.org/downloads Raspberry Pi downloads page]. It becomes apparent pretty quickly that there's a float-point compatibility issue with Java on Raspberry Pi. Here's a summary of what I understand regarding the state of Raspberry Pi operating systems and Java support as of 11/2012:<br />
<br />
== OS ==<br />
<br />
* The "official" distro is Raspbian Wheezy, which is offered for download on on [http://www.raspberrypi.org/downloads raspberrypi.org/downloads]<br />
* This distro is variant of Raspbian Wheezy from [http://www.raspbian.org/ raspbian.org] but with a light-weight desktop, Midori web browser, and a few other development extra specifically for Raspberry Pi<br />
* Raspbian Wheezy is a variant of Debian Wheezy but compiled for ARM processor with optimization specifically for Raspberry Pi (hardware floating-point)<br />
* [http://wiki.debian.org/DebianWheezy Debian Wheezy] is the "testing" distro of Debian, while [http://wiki.debian.org/DebianSqueeze/ Debian Squeeze] is the current stable release<br />
* There are [http://elinux.org/RPi_Distributions#Available_Distributions various other linux distros supporting ARM processor]<br />
<br />
I should mention that my understand is you can't just use any ARM linux distro straight up. The boot sequence for a Raspberry Pi dependent on the SD card. It actually boots from a small RISC core on the GPU, but the GPU firmware is loaded from the SD card. [http://elinux.org/RPi_Software#Overview More here].<br />
<br />
This article helps if you're a little lost like I was: [http://www.informit.com/articles/article.aspx?p=1620207&seqNum=4 Understanding ARM Architectures].<br />
<br />
== Java Compatability ==<br />
<br />
* Currently NO Java distro that I'm aware of has support for Raspberry Pi's hardware floating point unit (hard-float)<br />
* Therefore we need OS distro that support soft-float, ARMv6, little-endian<br />
* The Oracle article is discussing using Debian Squeeze, which I suspect is because it was the best distro available at the time with soft floating-point support.<br />
* However there is now a [http://www.raspberrypi.org/downloads Soft-float Debian wheezy Rasbian image] available at [http://www.raspberrypi.org/downloads raspberrypi.org/downloads], so I'm going to try that to start out<br />
<br />
Honestly I don't want a desktop at all and would like fast boot, so the Arch Linux distro appeals to me. (Note to try it later.)<br />
<br />
= Imaging =<br />
<br />
There's a Fedora installer that sounds interesting, but I'm running on OSX. The instructions on the [http://www.oracle.com/technetwork/articles/java/raspberrypi-1704896.html Oracle article] are based on Linux, but there's also [http://elinux.org/RPi_Easy_SD_Card_Setup decent instructions here]. Basically the distro is a raw SD card image, containing partitions, so you have to write it directly to the SD card in raw form.<br />
<br />
* Inserted the SD card into my MacBook's SD Slot<br />
* Ran Search->Disk Utility<br />
* SD card is listed as 8.01 GB APPLE SD Card...<br />
* Erase->MS-DOS(FAT), Name: RASPI<br />
* Erase<br />
<br />
Next, I tried [https://github.com/exaviorn/RasPiWrite RasPiWrite] and failed. The script doesn't even run due to syntax errors. I'm not going to debug a Python script, so that fails the 10-minute test.<br />
<br />
Now following [http://elinux.org/RPi_Easy_SD_Card_Setup "Easy Way" instructions] from the Raspberry Pi wiki...<br />
<br />
* df -h reveals my SD card mount simply enough:<br />
<br />
/dev/disk1s1 7.4Gi 624Ki 7.4Gi 1% /Volumes/RASPI<br />
<br />
$ sudo diskutil unmount /dev/disk1s1<br />
Password:<br />
Volume RASPI on disk1s1 unmounted<br />
<br />
$ sudo dd bs=1m if=~/Downloads/2012-08-08-wheezy-armel.img of=/dev/rdisk1<br />
1850+0 records in<br />
1850+0 records out<br />
1939865600 bytes transferred in 136.071302 secs (14256243 bytes/sec)<br />
<br />
Well that looks like it worked!<br />
<br />
[[File:Raspi-5.png]]<br />
<br />
= First Boot =<br />
<br />
The Raspberry Pi booted right into a blue menu screen called [http://elinux.org/RPi_raspi-config raspi-config] that lets you configure basic OS settings. <br />
<br />
* The first thing I did was hit EXPAND-ROOTFS to use of the rest of the free space on the SD card<br />
* After a "sudo reboot" it printed logs about resizing the root file system. That took a few minutes but seems work fine.<br />
* I configured, locale, timezone, enabled SSHD, and set the the desktop to NOT start on boot<br />
* Finished, reboot<br />
* The pi is showing up on my network, SSH works, looks good to go!<br />
<br />
pi@raspberrypi ~ $ df -h<br />
Filesystem Size Used Avail Use% Mounted on<br />
rootfs 7.3G 1.3G 5.7G 19% /<br />
/dev/root 7.3G 1.3G 5.7G 19% /<br />
tmpfs 22M 228K 22M 2% /run<br />
tmpfs 5.0M 0 5.0M 0% /run/lock<br />
tmpfs 44M 0 44M 0% /tmp<br />
tmpfs 10M 0 10M 0% /dev<br />
tmpfs 44M 0 44M 0% /run/shm<br />
/dev/mmcblk0p1 56M 35M 22M 61% /boot<br />
<br />
The [http://www.oracle.com/technetwork/articles/java/raspberrypi-1704896.html Oracle article] goes into a lot of detail about setting up DHCP, local. time-zone, etc e which doesn't seem necessary since Raspbian provides raspi-config.<br />
<br />
Hmm, I'm noticing the OS is only seeing 256 Mb instead of 512.... They told me I was sent an upgraded model to the 512 Mb.<br />
<br />
pi@raspberrypi ~ $ free -h<br />
total used free shared buffers cached<br />
Mem: 216M 48M 168M 0B 9.0M 23M<br />
-/+ buffers/cache: 15M 200M<br />
Swap: 99M 0B 99M<br />
<br />
pi@raspberrypi ~ $ cat /proc/cpuinfo <br />
Processor : ARMv6-compatible processor rev 7 (v6l)<br />
BogoMIPS : 697.95<br />
Features : swp half thumb fastmult vfp edsp java tls <br />
CPU implementer : 0x41<br />
CPU architecture: 7<br />
CPU variant : 0x0<br />
CPU part : 0xb76<br />
CPU revision : 7<br />
<br />
Hardware : BCM2708<br />
Revision : 0005<br />
Serial : 00000000edc79c8a<br />
<br />
(Emailed Newark customer service about it, have not heard back yet).<br />
<br />
= Getting Oracle JRE 7 Running =<br />
<br />
As I mentioned above, there's no Raspi hardware floating-point support in Java (yet?). I'm planning to install Oracle/OpenJDK/JRE to do some testing and see what runs best. Resin is not fully functional with a JRE, it can't compile JSPs...<br />
<br />
Downloading ARMv6/7 Linux - Headless EABI, VFP, SoftFP ABI, Little Endian1 (ejre-7u6-fcs-b24-linux-arm-vfp-client_headless-10_aug_2012.tar.gz) from [http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html Oracle].<br />
<br />
(Hmm, it takes like 2 minutes to scp 32Mb to the Pi from OSX... That troubling. Not sure if it's the write to SD card speed or network.)<br />
<br />
Unziped, untar, there's no installer. There's only 2 files in bin, java and keytool. I'm going to setup Java like a typical linux install by moving the extracted dir to /usr/ejre1.7.0_06 and symlink to /usr/java and link the executables into /usr/bin.<br />
<br />
pi@raspberrypi ~ $ which java<br />
/usr/bin/java<br />
pi@raspberrypi ~ $ java -version<br />
java version "1.7.0_06"<br />
Java(TM) SE Embedded Runtime Environment (build 1.7.0_06-b24, headless)<br />
Java HotSpot(TM) Embedded Client VM (build 23.2-b09, mixed mode)<br />
<br />
= Getting Resin Running =<br />
<br />
I'm going to focus on the open-source Resin Servlet Container for this project.<br />
<br />
wget http://www.caucho.com/download/resin-4.0.32.zip<br />
<br />
Extracting the zip was fast, but the whole system then stopped responding for a few seconds afterwards... I guessing it's write buffering to the SD card and has to wait for the hardware to catchup. (?)<br />
<br />
Trying a configure/make/make install of Resin:<br />
<br />
./configure<br />
<br />
configure: error: <br />
<br />
*** Can't find JNI directory in JAVA_HOME=/usr/java<br />
*** JNI is expected in /usr/java/include/linux<br />
<br />
Crap... this Java distro does not include the Java headers. We won't be able to compile Resin native libraries with this Java, maybe one of the others will have headers. Resin will still work in pure Java mode.<br />
<br />
Let's try with:<br />
<br />
./configure --disable-jni<br />
<br />
Configure succeeds that time. "make" succeeds. "sudo make install" succeeds. <br />
<br />
Resin is installed to /etc/init.d, /etc/resin, /usr/local/share/resin, /var/resin, etc.<br />
<br />
pi@raspberrypi /var/resin $ resinctl start<br />
Resin/4.0.32 launching watchdog at 127.0.0.1:6600<br />
java.io.FileNotFjava.io.FiloundExceNotFoeption:undExce /var/ption: /log/resivar/logn/watch/resin/dog-manwatchdoager.log g-manage(Permissr.log (Pion deermissionied)<br />
n denied)<br />
at java.io.FileOutputStream.open(Native Method)<br />
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)<br />
at java.io.FileOutputStream.<init>(FileOutputStream.java:104)<br />
at com.caucho.vfs.FilePath.openAppendImpl(FilePath.java:586)<br />
at com.caucho.vfs.Path.openAppend(Path.java:1229)<br />
at com.caucho.boot.WatchdogManager.<init>(WatchdogManager.java:143)<br />
at com.caucho.boot.WatchdogManager.main(WatchdogManager.java:1009)<br />
Resin/4.0.32 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
Well that's a weird error... I forgot to start with sudo, retry.<br />
<br />
pi@raspberrypi /var/log/resin $ sudo resinctl start<br />
Resin/4.0.32 launching watchdog at 127.0.0.1:6600<br />
Resin/4.0.32 started -server 'app-0' with watchdog at 127.0.0.1:6600<br />
<br />
That's better. It only took about 15 seconds to startup, not too bad. Checking the logs...<br />
<br />
[2012/12/04 14:14:31.094] {main} Unable to find native library 'resin_os' for com.caucho.bootjni.JniProcess. Resin expects to find this library in:<br />
(Unix) /usr/local/share/resin-4.0.32/libexec/libresin_os.so<br />
On Unix, run ./configure --prefix=`pwd`; make; make install.<br />
<br />
The JVM exception was: java.lang.UnsatisfiedLinkError: no resin_os in java.library.path<br />
<br />
watchdog-manager.log is complaining about missing native libraries, but that's expected.<br />
<br />
[12-12-04 14:15:12.478] {main} Resin-4.0.32 (built Mon, 01 Oct 2012 03:05:04 PDT)<br />
[12-12-04 14:15:12.482] {main} <br />
[12-12-04 14:15:12.485] {main} Linux 3.2.27+ arm<br />
[12-12-04 14:15:12.489] {main} Java(TM) SE Embedded Runtime Environment 1.7.0_06-b24, UTF-8, en<br />
[12-12-04 14:15:12.493] {main} Java HotSpot(TM) Embedded Client VM 23.2-b09, 32, mixed mode, Oracle Corporation<br />
<br />
Cool!<br />
<br />
Trying http://raspberrypi:8080/ <br />
<br />
500 Servlet Exception<br />
<br />
javac compiler is not available in Java(TM) SE Embedded Runtime Environment<br />
1.7.0_06-b24. Check that you are using the JDK, not the JRE.<br />
<br />
Well that's expect also, we're using a JRE so no JSP compiler...<br />
<br />
Trying http://raspberrypi:8080/resin-doc/ That works! Why?... XTP is not compiled! <br />
<br />
Trying http://raspberrypi:8080/resin-admin That works too! PHP is not compiled either!<br />
<br />
Admin account generation worked. Resin restart took 45 seconds, Ugh.<br />
<br />
[[File:Raspi-6.png]]<br />
<br />
= Getting OpenJDK 7 Running =<br />
<br />
Attempting to install OpenJDK from the package:<br />
<br />
apt-get install openjdk-7-jdk<br />
<br />
Nice! That works!<br />
<br />
root@raspberrypi:~# which java<br />
/usr/bin/java<br />
root@raspberrypi:~# cd /usr/bin/<br />
root@raspberrypi:/usr/bin# ls -l java<br />
lrwxrwxrwx 1 root root 22 Dec 4 16:21 java -> /etc/alternatives/java<br />
root@raspberrypi:/usr/bin# cd /etc/alternatives/<br />
root@raspberrypi:/etc/alternatives# ls -l java<br />
lrwxrwxrwx 1 root root 46 Dec 4 16:21 java -> /usr/lib/jvm/java-7-openjdk-armel/jre/bin/java<br />
root@raspberrypi:/etc/alternatives# cd /usr/lib/jvm/<br />
root@raspberrypi:/usr/lib/jvm# ls -l<br />
total 8<br />
lrwxrwxrwx 1 root root 20 Oct 18 03:13 java-1.7.0-openjdk-armel -> java-7-openjdk-armel<br />
drwxr-xr-x 7 root root 4096 Dec 4 16:19 java-7-openjdk-armel<br />
drwxr-xr-x 3 root root 4096 Dec 4 16:16 java-7-openjdk-common<br />
<br />
So OpenJDK uses the Linux Alternatives project... (Not a big fan of alternatives but I'll deal.) It install armel and common, not sure what that's about.<br />
<br />
Starting Resin with OpenJDK...<br />
<br />
[12-12-05 20:05:52.793] {main} <br />
[12-12-05 20:05:52.817] {main} Resin-4.0.32 (built Mon, 01 Oct 2012 03:05:04 PDT)<br />
[12-12-05 20:05:52.826] {main} <br />
[12-12-05 20:05:52.838] {main} Linux 3.2.27+ arm<br />
[12-12-05 20:05:52.872] {main} OpenJDK Runtime Environment 1.7.0_03-b21, UTF-8, en<br />
[12-12-05 20:05:52.887] {main} OpenJDK Zero VM 22.0-b10, 32, mixed mode, Oracle Corporation<br />
<br />
Ok it start, but wow it's really slow. ResinBoot itself took like 20 seconds, and it must have been 3 minutes before port 8080 was bound. http://raspberrypi:8080/ loads to, but it took like 40 seconds. <br />
<br />
Doing some research, I see there's 3 different VM's built into OpenJDK, that's interesting. Here's the 3:<br />
<br />
* [http://openjdk.java.net/projects/zero/ Zero VM]<br />
* [http://www.cacaojvm.org/ Cacao VM]<br />
* [http://jamvm.sourceforge.net/ Jam VM]<br />
<br />
<br />
The /usr/lib/jvm/java-7-openjdk-armel/docs/README.Debian explains this in detail:<br />
<br />
The OpenJDK build is configured --with-additional-vms to build with<br />
different virtual machines. The original implementation of the hotspot<br />
VM is only available on the amd64, i386, lpia and sparc architectures.<br />
Other VM's are CACAO, providing a just in time compiler on several<br />
architectures (although the VM implementation is incomplete), and Zero,<br />
providing a byte code interpreter for every architecture. On some<br />
architectures Zero is built with JIT support using shark (still considered<br />
experimental).<br />
<br />
To use a different VM other than the default, use<br />
<br />
java -cacao|-zero|-shark<br />
<br />
or for the java tools, use<br />
<br />
<tool name> -J-cacao|-J-zero|-J-shark.<br />
<br />
The zero build on the ix86 architectures is built with shark (just in time<br />
compiler); to use the zero build without shark support, use the `-Xint'<br />
option to operate in interpreted-only mode.<br />
<br />
On some architectures (currently armel and powerpc, when built against<br />
llvm-2.6) which use ther zero vm as the default, the openjdk-7-jre-zero<br />
package contains the shark vm.<br />
<br />
To change the default permanently, edit /etc/java-7-openjdk/jvm.cfg.<br />
<br />
The CACAO VM can be found in the icedtea-7-jre-cacao package, the Zero/Shark<br />
VM can be found in the openjdk-7-jre-zero package (on the architectures<br />
where the Hotspot VM is available).<br />
<br />
So Zero is the default, which is interpreted mode, so that could account for the slow performance I was seeing. Sounds like I need to do some performance testing.<br />
<br />
I see OpenJDK includes headers!<br />
<br />
root@raspberrypi:/usr/lib/jvm/java-7-openjdk-armel/include# ls -l<br />
total 212<br />
-rw-r--r-- 1 root root 21079 Oct 18 03:05 classfile_constants.h<br />
-rw-r--r-- 1 root root 9544 Oct 18 03:05 jawt.h<br />
lrwxrwxrwx 1 root root 15 Oct 18 03:13 jawt_md.h -> linux/jawt_md.h<br />
-rw-r--r-- 1 root root 7206 Oct 18 03:05 jdwpTransport.h<br />
-rw-r--r-- 1 root root 74663 Oct 18 03:05 jni.h<br />
lrwxrwxrwx 1 root root 14 Oct 18 03:13 jni_md.h -> linux/jni_md.h<br />
-rw-r--r-- 1 root root 4771 Oct 18 03:05 jvmticmlr.h<br />
-rw-r--r-- 1 root root 78425 Oct 18 03:05 jvmti.h<br />
drwxr-xr-x 2 root root 4096 Dec 4 16:19 linux<br />
<br />
So I wonder if Resin will compile on Raspberry Pi now... Trying...<br />
<br />
./configure works!<br />
<br />
Resin Configuration Summary:<br />
<br />
RESIN : 4.0.32<br />
home : /usr/local/share/resin-4.0.32<br />
root : /var/resin<br />
conf : /etc/resin<br />
log : /var/log/resin<br />
plugins : common resin_os <br />
init : /etc/init.d/resin<br />
<br />
JAVA_HOME : /usr/lib/jvm/java-7-openjdk-armel/jre/bin/../..<br />
<br />
JNI : 32-bit<br />
include : -I/usr/lib/jvm/java-7-openjdk-armel/jre/bin/../../include<br />
CFLAGS : <br />
cflags_shlib : -fpic<br />
ld_shlib : gcc<br />
ldflags_shlib : -shared -fPIC -m32<br />
libs_shlib : <br />
epoll() for keepalives<br />
<br />
But make fails:<br />
<br />
gcc -g -O2 -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -pthread -fPIC -fno-omit-frame-pointer -O2 -DHAS_SOCK_TIMEOUT -DHAS_SENDFILE -DHAS_SPLICE -DPOLL -DHAS_JVMTI -fPIC -m32 -DRESIN_HOME=\"/usr/local/share/resin-4.0.32\" -I/usr/include -I/usr/lib/jvm/java-7-openjdk-armel/jre/bin/../../include -I../common -DCPU=\"armv6l\" -DOS= -c -o boot.o boot.c<br />
cc1: error: unrecognized command line option ý-m32ý<br />
<br />
So gcc on Raspberry Pi doesn't like -m32... It's a 32-bit architecture. I can probably work out the proper compilation flags but will put that off until later. For now we'll continue to run Resin in java-only mode.<br />
<br />
= JVM Performance Testing = <br />
<br />
* See [[Java On Raspberry Pi Performance]]<br />
<br />
= Resin on OpenJDK =<br />
<br />
Resin is automatically adding -server to the Resin command line during startup. -server implies -zero, so I can't get it to use -cacao or -jamvm at all without changes.<br />
<br />
I'm staring a [[Resin Changes To Support Raspberry Pi]] list.<br />
<br />
= Oracle JDK on Raspberry Pi =<br />
<br />
I'm quite interested in trying [http://pi4j.com/ Pi4J], which looks like a great little Java wrapper around a native library called [https://projects.drogon.net/raspberry-pi/wiringpi/ WiringPi] that lets you work with the Raspi hardware directly (GPIO, serial port, etc)<br />
<br />
The maintainer of Pi4J has a decent write on [http://www.savagehomeautomation.com/pi-jdk Raspberry Pi - Installing Oracle Java Development Kit (JDK 1.7.0u6)]. So reading that I come to find out there IS an [http://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle JDK that works on Raspberry Pi]! (WTF Oracle? Why isn't this listed under "Java Embedded". I guess because the "embedded" version is stripped down to make the size smaller.) Anyway, [http://www.oracle.com/technetwork/java/javase/downloads/index.html visit the Oracle downloads page], Java SE 7u10, JDK, there's a version available for "Linux ARM v6/v7 Soft Float ABI". That's what we need... Now to redo my [[Java On Raspberry Pi Performance]] tests, again.<br />
<br />
= Resin on Oracle JDK =<br />
<br />
Unfortunately I've hit a wall with Resin in it's current state. Resin automatically adds "-server" to the server startup command, and the JDK apparently won't run on Raspberry Pi with -server. It complains about requiring and ARMv7 chip, but the Pi is v6... (Resin embed may work.)<br />
<br />
pi@raspberrypi ~/resin-4.0.32 $ /usr/java/bin/java -jar lib/resin.jar start <br />
Resin/4.0.32 launching watchdog at 127.0.0.1:6600<br />
Error occurred during initialization of VM <br />
Server VM is only supported on ARMv7+ VFP<br />
<br />
Adding "remove -server" to the [[Resin Changes To Support Raspberry Pi]] list, and starting work on the changes to Resin 7.<br />
<br />
= Resin Lite =<br />
<br />
I'm coming back to this after a few weeks of holidays, distractions, bug fixes, and various other work... I've created a special cut of our next version of Resin, Resin 7, called "Resin Lite". Resin Lite is a single jar .war runner. To be honest it's no very "lite" yet, but at least it should run better on RasPi since it won't add -server automatically.<br />
<br />
=== Resin Lite on Zero ===<br />
<br />
Resin starts on Zero with exceptions but appears to run OK. I get a response to a servlet. Performance is slow. Log below...<br />
<br />
pi@raspberrypi ~/resin-lite $ java -zero -jar resin-lite.jar webtest.war <br />
ResinLite starting at Tue, 08 Jan 2013 13:53:11 -0500 (EST)<br />
13-01-08 13:54:44.881 [main] INFO ResinSystem - <br />
13-01-08 13:54:44.890 [main] INFO ResinSystem - Resin-7.0.s130102 (built Wed, 02 Jan 2013 06:01:05 EST)<br />
13-01-08 13:54:44.896 [main] INFO ResinSystem - <br />
13-01-08 13:54:44.903 [main] INFO ResinSystem - Linux 3.2.27+ arm<br />
13-01-08 13:54:44.909 [main] INFO ResinSystem - OpenJDK Runtime Environment 1.7.0_03-b21, UTF-8, en<br />
13-01-08 13:54:44.916 [main] INFO ResinSystem - OpenJDK Zero VM 22.0-b10, 32, mixed mode, Oracle Corporation<br />
13-01-08 13:54:44.922 [main] INFO ResinSystem - <br />
13-01-08 13:54:44.931 [main] INFO ResinSystem - user.name = pi<br />
13-01-08 13:54:47.206 [main] INFO ServletService - <br />
13-01-08 13:54:47.213 [main] INFO ServletService - resin.home = /home/pi/resin-lite<br />
13-01-08 13:54:47.219 [main] INFO ServletService - resin.root = /home/pi/resin-lite<br />
13-01-08 13:54:47.232 [main] INFO ServletService - resin.conf = /home/pi/resin-lite/conf/resin.conf<br />
13-01-08 13:54:47.236 [main] INFO ServletService - <br />
13-01-08 13:54:47.243 [main] INFO ServletService - server = 127.0.0.1:-1 (:default)<br />
13-01-08 13:54:47.249 [main] INFO ServletService - stage = production<br />
13-01-08 13:54:49.206 [main] INFO Host - Host[production/host/default] active<br />
13-01-08 13:54:49.225 [main] INFO ServletService - ServletService[id=default,cluster=] active<br />
13-01-08 13:54:49.257 [main] INFO NetworkListenSystem - <br />
13-01-08 13:54:49.397 [main] INFO TcpPort - http listening to *:8080<br />
13-01-08 13:54:50.740 [main] INFO NetworkListenSystem - <br />
13-01-08 13:54:50.785 [main] INFO Resin - ResinEmbeddedLite[id=default] started in 25338ms<br />
13-01-08 13:55:30.871 [main] WARNING WebApp - java.lang.InternalError: NYI<br />
at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252)<br />
at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208)<br />
at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760)<br />
at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:842)<br />
at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:820)<br />
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:889)<br />
at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.<init>(AdapterMethodHandle.java:568)<br />
at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556)<br />
at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95)<br />
at java.lang.invoke.MethodHandles$Lookup.accessStatic(MethodHandles.java:592)<br />
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:587)<br />
at sun.invoke.util.ValueConversions$LazyStatics.<clinit>(ValueConversions.java:694)<br />
at sun.invoke.util.ValueConversions.buildArrayProducer(ValueConversions.java:1176)<br />
at sun.invoke.util.ValueConversions.varargsArray(ValueConversions.java:1164)<br />
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:888)<br />
at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.<init>(AdapterMethodHandle.java:568)<br />
at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556)<br />
at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95)<br />
at java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:963)<br />
at com.caucho.config.attribute.SetterAttribute.<init>(SetterAttribute.java:55)<br />
at com.caucho.config.type.InlineBeanType.addProp(InlineBeanType.java:892)<br />
at com.caucho.config.type.InlineBeanType.introspectMethods(InlineBeanType.java:847)<br />
at com.caucho.config.type.InlineBeanType.introspect(InlineBeanType.java:607)<br />
at com.caucho.config.type.ConfigType.carefulIntrospect(ConfigType.java:68)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:593)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.attribute.CreateAttribute.getConfigType(CreateAttribute.java:75)<br />
at com.caucho.config.attribute.Attribute.isProgram(Attribute.java:74)<br />
at com.caucho.config.xml.XmlConfigContext.configureChildNode(XmlConfigContext.java:452)<br />
at com.caucho.config.xml.XmlConfigContext.configureAttribute(XmlConfigContext.java:324)<br />
at com.caucho.config.program.NodeBuilderChildProgram.inject(NodeBuilderChildProgram.java:82)<br />
at com.caucho.config.program.ContainerProgram.inject(ContainerProgram.java:88)<br />
at com.caucho.config.program.ConfigProgram.configure(ConfigProgram.java:107)<br />
at com.caucho.env.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:480)<br />
at com.caucho.env.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:59)<br />
at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:684)<br />
at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:77)<br />
at com.caucho.env.deploy.DeployController.startOnInit(DeployController.java:538)<br />
at com.caucho.env.deploy.DeployContainer.update(DeployContainer.java:241)<br />
at com.caucho.env.deploy.DeployContainer.update(DeployContainer.java:223)<br />
at com.caucho.env.deploy.DeployContainer.add(DeployContainer.java:87)<br />
at com.caucho.server.webapp.WebAppContainer.addWebApp(WebAppContainer.java:413)<br />
at com.caucho.resin.ResinEmbed.deployWebApplication(ResinEmbed.java:581)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:380)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
<br />
13-01-08 13:56:11.043 [http://*:8080-3] INFO WebApp - WebApp[production/webapp/default/ROOT] stopping<br />
13-01-08 13:56:15.778 [http://*:8080-3] WARNING JniTroubleshoot - Unable to find native library 'resin_os' for com.caucho.loader.ClassEntry. Resin expects to find this library in:<br />
(Unix) /home/pi/resin-lite/libexec/libresin_os.so<br />
On Unix, run ./configure --prefix=`pwd`; make; make install.<br />
<br />
The JVM exception was: java.lang.UnsatisfiedLinkError: Can't load library: /home/pi/resin-lite/webtest/libexec/libresin_os.so<br />
<br />
13-01-08 13:56:16.680 [http://*:8080-3] WARNING DynamicClassLoader - java.lang.NoClassDefFoundError: javax/faces/application/ViewHandlerWrapper<br />
while loading com.caucho.server.cdi.ConversationJsfViewHandler (in RootDynamicClassLoader[])<br />
13-01-08 13:56:17.119 [http://*:8080-3] INFO WebApp - WebApp[production/webapp/default/ROOT] active<br />
13-01-08 13:56:18.999 [http://*:8080-2] INFO TldManager - Loading .tld files from global classpath<br />
<br />
=== Resin Lite on Cacao ===<br />
<br />
Resin fails to startup on Cacao. Log below...<br />
<br />
pi@raspberrypi ~/resin-lite $ java -cacao -jar resin-lite.jar webtest.war <br />
ResinLite starting at Tue, 08 Jan 2013 14:06:02 -0500 (EST)<br />
LOG: [0x4007a000] jmm_GetMemoryManagers: FIX ME!<br />
LOG: [0x4007a000] jmm_GetMemoryPools: FIX ME!<br />
LOG: [0x4007a000] jmm_GetBoolAttribute: Unknown attribute 24<br />
LOG: [0x4007a000] jmm_GetBoolAttribute: Unknown attribute 25<br />
LOG: [0x4007a000] jmm_GetMemoryUsage: IMPLEMENT ME!<br />
java.lang.NullPointerException<br />
at java.lang.Throwable.fillInStackTrace(Throwable.java:782)<br />
at java.lang.Throwable.<init>(Throwable.java:250)<br />
at java.lang.Exception.<init>(Exception.java:54)<br />
at java.lang.RuntimeException.<init>(RuntimeException.java:51)<br />
at java.lang.NullPointerException.<init>(NullPointerException.java:60)<br />
at com.caucho.db.block.BlockManager.getMaxMemory(BlockManager.java:135)<br />
at com.caucho.db.block.BlockManager.defaultCapacity(BlockManager.java:104)<br />
at com.caucho.db.block.BlockManager.create(BlockManager.java:89)<br />
at com.caucho.server.resin.ResinDelegate$BlockManagerMemoryFreeTask.<init>(ResinDelegate.java:396)<br />
at com.caucho.server.resin.ResinDelegate.addPreTopologyServices(ResinDelegate.java:380)<br />
at com.caucho.server.resin.Resin.preConfigureInit(Resin.java:760)<br />
at com.caucho.server.resin.Resin.<init>(Resin.java:248)<br />
at com.caucho.server.resin.ResinEmbedded.<init>(ResinEmbedded.java:46)<br />
at com.caucho.server.resin.ResinEmbeddedLite.<init>(ResinEmbeddedLite.java:41)<br />
at com.caucho.resin.ResinLite.createResin(ResinLite.java:109)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:335)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
Exception in thread "main" java.lang.UnsatisfiedLinkError: registerNatives<br />
at java.lang.Throwable.fillInStackTrace(Throwable.java:782)<br />
at java.lang.Throwable.<init>(Throwable.java:265)<br />
at java.lang.Error.<init>(Error.java:70)<br />
at java.lang.LinkageError.<init>(LinkageError.java:55)<br />
at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java:54)<br />
at java.lang.invoke.MethodHandleNatives.<clinit>(MethodHandleNatives.java:127)<br />
at java.lang.invoke.MemberName.<init>(MemberName.java:352)<br />
at java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:960)<br />
at com.caucho.config.attribute.SetterAttribute.<init>(SetterAttribute.java:55)<br />
at com.caucho.config.type.InlineBeanType.addProp(InlineBeanType.java:892)<br />
at com.caucho.config.type.InlineBeanType.introspectMethods(InlineBeanType.java:847)<br />
at com.caucho.config.type.InlineBeanType.introspect(InlineBeanType.java:607)<br />
at com.caucho.config.type.ConfigType.carefulIntrospect(ConfigType.java:68)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:593)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.xml.XmlBeanAttribute.<init>(XmlBeanAttribute.java:57)<br />
at com.caucho.config.xml.XmlBeanAttribute.<clinit>(XmlBeanAttribute.java:49)<br />
at com.caucho.config.type.EnvironmentBeanType.<init>(EnvironmentBeanType.java:57)<br />
at com.caucho.config.type.TypeFactory.createType(TypeFactory.java:626)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:586)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:183)<br />
at com.caucho.config.xml.XmlConfigContext.configure(XmlConfigContext.java:241)<br />
at com.caucho.config.Config.configure(Config.java:324)<br />
at com.caucho.config.Config.configure(Config.java:254)<br />
at com.caucho.server.resin.BootConfig.configureFile(BootConfig.java:132)<br />
at com.caucho.server.resin.Resin.configureFile(Resin.java:1023)<br />
at com.caucho.resin.ResinEmbed.initConfig(ResinEmbed.java:520)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:344)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
<br />
=== Resin on JamVm ===<br />
<br />
Resin fails to startup on JamVM. Log below:<br />
<br />
pi@raspberrypi ~/resin-lite $ java -jamvm -jar resin-lite.jar webtest.war <br />
ResinLite starting at Tue, 08 Jan 2013 14:08:34 -0500 (EST)<br />
jmm_GetBoolAttribute: Unknown attribute 24<br />
jmm_GetBoolAttribute: Unknown attribute 25<br />
jmm_GetMemoryUsage<br />
java.lang.NullPointerException<br />
at com.caucho.db.block.BlockManager.getMaxMemory(BlockManager.java:135)<br />
at com.caucho.db.block.BlockManager.defaultCapacity(BlockManager.java:104)<br />
at com.caucho.db.block.BlockManager.create(BlockManager.java:89)<br />
at com.caucho.server.resin.ResinDelegate$BlockManagerMemoryFreeTask.<init>(ResinDelegate.java:396)<br />
at com.caucho.server.resin.ResinDelegate.addPreTopologyServices(ResinDelegate.java:380)<br />
at com.caucho.server.resin.Resin.preConfigureInit(Resin.java:760)<br />
at com.caucho.server.resin.Resin.<init>(Resin.java:248)<br />
at com.caucho.server.resin.ResinEmbedded.<init>(ResinEmbedded.java:46)<br />
at com.caucho.server.resin.ResinEmbeddedLite.<init>(ResinEmbeddedLite.java:41)<br />
at com.caucho.resin.ResinLite.createResin(ResinLite.java:109)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:335)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
Exception in thread "main" java.lang.UnsatisfiedLinkError: registerNatives<br />
at java.lang.invoke.MethodHandleNatives.registerNatives(Native Method)<br />
at java.lang.invoke.MethodHandleNatives.<clinit>(MethodHandleNatives.java:127)<br />
at java.lang.invoke.MemberName.<init>(MemberName.java:352)<br />
at java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:960)<br />
at com.caucho.config.attribute.SetterAttribute.<init>(SetterAttribute.java:55)<br />
at com.caucho.config.type.InlineBeanType.addProp(InlineBeanType.java:892)<br />
at com.caucho.config.type.InlineBeanType.introspectMethods(InlineBeanType.java:847)<br />
at com.caucho.config.type.InlineBeanType.introspect(InlineBeanType.java:607)<br />
at com.caucho.config.type.ConfigType.carefulIntrospect(ConfigType.java:68)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:593)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.xml.XmlBeanAttribute.<init>(XmlBeanAttribute.java:57)<br />
at com.caucho.config.xml.XmlBeanAttribute.<clinit>(XmlBeanAttribute.java:49)<br />
at com.caucho.config.type.EnvironmentBeanType.<init>(EnvironmentBeanType.java:57)<br />
at com.caucho.config.type.TypeFactory.createType(TypeFactory.java:626)<br />
at com.caucho.config.type.TypeFactory.getConfigTypeImpl(TypeFactory.java:586)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:193)<br />
at com.caucho.config.type.TypeFactory.getType(TypeFactory.java:183)<br />
at com.caucho.config.xml.XmlConfigContext.configure(XmlConfigContext.java:241)<br />
at com.caucho.config.Config.configure(Config.java:324)<br />
at com.caucho.config.Config.configure(Config.java:254)<br />
at com.caucho.server.resin.BootConfig.configureFile(BootConfig.java:132)<br />
at com.caucho.server.resin.Resin.configureFile(Resin.java:1023)<br />
at com.caucho.resin.ResinEmbed.initConfig(ResinEmbed.java:520)<br />
at com.caucho.resin.ResinEmbed.start(ResinEmbed.java:344)<br />
at com.caucho.resin.ResinLite.main(ResinLite.java:82)<br />
<br />
=== Resin Lite on Oracle JDK 7 ===<br />
<br />
Resin starts up with warning and seems to run OK on Oracle JDK 7. I can't use -server, but that was already established previously and not required anyway.<br />
<br />
It's complaining about missing a JSF library, which it is since I did not include javax.faces jar. Log below...<br />
<br />
pi@raspberrypi ~/resin-lite $ /usr/jdk1.7.0_10/bin/java -jar resin-lite.jar webtest.war <br />
ResinLite starting at Tue, 08 Jan 2013 14:23:39 -0500 (EST)<br />
13-01-08 14:24:00.274 [main] INFO ResinSystem - <br />
13-01-08 14:24:00.283 [main] INFO ResinSystem - Resin-7.0.s130102 (built Wed, 02 Jan 2013 06:01:05 EST)<br />
13-01-08 14:24:00.288 [main] INFO ResinSystem - <br />
13-01-08 14:24:00.300 [main] INFO ResinSystem - Linux 3.2.27+ arm<br />
13-01-08 14:24:00.307 [main] INFO ResinSystem - Java(TM) SE Runtime Environment 1.7.0_10-b18, UTF-8, en<br />
13-01-08 14:24:00.319 [main] INFO ResinSystem - Java HotSpot(TM) Client VM 23.6-b04, 32, mixed mode, Oracle Corporation<br />
13-01-08 14:24:00.324 [main] INFO ResinSystem - <br />
13-01-08 14:24:00.330 [main] INFO ResinSystem - user.name = pi<br />
13-01-08 14:24:01.998 [main] INFO Table - Table[mnode:2] validating indexes due to unclean shutdown.<br />
13-01-08 14:24:02.285 [main] INFO Table - Table[data:3] validating indexes due to unclean shutdown.<br />
13-01-08 14:24:02.668 [main] INFO ServletService - <br />
13-01-08 14:24:02.673 [main] INFO ServletService - resin.home = /home/pi/resin-lite<br />
13-01-08 14:24:02.679 [main] INFO ServletService - resin.root = /home/pi/resin-lite<br />
13-01-08 14:24:02.696 [main] INFO ServletService - resin.conf = /home/pi/resin-lite/conf/resin.conf<br />
13-01-08 14:24:02.702 [main] INFO ServletService - <br />
13-01-08 14:24:02.727 [main] INFO ServletService - server = 127.0.0.1:-1 (:default)<br />
13-01-08 14:24:02.734 [main] INFO ServletService - stage = production<br />
13-01-08 14:24:05.028 [main] INFO Host - Host[production/host/default] active<br />
13-01-08 14:24:05.042 [main] INFO ServletService - ServletService[id=default,cluster=] active<br />
13-01-08 14:24:05.064 [main] INFO NetworkListenSystem - <br />
13-01-08 14:24:05.169 [main] INFO TcpPort - http listening to *:8080<br />
13-01-08 14:24:06.096 [main] INFO NetworkListenSystem - <br />
13-01-08 14:24:06.139 [main] INFO Resin - ResinEmbeddedLite[id=default] started in 21030ms<br />
13-01-08 14:24:10.427 [main] WARNING JniTroubleshoot - Unable to find native library 'resin_os' for com.caucho.loader.ClassEntry. Resin expects to find this library in:<br />
(Unix) /home/pi/resin-lite/libexec/libresin_os.so<br />
On Unix, run ./configure --prefix=`pwd`; make; make install.<br />
<br />
The JVM exception was: java.lang.UnsatisfiedLinkError: Can't load library: /home/pi/resin-lite/webtest/libexec/libresin_os.so<br />
<br />
13-01-08 14:24:11.904 [main] WARNING DynamicClassLoader - java.lang.NoClassDefFoundError: javax/faces/application/ViewHandlerWrapper<br />
while loading com.caucho.server.cdi.ConversationJsfViewHandler (in RootDynamicClassLoader[])<br />
13-01-08 14:24:12.217 [main] INFO WebApp - WebApp[production/webapp/default/ROOT] active<br />
13-01-08 14:27:18.415 [http://*:8080-4] INFO TldManager - Loading .tld files from global classpath<br />
<br />
= Wireless =<br />
<br />
I purchased this [http://adafruit.com/products/814 cute little USB Wifi adapter from Adafruit] for only $12. What a pain to setup if you don't use outdated WEP or WPA wireless networking. I use WPA2 with AES/CCMP (like everyone really really should be). Here's my config that finally worked using Raspbian Wheezy 2012-12-16 (not Occidentalis). (At the time of writing this, Occidentalis is a few releases behind Raspbian. Plus I was getting very weird keyboard ghosting using Occidentalis. Not sure why but it doesn't happen with Rasbian.)<br />
<br />
I did NOT have to install any drivers.<br />
<br />
pi@raspberrypi ~ $ cat /etc/network/interfaces <br />
auto lo<br />
<br />
iface lo inet loopback<br />
iface eth0 inet dhcp<br />
<br />
allow-hotplug wlan0<br />
iface wlan0 inet manual<br />
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf<br />
iface default inet dhcp<br />
<br />
pi@raspberrypi ~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf <br />
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev<br />
update_config=1<br />
<br />
network={<br />
ssid="your_sid"<br />
#psk="wireless password"<br />
psk=generated_by_wpa_passphrase<br />
proto=RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP<br />
auth_alg=OPEN<br />
}<br />
<br />
I found you can put your wireless password in for "psk", but I don't like having passwords in clear text. So run "wpa_passphrase <sid> <password>" it generates a psk you can use instead<br />
<br />
wpa_supplicant reference: [http://www.lsi.upc.edu/lclsi/Manuales/wireless/files/wpa_supplicant.conf]<br />
<br />
pi@raspberrypi ~ $ sudo ifconfig -a<br />
eth0 Link encap:Ethernet HWaddr b8:27:eb:c7:9c:8a <br />
UP BROADCAST MULTICAST MTU:1500 Metric:1<br />
RX packets:10621 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:3979 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000 <br />
RX bytes:4256838 (4.0 MiB) TX bytes:533647 (521.1 KiB)<br />
<br />
lo Link encap:Local Loopback <br />
inet addr:127.0.0.1 Mask:255.0.0.0<br />
UP LOOPBACK RUNNING MTU:16436 Metric:1<br />
RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:0 <br />
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)<br />
<br />
wlan0 Link encap:Ethernet HWaddr 00:e0:4c:10:47:f2 <br />
inet addr:192.168.1.16 Bcast:192.168.1.255 Mask:255.255.255.0<br />
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br />
RX packets:4761 errors:0 dropped:7099 overruns:0 frame:0<br />
TX packets:237 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000 <br />
RX bytes:915418 (893.9 KiB) TX bytes:39607 (38.6 KiB)<br />
<br />
= sddd =<br />
<br />
I've written a nice little script for OSX to help in imaging an SD card. See [[sddd| sdd - Paul's dd for SD Card script for OSX]]<br />
<br />
</font></div>Cowanhttp://wiki4.caucho.com/File:Sddd.tar.gzFile:Sddd.tar.gz2013-02-08T00:00:00Z<p>Cowan: uploaded a new version of &quot;File:Sddd.tar.gz&quot;</p>
<hr />
<div></div>Cowanhttp://wiki4.caucho.com/SdddSddd2013-02-08T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
= sddd - OSX SD Card Imaging Script =<br />
<br />
sddd is a shell script to make writing disk images to raw devices easier, less error prone, and more informative.<br />
<br />
sddd distinguishes itself from standard "dd" because it provides constant graphical feedback while writing to the disk. dd is notorious for providing no feedback about what it's doing until complete.<br />
<br />
This makes it great for writing Raspberry Pi images to an SD card, but it should work for writing to a USB drive also.<br />
<br />
== Requirements ==<br />
<br />
* OSX<br />
* SD card reader<br />
* diskutil (included with OSX)<br />
* dd (included with OSX)<br />
* pv (NOT included with OSX, get it from the [http://www.macports.org/ MacPorts Project])<br />
<br />
To get pv install [http://www.macports.org/ MacPort]. After MacPorts is installed, install pv via 'sudo port install pv'.<br />
<br />
== Download ==<br />
<br />
<table border="1" cellspacing="0" cellpadding="10"><br />
<tr><br />
<td>[[Media:Sddd.tar.gz|sddd.tar.gz]]</td><br />
<td>v1.1</td><br />
<td>02/08/2013</td><br />
</tr><br />
</table><br />
<br />
== Instructions ==<br />
<br />
# Download and save Sddd.tar.gz to your home directory<br />
# Open command prompt and extract it (tar xvfz Sddd.tar.gz)<br />
# Make sddd executable if it's not already (chmod u+x sddd)<br />
# Execute sddd as ./sddd <disk.img> [<SD card device>]<br />
<br />
== Usage ==<br />
<br />
* '''The first parameter is the disk image file.'''<br />
* '''The 2nd parameter (optional) is the disk device to write to. If not specified, sddd will prompt you to enter the device.'''<br />
<br />
molson:~ paul$ ./sddd<br />
sddd: usage : sddd <source image> [<disk>]<br />
example : sudo ./sddd 2012-12-16-wheezy-raspbian.img disk2<br />
<br />
== Example ==<br />
<br />
molson:~ paul$ sudo ./sddd Downloads/2012-12-16-wheezy-raspbian.img<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
Enter the SD card disk (disk0/disk1/disk2/disk3) ? disk2<br />
WARNING: disk2 appears to be mounted, shall I unmount /dev/disk2 (y/n)? y<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
WARNING: Writing to the wrong device will ruin your hard drive! Make sure you have entered SD card disk!<br />
Write Downloads/2012-12-16-wheezy-raspbian.img to disk2 (y/n)? y<br />
Writing Downloads/2012-12-16-wheezy-raspbian.img to disk2...<br />
1.81GiB 0:04:10 [7.38MiB/s] [================================>] 100% <br />
0+30689 records in<br />
0+30689 records out<br />
1939865600 bytes transferred in 250.811770 secs (7734348 bytes/sec)<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful</div>Cowanhttp://wiki4.caucho.com/SdddSddd2013-02-08T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
= sddd - OSX SD Card Imaging Script =<br />
<br />
sddd is a shell script to make writing disk images to raw devices easier, less error prone, and more informative.<br />
<br />
sddd distinguishes itself from standard "dd" because it provides constant graphical feedback while writing to the disk. dd is notorious for providing no feedback about what it's doing until complete.<br />
<br />
This makes it great for writing Raspberry Pi images to an SD card, but it should work for writing to a USB drive also.<br />
<br />
== Requirements ==<br />
<br />
* OSX<br />
* SD card reader<br />
* diskutil (included with OSX)<br />
* dd (included with OSX)<br />
* pv (NOT included with OSX, get it from the [http://www.macports.org/ MacPorts Project])<br />
<br />
To get pv install [http://www.macports.org/ MacPort]. After MacPorts is installed, install pv via 'sudo port install pv'.<br />
<br />
== Download ==<br />
<br />
<table border="1" cellspacing="0" cellpadding="10"><br />
<tr><br />
<td>[[Media:Sddd.tar.gz|sddd.tar.gz]]</td><br />
<td>v1.1</td><br />
</tr><br />
</table><br />
<br />
== Instructions ==<br />
<br />
# Download and save Sddd.tar.gz to your home directory<br />
# Open command prompt and extract it (tar xvfz Sddd.tar.gz)<br />
# Make sddd executable if it's not already (chmod u+x sddd)<br />
# Execute sddd as ./sddd <disk.img> [<SD card device>]<br />
<br />
== Usage ==<br />
<br />
* '''The first parameter is the disk image file.'''<br />
* '''The 2nd parameter (optional) is the disk device to write to. If not specified, sddd will prompt you to enter the device.'''<br />
<br />
molson:~ paul$ ./sddd<br />
sddd: usage : sddd <source image> [<disk>]<br />
example : sudo ./sddd 2012-12-16-wheezy-raspbian.img disk2<br />
<br />
== Example ==<br />
<br />
molson:~ paul$ sudo ./sddd Downloads/2012-12-16-wheezy-raspbian.img<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
Enter the SD card disk (disk0/disk1/disk2/disk3) ? disk2<br />
WARNING: disk2 appears to be mounted, shall I unmount /dev/disk2 (y/n)? y<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
WARNING: Writing to the wrong device will ruin your hard drive! Make sure you have entered SD card disk!<br />
Write Downloads/2012-12-16-wheezy-raspbian.img to disk2 (y/n)? y<br />
Writing Downloads/2012-12-16-wheezy-raspbian.img to disk2...<br />
1.81GiB 0:04:10 [7.38MiB/s] [================================>] 100% <br />
0+30689 records in<br />
0+30689 records out<br />
1939865600 bytes transferred in 250.811770 secs (7734348 bytes/sec)<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful</div>Cowanhttp://wiki4.caucho.com/File:Sddd.tar.gzFile:Sddd.tar.gz2013-02-08T00:00:00Z<p>Cowan: uploaded a new version of &quot;File:Sddd.tar.gz&quot;</p>
<hr />
<div></div>Cowanhttp://wiki4.caucho.com/SdddSddd2013-02-07T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
= sddd - OSX SD Card Imaging Script =<br />
<br />
sddd is a shell script to make writing disk images to raw device easier, less error prone, and more informative.<br />
<br />
sddd distinguishes itself from standard "dd" because it provides constant graphical feedback while writing to the disk. dd is notorious for providing no feedback about what it's doing until complete.<br />
<br />
This makes it great for writing Raspberry Pi images to an SD card, but it should work for writing to a USB drive also.<br />
<br />
== Requirements ==<br />
<br />
* OSX<br />
* SD card reader<br />
* diskutil (included with OSX)<br />
* dd (included with OSX)<br />
* pv (NOT included with OSX, get it from the [http://www.macports.org/ MacPorts Project])<br />
<br />
To get pv install [http://www.macports.org/ MacPort]. After MacPorts is installed, install pv via 'sudo port install pv'.<br />
<br />
== Download ==<br />
<br />
<table border="1" cellspacing="0" cellpadding="10"><br />
<tr><br />
<td>[[Media:Sddd.tar.gz|sddd.tar.gz]]</td><br />
<td>v1.0</td><br />
</tr><br />
</table><br />
<br />
== Instructions ==<br />
<br />
# Download and save sddd.tar.gz to your home directory<br />
# Open command prompt and extract it (tar xvfz sdd.tar.gz)<br />
# Make sddd executable if it not already (chmod u+x sddd)<br />
# Execute sddd as ./sddd <.img file> [<SD card device>]<br />
<br />
== Usage ==<br />
<br />
* '''The first parameter is the disk image file.'''<br />
* '''The 2nd parameter (optional) is the disk device to write to. If not specified, sddd will prompt you to enter the device.'''<br />
<br />
molson:~ paul$ ./sddd<br />
sddd: usage : sddd <source image> [<disk>]<br />
example : sudo ./sddd 2012-12-16-wheezy-raspbian.img disk2<br />
<br />
== Example ==<br />
<br />
molson:~ paul$ sudo ./sddd Downloads/2012-12-16-wheezy-raspbian.img<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
Enter the SD card disk (disk0/disk1/disk2/disk3) ? disk2<br />
WARNING: disk2 appears to be mounted, shall I unmount /dev/disk2 (y/n)? y<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
WARNING: Writing to the wrong device will ruin your hard drive! Make sure you have entered SD card disk!<br />
Write Downloads/2012-12-16-wheezy-raspbian.img to disk2 (y/n)? y<br />
Writing Downloads/2012-12-16-wheezy-raspbian.img to disk2...<br />
1.81GiB 0:04:10 [7.38MiB/s] [================================>] 100% <br />
0+30689 records in<br />
0+30689 records out<br />
1939865600 bytes transferred in 250.811770 secs (7734348 bytes/sec)</div>Cowanhttp://wiki4.caucho.com/SdddSddd2013-02-07T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
= sddd - OSX SD Card Imaging Script =<br />
<br />
sddd is a shell script to make writing disk images to raw device easier, less error prone, and more informative.<br />
<br />
sddd distinguishes itself from standard "dd" because it provides constant graphical feedback while writing to the disk. dd is notorious for providing no feedback about what it's doing until complete.<br />
<br />
This makes it great for writing Raspberry Pi images to an SD card, but it should work for writing to a USB drive also.<br />
<br />
== Requirements ==<br />
<br />
* OSX<br />
* SD card reader<br />
* diskutil (included with OSX)<br />
* dd (included with OSX)<br />
* pv (NOT included with OSX, get it from the [http://www.macports.org/ MacPorts Project])<br />
<br />
To get pv install [http://www.macports.org/ MacPort]. After MacPorts is installed, install pv via 'sudo port install pv'.<br />
<br />
== Download ==<br />
<br />
<table border="1" cellspacing="0" cellpadding="10"><br />
<tr><br />
<td>[[Media:Sddd.tar.gz|sddd.tar.gz]]</td><br />
<td>v1.0</td><br />
</tr><br />
</table><br />
<br />
== Instructions ==<br />
<br />
# Download and save sddd to your home directory<br />
# Open command prompt, and make sddd execututable (chmod u+x sddd)<br />
# Execute sddd as ./sddd <.img file> [<SD card device>]<br />
<br />
== Usage ==<br />
<br />
* '''The first parameter is the disk image file.'''<br />
* '''The 2nd parameter (optional) is the disk device to write to. If not specified, sddd will prompt you to enter the device.'''<br />
<br />
molson:~ paul$ ./sddd<br />
sddd: usage : sddd <source image> [<disk>]<br />
example : sudo ./sddd 2012-12-16-wheezy-raspbian.img disk2<br />
<br />
== Example ==<br />
<br />
molson:~ paul$ sudo ./sddd Downloads/2012-12-16-wheezy-raspbian.img<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
Enter the SD card disk (disk0/disk1/disk2/disk3) ? disk2<br />
WARNING: disk2 appears to be mounted, shall I unmount /dev/disk2 (y/n)? y<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
WARNING: Writing to the wrong device will ruin your hard drive! Make sure you have entered SD card disk!<br />
Write Downloads/2012-12-16-wheezy-raspbian.img to disk2 (y/n)? y<br />
Writing Downloads/2012-12-16-wheezy-raspbian.img to disk2...<br />
1.81GiB 0:04:10 [7.38MiB/s] [================================>] 100% <br />
0+30689 records in<br />
0+30689 records out<br />
1939865600 bytes transferred in 250.811770 secs (7734348 bytes/sec)</div>Cowanhttp://wiki4.caucho.com/SdddSddd2013-02-07T00:00:00Z<p>Cowan: </p>
<hr />
<div>{{Embedded}} {{Raspi}}<br />
<br />
= sddd - OSX SD Card Imaging Script =<br />
<br />
sddd is a shell script to make writing disk images to raw device easier, less error prone, and more informative.<br />
<br />
sddd distinguishes itself from standard "dd" because it provides constant graphical feedback while writing to the disk. dd is notorious for providing no feedback about what it's doing until complete.<br />
<br />
This makes it great for writing Raspberry Pi images to an SD card, but it should work for writing to a USB drive also.<br />
<br />
== Requirements ==<br />
<br />
* OSX<br />
* SD card reader<br />
* diskutil (included with OSX)<br />
* dd (included with OSX)<br />
* pv (NOT included with OSX, get it from the [http://www.macports.org/ MacPorts Project])<br />
<br />
To get pv install [http://www.macports.org/ MacPort]. After MacPorts is installed, install pv via 'sudo port install pv'.<br />
<br />
== Download ==<br />
<br />
[[Media:Sddd.tar.gz|sddd.tar.gz]] v1.0<br />
<br />
== Instructions ==<br />
<br />
1. Download and save sddd to your home directory<br />
2. Open command prompt, and make sddd execututable (chmod u+x sddd)<br />
3. Execute sddd as ./sddd <.img file> [<SD card device>]<br />
<br />
== Usage ==<br />
<br />
The first parameter is the image file.<br />
The optional 2nd parameter is the disk device to write to. If not specified, sddd will prompt you to enter the device.<br />
<br />
molson:~ paul$ ./sddd<br />
sddd: usage : sddd <source image> [<disk>]<br />
example : sudo ./sddd 2012-12-16-wheezy-raspbian.img disk2<br />
<br />
== Example ==<br />
<br />
molson:~ paul$ sudo ./sddd Downloads/2012-12-16-wheezy-raspbian.img<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
Enter the SD card disk (disk0/disk1/disk2/disk3) ? disk2<br />
WARNING: disk2 appears to be mounted, shall I unmount /dev/disk2 (y/n)? y<br />
Unmounting /dev/disk2...<br />
Unmount of all volumes on disk2 was successful<br />
/dev/disk0<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: GUID_partition_scheme *250.1 GB disk0<br />
1: EFI 209.7 MB disk0s1<br />
2: Apple_HFS Macintosh HD 249.2 GB disk0s2<br />
3: Apple_Boot Recovery HD 650.0 MB disk0s3<br />
/dev/disk2<br />
#: TYPE NAME SIZE IDENTIFIER<br />
0: FDisk_partition_scheme *8.1 GB disk2<br />
1: Windows_FAT_32 58.7 MB disk2s1<br />
2: Linux 1.9 GB disk2s2<br />
<br />
WARNING: Writing to the wrong device will ruin your hard drive! Make sure you have entered SD card disk!<br />
Write Downloads/2012-12-16-wheezy-raspbian.img to disk2 (y/n)? y<br />
Writing Downloads/2012-12-16-wheezy-raspbian.img to disk2...<br />
1.81GiB 0:04:10 [7.38MiB/s] [================================>] 100% <br />
0+30689 records in<br />
0+30689 records out<br />
1939865600 bytes transferred in 250.811770 secs (7734348 bytes/sec)</div>Cowan