LSPS documentation logo
LSPS Documentation
Running the Application with the SDK Embedded Server

When you generate the LSPS Application, apart from the application, an embedded server, SDK Embedded Server, with the application deployed and a launcher is generated in the *<APP>-embedded* project. The server uses an embedded h2 database.

When you run the server using the launcher class, the server starts and if there is no h2 database, a new h2 database is created in the project.

The server is intended for testing purposes only. For information on how to set up production servers, refer to the deployment documentation

Configuring the Mail Server of the SDK Embedded Server

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:

<Resource id="mail/LSPS_MAIL"  type="javax.mail.Session">
  mail.transport.protocol=smtp
  mail.smtp.host=<YOUR_SMTP>
  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

Configuring Data Source of SDK Embedded Server

To add a data source to the SDK Embedded server, do the following:

  1. In <YOUR_APP>-embedded/conf/conf/openejb.xml, define the resource and its properties.

    Example mssql data source

    ...
      <Resource id="jdbc/LSPS_DS" type="javax.sql.DataSource">
        JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
        JdbcUrl jdbc:sqlserver://localhost:1433;DatabaseName=lsps
        Username lsps
        Password lsps
      </Resource>
    
  2. Restart the server.

Now you can map a data type model to the data source:

  1. In the Outline view, click the root node of the hierarchy.
  2. In the Properties view of the data type hierarchy, set database to resource id.
  3. Set the table name prefix so you can identify your tables easily.
  4. Upload the modules to create the database tables.

You can also create entities for the data base entries and use them via EJBs with EntityManager.

Deleting the Embedded H2 Database of SDK Embedded Server

To delete the embedded database of SDK Embedded Server, remove the h2 directory in the <YOUR_APP>-embedded project.