• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 635
  • Last Modified:

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

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
JavierVera
Asked:
JavierVera
  • 2
  • 2
1 Solution
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
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
 
JavierVeraAuthor Commented:
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
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
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
 
JavierVeraAuthor Commented:
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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now