Tag Archives: Exception exception

Summary of common runtimeException exceptions

Common runtimeException summary in development or interview

The common types are as follows:

 

NullPointerException – null pointer reference exception
ClassCastException – type cast exception.
Illegalargumentexception – pass illegal parameter exception.
Arithmeticexception – arithmetic operation exception
arraystoreexception – storing objects incompatible with declared types into an array exception
indexoutofboundsexception – subscript out of bounds exception
negativearraysizeexception – creating an array with negative size error exception
numberformatexception – number format exception
SecurityException – Security Exception
exception Unsupported operationexception – unsupported operation exception

 

Arithmetic exception class: arithmeticexception
null pointer exception class: NullPointerException
type coercion exception: ClassCastException
array negative subscript exception: negativearrayexception
array subscript out of bounds exception: ArrayIndexOutOfBoundsException
security violation exception: SecurityException
file ended exception: eofexception
exception File not found exception: FileNotFoundException
string converted to number exception: numberformatexception
operation database exception: sqlexception
input/output exception: IOException
method not found exception: nosuchmethodexception

Java.lang.AbstractMethodError
Abstract method error. Thrown when an application attempts to call an abstract method.

java.lang.AssertionError
Wrong assertion. Used to indicate the failure of an assertion.

java.lang.ClassCircularityError
Class loop dependency error. When initializing a class, if a circular dependency between classes is detected, the exception is thrown.

java.lang.ClassFormatError
Class format error. Thrown when the Java virtual machine attempts to read a Java class from a file and detects that the contents of the file do not conform to the valid format of the class.

java.lang.Error
Wrong. Is the base class for all errors and is used to identify serious program running problems. These problems usually describe anomalies that should not be captured by the application.

java.lang.ExceptionInInitializerError
Initializer error. Thrown when an exception occurs during the execution of a class’s static initializer. Static initializers are static statements directly contained in classes.

java.lang.IllegalAccessError
Illegal access error. When an application attempts to access, modify the field of a class or call its method, but violates the visibility declaration of the field or method, it throws the exception.

java.lang.IncompatibleClassChangeError
Incompatible class change error. This exception is thrown when the class definition on which the executing method depends is changed incomparably. Generally, it is easy to cause this error when the declaration definition of some classes in the application is modified without recompiling the whole application.

java.lang.InstantiationError
Instantiation error. This exception is thrown when an application attempts to construct an abstract class or interface through Java’s new operator.

this exception is thrown java.lang.InternalError
Internal error. Used to indicate that an internal error has occurred in the Java virtual machine.

java.lang.LinkageError
Link error. This error and all its subclasses indicate that a class depends on other classes. After the class is compiled, the dependent class changes its class definition and does not recompile all the classes, thus causing an error.

java.lang.NoClassDefFoundError
Class definition error not found. This error is thrown when a Java virtual machine or class loader attempts to instantiate a class and cannot find its definition.

java.lang.NoSuchFieldError
There are no errors in the domain. This error is thrown when an application attempts to access or modify a domain of a class, but there is no definition of the domain in the definition of the class.

java.lang.NoSuchMethodError
Method has no errors. This error is thrown when an application attempts to call a method of a class and there is no definition of the method in the definition of the class.

java.lang.OutOfMemoryError
Out of memory error. This error is thrown when the available memory is insufficient for the Java virtual machine to allocate to an object.

java.lang.StackOverflowError
Stack overflow error. This error is thrown when the level of an application recursive call is too deep to cause a stack overflow.

java.lang.ThreadDeath
The thread ends. This error is thrown when the stop method of the thread class is called to indicate the end of the thread.

java.lang.UnknownError
Unknown error. Used to indicate that an unknown fatal error has occurred in the Java virtual machine.

java.lang.UnsatisfiedLinkError
Unsatisfied link error. Thrown when the Java virtual machine does not find a native language definition of a class declared as a native method.

java.lang.UnsupportedClassVersionError
Unsupported class version error. When the Java virtual machine attempts to read a class file from, but finds that the major and minor version numbers of the file are not supported by the current Java virtual machine, this error is thrown.

java.lang.VerifyError
Validation error. This error is thrown when the verifier detects an internal incompatibility or security problem in a class file.

java.lang.VirtualMachineError
Virtual machine error. It is used to indicate that the virtual machine is damaged or insufficient resources are needed to continue the operation.

java.lang.ArithmeticException
The arithmetic condition is abnormal. For example: integer divided by zero and so on.

