Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Tomcat doesn't seem to be picking up jars in my WEB-INF/lib folder

0

63 views

I have a maven pom that builds all my required libraries into my WEB-INF/lib folder, then packages it up as a war. When I try to deploy this war, Tomcat throws many ClassNotFoundExceptions - the latest one being "java.lang.ClassNotFoundException: javax.xml.bind.annotation.AccessorOrder"; The only way I've found to fix it is to copy the required library files from my WEB-INF/lib folder and tossing them into tomcat/lib, but this can't be the correct way of doing it.

Is there something I have to do to tomcat to make it look in my WEB-INF/lib folders? Is there something I have to do in my source to tell tomcat to look there? Am I stuck having to have my tomcat/lib folder filled with 50+ jars?

Maybe it's relevant, but I'm using CXF and Spring-MVC technologies.

I'd post source code, but I don't know which file to put, so I'll post this current error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'publisher' defined in ServletContext resource [/WEB-INF/forum-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [publisher.Publisher]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/AccessorOrder    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)  at java.security.AccessController.doPrivileged(Native Method)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [publisher.Publisher]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/AccessorOrder
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
    ... 36 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/AccessorOrder
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:59)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:41)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:123)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)
    at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
    at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:327)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:198)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)

Thanks for any help

asked April 11, 2011 5:53 pm CDT
posted via StackOverflow

0 Answers

Be the first to answer this question

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions