Hey all,

I have a very frustrating problem.  I'm using JWS1.1.3 on my local PC
WinNT or 95 (so I'm using localhost or 127.0.0.1:8080).  I'm calling a
servlet on the JWS from a java pgm (which is called from an Applet).
All the Java pgm's are in the public_html/dir folder. Here's some JWS
specifics

JavaWebServer
Add Servlet
Name: emailAssessmentServlet
ClassName: dir.subdir.EmailAssessmentServlet

Add Servlet Alias
Alias:  /mailservlet         (the / is required by JWS)
Name: emailAssessmentServlet


I put EmailAssessmentServlet.class in these directories


C:\JavaWebServer1.1.3\public_html\dir\subdir\EmailAssessmentServlet.class

I also put it here (to see if it made a difference - it didn't)

C:\JavaWebServer1.1.3\servlets\dir\subdir\EmailAssessmentServlet.class

I also put it in C:\JavaWebServer1.1.3\servlets to cover all bases. No
go.

Here is some of the the code in my applet to call the servlet by the
alias.

m_strServlet = "http://127.0.0.1:8080/mailservlet"
URL u = new URL(m_strServlet);
System.out.println(u.toString() + "  is the u instance object");

 This does print http://127.0.0.1:8080/mailservlet on the Java console

// Open an HTTP connection to the URL.
URLConnection conn = u.openConnection();

// Make sure we can POST this object.
conn.setDoOutput(true);

// Compress the object as we write it to the output stream.
ObjectOutputStream oos = new ObjectOutputStream(new
GZIPOutputStream(conn.getOutputStream()));

// Write the object.
     System.out.printline("Before write");
oos.writeObject(a);
     System.out.printline("After write");

// Close the resources.
oos.close();

// See if the operation was a success or a failure.
BufferedReader reader = new BufferedReader(new
InputStreamReader(conn.getInputStream()));

if (reader == null)
            System.out.println("Buffered Reader is NULL");
      else
            System.out.println("Buffered Reader is NOT NULL");

// Read the result.
String result = reader.readLine();
System.out.println("Reader Result is " + result);

// Close the stream.
reader.close();

// Test the results.
if (!Resources.SUCCESS.equals(result)) {
      throw new AssessmentCommandException("Operation Failed.");
            }

   } catch (AssessmentCommandException acex) {
        System.out.println("AssessmentCommandException");
        throw acex;
   } catch (Exception ex) {
        System.out.println("Exception");
        ex.printStackTrace();
        throw new AssessmentCommandException(ex.getMessage());
       }
}

I see all the correct messages until it goes to close the oos object.
Then I get the message
                Exception

and the printStactTrace says

      java.io.FileNotFoundException: 127.0.0.1:8080//mailservlet

I don't know how the "//" is getting in the middle of the URL.  It's
not there on the Java Console when I do the println!

I can't see anything wrong and am due to be admitted to the Dallas
Mental Institution any day now.

Does anyone have any clues I can try?

BTW, the Servlet sends an email and after four days of working on this
I've successfully sent it a few times but then I can't recreate the
successful attempts.

Here is a different topic question regarding Servlets.  If a servlet is
compiled and uses a few other custom object classes (like as serialized
input) and the source custom object changes but the servlet is not
recompiled - will this or can this cause a problem?  Does the Servlet
need to be kept manually in sync with the objects it imports by
recompiling, or is it dynamic like custom java programs in a package?

Thank you all for any help you can provide in this.

Dave Updike
Greenbrier & Russel - Dallas Consulting

===
Dave Updike

http://www.KnowledgeMarks.com   "Know Your Stuff!"

Make it your START PAGE today!
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to