Android + Java + Heroku + JAX-RS

Spring MVC Hibernate Heroku
Embedded JETTY
Embedded Play
JAX RS

CSS Links

Sending Email With Java (Beware)

I turn on debugging to trace what’s going on. All looks good but one email bounces back after a day and some hotmail and gmails just vanish.

To test a mail server from one of our UNIX servers:

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.util.*;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
public class Mail {

 /// example command line run
 public static void main(String[] args) {
String sArray[] = new String[] {"tim.spann@somedomain.com", "tspann@timmail.com", "tspannjava@joemail.com"};
List<String> emails = Arrays.asList(sArray);
 Iterator<String> iterator = emails.iterator();
 while (iterator.hasNext()) {
 Mail.sendEmail("test from test", "message", iterator.next() );
}
}

/**
 * size of buffer
 */
 public static final int gkBUFFER_SIZE = 256;
/**
 * getCurrentDateTime
 * @return Date current date
 */
 public final static Date getCurrentDateTime() {
 return new Date(System.currentTimeMillis());
 }

/**
 * sendEmail
 * @param subject subject of email
 * @param message message text
 * @param emailAddress email address to send to
 * @return String log of errors/status
 */
 public final static String sendEmail(String subject, String message,
 String emailAddress) {
// email sent
 boolean emailSent = true;
// email message
 StringBuffer emailLoggingMessage =
 new StringBuffer(Mail.gkBUFFER_SIZE);
// start of message
 emailLoggingMessage
 .append("Email:")
 .append(emailAddress).append(System.getProperty("line.separator"));
// Email Properties
 Properties props = new Properties();
// add properties from properties file
 props.put("mail.smtp.host",
 "mymail.mydomain.com");
 props.put("mail.debug",
 "true");
 props.put("mail.smtp.port","25");
// -- login
 props.put("mail.smtp.auth", "true");
Session session = Session.getInstance(props,
 new javax.mail.Authenticator() {
 protected PasswordAuthentication getPasswordAuthentication() {
 return new PasswordAuthentication("nt domainntid", "ntpassword");
 }
 });

// / -------------
// turn on debug mode
 session.setDebug(true);
Message msg = new MimeMessage(session);
 InternetAddress addressFrom = null;
 try {
 addressFrom =
 new InternetAddress("Timothy.Spann@SomeSenderDomain.com");
 } catch (AddressException e) {
 e.printStackTrace();
emailLoggingMessage.append(e.getLocalizedMessage()).append(
 System.getProperty("line.separator"));
 emailSent = false;
 }
 try {
 msg.setFrom(addressFrom);
 } catch (MessagingException e) {
 e.printStackTrace();
emailLoggingMessage.append(e.getLocalizedMessage()).append(
 System.getProperty("line.separator"));
 emailSent = false;
 }
// recipient
 InternetAddress addressTo = null;
 try {
 addressTo = new InternetAddress(emailAddress);
 } catch (AddressException e) {
 e.printStackTrace();
 // refactor this
 emailLoggingMessage.append(e.getLocalizedMessage()).append(
 System.getProperty("line.separator"));
 emailSent = false;
 }
// add to address as recipient
 try {
 msg.setRecipient(Message.RecipientType.TO, addressTo);
 } catch (MessagingException e) {
 e.printStackTrace();
 emailLoggingMessage.append(e.getLocalizedMessage()).append(
 System.getProperty("line.separator"));
 emailSent = false;
 }

// Setting the Subject and Content Type
 try {
 msg.setSubject(subject);
 } catch (MessagingException e) {
 e.printStackTrace();
 emailLoggingMessage.append(e.getLocalizedMessage()).append(
 System.getProperty("line.separator"));
 emailSent = false;
 }
 try {
 msg.setContent(message,"text/plain");
 } catch (MessagingException e) {
 e.printStackTrace();
 emailLoggingMessage.append(e.getLocalizedMessage()).append(
 System.getProperty("line.separator"));
 emailSent = false;
 }
 try {
 Transport.send(msg);
 } catch (MessagingException e) {
 e.printStackTrace();
 emailLoggingMessage.append(e.getLocalizedMessage()).append(
 System.getProperty("line.separator"));
 emailSent = false;
 }
// sent message
 if (emailSent) {
 emailLoggingMessage.append("Email successfully sent.")
 .append(System.getProperty("line.separator"));
 }
// return message
 return emailLoggingMessage.toString();
 }
}

