You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Nuttall, Chris" <Ch...@intervoice-brite.co.uk> on 2001/04/09 11:21:58 UTC

NoSuchMethodError deploying Struts on Windows 95

I've successfully deployed/developing using Struts on an NT machine at work,
but have run into a 'simple' problem installing Struts at home on Windows
95.

Placing the struts-example WAR in my webapp directory causes Tomcat not to
start, with the error being reported as method getServletName() not found.
I'm definitely using an up to date version of servlet.jar,  and have tried
the obvious, like searching out and removing old copies of servlet.jar, but
can't seem to nail this one and am even starting to look for the 'red
herring' in all this.

I've tried loading my latest servlet.jar under tomcat\lib (successfully
picked up by tomcat.bat), jdk1.2.2\lib, SERVLETAPI_HOME, and even placing
the jar files on my CLASSPATH, as below...


>From stack trace:
----------------
.../removeForward, type=org.apache.struts.actions.RemoveForwardAction])
Pop org.apache.struts.action.ActionMapping
New org.apache.struts.action.ActionMapping
Set org.apache.struts.action.ActionMapping properties
Call
org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/admin
/removeMapping, type=org.apache.struts.actions.RemoveMappingAction])
Pop org.apache.struts.action.ActionMapping
Exception in thread "main" java.lang.NoSuchMethodError:
javax.servlet.ServletCon
fig: method getServletName()Ljava/lang/String; not found
        at
org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java
, Compiled Code)
        at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
        at javax.servlet.GenericServlet.init(GenericServlet.java:266)
        at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)

        at org.apache.tomcat.core.Handler.init(Handler.java:215)
        at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
        at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOn
StartupInterceptor.java, Compiled Code)
        at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
, Compiled Code)
        at org.apache.tomcat.core.ContextManager.init(ContextManager.java,
Compi
led Code)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)


Environment Details:
-------------------
Windows 95
JDK1.2.2
Tomcat 3.2.1

autoexec.bat:
...
path=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\jdk1.2.2\bin;D:\struts\ant\src\antidot
e\bin;C:\ORACLE\BIN;

set
CLASSPATH=C:\jdk1.2.2\lib\tools.jar;C:\jdk1.2.2\lib\servlet.jar;C:\jdk1.2.2\
lib\parser.jar;C:\jdk1.2.2\lib\jaxp.jar;

set JAVA_HOME=C:\jdk1.2.2
set TOMCAT_HOME=D:\jakarta\tomcat
set SERVLETAPI_HOME=D:\jakarta\servletapi


Any suggestions...???

Cheers,

- Chris

---------------------------------------------------------------
Christopher Nuttall
Software Engineer - Unified Messaging
InterVoice-Brite

Tel:
Fax:
Email:  Chris.Nuttall@intervoice-brite.co.uk
---------------------------------------------------------------


Re: NoSuchMethodError deploying Struts on Windows 95

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 9 Apr 2001, Nuttall, Chris wrote:

> I've successfully deployed/developing using Struts on an NT machine at work,
> but have run into a 'simple' problem installing Struts at home on Windows
> 95.
> 
> Placing the struts-example WAR in my webapp directory causes Tomcat not to
> start, with the error being reported as method getServletName() not found.
> I'm definitely using an up to date version of servlet.jar,  and have tried
> the obvious, like searching out and removing old copies of servlet.jar, but
> can't seem to nail this one and am even starting to look for the 'red
> herring' in all this.
> 
> I've tried loading my latest servlet.jar under tomcat\lib (successfully
> picked up by tomcat.bat), jdk1.2.2\lib, SERVLETAPI_HOME, and even placing
> the jar files on my CLASSPATH, as below...
> 

The most likely explanation for this is that you have an old version of
servlet.jar or jsdk.jar in your classpath, or in your system extensions
directory ($JAVA_HOME/jre/lib/ext).

Craig McClanahan