You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Remacle, F (Francois)" <f....@dl.ac.uk> on 2006/07/03 11:49:47 UTC

Odd problem with Java Web service deployment

Hi everyone,

I am writing to this mailing list as my last chance because I am
completely stuck and cannot find solution to my problem anywhere on FAQ,
internet or other webresources.

Here is the problem, I am trying to deploy a very simple webservice
because I am new to webservice so I wanted to start simply. However when
I deploy it it won't start. My web.xml file is as follow:
------------------------------------------------------------------------
-------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
        <display-name>Hegemonie Acces Base de Donnees</display-name>
    <listener>
 
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextLi
stener</listener-class>
    </listener>
        <servlet>
                <servlet-name>HegeWebService</servlet-name>
	
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-
class>
        </servlet>
        <servlet-mapping>
         <display-name>Hegemonie Acces Base de Donnees</display-name>
                <servlet-name>HegeWebService</servlet-name>
                <url-pattern>/webinterface</url-pattern>
        </servlet-mapping>
</web-app>
------------------------------------------------------------------------
-------------------------------
The problem comes from the reference to the classes in
"com.sun.xml.ws.transport.http.servlet.*" which import classes from
"javax.servlet.*" 

When trying to start the service I got : 
------------------------------------------------------------------------
-------------------------------
03-Jul-2006 10:13:51 org.apache.catalina.core.StandardHostDeployer start
INFO: standardHost.start /HegeWebService
03-Jul-2006 10:13:51 org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Skipped installing application listeners due to previous
error(s)
03-Jul-2006 10:13:51 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
03-Jul-2006 10:13:51 org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
------------------------------------------------------------------------
-------------------------------

When looking the server log file is due to :
------------------------------------------------------------------------
-------------------------------
2006-07-03 10:13:51 StandardContext[/HegeWebService]Error configuring
applicatio
n listener of class
com.sun.xml.ws.transport.http.servlet.WSServletContextListen
er
java.lang.NoClassDefFoundError:
javax/servlet/ServletContextAttributeListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
	  ......
------------------------------------------------------------------------
-------------------------------

Now the things which is odd is that on the server there are other
services using their own context listener that import the same classes
and they start without any problem!! 

For example:
------------------------------------------------------------------------
-------------------------------
2006-07-03 10:13:48 StandardContext[/jsp-examples]ContextListener:
contextInitia
lized()
2006-07-03 10:13:48 StandardContext[/jsp-examples]SessionListener:
contextInitia
lized()
2006-07-03 10:13:49 StandardContext[/servlets-examples]ContextListener:
contextI
nitialized()
2006-07-03 10:13:49 StandardContext[/servlets-examples]SessionListener:
contextI
nitialized()
------------------------------------------------------------------------
-------------------------------

According to all different things I have seen on the internet they
sometimes talks about the classpath, however even if I add explicitely
the servlet-api.jar that is in $CATALINA_HOME/common/lib on the
classpath inside catalina.sh or on the system classpath that does not
change anything. And I doubt the problem comes from there since other
examples using classes relying on this packages works fine, only mine
crashes down not finding these classes.

I am completely stuck by this and cannot find any way out of it...

Any suggestion?

Thanks

Francois Remacle


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Odd problem with Java Web service deployment

Posted by "Remacle, F (Francois)" <f....@dl.ac.uk>.
Hi Frank,

Thanks for your reply,

In fact it is finding these listeners (or the error message is
misleading me), it is the javax.servlet.AttributeContextListener that
its not finding which is odd since the others app finds it... 

-----Original Message-----
From: Franck Borel [mailto:borel@ub.uni-freiburg.de] 
Sent: 03 July 2006 13:06
To: Tomcat Users List
Subject: Re: Odd problem with Java Web service deployment


> According to all different things I have seen on the internet they 
> sometimes talks about the classpath, however even if I add explicitely

> the servlet-api.jar that is in $CATALINA_HOME/common/lib on the 
> classpath inside catalina.sh or on the system classpath that does not 
> change anything. And I doubt the problem comes from there since other 
> examples using classes relying on this packages works fine, only mine 
> crashes down not finding these classes.
>
>   
Your application is searching in your webapps-environment and doesn't
find any Listener Have you tried to include the context-classees in your
webapps directory like this?
/webapps/<your>-Application/WEB-INF/classes/listeners/ContextListener.cl
ass

-- Franck




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Odd problem with Java Web service deployment

Posted by Franck Borel <bo...@ub.uni-freiburg.de>.
> According to all different things I have seen on the internet they
> sometimes talks about the classpath, however even if I add explicitely
> the servlet-api.jar that is in $CATALINA_HOME/common/lib on the
> classpath inside catalina.sh or on the system classpath that does not
> change anything. And I doubt the problem comes from there since other
> examples using classes relying on this packages works fine, only mine
> crashes down not finding these classes.
>
>   
Your application is searching in your webapps-environment and doesn't
find any Listener
Have you tried to include the context-classees in your webapps directory
like this?
/webapps/<your>-Application/WEB-INF/classes/listeners/ContextListener.class

-- Franck