How to deploy Simple Java Spring boot application into Azure Web Job? - spring-boot

I have a simple spring boot application with controller class having Rest API's. Now I want to deploy this Java Spring application into Azure Web Job and trigger manually.
In Microsoft documentation (https://learn.microsoft.com/en-us/azure/app-service/webjobs-create) the details of deploying application written in .NET and C# is provided but I could not find anything related to Java or Spring boot App deployment into Azure Web job.
Can anyone please let me know the steps to be followed for deploying Spring boot app into Azure Web Job or Attach any documentations for reference?
Thanks & Regards,
Preethi H R

To execute the Java web jobs on Azure, I have followed the MSDOC.
created a Java spring boot Project and compressed into zip file.
Open Azure Portal, navigate to App Service page of your App Service web app and select Webjobs and add a new Webjob by providing required settings as specified below:
On the WebJobs page, select Add.
Fill the details in Add WebJob settings as specified in the table.
File Upload: Upload Executable or script file which has been converted to zip file (Springboot_H2_database_CRUD.zip).
Create a manually triggered WebJob
select WebJobs in Azure App service, create a new web job by selecting Type as Triggered in the settings and select Manual in Triggers.
Select OK.
To run the WebJob, click on the webjob name and select Run.
Create a scheduled WebJob
A scheduled Webjob is also triggered. You can schedule the trigger to occur automatically on the schedule you specify.
Select OK and Run the newly created webjob.
Desired execution frequency can be configured for the web job.

Related

How to Generate Swagger File For Azure Java Function

I Have Azure HttpTrigger Java functions(get, Post) Those are Working Fine in Postman but, as per the Client Requirement I need To create swagger UI file for all those functions(Java) i am searching Refference stuff from lastweek, stil i did not get it,So plese any one share/guide/help me
How to craete Azure HttpTriggerr Java function project with Springboot Application?
How to add Swagger Configuration to it?
How to craete Azure HttpTriggerr Java function project with Springboot Application?
Following this MS Doc, created the Azure Functions Http Trigger in Spring boot.
1st Step is cloning the basic Function code of Sprint Boot Azure Functions Application.
Step 2: In pom.xml, you have to change these properties accordingly:
<functionResourceGroup>HariTestRG</functionResourceGroup>
<functionAppName>my-spring-function-app</functionAppName>
Step 3: Clean and build the packages ./mvnw clean package and then run using the cmdlet ./mvnw azure-functions:run
Next is to deploy the function code to Azure Function App:
./mvnw azure-functions:deploy
Result:
How to add Swagger Configuration to it?
Go to the Azure Portal > Deployed Function App > Click on API Management on left Index > Import the Function App APIs in APIM Instance > Then you'll see the Open API Definition which generates the swagger UI file for all the functions:

No response when trying to publish the project on to the WAS Server

I have imported a project into the eclipse and it has different modules like
Audit
AuditEJB
Common
CommonLoginConsumer
Core
Db2Integration
EJB
InitWeb
Integration EAR
MDMIntegration
PrepackagedApps
Properties
SchedulerEJB
ScreensWeb
WebServiceConsumer
WebServiceProvider
Provider
CCWSTest (Gradle module)
CTest
CUiWeb
UtilityTestEAR
UtilityTestWeb
Configured build Path, solved all the Java Problems. In the company that I'm working to configure WAS Server 8.0, we need to configure DSC which has all the deployment frameworks.
In Servers (Right click)> Add and Remove, I have IntegrationEAR and UtilityTestEAR
UtilityTestEAR contains Properties, and UtilityTestWeb
Integration EAR has apsclient-source.jar, Adit, AuditEJB, Common, CommonLoginConsumer, Core, Db2Integration, EJB, InitWeb, MDMIntegration, Properties, SchedulerEJB, ScreensWeb, WebServiceConsumer, WebServiceProvider, Provider, org.apache.soap.encoding61.jar
When I added UtilityTestEAR to the WAS Server, Server started Successfully and when I try to publish there was no response.
When I added IntegrationEAR to the WAS Server, when I started the server, there was an error saying:
The publish encountered some problems and the application may not have been installed or it may have been successfully installed but was unable to start.
The application contains validation errors. Correct the errors in the Problems view before publishing the application on the server.
If you want to allow applications containing errors to be published on the server, enable the Allow applications containing errors to be published on a server check box (Windows > Preferences > Servers > WebSphere).
CHKJ2802E: class com.ford.mss.cdr.cib.mdb.CdrAuditLogMDB, or one of its supertypes, cannot be reflected. Check the classpath.
I am trying to deploy to my localhost.
Please Suggest

Spring 4, STS 3.7 tc server 3.1.1. how to enable insights for my existing web application?

I am new to Spring framework even though i have been a java dev for quite some time. I am impressed by the spring insight application demos in you tube and want to use it in my application. How ever, when i try to create a new tc server using the instructions provided, for windows 8.1 64 bit
tcruntime-instance.bat create --template bio --template insight -i C:\workspaces\eclipses\sts\sts-bundle\pivotal-tc-server-developer-3.1.1.RELEASE\insight-instance http-insight-server-stsdeployed
When i try to add the folder created as the location of the new tc server with insight configured, using STS-> server view-> right click-> new-> server-> selected v3.0-3.1- && server-runtime env->add->browse="newly created server instance directory" it shows me below error.
The Tomcat installation directory is not valid. It is missing expected file or folder tcruntime-ctl.sh.
any idea how to add a new server and run my application on it? or add spring insights to existing spring boot or spring web application thru maven or spring configuration?
Note: Even though im using STS, i would like to know how to use these instances with Eclipse or IntelliJ idea. Im on a windows 8.1 64 bit machine.
When you click "add" from your instructions, you are browsing to a new tc Server installation directory (the binaries you want to run) not the instance directory. Once you select the installation directory of the version you wish to use, you will select next in the configuration and it will give you the option to "Create instance" or use an existing instance. You will then select use an existing instance and point to your newly created instance directory.

IBM Worklight 6.0 - Deployed application is available in all Worklight Consoles

I have installed IBM Worklight Server 6.0 in WAS 8.0.
I have deployed a projectA.war & projectB.war via ant script and I can access both the console with the different context root.
The problem I am facing here is, I have deployed the appA.wlapp in projectA.war via the Worklight console, the same application is available when I access the projectB.war console.
Can anyone help me to find the solution?
My only guess right now is that there is a mutual database for both projects so you see the same app in both consoles (and that too only happens w/out an error because maybe the different .war files have identical authenticationConfig.xml settings).
That is, the same database configuration is used for both projects; This configuration is either:
Part of the .war files that you deploy (in worklight.properties), or
Something that you configure in the Ant task script used to deploy the .war files, or
Some configuration in the application server hosting the .war files.
See documentation: http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fadmin%2Fc_clustering.html

Oracle ADF on JBoss: Wrapped Jdbc Connection problem

I'm trying to run an application using Oracle ADF Business Components on a JBoss Server. I've maneged to deploy it, but when I try to load the page I get below exception:
java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection
Is there a way solve this? Maybe configure JBoss to not use this wrapped connection or configure the ADF framework to unwrap it?
This is a while back, but I'll just follow up on my own question.
There is a guide on Oracle Metalink (Needs login) wich explains how to deploy ADF/BC on JBoss. I'm pretty sure this is what solved this for me (it's a while ago..)
Here is a copy of it:
Abstract
The purpose of this note is to show how you create an ADF BC Application Module and how you deploy it on a JBoss Application Server. It will also show you what configurations you need to perform on the JBoss side in order for the Application Module to work correctly.
Scope & Application
This note is intended for anyone who is about to deploy an ADF BC Module to a JBoss Application Server.
How To Deploy an ADF BC Module to a JBoss Application Server
The steps necessary for deploying an ADF BC Module to a JBoss Application Server are the following:
Setup the ADF Runtime Libraries on the JBoss Server
Setup data source(s) on the JBoss Server
Configure the ADF BC Module
Deploy the ADF BC Module
I will go through each of these steps more detailed. There is also a complete example attached for download here.
Setup the ADF Runtime Libraries on the JBoss Server
Shutdown the Application Server.
Invoke the ADF Runtime Installer wizard. Choose Tools | ADF Runtime Installer, and choose a server type from the submenu.
Proceed through the pages of the wizard. For detailed instructions for any page of the wizard, click Help.
On the Location page, select the home (or root) directory of the server on which the libraries are to be installed.
On the Installation Options page, you may choose the operation that you wish to perform.
* Install the ADF runtime libraries from your JDeveloper installation.
* Uninstall previously installed ADF runtime libraries.
* Restore an archived version of the ADF runtime libraries as the active version.
On the Summary page, click Migrate if you wish to prepare any existing UIX JSP projects for deployment.
On the Summary page, confirm the details of the installation, and click Finish.
Restart the application server.
Setup data source(s) on the JBoss Server
To create an Oracle data source in the JBoss server, you need to take the following steps:
Create a file called oracle-ds.xml. This file will contain your data source configuration. Below is an example on how such a file can look like.
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>jdbc:oracle:thin:#mydbhost.com:1521:mysid</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>hr</user-name>
<password>******</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
</local-tx-datasource>
</datasources>
Copy the file to the /deploy. This will install it on the JBoss server.
Configure the ADF BC Module
There are a few steps that need to be taken upon the ADF BC Module in order for it to run on the JBoss server.
When creating an ADF BC Module that will be used on a JBoss application server, one needs to set the SQL Flavor to SQL92 and the Type Map to Java. This change is required when using JBoss as the Application Server.
****Package the ADF Business Components project as an EJB session bean.****
Right Click on the Application Module, select Business Components Deployment.
In the profiles Dialog, select EJB Session Beans.
In the EJB Session Beans dialog, select Deploy To: Other EJB Container
In the AppModules dialog, configure the Application Module as seen in the figure 1 below.
Figure 1. Configuration of the Application Module
Once done, your Project will look similar to the one shown in the figure 2 below.
Figure 2. The JDeveloper Project
The final step is to configure the Application Module to use the data source we created in the previous step. This is done as follows:
Edit the application module.
In the Navigator, right-click the Business Components application module icon and choose Configurations.
Select the appropriate configuration.
Select this configuration and click Edit.
In the Connection Type list, choose JDBC DataSource.
Enter a DataSource Name. For example: java:/OracleDS.
Deploy the ADF BC Module
If you have your JBoss server either locally or mapped on your local machine, you can deploy it directly from inside JDeveloper. If your JBoss server is remote, and not mapped to the local machine, or you have a JSP application that later will use this module, you cannot deploy it directly from within JDeveloper. Both methods are described below.
Deploying the Module from within JDeveloper
1. Create a connection to the target application server.
2. If you want to support JBoss-specific configuration options for the EJB, add a jboss.xml deployment descriptor file. For more information on this file, see http://www.jboss.org.
3. If your project is a Business Components UIX JSP project, add required Cabo resources to it.
4. Select the deployment profile in the Navigator, right-click, and choose Deploy to | < application server connection> to package the application as an archive file and deploy it via the selected application server connection.
Deploying the Module outside of JDeveloper
If your JBoss server is remote, and not mapped to the local machine, or you have a JSP application that later will use this module you will have to do as follows:
Choose Deploy to EAR file from the context menu to deploy it as an EAR file. You must deploy this application to an EAR file and not a WAR file, as JBoss will not add the EJB references under the java:comp/env/ JNDI namespace for a WAR file.
Copy this file manually to the /deploy directory.

Resources