Powered by Blogger.

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

There are two solutions

1. Take the beans.xml out of package and put in default package.
2. Specify package name of the file..


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. 

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
so we can read these type of characters and returns only the numbers using java method isDigit from Character class.

Read more..

Display first fetter of a word with Capital letter in a given Sentence or String

>> Friday, February 28, 2020

The below code will display every first letter of a word in the sentence will display as a capital letter or in Camel Case using java program.
CamelCase Words in the Sentence

Read more..

convert .pem file to .ppk using puttygen - AWS

>> Friday, January 3, 2020

PEM-Privacy Enhanced Mail is a Base64 encoded DER certificate file format.  PEM certificates are frequently used for web servers as they can easily be translated into readable data using a simple text editor.  Generally when a PEM encoded file is opened in a text editor, it contains very distinct headers and footers.

while creating an instance in Amazon EC2 you will be required to create Key Pairs and .pem file will be generated. I have shown in the below images how to convert .pem file to .ppk file format using puttygen in the below images.

Read more..

Java Program to Print Square Pattern with Stars

>> Wednesday, August 8, 2018

This is a very basic program for beginners who starts learning for loop. This is the best example to understand how the nested loops works. In our program we are going to print the below square star (* ) pattern as shown in the image.

Read more..

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