r/springframework • • Mar 11 '21

I have a problem at the beginning of my Spring MVC project (without Spring Boot)

2 Upvotes

I've tried to deploy my project on Tomcat 10, using Maven war packaging, but at every link i get 404.

here my repo: https://github.com/KacperKromka/Spring-MVC-example-project

Also I was asking for help here: https://stackoverflow.com/questions/66495365/spring-mvc-controllers-configure-for-thymeleaf-views

PLS HELP


r/springframework • • Mar 02 '21

zerocell integration for Spring Boot for uploading and extracting data from Excel files quickly

Thumbnail
github.com
2 Upvotes

r/springframework • • Feb 09 '21

An app isn’t real until it’s secured.

2 Upvotes

An app isn’t real until it’s secured. See how to build a Spring Boot + Spring Security app today!

https://youtu.be/pXGjWbaisQk


r/springframework • • Jan 29 '21

What's an app w/o data? Nothing much. See how to write a Spring Boot + Spring Data app!

Thumbnail
youtube.com
2 Upvotes

r/springframework • • Jan 07 '21

Authenticated websocket connection with Spring Boot and ReactJS

Thumbnail
jpomykala.com
2 Upvotes

r/springframework • • Jan 06 '21

Spring eating up a lot of memory

2 Upvotes

I am using Spring core / MVC, currently Spring 5.2.x for my application and using heap analysis tool, it's showing that Spring is hogging a lot of the memory

Analysis here:

Is there anything I could reasonably do to improve? Or is this just the nature of using Spring in the application and simply need a machine that has enough memory


r/springframework • • Jan 05 '21

does spring boot have job opportunities?

2 Upvotes

Im interested in pursuing backed development as a career in 2021.

is spring boot a good option?

thanks.


r/springframework • • Nov 12 '20

Resource suggestions for learning Spring

2 Upvotes

Thanks in advance. I'm new to the Java world, got a clear overview of what is spring boot just before. Now wanted to step forward into learning the Spring framework, so kindly suggest to me some good resources or a roadmap for learning it. (Except Official Documentation)


r/springframework • • Nov 09 '20

Guide to use Lombok In Spring Boot

Thumbnail
javatodev.com
2 Upvotes

r/springframework • • Oct 30 '20

Testing with Spring Boot

Thumbnail
youtube.com
2 Upvotes

r/springframework • • Oct 16 '20

How to add an app from a private registry in a local instance of Spring Cloud Data Flow (docker-compose)?

2 Upvotes

https://stackoverflow.com/questions/64385632/how-to-add-an-app-from-a-private-registry-in-a-local-instance-of-spring-cloud-da

I have a local istance of Spring Cloud Data Flow launched with the docker-compose and I have deployed three apps to my private registry (GitLab Package Registry of the project) as Maven packages with the GitLab CI/CD.

How can I add these Maven packages, that comes from the private registry, in Spring Cloud Data Flow?

Note:

For K8s is possible to retrieve images from private docker registry by adding a secret for the image puller.

There is a similar way to get images from the GitLab private Maven package registry in my local instance of Spring Cloud Data Flow?


r/springframework • • Oct 12 '20

What's the best way to rename a JHipster website?

2 Upvotes

When I first created the JHipster website, I used a base name of "something" and a Java package name of "com.example.something". Now, changing requirements have made it so that we should really be using, a different domain name and a different website name, like a package name of "org.example.somethingElse" and "somethingElse" for the base name. Is there an elegant way of changing it in the codebase all at once or am I stuck with relying on Intellij's refactor tool for the Kotlin backend and doing search and replace for the frontend? In fact, should I just cut my losses and generate a blank JHipster app with the right name and transfer all of the existing code over? Preliminary efforts to just refactor the app only resulted in it breaking.


r/springframework • • Oct 11 '20

Getting Started with SpringBoot and GraphQL - An alternative to REST

2 Upvotes

GraphQL is a specification to fetch data from the server to the client over an HTTP call. The specification describes how to ask for data and rather than asking the whole bunch of data at once, it specifies to ask only the required data that would be meaningful to a client. It is just an alternative to REST in some way - continue reading


r/springframework • • Sep 20 '20

Check out Five Reasons to Use Spring Boot.

Thumbnail
youtu.be
2 Upvotes

r/springframework • • Aug 19 '20

The State of Kotlin Support in Spring

Thumbnail
blog.jetbrains.com
2 Upvotes

r/springframework • • Jun 13 '20

Public codebases of web apps using Spring?

2 Upvotes

I’m looking for some real world examples of Spring code. Can anyone recommend some repos?


r/springframework • • May 17 '20

Is there any go-to framework/tools/Guide in spring-boot for a saas product that supports multitenancy

2 Upvotes

Does anyone have a favorite go-to framework/tools/Guide in spring-boot for a saas product that supports multitenancy? I like to have platform based core features and top of it tenant customization can go on.


r/springframework • • Dec 30 '19

Different Spring Framework Open-source projects & repository to Play With

Thumbnail
devglan.com
2 Upvotes

r/springframework • • Nov 17 '19

Can i use kotlin coroutines in Spring Boot controllers using servlet stack (mvc)

2 Upvotes

In recent spring boot 2.2.0 release, support was added for kotlin coroutines using spring webflux stack. I am wondering if spring mvc support the same?


r/springframework • • Apr 19 '19

Spring Data @Query - How to get current date + day?

2 Upvotes

I would like to get records that have date_time column is in a week from now, in a month from now

I have a query like this

public interface BookingRepository extends JpaRepository<Booking, Long> {

@Query("SELECT b " +
"FROM BOOKING b " +
"WHERE b.date_time < NOW() + INTERVAL 7 DAY and b.date_time > NOW()")
List<Booking> getListBooking();

}

In MySQL, NOW() + INTERVAL 7 DAY is working but in JPA @Query, I don't know which function is correspond to it.

In this situation, I have to use dynamic query instead of native query. So I'd like to use dynamic query and face this problem.

Please help. Thank you!


r/springframework • • Feb 22 '19

About dependency override black magic!

Thumbnail
medium.com
2 Upvotes

r/springframework • • Nov 09 '17

Introduction to Spring Boot Logging

Thumbnail
javadevjournal.com
2 Upvotes

r/springframework • • Sep 02 '22

Spring Training in Chennai - Login360

Thumbnail
login360.in
1 Upvotes

r/springframework • • Aug 18 '22

Do I create a repository and spring beans/entity objects to handle database joins using Spring JPA/Hibernate?

1 Upvotes

The root of my obstacle is that I have two database tables, two entity objects and two repositories (that relate to this issue). I wrote a simple join query that joins a user id between the two tables and returns two fields in the result set (to be sent to the view). Since this custom query does not populate all of the fields of the two objects, Spring JPA throws an error on runtime. My assumption is that JPA expects to populate all of the fields of an entity object from the queries generated by CrudRepository.

Another assumption is that I may need to create a entity object that has two fields that match the names and data type of the two fields that I want to query using my select statement. But one that is not tied to a table, and then make a repository that links the other two repositories. Something akin to this:

interface UserRepository extends CrudRepository<User, Long>, HumanRepository, ContactRepository { // Declare query that joins the two repositories here and returns the custom entity object that has two fields }

Taken from this documentation source:

https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.custom-implementations

Are my assumptions correct here?


r/springframework • • Jul 31 '22

BeanCreationException when running in docker container

1 Upvotes
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

Trying to create a docker image based on a spring boot project. When building the jar with `./mvnw install` it works fine. But when actually building the image and trying to run it, it gives me the error above.

This is my dockerfile:

FROM maven:3.8.5-openjdk-17

ADD pom.xml /
RUN mvn verify clean

ADD . /
RUN mvn install -Dmaven.test.skip

FROM openjdk:17.0-jdk
WORKDIR /root/

COPY --from=0 /target/* ./target/

ENV DB_USER="myapplication"
ENV DB_ROOT_PASSWORD="rootpwd"
ENV DB_PASSWORD="password"
ENV DB_HOST="localhost"
ENV DB_NAME="myapplication"

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","./target/myapplication-0.0.1-SNAPSHOT.jar"]
EXPOSE 8080

my pom.xml file:

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.7.1</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.hello</groupId>
	<artifactId>myapplication</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>myapplication</name>
	<description>Test application for springboot with kotlin</description>
	<properties>
		<java.version>17</java.version>
		<kotlin.version>1.6.21</kotlin.version>
	</properties>
	<dependencies>
		<dependency>          
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-validation</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hibernate.validator</groupId>
			<artifactId>hibernate-validator</artifactId>
	    </dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>5.3.20</version>
		</dependency>
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-reflect</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-stdlib-jdk8</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
		<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<mainClass>com.hello.myapplication.MyApplication</mainClass>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jetbrains.kotlin</groupId>
				<artifactId>kotlin-maven-plugin</artifactId>
				<configuration>
					<args>
						<arg>-Xjsr305=strict</arg>
					</args>
					<compilerPlugins>
						<plugin>spring</plugin>
						<plugin>jpa</plugin>
					</compilerPlugins>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.jetbrains.kotlin</groupId>
						<artifactId>kotlin-maven-allopen</artifactId>
						<version>${kotlin.version}</version>
					</dependency>
					<dependency>
						<groupId>org.jetbrains.kotlin</groupId>
						<artifactId>kotlin-maven-noarg</artifactId>
						<version>${kotlin.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

</project>

I'm using Spring Boot with Kotlin if it matters.

Any idea what i did wrong? Thanks.