Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Servlet Error 500 NoSuchMethod Error when invoking JavaBean method from JSP in WebSphere 3.5.2

8 views
Skip to first unread message

Mamading Ceesay

unread,
Mar 13, 2001, 10:36:19 AM3/13/01
to
I'm using the DefaultServletEngine under the DefaultServer with the JSP 1.0
Enabler.
I have Servlet 2.2/JavaServer Pages 1.1 Full Compliance mode turned on.
Here's the
JSP code, I'm a Java novice so please make the appropriate allowances ;-) :-

<%@ page language = "java" %>
<%@ page import = "javax.servlet.*" %>
<%@ page import = "javax.servlet.http.*" %>
<%@ page import = "java.io.*" %>
<jsp:useBean id="dominoBean" class="test.AngelSessBean"/>
<%
String userName = "";
String fullName = "";
String commonUserName = null;
String message = "";
boolean gotNotesSession;

gotNotesSession = dominoBean.setNotesSession(session);

if (gotNotesSession)
{
userName = dominoBean.getUserName(session);
// fullName = dominoBean.getFullName();
commonUserName = null;
}

message = dominoBean.getMessage();
%>
<html>
<head>
<title>
Web 1 Session Info
</title>
</head>
<body>
<br><br><br>
<center>
<font face="Comic Sans MS" size="7">
Dummy Web 1 Session Info<br>
<font size="5">
<p>
<%= message %>.<br>
It contained the following details amongst others:<br>
The Username retrieved from the HttpSession object is <%= userName %>.<br>
Full Username is <%= fullName %>.<br>
Common Username is .<br>
</font>
</font>
</center>
</body>
</html>

Please note that the setNotesSession method call is successful, however the
subsequent
call to the getUserName method which has the signature

public String getUserName(HttpSession jspSession)

and is defined in the same JavaBean gives the following Error 500 page
output :-

Error 500
An error has occured while processing
request:http://angel/MCtest/angelsess.jsp
Message: Server caught unhandled exception from servlet [jsp10]: Server
caught unhandled exception from JSP [angelsess.jsp]

Target Servlet: jsp10
StackTrace:
----------------------------------------------------------------------------
----
Root Error-1: test.AngelSessBean: method
getUserName(Ljavax/servlet/http/HttpSession;)Ljava/lang/String; not found

java.lang.NoSuchMethodError: test.AngelSessBean: method
getUserName(Ljavax/servlet/http/HttpSession;)Ljava/lang/String; not found
at
C_0003a.notes.data.d_00025mino.html.MCtest.MCtest_angelsess_jsp_41._jspServi
ce(MCtest_angelsess_jsp_41.java:120)
at com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:175)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:159
)
at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:608)
at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
.java:580)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycl
eServlet.java:160)
at
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServle
t.java:287)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycle
Servlet.java:105)
at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:35
3)
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletMan
ager.java:729)
at
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManag
er.java:655)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W
ebAppRequestDispatcher.java:338)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest
Dispatcher.java:175)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD
ispatcher.java:93)
at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.
java:77)
at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn
vocation.java:67)
at
com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(Cacheabl
eInvocationContext.java:106)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ
estProcessor.java:160)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener
.java:300)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQ
EventListenerImp.java:230)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventL
istenerImp.java:104)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQE
ventSource.java:212)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.notifyService(SQWrapperEventSource.java:347)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.run(SQWrapperEventSource.java:216)
at
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run
(OutOfProcThread.java:248)
at java.lang.Thread.run(Thread.java:481)


----------------------------------------------------------------------------
----
Wrapped Error-2: Server caught unhandled exception from JSP [angelsess.jsp]

