javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS

I am getting exception while sending mail using JavaMail APIs. Mail properties are as


	mail.transport.protocol = smtp
	mail.smtp.host = mailHost
	mail.smtp.port = 25
	mail.smtp.auth = true

The exception I am getting while sending email


Exception in thread "main" javax.mail.SendFailedException: Sending failed;
        nested exception is:
	javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first m1sm949464nzf
 	at javax.mail.Transport.send0(Transport.java:219)
	at javax.mail.Transport.send(Transport.java:81)
	at example.SendMailUsingAuthentication.postMail(SendMailUsingAuthentication.java:77)
	at example.SendMailUsingAuthentication.main(SendMailUsingAuthentication.java:35)

Error in setting up Quartz (Spring framework)


'org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean' defined in ServletContext resource [/WEB-INF/tvp-job.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/UserTransaction
Caused by:
java.lang.NoClassDefFoundError: javax/transaction/UserTransaction
	at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1104)
	at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1355)
	at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:687)
	at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)

java.sql.SQLException: Closed Connection


Caused by: java.sql.SQLException: Closed Connection: next at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)

Installing mysql in linux

To install mysql type following command in terminal


$ sudo apt-get install mysql-server

When installation is done, you may want to setup password for root


sudo mysqladmin -u root -h localhost password 'test'
sudo mysqladmin -u root -h hostname password 'test'

Replace hostname and ‘test’ with your actually hostname and desired

<< Back to Setting up j2ee developer environment …

What is Boundary Value Analysis?

Boundary value analysis is defining the input-output of a system for extreme cases. For example if the specification for a text field on a web page is to accept numbers from 1 to 99 then boundary value analysis will include inputs near 1 (-1, 0. 1.1 etc) and near 99 (98, 99.5 and 100 etc.)

Installing tomcat in ubuntu/linux

Download tomcat from http://tomcat.apache.org
Go to the directory where you have downloaded apache-tomcat-6.0.18.tar.gz


$ cd
$ tar xvzf apache-tomcat-6.0.14.tar.gz

Move tomcat to ~/opt directory


sudo mv apache-tomcat-6.0.18 ~/opt/tomcat

Now you can start tomcat by executing startup.sh script located in tomcat/bin directory.

<< Back to Setting up j2ee developer environment …

What is Equivalence Partitioning?

Equivalence Partitioning is defining sets of input-output for a system and each of such sets is called an equivalence partition.

Installing eclipse in ubuntu/linux

Download eclipse from http://www.eclipse.org/downloads/
Make an opt directory in user’s home directory


$ mkdir ~/opt

Go to the directory where you have downloaded eclipse


$ tar -xvf eclipse-SDK-3.4.1-linux-gtk.tar.gz && mv eclipse ~/opt

Make a bin folder in user’s home directory


$ mkdir ~/bin

Next create an executable for Eclipe at ~/bin/eclipse


$ vi ~/bin/eclipse

Add the following lines in this file


export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="$HOME/opt/eclipse"
$ECLIPSE_HOME/eclipse $*

Finally make script executable


$ chmod +x ~/bin/eclipse

You can now execute that file to start up Eclipse.

<< Back to Setting up j2ee developer environment ...

Installing JDK in ubuntu/linux

To install jdk6.0 type the following command in terminal window


$ sudo apt-get install sun-java6-jdk

Provide password for root. It will show you agreement. Select and wait for installation to be completed.
We should set JAVA_HOME environment variable after successful installation of jdk.


$ vi ~/.bashrc

Insert following line in above file


export JAVA_HOME=/usr/lib/jvm/java-6-sun

<< Back to Setting up j2ee developer environment ...

Setting up j2ee developer environment in ubuntu/linux

A java developer machine has following most frequent tools in his machine.
1.  Sun JDK 6.0
2.  Eclispe 3.4
3.  Tomcat 6.X
4.  MySql 5
5.  Apache 2

Currently above are the popular versions, please update version if a newer version is available. Also, I have tried to list down all the necessary links and commands so that you can save time in finding these links or commands.

if you find something missing, please post a comment.

Next Page →

Technology