To configure the SMTP settings of SDK Embedded Server, set the respective properties in the mail/LSPS_MAIL
element of the<APP>-embedded/conf/conf/openejb.xml
file:
mail.transport.protocol=smtp
mail.smtp.host=mailsmtp.whitestein.com
mail.smtp.port=25
mail.from=<YOUR@EMAIL.com>
mail.smtp.user=lsps_user
mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.password=<PASSWORD>
password=<PASSWORD>
Important: SDK Embedded Server fails to communicate with an SMTP server that requires MD5Digest authentication. This causes the
sendEmail()
calls to fail. To force another authentication method, specify the following property in the<APP>-embedded/conf/conf/openejb.xml
file:mail.smtp.sasl.mechanisms=PLAIN
To add a data source to the SDK Embedded server, do the following:
In <YOUR_APP>-embedded/conf/conf/openejb.xml
, define the resource and its properties.
Example mysql data source
...
JdbcUrl jdbc:h2:tcp://localhost/./h2/h2;MVCC=TRUE;LOCK_TIMEOUT=60000
Username lsps
Password lsps
</Resource>
<!-- adding this Resource tag:-->
<Resource id="jdbc/USERS_DS" type="javax.sql.DataSource">
JdbcDriver com.mysql.cj.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/training_users;
Username root
Password root
</Resource>
Now you can map a data type model to the data source:
You can also create entities for the data base entries and use them via EJBs with EntityManager.
To delete the system database of SDK Embedded Server, remove the h2
directory in the <YOUR_APP>-embedded
project.