Powered by Blogger.

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

>> Friday, October 22, 2021

INFO: Marking servlet [dad-frontController] as unavailable
Oct 22, 2021 6:31:27 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [dad-frontController] in web application [/home.com] threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

Servlet /webapp threw load() exception or
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet



follow the below steps when you face the above error while running the spring web or spring MVC application on your machine.

Read more..

SEVERE: Servlet [Controller] in web application [/myfirst-mvc-project] threw load() exception

>> Thursday, September 30, 2021

I have got the below error while running my First Spring Web MVC application using Tomcat Server.

The error log in the Console is: 


 INFO: Marking servlet [dad-frontController] as unavailable

Sep 30, 2021 10:34:12 PM org.apache.catalina.core.StandardContext loadOnStartup

SEVERE: Servlet [dad-frontController] in web application [/myfirst-mvc-project] threw load() exception

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet


Read more..

cvc-id.3: A field of identity constraint 'web-app-servlet-name-uniqueness' matched element 'web-app', but this element does not have a simple type.

 The above error will occur in your web.xml while writing Servlet Code or Spring WebMVC code. 

The Error should be

 cvc-id.3: A field of identity constraint 'web-app-servlet-name-uniqueness' matched element 'web-app', but this element does not have a simple type.

Read more..

class path resource [beans.xml] cannot be opened because it does not exist

>> Wednesday, August 25, 2021


 

ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");


Caused by: java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not exist

at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:187)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:333)

... 13 more



Solution:
There are two solutions

1. Take the beans.xml out of package and put in default package.
2. Specify package name of the file..
    ClassPathXmlApplicationContext("com/se/io/beans.xml");

 






Read more..

Solved: Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException

>> Saturday, May 29, 2021

when i run my Simple Spring Boot Application i have faced the below exception in the console. 


as
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606) ~[na:na]
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168) ~[na:na]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
	... 32 common frames omitted

The JAXB APIs are considered to be Java EE APIs and therefore are no longer contained on the default classpath in Java SE 9. In Java 11, they are completely removed from the JDK. Java 9 introduces the concepts of modules, and by default, the java.se aggregate module is available on the classpath (or rather, module-path). 

As the name implies, the java.se aggregate module does not include the Java EE APIs that have been traditionally bundled with Java 6/7/8. Fortunately, these Java EE APIs that were provided in JDK 6/7/8 are still in the JDK, but they just aren't on the classpath by default. The extra Java EE APIs are provided in the following modules:

Read more..

strip only the numbers from any formatted string of phone number

>> Thursday, April 23, 2020

This is a method which returns a string contains numbers init.The phone numbers may contain in differnt formats Ex: (123) 456-7890
                                 123-456-7890
so we can read these type of characters and returns only the numbers using java method isDigit from Character class.

Read more..

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.