There is a lack of communication between the tomcat application and the database

I am currently working on a web application that is stored in a war file and runs with Tomcat. Initially, I start my MySQL 5.7 database, followed by running a Spring Boot project created with the necessary files. After completing these steps, I deploy my war file and launch the application. However, I am facing an issue where there seems to be no connection established between the app and the database.

function sendData(data) {
    $.ajax({
        url : link + ':3306/v1/user/login',
        type : 'POST',
        contentType : "application/json; charset=utf-8",
        data : data,
        dataType : 'json',
        success : function(response) {
            processResponse(response);
        },
        error: function(data, textStatus, jqXHR) {
            handleAjaxError(data, textStatus, jqXHR);
        }
    });
}

Answer №1

When making an ajax call, ensure you're correctly sending the request to the appropriate endpoint like link + ':3306/v1/user/login'.

Remember that MySQL typically operates on port 3306 while your spring-boot application is likely running on port 8080 within a tomcat server. Make sure you are calling the right service within your app to interact with the MySQL database.

For more insights into your current issue, I recommend checking out this resource:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Locate and refine the pipeline for converting all elements of an array into JSON format using Angular 2

I am currently working on implementing a search functionality using a custom pipe in Angular. The goal is to be able to search through all strings or columns in a received JSON or array of objects and update the table accordingly. Here is the code snippet ...

"Glowing orbs in the night: a dark mode spectacle with

I have implemented a night mode (or perhaps dark mode) toggle button located at the top-right corner of my webpage. Here is a link to a perfect example showcasing what I am aiming for However, unlike the provided link, I switch between night mode and lig ...

Error: Angular7 Unable to locate namespace 'google'

I am currently utilizing the import { MapsAPILoader } from '@agm/core'; package to enable auto-complete address search functionality. However, I have encountered an error message stating cannot find namespace 'google'. The error occu ...

Can someone help me uncover the previous URL for login using just JavaScript? I've tried using document.referrer but it's not giving me the

Currently, I am utilizing express with pug templates and pure JavaScript. In order to enhance the user experience of my log in system, I would like to save the URL that someone came to the login page with, so that I can redirect them back to it once they h ...

Using custom class instances or objects within Angular controllers is a simple process

Using three.js, I have created a class called threeDimView that houses my scene, camera, and other elements. In my JavaScript code, I instantiate a global object of this class named threeDimView_. threeDimView_ = new threeDimView(); Now, I wish to displa ...

Tips for emphasizing matches within a string using JSX

I've implemented a custom autocomplete feature that suggests options based on user input. I want to highlight the characters in the suggestions list that match the input value. For example, if the suggestion list includes "alligator", "lima", and "li ...

AJAX: Building a Robust Single Page Application with Enhanced Security

Currently, I am developing a web/mobile application using AJAX. This app consists of 4 pages: the login page and three protected pages that are only accessible to logged-in users. My plan is to implement the Single Page Application pattern, where all 4 pa ...

Determine the estimated download duration using the $http protocol

I am experiencing an issue with a function that calculates the time it takes to download a text file (3MB in size) from my server. While it works well for single requests, when I attempt to run multiple requests simultaneously, the time spent waiting for a ...

Alter the button's color seamlessly while staying on the same page

I have implemented a feature that allows me to change the category of photos without having to leave the page and it works perfectly. My next goal is to create a button system where the pre-defined category of a photo is indicated by a button with a green ...

In order to have JavaScript showcase a random word from a list when a button is clicked and then display it in a heading 3, follow these steps:

How can I create a JavaScript function that displays a random word from a list when a button is clicked and prints it in a heading 3? I would appreciate a quick response. //Start of Js code let display = document.getElementById("motivato"); console.log(di ...

Strategies for eliminating _next folder from file path within the build directory of Next Js

Is there a way to eliminate "_next" from the path in the build folder for Next Js version 13.2.4? For reference, here is an example: We would greatly appreciate any assistance on this matter. ...

Stopping the loop: Disabling the SetInterval function with ResponsiveVoice code in JavaScript

Currently, I am developing a queuing system and implementing voice announcements using Responsive Voice. I have used setInterval, but the issue is that the voice keeps looping without stopping. $( document ).ready(function() { setInterval(function() ...

The ideal version of firebase for showing messages in the foreground

Looking to instantly display notifications as soon as they are received? I recently watched a video on Angular 8 + Firebase where version 7.6.0 was discussed. While the notification is displayed in the foreground for me, I find that I need to click on some ...

Is it acceptable to incorporate Node.js modules for utilization in Next.js?

Here's a funny question for you. I am trying to generate UUID in my Next.js project without adding any unnecessary packages. So, I decided to import crypto in my component like this: import crypto from 'crypto'; After importing it, I used i ...

"Encountered an unexpected 'u' token in the JSON body while using body

I have set up body-parser to access the body of a POST request. The code in my index.js file is as follows: var express = require('express'); var app = express(); var bodyParser = require('body-parser'); app.use(bodyParser.urlencoded ...

Tips on how to send JSON data along with an attached file using HttpUrlConnection

I am facing a challenge where I need to send both JSON data as well as a CSV file in a POST request to a third party API: curl -H "aToken:$TOKEN" --form-string 'json={"project": "1234", "template": "5678&q ...

Revamping the Look: Refreshing Background of Div

I'm attempting to change the background image of the body element on a webpage when I hover over links with data-* attributes. It's working perfectly, but I can't seem to figure out how to create a smooth fade between the images when a link ...

KeyBy lodash method stores values in an object using the specified property as keys

There are multiple items stored in an array: "objects": [ { "category": "XXXXX", "item_name": "over_pkg_0", "price": 230 }, { "category": "XXXXX", "item_name": "over_pkg_1", "price": 54 }, ...

What is the best way to develop shared singleton components that work seamlessly across various platforms?

How about developing a React component called LoadingMask that can toggle the display of a loading mask based on the current state? The purpose would be to show the mask before an ajax call and hide it once the data is received. To avoid showing multiple ...

Loading images asynchronously in Next.js before the user arrives at the component displaying them

Currently, I am developing a Next.js application with only one page where users have the option to click on certain buttons to reveal an image. I would like to make it mandatory for clients to download the image before revealing it through a click event. S ...