Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

BufferedReader - InputStreamHandler Error. please help.  thanks

Thread view: 
PythonAnimal@gmail.com - 16 Nov 2005 21:55 GMT
Hello I am executing the following code.  I seem to be getting this
error
java.lang.NoSuchMethodError:
uploadequity3.EquityUpdater.loadFile(Ljava/io/BufferedReader;)Z

but I am passing the following
InputStream inpStream = fileUploaded.getInputStream();
InputStreamReader inpStreamReader = new InputStreamReader(inpStream);
BufferedReader  bufRea = new BufferedReader(inpStreamReader);

I pass this bufRea to a class.method(BufferedReader read)

When I pass the bufferedReader to this method I get teh previous error.
I was wondering, usually I pass a fileReader to a buffered reader but
because I am using a FormFile I can not do this.  This is a struts app.
Am I passing the wrong stream.  I see BufferedReader accepts a Reader,
is passing an InputStreamReader OK?
Thank-you!!
PythonAnimal@gmail.com - 16 Nov 2005 22:25 GMT
Here is the full stack trace..
java.lang.NoSuchMethodError:
uploadequity3.EquityUpdater.loadFile(Ljava/io/BufferedReader;)Z
    uploadequity3.FileUploadAction.execute(FileUploadAction.java:41)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
John C. Bollinger - 17 Nov 2005 01:01 GMT
> Here is the full stack trace..
> java.lang.NoSuchMethodError:
[quoted text clipped - 6 lines]
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

From the API docs:
====
public class NoSuchMethodError
extends IncompatibleClassChangeError

Thrown if an application tries to call a specified method of a class
(either static or instance), and that class no longer has a definition
of that method.

Normally, this error is caught by the compiler; this error can only
occur at run time if the definition of a class has incompatibly changed.
====

So, have you modified uploadequity3.FileUploadAction or
uploadequity3.EquityUpdater recently?  You somehow have managed to get
unmatched versions of these classes trying to work together.

Signature

John Bollinger
jobollin@indiana.edu

Roedy Green - 17 Nov 2005 01:17 GMT
>java.lang.NoSuchMethodError:
http://mindprod.com/jgloss/runerrormessages.html#NOSUCHMETHODERROR
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

PythonAnimal@gmail.com - 17 Nov 2005 22:25 GMT
Hi Me again, I Rechecked everything, I actually removed all the class
files and compiled everyting (javac *.java).  In one of my classes I
have a class loadFile(InputStream stream) - class compiles fine, But my
other class can not find this class.   I get
javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoSuchMethodError:
uploadequity3.EquityUpdater.loadFile(Ljava/io/InputStream;)Z
    uploadequity3.FileUploadAction.execute(FileUploadAction.java:42)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

Could it be because I am compiling one of hte classes on jbuilder,
while the other on UNIX??  I copy the class file over to the UNIX box.
Thanks in advance
John C. Bollinger - 18 Nov 2005 02:29 GMT
> Hi Me again, I Rechecked everything, I actually removed all the class
> files and compiled everyting (javac *.java).  In one of my classes I
[quoted text clipped - 13 lines]
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

This does not mean that one class cannot find another class.  To the
contrary, it means that one class finds the other just fine, but that
the class that was found does not contain a method that is supposed to
be there.

> Could it be because I am compiling one of hte classes on jbuilder,
> while the other on UNIX??  I copy the class file over to the UNIX box.

See my previous response in this thread.  This is not caused (directly)
by compiling one class in jbuilder and the other via javac on a UNIX
(tm) box.  HOWEVER, it could very well be caused by compiling the two
classes separately from incompatible sources.  If you cannot compile
them both in the same build, then at least ensure that the class for
EquityUploader *that will be used in production* is in the compilation
classpath for FileUploadAction, and that no other version is present.
(Watch out for out-of-date classes lying around.)  In the final extreme,
make sure you are compiling from identical sources in both places; your
version control system will help you there, presuming that you are using
one.

Signature

John Bollinger
jobollin@indiana.edu

PythonAnimal@gmail.com - 18 Nov 2005 14:56 GMT
Yes I actually moved all teh .java files over and when I do javac
*.java the compilation works but if I do simple javac EquityU.java it
does not work.  I rm *.class and redid this still I keep getting an
older class file.  I am figuring out if it is looking in another
directory but all the class files are stored in my
WEB-INF/class/pakFolderName.  Frustrating using javac *.java then
seeing the class was not updated.
Thanks again John.  I appreciate it.
PythonAnimal@gmail.com - 18 Nov 2005 14:58 GMT
I get this error.
EquityUpdater.java:68: cannot resolve symbol
for 2-3 different classes, yet the classes are all in the same package
in the same directory.  But when I do javac *.java everything compiles
fine.  This is quite frustrating Thanks.
John C. Bollinger - 19 Nov 2005 02:16 GMT
> I get this error.
> EquityUpdater.java:68: cannot resolve symbol
> for 2-3 different classes, yet the classes are all in the same package
> in the same directory.  But when I do javac *.java everything compiles
> fine.  This is quite frustrating Thanks.

That may indicate something screwy with your source code (misspelled
package names, possibly combined with redundant source files, for
instance) or it may indicate a problem with how you're using javac.
Those are the most likely things that occur to me, anyway.  I can't
offer any particular resolution, however, because I don't have any real
lead on a specific problem.

Signature

John Bollinger
jobollin@indiana.edu

John C. Bollinger - 19 Nov 2005 02:10 GMT
> Yes I actually moved all teh .java files over and when I do javac
> *.java the compilation works but if I do simple javac EquityU.java it
[quoted text clipped - 3 lines]
> WEB-INF/class/pakFolderName.  Frustrating using javac *.java then
> seeing the class was not updated.

You mean WEB-INF/classes/pakFolderName, I suppose.  Watch out for
another copy of your classes in a jar in WEB-INF/lib, as those would
also be in your webapp's class path.  Also watch out for copies in other
directories that your servlet container puts in your class path; these
directories depend on the container, so check the documentation.

Signature

John Bollinger
jobollin@indiana.edu



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.