I am testing on a UNIX Server with:

— mail.sh

export ANT_OPTS="-Xms2048m -Xmx2048m -XX:MaxPermSize=1024m"
export JAVA_OPTS="-server -Xms2048m -Xmx2048m -XX:MaxPermSize=1024m"
export CLASSPATH=$CLASSPATH:dsn.jar:mail.jar:mailapi.jar:pop3.jar:smtp.jar:activation.jar:imap.jar:ojdbc14.jar:runtime12.jar:.
javac Mail.java
java Mail > mail.txt 2&> mailerr.txt

Debug Log

DEBUG: JavaMail version 1.4.4
DEBUG: URL jar:file:/home/tspann/mail/pop3.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: jar:file:/home/tspann/mail/pop3.jar!/META-INF/javamail.providers
DEBUG: URL jar:file:/home/tspann/mail/smtp.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: jar:file:/home/tspann/mail/smtp.jar!/META-INF/javamail.providers
DEBUG: URL jar:file:/home/tspann/mail/imap.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: jar:file:/home/tspann/mail/imap.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name:
{com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc],
com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc],
com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc],
com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc],
com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc],
com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc],
imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,
com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsy stems, Inc],
smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc],
pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: URL jar:file:/home/tspann/mail/smtp.jar!/META-INF/javamail.address.map
DEBUG: successfully loaded resource: jar:file:/home/tspann/mail/smtp.jar!/META-INF/javamail.address.map
DEBUG: setDebug: JavaMail version 1.4.4
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "SomeSenderDomain.com", port 25, isSSL false
220 SomeSenderDomain.com SMTP Ready.
DEBUG SMTP: connected to host "SomeSenderDomain.com", port: 25

EHLO timspann.cool.com
250-ESMTP Server Ready
250-SIZE 0
250-DSN
250-STARTTLS
250 TLS
DEBUG SMTP: Found extension "SIZE", arg "0"
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "TLS", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<Timothy.Spann@SomeSenderDomain.com>
250 +OK Sender OK
RCPT TO:<tim.spann@somedomain.com>
250 +OK Recipient OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP: tim.spann@somedomain.com
DATA
354 Start mail input, end with '<CR><LF>.<CR><LF>'
From: Timothy.Spann@SomeSenderDomain.com
To: tim.spann@somedomain.com
Message-ID: <117704452.0.1350396539475.JavaMail.tspann@tspann.cool.com>
Subject: test from test
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

message
.
250 +OK message queued for delivery.
QUIT
221 Service closing transmission channel closing connection

Issues with IBM AIX Websphere JDK

JavaMail API
Transport
FSQ
Javamail Summary
Javamail Docs
Javamail Docs2
Javamail Readme
SMTP Package Summary
JavaMail without a server
JavaMail

IBM Issues with SSL TLS / GMAIL

Thin Client
IBM WAS security

java.security file at /base_v61/java/jre/lib/security

Port 25
Gmail Ports
SMTP
SMTP Errors
Javamail with SMTPS/SSL
Gmail SMTP using SSL
Javamail to Hotmail
SSL – Android
STARTTTLS
Javamail from Websphere
Sending Gmail
SSL Error Certificate
IBM Support
IBM Support
IBM Support

Javamail with TLS on AIX

SSL

 

