Do you want your ad here?

Contact us to get your ad seen by thousands of users every day!

[email protected]

Getting Started with Payara Server

  • November 10, 2020
  • 6107 Unique Views
  • 2 min read
Table of Contents
Introduction to Payara Server

The following four short videos will take you step-by-step through installing, writing, and deploying an application to Payara Server, even if you've never used the application server before:

Introduction to Payara Server

Learn how to write a simple Hello World application and deploy it to Payara Server.

Install Software

Four Software Requirements:

  1. Java
  2. Maven
  3. IDE (NetBeans)
  4. Payara Server Community

Start Payara Server

Two Methods of Starting Payara Server:

  1. Using the CLI
  2. Using NetBeans

Deploy App on Payara Server

Three Methods to Deploy an App on Payara Server:

  1. Through NetBeans
  2. Through the CLI
  3. Through the Admin Console

As an alternative, you can also follow these instructions...

Payara Server can be downloaded from the Payara website. Download to a directory of your choosing and then unzip. On Linux based systems you can use the following command:

unzip payara-.zip

By default, this will unzip the archive into {CURRENT_DIR}/payara41.

Starting Payara Server
To start Payara Server, execute the following command:

$ {PAYARA_INSTALL_DIR}/bin/asadmin start-domain

This will start domain1 domain, which is the default domain included with Payara Server. If you wanted to start a different domain, the domain name would need to be specified. An example can be seen below:

$ asadmin start-domain your_domain_name

Accessing the Administration Console
Once the server is up and running, type this URL http://localhost:4848 in your browser to access the Administration Console. This is the default URL for accessing the Administration Console.

Deploying an Application
In order for a web application to run, it must be first deployed on an application server such as Payara Server.

Deploying using Asadmin
To deploy a WAR file, you need to use the deploy option, followed by the path to the application to deploy. See below for an example of deploying a WAR file:

$ {PAYARA_INSTALL_DIR}/bin/asadmin deploy your_application.war

Deploying using Administration console

  1. Access the Administration Console by navigating to http://localhost:4848 (make sure a domain is running beforehand)
  2. Click on Applications under the heading Common Tasks pane on the left side of the page.
  3. Any deployed applications are listed here. Since there are none right now, click on Deploy.
  4. The current display should be the Deploy Applications or Modules page. Select Packaged File to be uploaded to the Server and click browse. Navigate to where your application is located, select the file and click Open. You should be returned to the same page with some settings listed.
  5. Change any settings if needed otherwise accept the default settings and click ok to be returned to the applications page. Your application should now be listed.
  6. Finally, under the action tab click launch. The default URL for application is http://localhost:8080/ your_application.

Visit the Payara Getting Started page for further resources on getting started, including: Configuring, Adding a data source, Adding functionality, monitoring, security auditing, Creating a Restful Web Service, Logging, Testing Apps, etc.

Do you want your ad here?

Contact us to get your ad seen by thousands of users every day!

[email protected]

Comments (2)

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Tobiloba avatar

Tobiloba

3 years ago

I see that you save the point of interest as text in the DB but the response gotten from ChatGPT is JSON. Does this mean you convert the response into string using libraries like gson before saving it in the database?

-8

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Denis Magda avatar

Denis Magda

3 years ago

Hey, The response is a String object in the JSON format [1]. The repository takes this JSON string as is and stores to the database [2]. Presently, Spring Data auto-generates the CREATE TABLE statement on the startup and sets the "point of interest" column's type to "text" (or "varchar", don't remember). However, it's always possible to ask Spring Data to use the "json" or "jsonb" type for the column if you wish to query the JSON at the database level. Finally, Vaadin displays a list of PointsOfInterests. Those are generated using the org.json library [3]. Let me know if you have other questions. Hope this helps. [1] https://github.com/YugabyteDB-Samples/budget-journey-gpt/blob/main/src/main/java/com/yugabyte/com/TripsAdvisorService.java#L103 [2] https://github.com/YugabyteDB-Samples/budget-journey-gpt/blob/main/src/main/java/com/yugabyte/com/TripsAdvisorService.java#L74 [3] https://github.com/YugabyteDB-Samples/budget-journey-gpt/blob/main/src/main/java/com/yugabyte/com/TripsAdvisorService.java#L114

12

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard