Tag Archives: Java Web

[Solved] SpringBoot Pack Project: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

Error prompt

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project store: Input length = 1 -> [Help 1]

Analysis: there are few corresponding dependencies Maven resources plugin

solution:
add a corresponding dependency:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.1.0</version>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

If the problem still exists, pay attention to the Maven resources plugin version. If there is a problem with version 3.2.0, change to version 3.1.0

[Redirect anomaly] Cannot call sendRedirect() after the response has been committed

Exception: threw exception [request processing failed; nested exception is java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed] with root cause
java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed

Reason:
there is no return after response reset. The subsequent program continues to run and submits the request again, so an error is reported,

When forwarding or redirecting according to conditions, the corresponding forwarding or redirecting statement is followed by return; Or return null;

404 error in browser accessing Servlet

The first Servlet program written with the MyEclipse tool — HelloWorld (refer to Section 4.1 of Java Web Programming). After the Web project is created, Tomcat is started through the MyEclipse development tool. See the Console window to output the server startup information as follows:

Then, when testing the program by typing the URL in the browser address bar, a 404 error occurs, as shown below:

My development environment is MyEclipse 2014+Tomcat 8.0. Previously, there were some new features in MyEclipse that did not support JDK 1.8. Later, I wondered if there was a version mismatch between development environments, so I tried to change Tomcat 8.0 to Tomcat 7.0.

Maven project pom.xml Solutions to error reporting

1. Error in pom.xml
Similar: Missing an artifact org. Springframework: spring – JDBC: jar: 3.2.4. RELEASE such errors, suggest a jar package.
I’ve run into this problem several times before. Every time I solve it, I forget it the next time. Make a note of it.
Force Update of Snapshots/Releases: Force Update of Snapshots/Releases: Force Update of Snapshots/Releases: Force Update of Snapshots/Releases: Force Update of Snapshots/Releases
 
SpringBoot error -Due to missing ServletWebServerFactory
Update 2019.6.24

2019-06-24 14:09:15.039  INFO 17356 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration' of type [org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration$$EnhancerBySpringCGLIB$$6d407ba3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-06-24 14:09:15.592  WARN 17356 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

 
ServletWebServerFactoryass references o>pache.catalina package>e,
It then looks at the JAR package that has been introduced and finds that there is no such package.
 
To solve this problem, add the following dependencies:

<dependency>
    <groupId>org.springframework.boot</groupId>           			
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

 
tomcat-embedbed embed embed embed embedtomcat-embed embed embed embed embed embed embed I did not introduce the spring-boot-starter-webpendency, which resulted in the incorrect introduction of Tomcat related packages, rather than a dependency conflict or other issue.
 
3, to be continued…
If you run into problems with Maven errors in the future, you will remember them here.

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)

was wrong today when using eclipse to execute the install command of maven:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)

this error, you can add the following plug-ins in the pom can be

<plugin> 
	<groupId>org.apache.maven.plugins</groupId> 
	<artifactId>maven-surefire-plugin</artifactId> 
	<version>2.6</version>	
	<configuration>	
	<skipTests>true</skipTests>	
	</configuration> 
</plugin>

Tomcat opens the startup.bat The reason for the flash

1. Reasons for not properly configuring JAVA_HOME,CLASSPATH,Path [verification method can open CMD, input Java,javac, and java-version in turn, if it can display some configuration information about Java, then the configuration is successful], if the configuration is not successful, a lot of people on the Internet have the answer, I will not go into details.

2. Default port 8080 is occupied

3 JDK and tomcat version does not match, this is also a problem, I used jdk11, found that the above two problems did not appear, but just can not run the tomcat server, finally find a needle in a haystack, looking for a long time, tomcat7.0X replaced by 9.0X,tomcat server can run normally.