Update Using Apache Commons Email (thanks DZONE Readers)

	/**
	 * 
	 * @param subject
	 * @param message
	 * @param emailAddress
	 * @return
	 */
	public final static String sendEmail(String subject, String message, String emailAddress) {
		// email sent
		boolean emailSent = false;

		// email message
		StringBuilder emailLoggingMessage =
				new StringBuilder(UserProvisioningUtility.gkBUFFER_SIZE);

		// start of message
		emailLoggingMessage
				.append(Messages.getString("UserProvisioningProcess.SMTP_MESSAGE_LOG"))
				.append(emailAddress).append(System.getProperty("line.separator"));

		Email email = new SimpleEmail();
		//email.setHostName("smtp.googlemail.com");
		//email.setSmtpPort(465);
		email.setHostName(Messages.getString("UserProvisioningProcess.EMAIL_SERVER"));

		int smtpPort = 25;
		if ( null != Messages.getString("UserProvisioningProcess.EMAIL_PORT")) {
			try {
				smtpPort = Integer.parseInt(Messages.getString("UserProvisioningProcess.EMAIL_PORT"));
			}
			catch(Throwable t) {
				emailLoggingMessage.append(t.getLocalizedMessage()).append(
						System.getProperty("line.separator"));				
			}
		}
		email.setSmtpPort(smtpPort);

//		email.setAuthenticator(new DefaultAuthenticator("username", "password"));
//		email.setSSLOnConnect(true);
		try {
			email.setFrom(Messages.getString("UserProvisioningProcess.FROM_EMAIL"));
		} catch (EmailException e) {
			emailLoggingMessage.append(e.getLocalizedMessage()).append(
					System.getProperty("line.separator"));
		}
		email.setSubject(subject);
		try {
			email.setMsg(message);
		} catch (EmailException e) {
			emailLoggingMessage.append(e.getLocalizedMessage()).append(
					System.getProperty("line.separator"));
		}
		try {
			email.addTo(emailAddress);
		} catch (EmailException e) {
			emailLoggingMessage.append(e.getLocalizedMessage()).append(
					System.getProperty("line.separator"));
		}
		try {
			email.send();
			emailSent = true;
		} catch (EmailException e) {
			emailLoggingMessage.append(e.getLocalizedMessage()).append(
					System.getProperty("line.separator"));
		}

		// sent message
		if (emailSent) {
			emailLoggingMessage.append(
					Messages.getString("UserProvisioningProcess.SMTP_MESSAGE_SENT"))
					.append(System.getProperty("line.separator"));
		}

		return emailLoggingMessage.toString();
	}

Hibernate OGM – MongoDB vs Kundera vs Jongo vs MongoDB API vs Morphia vs Spring Data Mongo – MongoDB Drivers for Java

I am working on a Spring MVC app that demonstrates all of the different MongoDB Java APIs.

Some Links
http://code.google.com/p/morphia/wiki/QuickStart

http://www.mongodb.org/display/DOCS/Java+Tutorial

http://jongo.org/#updating

https://github.com/hibernate/hibernate-ogm

https://openshift.redhat.com/community/blogs/configuring-hibernateogm-for-your-jboss-app-using-mongodb-on-openshift-paas

http://www.hibernate.org/subprojects/ogm.html

https://github.com/impetus-opensource/Kundera/wiki

https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes

http://blog.fisharefriends.us/morphia-vs-spring-data-mongodb/

http://www.ibm.com/developerworks/java/library/j-morphia/index.html

Maven POM Settings For Various Drivers

	
		morphia
		Morphia
		http://morphia.googlecode.com/svn/mavenrepo/
		default

		    sonatype-nexus
		    Kundera Public Repository
		    https://oss.sonatype.org/content/repositories/releases

			true

			false

		kundera-missing
		Kundera Public Missing Resources Repository
		http://kundera.googlecode.com/svn/maven2/maven-missing-resources

			true

			true

        com.google.code.morphia
        morphia
        0.99

        org.hibernate.ogm
        hibernate-ogm-core
        4.0.0-SNAPSHOT
        provided

	org.mongodb
	mongo-java-driver
	2.10.1

 org.springframework.data
 spring-data-mongodb
 1.0.4.RELEASE

