Solved

Configuring for Spring DAO with Jersey, what am i missing?

Posted on 2014-02-16
4
587 Views
Last Modified: 2014-03-21
Hi there people,
i've got question i couldnt find on google..

I had this error shown when trying to deploy on the debug server a Spring application.

I only wanted to configure the Spring DAO in order to use it with Jersey

--

feb 16, 2014 9:55:15 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configurando escuchador de aplicación de clase org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
      at java.lang.ClassLoader.findBootstrapClass(Native Method)
      at java.lang.ClassLoader.findBootstrapClassOrNull(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1595)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4149)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

---

Web.xml and other xml configs are attached to this post.


project folders:

  cold not having a classes folder be a reason for this error of not loading listener?
I have written classes with the @autowired annotation, could this be another factor?
What i expected from this was to see errros part configuration, so far i couldnt load this nor other project already working i've got.

I'd thank so much a guide for this configuration cause i've been wasting massive hours trying to achieve this properly.

Thanks in advance!
web.xml
applicationContext.xml
app-config.xml
0
Comment
Question by:JavierVera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 36

Expert Comment

by:mccarl
ID: 39864030
What libraries do you have configured for this project (the attached screenshot does not have the Libraries folder expanded)? The server that you are attempting to run this on should already have the classes in question so maybe it is a problem where you are also providing the same JAR and there are conflicts.

Also, you ask why you don't have a "classes" folder. This should be under your "build" folder that I can see in the screenshot but again that folder is not expanded so I can't see. Also, it would be useful to see the entire folder contents in the "build" folder so if you could post a screenshot of that, it would be useful.
0
 
LVL 1

Author Comment

by:JavierVera
ID: 39864952
Thank you Mccarl for your interest, i have added the whole pack of jars that i found on an old project built with spring 3.2

spring
i'd love to pass this situation, its struggling for 2 days now... thanks for any helps

also i managed to add a classes folder, but i wonder if its put correctly.

folder with classess please tell if i got wrong
0
 
LVL 36

Accepted Solution

by:
mccarl earned 500 total points
ID: 39869395
The only other thing that I can think is that the servers installation has some issue. What server are you using to run this on? Are you able to look in the server's installation directory, see if it has a "lib" directory or similar and look for "servlet-api.jar" inside that. That is the JAR that should supply the class in question javax.servlet.ServletContextListener.  Note that because it is already provided by the server, your application should include it itself.

Also, regarding the "classes" directory, no you should add it to the build path or create the directory yourself. I probably wasn't clear before but Eclipse should create that directory for you when it compiles your code, and it should be under the "build" folder that you can see in your initial screenshot (just above the WebContent folder)
0
 
LVL 1

Author Comment

by:JavierVera
ID: 39946420
Once again i had to find the solution myself  looool....
i guess there are very little people in this forum isn't it?
:)
anyway, i missed a Jar.
Thanks for reading.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question