java.lang.ArrayIndexOutOfBoundsException
Array index out of bounds exception. Thrown when the index value to the array is negative or greater than or equal to the size of the array.

java.lang.ArrayStoreException
Array storage exception. Thrown when a non array declaration type object is placed in an array.

java.lang.ClassCastException
Class shape exception. Suppose that there are classes a and B (a is not the parent or child of B), and O is an instance of a, then this exception will be thrown when o is forced to be constructed as an instance of class B. This exception is often referred to as a cast exception.

java.lang.ClassNotFoundException
Class exception not found. When the application attempts to construct a class according to the class name in the form of a string, and cannot find the class file with the corresponding name after traversing the classpath, it throws this exception.

java.lang.CloneNotSupportedException
Clone exception is not supported. When the Cloneable interface is not implemented or the clone method is not supported, the clone () method will throw this exception.

java.lang.EnumConstantNotPresentException
Enumeration constant has no exception. This exception is thrown when an application attempts to access an enumeration object by name and enumeration type, but the enumeration object does not contain a constant.

java.lang.Exception
Root exception. Describes what the application wants to capture.

java.lang.IllegalAccessException
Illegal access exception. This exception is thrown when an application attempts to create an instance of a class, access its properties, and call its methods through reflection, but it cannot access the definition of class, property, method, or construction method.

java.lang.IllegalMonitorStateException
Illegal monitoring status is abnormal. This exception is thrown when a thread tries to wait for a monitor of an object (o) that it does not own, or notifies other threads to wait for the monitor of the object (o).

java.lang.IllegalStateException
The illegal state is abnormal. When the Java environment and application are not in the legal calling state of a method, and the method is called, the exception is thrown.

java.lang.IllegalThreadStateException
Illegal thread state exception. When a method is called while it is not in legal calling state, an exception is thrown.

java.lang.IndexOutOfBoundsException
Index out of bounds exception. When the index value of accessing a sequence is less than 0 or greater than or equal to the sequence size, the exception is thrown.

java.lang.InstantiationException
Instantiation exception. This exception is thrown when an attempt is made to create an instance of a class that is an abstract class or interface through the newinstance() method.

java.lang.InterruptedException
Aborted exception. When a thread is in a long waiting, sleeping or other pause state, and other threads terminate the thread through the interrupt method of thread, this exception is thrown.

java.lang.NegativeArraySizeException
Negative array size exception. This exception is thrown when an array is created with a negative size value.

java.lang.NoSuchFieldException
Property has no exception. This exception is thrown when accessing a nonexistent property of a class.

java.lang.NoSuchMethodException
Method has no exception. This exception is thrown when a nonexistent method of a class is accessed.

java.lang.NullPointerException
Null pointer exception. This exception is thrown when the application attempts to use null where the object is required. For example: call instance method of null object, access property of null object, calculate length of null object, throw null with throw statement, etc.

java.lang.NumberFormatException
The number format is abnormal. This exception is thrown when an attempt is made to convert a string to a specified numeric type and the string does not meet the format required by the numeric type.

java.lang.RuntimeException
Runtime exception. Is the parent of all exceptions that can be thrown during normal operation of Java virtual machine.

java.lang.SecurityException
Security exception. An exception thrown by the security manager to indicate a security violation.

java.lang.StringIndexOutOfBoundsException
String index out of bounds exception. When the index value is used to access characters in a string and the index value is less than 0 or greater than or equal to the sequence size, the exception is thrown.

java.lang.TypeNotPresentException
There is no exception for the type. This exception is thrown when an application attempts to access a type in a string representation of the type name, but cannot find the type according to the given name. The difference between this exception and classnotfoundexception is that it is an unchecked exception, while classnotfoundexception is a checked exception.

java.lang.UnsupportedOperationException
Unsupported method exception. Exception indicating that the requested method is not supported.

java.lang.IllegalStateException Exception: cause analysis and solution

Today, I write a java file download program. After it’s finished, everything is normal, but it always throws out java.lang.IllegalStateException Abnormal, although it does not affect the normal use, but it always makes people feel very uncomfortable. There is nothing wrong with checking the code. Finally, I checked a lot of information on the Internet and finally found out the reason.

When we upload or download files, or filter files, we may need to use the output stream of the page.
for example, when we use it in action:
for example, when we use it in action response.reset ();
     response.setContentType (”application/ vnd.ms -excel”);
    OutputStream os = response.getOutputStream ();
throw an exception: java.lang.IllegalStateException