Hibernate OGM for MongoDB
https://community.jboss.org/wiki/PortingSeamHotelBookingExampleToOGM
https://github.com/ajf8/seam-booking-ogm
https://openshift.redhat.com/community/blogs/configuring-hibernateogm-for-your-jboss-app-using-mongodb-on-openshift-paas
https://github.com/openshift/openshift-ogm-quickstart

Kundera (JPA for MongoDB)
https://github.com/impetus-opensource/Kundera-Examples/wiki/Using-Kundera-with-Spring
https://github.com/impetus-opensource/Kundera
https://github.com/impetus-opensource/kundera-mongo-performance
https://github.com/impetus-opensource/Kundera-Examples
https://github.com/impetus-opensource/Kundera/wiki/Sample-Codes-and-Examples
https://github.com/impetus-opensource/Kundera-Examples/wiki/Twitter
http://architects.dzone.com/articles/sqlifying-nosql-%E2%80%93-are-orm
https://github.com/xamry/twitample
https://github.com/impetus-opensource/Kundera-Examples/wiki/Cross-datastore-persistence-using-Kundera
http://prabhubuzz.wordpress.com/2012/05/25/mongodb-cassandra-jpa-service-using-kundera/
http://gora.apache.org/
http://xamry.wordpress.com/2011/05/02/working-with-mongodb-using-kundera/
https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes
https://github.com/impetus-opensource/Kundera/wiki/Concepts

Reading CruiseControl Information

/**
 *
 */
package dev.util.cruise.rss;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;

import javax.mail.MessagingException;

// ROME
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;

/**
 * @author spannt
 *
 *         RSS FEED of Build
 *
 *         http://localhost:8080/dashboard/rss.xml
 *
 */
public class CruiseControlStatus {

