Tag Archives: intellectual idea

[Solved] IDEA JSP File out.println Error: Cannot resolve method ‘println(java.lang.String)’

Idea uses out in JSP Print error

As follows:

report errors:

Cannot resolve method ‘println(java.lang.String)’

1. My solution:

Create the Lib directory under WEB-INF

Find two jar packages and add them to lib

As shown in the figure:

After copy, select jsp-api.jar, right-click, Add as Library.

servlet-api. Jar. the same to previous one, right click Add as library

Find the Artifacts of Project Structure, double-click the jar package in the figure, and then click OK

At this time, we still report an error and need to restart idea. After restarting, we find out Println red fades and the problem is solved

Other Solutions (You can Take a Try):

2. Direct file -> Invalidate Caches-> Invaliadate and Restart

3. Associate Tomcat to file -> Project Structure-> modules-> Dependencies-> Add library

4. When creating a new Java project, you should select Java Enterprise instead of webapplication in Java Java Enterprise will automatically associate Tomcat to dependencies)

[Solved] IDEA Error: Unknown system variable ‘tx_isolation‘ at

IDEA Error: Unknown system variable ‘tx_isolation’ at

java.sql.SQLException: Unknown system variable ‘tx_isolation’ at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4208) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4140) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2597) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2758) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2820) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2769) at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569) at com.mysql.jdbc.ConnectionImpl.getTransactionIsolation(ConnectionImpl.java:3372) at com.mchange.v2.c3p0.impl.NewPooledConnection.(NewPooledConnection.java:107) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:198) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access800 ( B a s i c R e s o u r c e P o o l . j a v a : 32 ) a t c o m . m c h a n g e . v 2. r e s o u r c e p o o l . B a s i c R e s o u r c e P o o l 800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool800(BasicResourcePool.java:32)atcom.mchange.v2.resourcepool.BasicResourcePoolAcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

 

Solution:
1. the version of mysql-connector-java is too low and you need to upgarde to version 8.0.*
2. After you had upgraded the version of mysql-connector-java, update the driver:
com.mysql.jdbc.Driver——>com.mysql.cj.jdbc.Driver

[Solved] JAVA Project Import jstl Error: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator

The following error is generated when using jstl with tomcat10.
HTTP status 500 – Internal server error
Type Exception Report
Message java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
Description The server encountered an unexpected condition that prevented it from completing the request.
Exceptions

jakarta.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Reason
java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
java.base/java.lang.ClassLoader.defineClass1(Native Method)
java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252)
java.base/java.lang.ClassLoader.defineClass1(Native Method)
java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252)
org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:355)
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:195)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:487)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:391)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:367)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Reason
java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagLibraryValidator
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1444)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252)
java.base/java.lang.ClassLoader.defineClass1(Native Method)
java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252)
java.base/java.lang.ClassLoader.defineClass1(Native Method)
java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2516)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:872)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1408)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1252)
org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:355)
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:195)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:487)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:391)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:367)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
): Note that the full stack information for the main issue can be viewed in the server logs
Apache Tomcat/10.0.16

 

Solution (I):
If you are using tomcat10 version need to change tomcat10 to tomcat8
Solution (II):
Tomcat10 version needs to be used with :
jakarta.servlet.jsp.jstl-2.0.0.jar
jakarta.servlet.jsp.jstl-api-2.0.0.jar
Note: Only these two jstl packages are allowed under lib, no other jstl packages, otherwise it will still report an error

Mybatis-plus automatically generates code error [Solved]

09:39:23.593 [main] DEBUG com.baomidou.mybatisplus.generator.AutoGenerator - ==========================准备生成文件...==========================
Exception in thread "main" java.lang.NoClassDefFoundError: freemarker/template/Configuration
at com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine.init(FreemarkerTemplateEngine.java:41)
at com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine.init(FreemarkerTemplateEngine.java:34)
at com.baomidou.mybatisplus.generator.AutoGenerator.execute(AutoGenerator.java:103)
at com.dream.road.CodeGenerator.main(CodeGenerator.java:136)
Caused by: java.lang.ClassNotFoundException: freemarker.template.Configuration
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Solution:

Dependencies that need to be imported for automatic code generation

        <!--mybatis-plus automatically generates code-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-generator</artifactId>
            <version>3.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.28</version>
            <scope>compile</scope>
        </dependency>

IDEA Create Web Project with maven Error: The desired archetype does not exista…

When I use idea to create a simple web project, there are no SRC, webapp files and so on under the project. And the following errors are reported:

The desired archetype does not exista (org.apache. maven archetypes :maven- archetype webapp:RELEASE)

The specific errors are as follows:

[WARNING] The metadata D:\apache-maven-3.6.1\maven-repository\org\apache\maven\archetypes\maven-archetype-webapp\maven-metadata-alimaven.xml is invalid: entity reference name can not contain character ='

 

Solution:

1. Find the error path (such as the path indicated in bold and underlined above) through the error information above, and find the maven-archetype-webapp folder in your local warehouse

2. Delete files other than folders (such as XML files), and only keep version folders (such as 4.1 folder, 3.1 folder, etc.)

3. Reload the project (or rebuild the project).

[Solved] IDEA Start Project Error: Error running ‘xxxxxx‘: Command line is too long. Shorten command line for …..

Error in idea startup item: error running ‘XXXXXX’: command line is too long Shorten command line for xxxxxx or also for Spring Boot default configuration?

Error reason: this error may be reported when the newly pulled code is started after the idea is opened

Solution: just find the following line in workspace.xml file of the .idea folder:

< component name="PropertiesComponent"> ······</component>

Add a line in the middle

< property name="dynamic.classpath" value="true" />

The problem can be solved

[Solved] Error:(3, 46) java: Program Package org.springframework.context.annotation does not exist

This bug should only appear in idea2020
Error:(3, 46) java: Program Package org.springframework.context.annotation does not exist

First, open the file in the upper left corner of the idea, and then click settings

Then click build, execution, deployment > Build Tools > Maven > Runner
check delegate ide build/run actions to Maven

The problem will be solved easily
in addition, warm tips: only idea2020 will have this error, and there are many hidden bugs in 2020. It is recommended to upgrade to idea2021 as soon as possible

[Solved] SpringMVC Error: war exploded: Error during artifact deployment. See server log for details.

When starting tomcat, the following error is reported:

war exploded: Error during artifact deployment. See server log for details.

Solution:

Step 1: See someone online said that generally under WEB-INF, there should be applicationContext.xml file, even if not, the context should be specified in web.xml, so add the following code in web.xml:

Step 2: Be sure to write the bean in applicationContext.xml. (This is my own careless mistake, only used to remind everyone)

In short

This error has plagued me for a long time, I checked a lot of methods on the Internet but they do not apply, so this article is only used to help you troubleshoot, but also according to their own actual procedures to determine.

[Solved] Tomcat Do not Start Error: Error: Application Server not specified

Tomcat does not start, and reports Error: Application Server not specified. after checking, I found that although I followed the teacher’s steps, but the teacher did not import the local tomcat, it should already exist in the idea, and because I did not import it, I can not use it properly, I need to import the local downloaded tomcat

After importing the correct path, Tomcat can be enabled normally, because I have always added Tomcat plug-in to POM file, so I ignored this step.

How to Solve Assert error (IDEA Package Imported)

When using the MyBatis-Plus starter project, we found that no matter which package under IDEA is imported, Assert will report an error, indicating that the suitable package is not downloaded from maven, and then we have to go to the maven repository ourselves to download the required package Junit.

Open the maven repository, https://mvnrepository.com/, and search for junit will appear many, I will generally choose the number of people using.