Solved

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

Posted on 2014-02-16
4
548 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SPLUNK REST  API call to Splunk to create and index? 2 66
countAbc challenge 9 49
Apache Issues 9 44
unix in java example 9 37
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now