0

How do you make sense of exceptions like this? It doesn't add up because the CatalogFacade does compile fine, and By the way, I do implement the classes they ask for. "Any of" seems like it's not needed to have all of them.

Exception while loading the app : java.lang.IllegalStateException:        ContainerBase.addChild: start: org.apache.catalina.LifecycleException:         java.lang.IllegalArgumentException: java.lang.IllegalArgumentException:

Which is Inside this surrounding error message, that seems a bit vague:

     [exec] remote failure: Error occurred during deployment: Exception while lo
ading the app : java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java
.lang.IllegalArgumentException: PWC1430: Unable to add listener of type: com.sun
.javaee.blueprints.petstore.model.CatalogFacade, because it does not implement a
ny of the required ServletContextListener, ServletContextAttributeListener, Serv
letRequestListener, ServletRequestAttributeListener, HttpSessionListener, or Htt
pSessionAttributeListener interfaces. Please see server.log for more details.
     [exec] Command deploy failed.

BUILD FAILED C:\LatestPS\trunk\ws\bp-project\app-server-ant.xml:379: exec returned: 1

I've been trying things all night . It's not clear. By the way, to the best of my knowledge..there's nothing significant at app-server-ant.xml:379..

Here's the Full log(I know it's quite big): enter image description here

Some more of files are here : http://www.adelazzam.com/so.html

5
  • 1
    Looks like a bad config in your server.xml, context.xml or web.xml. Have you made changes to either?
    – pap
    Sep 22, 2011 at 8:00
  • yes, there is a web.xml file. There are various other files too, like app-server-ant.xml - could this be it? Sep 22, 2011 at 8:02
  • So it might be an error in something like this: <resource-ref> <res-ref-name>jdbc/PetstoreDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> ? Sep 22, 2011 at 8:06
  • Could you update your post with the entirety of the exception logged (full message and stacktrace) and the contents of your web.xml, context.xml and (if you've modified it) your server.xml.
    – pap
    Sep 22, 2011 at 8:08
  • Thank You So Much - yes I updated it with more info. Sep 22, 2011 at 8:33

1 Answer 1

2

The problem is there in the error-message. The <listener> you specify in your web.xml, CatalogFacade does not implement the required Listener interface, specified by the servlet specification.

Check the implementation of your CatalogFacade. Depending on what type of listener it should be (that is, what lifecycle events should it be notified of) it must implement one of ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener.

5
  • I think I am seeing this clearer now. I've ruled out the HttpSessionListener or HttpSessionAttributeListener interfaces, for example. I'm thinking it might be an issue between Java 1.5 and 1.6 , differences in ServletContextListener etc? The relevant code in the class is small - two functions. Thank You Very Much and Good Morning to you! Sep 22, 2011 at 8:56
  • 1
    Yes, that could be an issue. If you ARE implementing one of the required interfaces, make sure you are compiling with the same level of Java as you are running your server on and the correct servlet-api version (2.5, it looks like from your web.xml) jar files. Another "common" mistake is to include the servlet-api jar in your WEB-INF/lib, which can lead to inconsistencies and class collisions as the servlet api is already present in Tomcat.
    – pap
    Sep 22, 2011 at 9:01
  • That's very helpful information and I'm on it! So by "servlet-api version " this is GlassFish here(which comes with Tomcat I think)? I shal lcheck the WEB-INF/lib folder. Thank You So Much Sep 22, 2011 at 9:06
  • Wow ! It's working now Yay :) When I switched back to Java EE 5 (glassfish 2.1), and fixed a passwd issue, it loaded up. Here's a pic too! Thank You So Much, I owe you! Sep 22, 2011 at 13:46
  • 1
    Nice :) Good luck going forward!
    – pap
    Sep 23, 2011 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.