Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > The method is undefined for the type - ERROR !!!

Reply
Thread Tools

The method is undefined for the type - ERROR !!!

 
 
Danijel
Guest
Posts: n/a
 
      08-07-2005
Hi !

When I execute this code on localhost in jsp page everything works good.
Sever is Tomcat 5.5.9, class Film exists and it consists of static method
named isLookedByUser() that takes 2 parameters User and String.
Everything works perfect localy but...

<%
if (Film.isLookedByUser(user,sifraFilma){
do something ...
}
%>


When I upload on real server (also Tomcat 5.5.9 but working on Linux) I get
some stupid error that method is undefined for this class. That is simply
not true I checked that 100 times. Method exists on server also.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 31 in the jsp file: /proba.jsp
Generated servlet error:
The method isLookedByUser(User, String) is undefined for the type Film


org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandle
r.java:84)

org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:3
2

org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:28
org.apache.jasper.compiler.Compiler.compile(Compil er.java:267)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:255)

org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:5
56)

org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:2
93)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


For almost 3 days I cant find solution. Can someone help me Please.
Locally everything works fine but on server doesn't.


Thank's in advanced !
Danijel



 
Reply With Quote
 
 
 
 
Thomas Hawtin
Guest
Posts: n/a
 
      08-08-2005
Danijel wrote:
>
> <%
> if (Film.isLookedByUser(user,sifraFilma){

^)
> do something ...
> }
> %>
>
>
> When I upload on real server (also Tomcat 5.5.9 but working on Linux) I get
> some stupid error that method is undefined for this class. That is simply
> not true I checked that 100 times. Method exists on server also.
>
> [...]
> The method isLookedByUser(User, String) is undefined for the type Film


Can you do anything with the type Film from the JSP? Sometimes there can
be problems with not reloading classes, or they might not be in the
correct place. A short but complete example that demonstrate the problem
would be useful.

My guess is that Film is in the default package. JSPs are correctly
generated in a package of the JSP implementation's choosing. Film is
therefore in a different packages and isn't looked at. You can't even
import it with recent versions of javac (from 1.4ish?). You therefore
need to put Film in some package, and import it.

Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
 
Reply With Quote
 
 
 
 
Danijel
Guest
Posts: n/a
 
      08-08-2005
No Film class is working fine for other methods when uploaded to server.
Problem is this last method enterd.
Code works fine on local machine and package is checked 100 times. All my
classes are in same package.
That is why this problem drives me crazy.



"Thomas Hawtin" <(E-Mail Removed)> wrote in message
news:42f6a3cc$0$91529$(E-Mail Removed)...
> Danijel wrote:
> >
> > <%
> > if (Film.isLookedByUser(user,sifraFilma){

> ^)
> > do something ...
> > }
> > %>
> >
> >
> > When I upload on real server (also Tomcat 5.5.9 but working on Linux) I

get
> > some stupid error that method is undefined for this class. That is

simply
> > not true I checked that 100 times. Method exists on server also.
> >
> > [...]
> > The method isLookedByUser(User, String) is undefined for the type Film

>
> Can you do anything with the type Film from the JSP? Sometimes there can
> be problems with not reloading classes, or they might not be in the
> correct place. A short but complete example that demonstrate the problem
> would be useful.
>
> My guess is that Film is in the default package. JSPs are correctly
> generated in a package of the JSP implementation's choosing. Film is
> therefore in a different packages and isn't looked at. You can't even
> import it with recent versions of javac (from 1.4ish?). You therefore
> need to put Film in some package, and import it.
>
> Tom Hawtin
> --
> Unemployed English Java programmer
> http://jroller.com/page/tackline/



 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      08-14-2005
On Mon, 8 Aug 2005 01:16:07 +0200, "Danijel" <(E-Mail Removed)>
wrote or quoted :

>
>When I upload on real server (also Tomcat 5.5.9 but working on Linux) I get
>some stupid error that method is undefined for this class. That is simply
>not true I checked that 100 times. Method exists on server also.


Is this the only class misbehaving?

What is different about it from the others that do work?

Try deleting generated java and class files to force them to be
regenerated.

Perhaps the problem is simply you spelled the class or method
different ways or with different caps. You have to be a fanatically
good or at least a consistent speller to make Java work.

Sometimes I cut and paste to ensure two complex names are absolutely
identical and discover that my eyes were ignoring a typo,
 
Reply With Quote
 
chncho chncho is offline
Junior Member
Join Date: Jul 2012
Posts: 1
 
      07-24-2012
Quote:
Originally Posted by Danijel View Post
Hi !

When I execute this code on localhost in jsp page everything works good.
Sever is Tomcat 5.5.9, class Film exists and it consists of static method
named isLookedByUser() that takes 2 parameters User and String.
Everything works perfect localy but...

<%
if (Film.isLookedByUser(user,sifraFilma){
do something ...
}
%>


When I upload on real server (also Tomcat 5.5.9 but working on Linux) I get
some stupid error that method is undefined for this class. That is simply
not true I checked that 100 times. Method exists on server also.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 31 in the jsp file: /proba.jsp
Generated servlet error:
The method isLookedByUser(User, String) is undefined for the type Film


org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandle
r.java:84)

org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:3
2

org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:28
org.apache.jasper.compiler.Compiler.compile(Compil er.java:267)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:255)

org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:5
56)

org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:2
93)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


For almost 3 days I cant find solution. Can someone help me Please.
Locally everything works fine but on server doesn't.


Thank's in advanced !
Danijel
I have the same problem, also.Have you solve your problem?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefine Method Only Marks the Method Undefined Su Zhang Ruby 3 04-18-2011 12:11 AM
undefined vs. undefined (was: new Array() vs []) VK Javascript 45 09-12-2006 05:26 PM
undefined behavior or not undefined behavior? That is the question Mantorok Redgormor C Programming 70 02-17-2004 02:46 PM
Re: How do I access another type's method from one type's method Howard C++ 2 07-04-2003 12:08 PM
Re: How do I access another type's method from one type's method Rolf Magnus C++ 1 07-04-2003 02:38 AM



Advertisments