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
Solved

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

Posted on 2014-02-16
4
570 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
  • 2
  • 2
4 Comments
 
LVL 35

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 35

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 New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
fibonacci ten numbers 4 45
Tomcat: Unable to run tomcat service. 2 23
eclipse buid path vs tomcat lib path 10 34
Java: The Public Class Main 4 30
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.

790 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