An OSGi Application Project (EBA) groups together a set
of bundles. The application can consist of different OSGi bundles
types.
About this task
If you are using the CICS Explorer SDK, you can refer to theCICS Explorer and CICS Explorer SDK help, which provides full
details on how you can complete each of the following steps to develop and package web
applications.If you are using a build toolchain such as Maven or
Gradle, you can use CICS-provided artifacts on Maven Central to define Java dependencies.
Procedure
- If you're using the CICS Explorer SDK, set up a target platform
for your Java™ development, using the CICS® TS V5.3 with Liberty and PHP template. You might get a warning that
the target is a newer version than the current Eclipse installation, but you can ignore this warning
message.
- Create an OSGi bundle project for your application.
- Develop your web application. You can use the JCICS API
to access CICS services and
JDBC to connect to DB2®. The CICS Explorer SDK includes
examples of web components and OSGi bundles that use JCICS and DB2. Create OSGi bundles that use
JCICS to separate the business from the presentation logic. You can
also use semantic versioning in OSGi bundles to manage updates to
the business logic of the application. For each WAB or OSGi bundle
that uses DB2 through
the JDBC DriverManager interface, include an Import-Package header
for com.ibm.db2.jcc in the bundle manifest.
Omitting this import will result in the error message java.sql.SQLException:
No suitable driver found for jdbc:default:connection. The import is not required when using the JDBC DataSource
interface.
- Optional: If you want to authenticate users
of the Web application, create a web.xml file in the web project to
contain a security constraint. The CICS Explorer SDK includes
a template for this file that contains the correct information for CICS. See Authenticating users in a Liberty JVM server for further information.
- Create an OSGi Application Project that references your
OSGi bundles.
- Create a CICS bundle
project that references the OSGi Application Project. You can also
add definitions and imports for CICS resources.
Each CICS bundle contains an
ID and version so you can manage changes in a granular way.
- Optional: Add a URIMAP and TRANSACTION resource
to a CICS bundle if you want
to map inbound web requests from a URI to run under a specific transaction.
If you do not define these resources, all work runs under a supplied
transaction, which is called CJSA. These resources are installed dynamically
and managed as part of the bundle in CICS.
Results
You set up your development environment, created a OSGi web
application, and packaged it for deployment.
What to do next
When you are ready to deploy your application, export the CICS bundle projects to zFS. The
referenced projects are built and included in the transfer to zFS.
Alternatively, you can follow a development deployment model by exporting
the application as an EBA file and deploying it to the dropins directory
of a running Liberty JVM server. You should be aware that Security
and other qualities of service are not configurable using dropins.