Tag Archives: [report error]

Batch error reporting in Java spring

1、 Questions

Error in starting batch task:

ERROR [com.alibaba.druid.pool.DruidDataSource]
 - {dataSource-1} init error java.sql.SQLException: oracle.jdbc.OracleDriver

2、 Solution

1. The reason is that I don’t have the jar package driven by JDBC, so I found a few on the Internet and asked me to download Ojdbc14 or ojdbc7. 14 is finished, but it’s useless. Ojdbc7 is the wrong version. Later, I opened the library and found that there are problems with both downloads;

You can only delete these invalid jar packages, and then find a JDBC 6 jar package to put on. The result is OK;

[exception] address already in use: bind

1. Problems:

Bind Exception:Address Already in use;
Failed to start connector;
Address Already in use:bind;
EmbeddedServletContainer Excepiton:Unable to start embedder Tomcat servlet container;
IllegalState Exception:Tomcat connector in failed state;

2. Source code:

None;

3. Screenshot:

4. Summary:

Here we put it java.exe Turn it all off;

[Java] Java program error: exception_ ACCESS_ VIOLATION (0xc0000005)

When running Java program, error: exception_ ACCESS_ VIOLATION (0xc0000005);

According to the description of the original webpage:

EXCEPTION_ACCESS_VIOLATION

In rare circumstances, a Java program could stop with a message similar to the following:
 An unexpected error has been detected by HotSpot Virtual Machine:
 EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c042340, pid=1743, tid=122
 Java VM: Java HotSpot(TM) Client VM (1.5.4_02)
Problematic frame:
C [ntdll.dll+0x2430]
Essentially, Java will stop with a message such as the above if a "serious" error occurs that means the JVM can't continue to function. Usually, the most discriminating line is the first mention of a DLL, such as the line in bold above. The source of the error could be any of the following:

 1. a bug in the JVM itself; search Google and/or the Java web site for
    a mention of ntdll.dll+0x2430;
 2. a bug in some non-Java code that was being run at the time: e.g.
    Java might have been calling into a printer driver, graphics driver
    etc.

If you're not sure what to do but are not using the latest version of the JVM for your system, then a good first course of action is usually to upgrade your JVM. If the bug is in some other DLL, e.g. a printer driver, database driver, graphics driver etc, then it is best to see if you can upgrade the component in question.

If the error is occurring in some native code that you have written, then you need to find out which line of code corresponds to the offset mentioned (in this case, 0x2430, although the DLL isn't one of ours in this example). Usually you can tell your compiler to generate a "map 

The possible reasons are as follows:
1. A bug in the JVM itself; search Google and/or the Java Web site for
a mention of ntdll.dll +0x2430;
For a bug in the JVM itself, visit Google or the Java website (according to ntdll.dll +A bug in some non java code that was being run at the time: e.g.
java might have been calling into a printer driver, Graphics driver
etc.
a bug in a running non java code may cause the print driver to be called, such as the graphics driver;

Here, my suggestions are:
1. The port number may conflict, so close other unnecessary Java programs;
2 2. For the same Java program, some function may be set to start automatically (which will crowd out the Java program you are using). If there is a pause button, pause the function in the same Java program first (without affecting it), run the part of your own function first, and then start other functions after running this part of your own function;

Welcome to my official account:
[screen bridge community]

[mybatis] error: malformed ognl expression: name! = null and name! = ‘”

1、 Questions

Malformed ognl expression: name! = null and name! = ‘
report an error;
malformed means abnormal;

2、 Solutions and reasons

It turned out to be* Mapper.xml In the document:

<if test ="userId ! null">

The equals sign is missing; the SQL in the automatically generated mybatis file is missing an equals sign

<if test ="userId != null">

Moreover, there should be no space between exclamation mark and equal sign;

No matching editors or conversion strategy found

1、 Questions

Recently, I’ve been building the batch framework of spring, and frequent errors have been reported. It’s a trip to the pit;

Cannot convert value of type 'java.lang.String' to 
required type 'javax.sql.DataSource' for property 'dataSource': 
no matching editors or conversion strategy found

2、 Solution

The reason is that [ref] is wrongly written as [value] in the XML configuration of persistence layer;

Spring nested exception is java.lang.NoClassDefFoundError: org/springframework/core/MethodClassKey

1、 Questions

Build your own batch task framework, and then report an error

- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/MethodClassKey
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/MethodClassKey
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
	at com.caliper.tail.batch.common.BatchApp.start(BatchApp.java:85)

2、 Solution

The spring core package is not imported; just go to Maven repository and import the jar package of spring core;

<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>5.1.5.RELEASE</version>
</dependency>

[spring] springboot failed to install cli, unsupportclassversionerror 52.0

1、 Error information

Install springboot cli yesterday:
1. Download and unzip it directly from the official website;
2. Add the bin directory absolute path of the unzipped folder to the environment variable path;
3. Enter “ spring -- version " in the CMD to verify whether the installation is successful;

However, an error was reported during verification. The error information is as follows:

UnsupportClassVersionError:org/springframework/boot/loader/JarLauncher:Unsupporyed major.minor version 52.0
......
Could not find the main class

2、 Solutions

2.1. You need to set the JDK version

2.2. There are two ways to modify the language level, one is to click project structure, which is the button in the upper right corner of idea;

Modify JDK version and language level in project:

Modify the language level in modules:

3、 Results

Then there is no problem

Java error: unable to find or load the main class

1、 Problem
today, copy the code of idea to eclipse for execution, and then report an error: “error: unable to find or load the main class”;

2、 The solution
can be executed in idea and can be executed in eclipse, which means that there is no problem with the code. The only problem is the running environment. After checking the configuration, the problem is found:

here is an error in Maven dependency:

what the hell pom.xml Log off the error reporting dependency in the file, and then run the main method;