Localhost:8080

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Localhost:8080

Postby KT27 » 28. April 2019 10:35

I create Restful web service using intelliJ IDEA and mysql(XAMPP). Program was run correctly but http://localhost:8080/demo/all this URL did not work. Please help me friends.
KT27
 
Posts: 4
Joined: 28. April 2019 10:25
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Localhost:8080

Postby Altrea » 28. April 2019 11:00

How should we be able to help you?
We don't know anything about your web service and its configuration.
We don't know any error message or error code.
We don't know anything about the contents of your log files.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Localhost:8080

Postby KT27 » 29. April 2019 09:59

This is my java code
Code: Select all
package pizzaloop;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity

public class PizzaDetails {
    @Id
    @GeneratedValue(strategy= GenerationType.AUTO)
    private Integer id;
    private String name;
    private String description;
    private Double price;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }
}



This is my main controller java code
Code: Select all
package pizzaloop;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(path="/demo")
public class MainController {

    @Autowired

    private PizzaRepository pizzaRepository;
    @GetMapping(path="/all")

    public @ResponseBody
    Iterable<PizzaDetails> getPizzaDetails() {
        return pizzaRepository.findAll();
    }
}


This is application Java code
Code: Select all
package pizzaloop;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


@SpringBootApplication

public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }


}





this is maven code
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>lk.ac.kln.rest</groupId>
    <artifactId>mysql-rest-service</artifactId>
    <version>1.0-SNAPSHOT</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.3.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- JPA Data (We are going to use Repositories, Entities, Hibernate, etc...) -->

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.7.1</version>
            <type>maven-plugin</type>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <!-- Use MySQL Connector-J -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
    </dependencies>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>


project compile and it was run correctly. But browser not show my data base values in JSON format.
"http://localhost:8080/demo/all" this is not working.
please help me.
KT27
 
Posts: 4
Joined: 28. April 2019 10:25
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Localhost:8080

Postby Nobbie » 29. April 2019 11:44

I dont think Xampp supports Maven. Due to Wikipedia you need "Apache Maven for executing IntelliJ IDEA. Unfortunately i cannot help any further, as i dont know IntelliJ IDEA neither Apache Maven, but surely i can say that Xampp does not deliver Apache Maven.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Localhost:8080

Postby KT27 » 30. April 2019 10:00

Thanks for the reply but we did at the university. Now I can't do it my PC. :(
KT27
 
Posts: 4
Joined: 28. April 2019 10:25
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Localhost:8080

Postby Nobbie » 30. April 2019 10:07

Why dont you try to install Apache Maven? See https://maven.apache.org
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Localhost:8080

Postby KT27 » 30. April 2019 13:55

Thanks. I installed it but still above problem. :cry:
KT27
 
Posts: 4
Joined: 28. April 2019 10:25
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Localhost:8080

Postby Nobbie » 30. April 2019 19:38

The problem is, installing and running a webserver is a quite sophisticated task. Its not as simple as installing a game or so. Usually educated system administrators are doing that job. It requires lots of knowledge about TCPIP, HTTP, Java JRE etc. etc. etc. - you cannot simply click a button and everything is fine.

Ask in your university for support. They really should know what is needed and how to configure it.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 113 guests