Cause analysis:
this is a problem in the servlet code generated by the web container out.write (), which is invoked in JSP. response.getOutputStream () conflicts.
that is, the servlet specification states that it cannot be called either response.getOutputStream (), and then call response.getWriter (), no matter which one is called first, an IllegalStateException will be thrown when calling the second one,

Because in JSP, the out variable is generated through the response.getWriter It is used in the program response.getOutputStream , and the out variable is used, so the above error occurs.

solve:

Method 1: add the following two sentences to the JSP file

<%
out.clear ();
out = pageContext.pushBody ();
%>

Defects of this method:
many development projects are not caused by JSP front-end, such as freemaker, velocity and so on“ response.getOutputStream () “not in JSP, but in servlet/action

Method 2: in action, do not return to the specific result file, return null
instead

//return SUCCESS;
return null;

java.lang.ClassNotFoundException : com.mysql.jdbc . driver project cannot connect to database, exception, lack of MySQL driver

Project started, database connection failed:

2018-06-26 14:01:00,168 |OFBiz-JobPoller      |DBCPConnectionFactory         |E| null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) [ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) [ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:376) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.reloadCrashedJobs(JobManager.java:294) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
2018-06-26 14:01:00,168 |OFBiz-JobPoller      |GenericDelegator              |E| Failure in findByCondition operation for entity [JobSandbox]: org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver). Rolling back transaction.
org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:376) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.reloadCrashedJobs(JobManager.java:294) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	... 12 more
2018-06-26 14:01:00,168 |OFBiz-JobPoller      |JobManager                    |W| Unable to load crashed jobs
org.ofbiz.entity.GenericEntityException: org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver) (com.mysql.jdbc.Driver (com.mysql.jdbc.Driver))
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1831) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:376) ~[ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.reloadCrashedJobs(JobManager.java:294) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) ~[ofbiz-entity.jar:?]
	... 5 more
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1811) ~[ofbiz-entity.jar:?]
	... 5 more
2018-06-26 14:01:00,171 |OFBiz-JobPoller      |DBCPConnectionFactory         |E| null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) [ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) [ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
2018-06-26 14:01:00,171 |OFBiz-JobPoller      |JobManager                    |W| Exception thrown while polling JobSandbox: 
org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) ~[ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	... 10 more
2018-06-26 14:01:30,173 |OFBiz-JobPoller      |DBCPConnectionFactory         |E| null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) [ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) [ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) [ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) [ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
2018-06-26 14:01:30,173 |OFBiz-JobPoller      |JobManager                    |W| Exception thrown while polling JobSandbox: 
org.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:91) ~[ofbiz-entity.jar:?]
	at org.ofbiz.geronimo.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:83) ~[ofbiz-geronimo.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericDAO.selectListIteratorByCondition(GenericDAO.java:763) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.datasource.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:140) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.GenericDelegator.find(GenericDelegator.java:1775) ~[ofbiz-entity.jar:?]
	at org.ofbiz.entity.util.EntityQuery.queryIterator(EntityQuery.java:392) ~[ofbiz-entity.jar:?]
	at org.ofbiz.service.job.JobManager.poll(JobManager.java:194) [ofbiz-service.jar:?]
	at org.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:224) [ofbiz-service.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_161]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_161]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_161]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_161]
	at org.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:88) ~[ofbiz-entity.jar:?]
	... 10 more

The configuration file is OK and lacks the MySQL driver mysql-connector-java-5.1.25.jar

java.lang.IllegalArgumentException : could not get next sequenced ID for sequence name: Visitor solution

HTTP Status 500 – Could not get next sequenced ID for sequence name: Visitor

 

 

type Exception report
message Could not get next sequenced ID for sequence name: Visitor
description The server encountered an internal error that prevented it from fulfilling this request.
exception

java.lang.IllegalArgumentException: Could not get next sequenced ID for sequence name: Visitor
	org.ofbiz.entity.GenericDelegator.getNextSeqId(GenericDelegator.java:2515)
	org.ofbiz.entity.GenericDelegator.getNextSeqId(GenericDelegator.java:2503)
	org.ofbiz.entity.GenericEntity.setNextSeqId(GenericEntity.java:626)
	org.ofbiz.entity.GenericDelegator.createSetNextSeqId(GenericDelegator.java:789)
	org.ofbiz.webapp.stats.VisitHandler.getVisitor(VisitHandler.java:245)
	org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:206)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:326)

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.33 logs.


Apache Tomcat/8.0.33

The database uses MySQL and is configured to start automatically, but it was shut down unexpectedly, resulting in an error.