0

i was using declarative way to make beans the spring managed.It works fine. I am planning to go annotattion way now. I followed this Tutorial

What i did is

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd">


     <context:component-scan base-package="com" />

</beans>

And used the Component annotation

@Component
public class EmployeeServiceImpl implements EmployeeService {}

But when i start my web application i get below error

java.lang.ClassNotFoundException: javax.annotation.Nullable
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)But when is start my web application i get  below error

UPDATE:- On google i found out that javax.annotation.Nullable can be found under jsr305-1.3.7.jar. But i think absence of jsr305-1.3.7.jar is not a problem as i could make it work in simple spring hello world project without the presence of jsr305-1.3.7.jar.So i think problem lies somewhere else.

user3198603
  • 5,528
  • 13
  • 65
  • 125

1 Answers1

0

Add jsr305-1.3.7.jar to your classpath. You are getting the exception since the JVM is not able to find the required class

Keerthivasan
  • 12,760
  • 2
  • 32
  • 53
  • This is no where related to the spring jars. You need to ensure that you have all the required jars in the classpath – Keerthivasan Feb 28 '14 at 09:19