    /**
     *
     * @param url
     * @return
     */
    public static String getPage(String url) {

        StringBuilder out = new StringBuilder();

        URL myUrl = null;
        try {
            myUrl = new URL(url);
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        BufferedReader in = null;
        try {
            in = new BufferedReader(new InputStreamReader(myUrl.openStream()));
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        String line;

        try {
            while ((line = in.readLine()) != null)
                out.append(line).append(“n”);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        try {
            in.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return out.toString();
    }

    /**
     * @param args
     */
    @SuppressWarnings(“unchecked”)
    public static void main(String[] args) {

        boolean sendEmail = false;

        URL url = null;
        try {
            url = new URL(“http://localhost:8080/dashboard/rss.xml”);
        } catch (MalformedURLException e) {
            e.printStackTrace();

            System.exit(-1);
        }
        XmlReader reader = null;

        StringBuilder out = new StringBuilder();

        try {

            try {
                reader = new XmlReader(url);
            } catch (IOException e) {
                e.printStackTrace();
                System.exit(-1);
            }
            SyndFeed feed = new SyndFeedInput().build(reader);
            out.append(“nCruise Controlnn ” + feed.getLink()).append(“nn”);

            for (Iterator<SyndEntry> i = feed.getEntries().iterator(); i.hasNext();) {
                SyndEntry entry = (SyndEntry) i.next();

                /**
                 * <title>release passed Thu, 01 Nov 2012 15:34:37 -0400</title>
                 * <description>Build passed</description> <pubDate>Thu, 01 Nov
                 * 2012 15:34:37 -0400</pubDate>
                 * <link>http://localhost:8080/dashboard
                 * /tab/build/detail/release</link>
                 */
                if (entry.getTitle() != null
                        && entry.getTitle().contains(“CASS FAILED”)) {
                    sendEmail = true;
                    out.append(entry.getTitle() + “<br>n”
                            + entry.getDescription().getValue() + “<br>n”
                            + entry.getPublishedDate() + “<br>n”
                            + entry.getLink() + “<br><br>nn”);
                }
            }

            if (sendEmail) {
                // get page
                out.append(“nn”).append(
                        getPage(“http://localhost:8080/dashboard/tab/builds”));

                GoogleMail mail = new GoogleMail();
                String[] recipients = { “tim.spann@devland.dev” };
                try {
                    mail.sendSSLMessage(recipients, “Build Notification”,
                            out.toString(), “tim.spann@devland.dev”);
                } catch (MessagingException e) {
                    e.printStackTrace();
                }
            }

        } catch (IllegalArgumentException | FeedException e) {
            e.printStackTrace();
        } finally {
            if (reader != null)
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
        }
    }
}

 

Spring Tutorials – Links

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-customized-user-login-logout.html

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-service-dao-persistence.html

http://tshikatshikaaa.blogspot.com/2012/08/jpa-tutorial-with-examples-using-hibernate-standalone.html

http://tshikatshikaaa.blogspot.com/2012/10/spring-mvc-form-validation-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/09/junit-testing-spring-service-and-dao.html

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-controller-junit-testing.html

http://tshikatshikaaa.blogspot.nl/2012/09/spring-web-jpa-hibernate-in-memory.html

http://tshikatshikaaa.blogspot.com/2012/11/serving-static-resources-with-spring-mvc.html

http://tshikatshikaaa.blogspot.nl/2012/09/junit-testing-spring-service-and-dao.html

http://tshikatshikaaa.blogspot.com/2013/01/anatomy-of-default-openshift-spring-web.html

http://tshikatshikaaa.blogspot.nl/2013/01/spring-selenium-tests-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-with-http-only.html

http://www.infoq.com/presentations/Introduction-WebSocket

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-from-java.html

http://tshikatshikaaa.blogspot.com/2012/10/setting-logging-dependencies-in-spring.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-with-ajax.html

http://tshikatshikaaa.blogspot.com/2012/10/returning-json-in-spring-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/11/fetching-json-with-ajax-in-spring-mvc-context.html

http://tshikatshikaaa.blogspot.com/2012/11/introduction-to-spring-jpa-data-features.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-error-handling.html

http://www.dzone.com/links/r/caching_with_spring_data_redis.html

http://www.dzone.com/links/r/spring_mvc_how_to_use_sessionattributes_annotation.html

http://www.dzone.com/links/r/cloud_stack_of_your_dreams_bootstrap_and_spring_r.html

http://www.dzone.com/links/r/spring_roo_and_twitter_bootstrap_roostrap_for_spr.html

http://www.dzone.com/links/r/spring_transaction_propagation_tutorial.html

http://www.dzone.com/links/r/rest_services_with_jaxrs_and_spring_handling_lost.html

 

 

 

 

 

Facebook Open Graph – Links

The Days of Shell and Rational Roses

http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/

That post reminded me of why UNIX and combining simple single function programs together made UNIX (and Linux) so amazing.

My first college CGI and my first corporate one (Database America’s Yellow Pages engine) were all written in bourne shell!  I thought it was so primitive, but thinking back I was able to implement a functional, fast and solid application in only a few days.   The school project was as a simple web interface to a C++ application I wrote to do some B-Tree application for class.  I do remember making database calls through command line SQL tools and parsing the results wasn’t as clean or as safe as you would want, but that was really because the command line tools were not designed to fit into the standard UNIX change.

We eventually upgraded to Perl, which was really like ShellScript++.

I guess the takeaway here is that make small reusable components that function fast, simple and can be easily chained with other components to make a custom “tool”.  Software is just a tool even when it looks like a fancy magazine or funky website.  Hmm Pipes and Mule ESB have that same feel.  Shell was the ultimate object reuse.

So you would do the painful, slow job of writing C++, even with Rational Rose UML to help guide you, it was painful.  You had to hope you had the correct libraries and that there were free ones.  STL was a great help, but you had to buy a license.  I think we had to buy a bunch of licenses from RogueWave for database stuff as well.  Now Java, Node.Js and the rest have a ton of free libraries for everything.  Which is great, but you have to pick the right one, get it into a build script of some sort (ANT, Maven, Gradle, Rake, SBT, …), combine it with some other libraries and then write some code specific to that library.  With tools like Eclipse and NetBeans, you can automate a lot of that, but even all the libraries and frameworks that help you add bulk and complexities.  More points of failure, not an elegant connection of small tools, but a behemoth of patched together disjoint libraries.

Anyone remembermsql ? MySQL and msql competed for awhile and then MySQL crushed it..

The archive of my old Montclair State Website.

 

Nodester is now AppFog

Quickly add Java, Java Grails, PHP, Python, Ruby, Node.js, … apps.

The free one allows unlimited apps like Heroku.

It also supports a bunch of free services like OpenShift (MySQL, Postgresql, MongoDB, RabbitMQ, and Redis <- very few support this great NoSQL option).

Fast, free and a slick web GUI.

Your choice of data hosting (Amazon, Rackspace, HP or Azure) in different locations (Virginia, Europe, Asia, Dallas, Vegas and San Antonio.)

Up to 2 Gigs free, up to 8 services.

Running CloudFoundry Sample

Docs for accessing mysql

On Windows 7

af login
gem update --system gem install af
mvn clean package af update tspannjavajava gem update --system Latest version currently installed. Aborting. gem install af Successfully installed af-0.3.18.11 1 gem installed Installing ri documentation for af-0.3.18.11... Installing RDoc documentation for af-0.3.18.11... af login Attempting login to [https://api.appfog.com] Email: email@email.com Password: ***************** Successfully logged into [https://api.appfog.com] mvn install F:Projectscloudfoundry-sampleshello-java>af update tspannjavajava Uploading Application:   Checking for available resources: OK   Packing application: OK   Uploading (12K): OK Push Status: OK

RabbitMQ

Need to move WEB-INF to maven root

Failed until I made the directory exactly like ZIP file source code download, see META-INF and WEB-INF.

Directory of Projectscloudfoundry-sampleshello-java

01/22/2013  02:37 PM    <DIR>          .

01/22/2013  02:37 PM    <DIR>          ..

01/22/2013  02:37 PM                42 .gitignore

01/22/2013  02:37 PM             5,312 README.md

01/22/2013  02:37 PM    <DIR>          src

04/16/2012  11:38 PM               692 pom.xml

04/16/2012  11:39 PM               117 pom.properties

01/22/2013  02:45 PM    <DIR>          target

01/22/2013  02:37 PM    <DIR>          WEB-INF

4 File(s)          6,163 bytes

5 Dir(s)  15,830,614,016 bytes free

Projectscloudfoundry-sampleshello-java>af update tspannjavajava

Uploading Application:

Checking for available resources: OK

Packing application: OK

Uploading (15K): OK

Push Status: OK

Stopping Application ‘tspannjavajava’: OK

Staging Application ‘tspannjavajava’: OK

Starting Application ‘tspannjavajava’: OK

F:Projectscloudfoundry-sampleshello-java>

Spring

same as cloudfoundry

https://github.com/SpringSource/cloudfoundry-samples/wiki/Cloud-foundry-environment-variables

http://blog.springsource.org/2011/10/13/using-cloud-foundry-services-with-spring-part-1-the-basics/

Similiar to Stackato

http://docs.stackato.com/deploy/languages/java.html

http://jackson.codehaus.org/1.0.1/javadoc/org/codehaus/jackson/JsonNode.html

http://blog.springsource.org/2011/10/13/using-cloud-foundry-services-with-spring-part-1-the-basics/

http://docs.stackato.com/deploy/services/data-services.html#database-services-advanced

https://github.com/Stackato-Apps/hello-java-mysql

Raspberry Pi and Development

Here are some links I have found useful in setting up my Raspberry Pi machine for development and more.
Raspberry Pi
Raspberry Pi on My TV

 

 


MongoDB
Development on Pi
Multimedia
C-64 Emulator (Games)
UPnP
Java on Raspberry Pi

Eclipse/Java

Some Useful Updates via Raspian/Debian
sudo apt-get update
sudo apt-get install eclipse

Java library for Raspberry Pi
Java Library for RPi (Pi4J)
JVM on Pi
Oracle JVM Downloads
JDK1.7 on Pi

General Raspberry Pi Usage

Node.JS on Raspberry Pi
Scala on Raspberry Pi

Installing the TypeSafe Stack