com.sun.jsp.JspWithNoErrorPageException: Server caught unhandled exception
from JSP [angelsess.jsp]
at javax.servlet.ServletException.<init>(ServletException.java:132)
at
com.ibm.websphere.servlet.error.ServletErrorReport.<init>(ServletErrorReport
.java:43)
at
com.ibm.servlet.engine.webapp.WebAppErrorReport.<init>(WebAppErrorReport.jav
a:32)
at
com.sun.jsp.JspWithNoErrorPageException.<init>(JspWithNoErrorPageException.j
ava:26)
at
C_0003a.notes.data.d_00025mino.html.MCtest.MCtest_angelsess_jsp_41._jspServi
ce(MCtest_angelsess_jsp_41.java:145)
at com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:175)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:159
)
at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:608)
at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
.java:580)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycl
eServlet.java:160)
at
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServle
t.java:287)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycle
Servlet.java:105)
at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:35
3)
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletMan
ager.java:729)
at
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManag
er.java:655)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W
ebAppRequestDispatcher.java:338)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest
Dispatcher.java:175)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD
ispatcher.java:93)
at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.
java:77)
at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn
vocation.java:67)
at
com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(Cacheabl
eInvocationContext.java:106)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ
estProcessor.java:160)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener
.java:300)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQ
EventListenerImp.java:230)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventL
istenerImp.java:104)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQE
ventSource.java:212)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.notifyService(SQWrapperEventSource.java:347)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.run(SQWrapperEventSource.java:216)
at
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run
(OutOfProcThread.java:248)
at java.lang.Thread.run(Thread.java:481)


----------------------------------------------------------------------------
----
Wrapped Error-3: Server caught unhandled exception from servlet [jsp10]:
Server caught unhandled exception from JSP [angelsess.jsp]

com.ibm.servlet.engine.webapp.UncaughtServletException: Server caught
unhandled exception from servlet [jsp10]: Server caught unhandled exception
from JSP [angelsess.jsp]
at javax.servlet.ServletException.<init>(ServletException.java:132)
at
com.ibm.websphere.servlet.error.ServletErrorReport.<init>(ServletErrorReport
.java:43)
at
com.ibm.servlet.engine.webapp.WebAppErrorReport.<init>(WebAppErrorReport.jav
a:32)
at
com.ibm.servlet.engine.webapp.UncaughtServletException.<init>(UncaughtServle
tException.java:11)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W
ebAppRequestDispatcher.java:355)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest
Dispatcher.java:175)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD
ispatcher.java:93)
at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.
java:77)
at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn
vocation.java:67)
at
com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(Cacheabl
eInvocationContext.java:106)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ
estProcessor.java:160)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener
.java:300)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQ
EventListenerImp.java:230)
at
com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventL
istenerImp.java:104)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQE
ventSource.java:212)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.notifyService(SQWrapperEventSource.java:347)
at
com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRu
nnable.run(SQWrapperEventSource.java:216)
at
com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run
(OutOfProcThread.java:248)
at java.lang.Thread.run(Thread.java:481)

Anybody able to clue me in how I can fix this?

Regards,
Mamading Ceesay


Ken Hygh

unread,
Mar 13, 2001, 12:12:53 PM3/13/01
to
Mamading,
Any NoSuchMethodError means that you compiled with one version of code, but are
executing with a class definition that's a different version that doesn't have
that method. Make sure you have this class in only one jar/zip/directory on the
classpath.

Ken

Mamading Ceesay

unread,
Mar 13, 2001, 12:57:06 PM3/13/01
to
Ken Hygh wrote in message <3AAE5515...@nc.rr.com>...

>
>Any NoSuchMethodError means that you compiled with one version of code, but
are
>executing with a class definition that's a different version that doesn't
have
>that method. Make sure you have this class in only one jar/zip/directory
on the
>classpath.
>


Thanks for your reply, Ken. I did make sure that I had the class in only
one place on the
classpath and as I said in the original post, the getUserName method which
is generating
the error is defined in the same JavaBean as the setNotesSession method
which was called
successfully.

However, the machine that WebSphere is running on has been rebooted and the
getUserName
method call is now working. Does this mean that WebSphere was cacheing a
copy of the
JavaBean class, and ignoring any subsequently modified and recompiled
version of the class,
despite the fact that I have only one compiled version of the code at any
given time? In other
words, am I going to have to restart WebSphere everytime I recompile my
JavaBean? That
can't be right!

Regards,
Mamading.


Rob Winston

unread,
Mar 13, 2001, 7:56:07 PM3/13/01
to
Depends on the class path. Webapp classpath is auto-reload (by default,
though this is configurable). Other classpaths (AppServer, Node) are not.
Typically you do not want JavaBean classes to be auto-reloaded because it
can cause problems if a reference to an instance of the class is stored in
the HttpSession.

"Mamading Ceesay" <mce...@coldspam.com> wrote in message
news:98lmio$kmq$1...@news.software.ibm.com...

0 new messages