Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default My Applet is giving error with I communicate with servlet.

    Please help me.
    My problem is:-
    I have create Applet and one Servlet, now I wnat to read string from servle in applet , now error is occure when run applet .
    Error is:-

    Java Code:
    java.io.FileNotFoundException: http://localhost:8080/AppletServletExample/servlet/com.ServletExample
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    	at com.AppletCallingServlet.paint(AppletCallingServlet.java:34)
    	at sun.awt.RepaintArea.paintComponent(Unknown Source)
    	at sun.awt.RepaintArea.paint(Unknown Source)
    	at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$000(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue$2.run(Unknown Source)
    	at java.awt.EventQueue$2.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    ok
    java.io.FileNotFoundException: http://localhost:8080/AppletServletExample/servlet/com.ServletExample
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    	at com.AppletCallingServlet.paint(AppletCallingServlet.java:34)
    	at sun.awt.RepaintArea.paintComponent(Unknown Source)
    	at sun.awt.RepaintArea.paint(Unknown Source)
    	at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$000(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.awt.EventQueue$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue$2.run(Unknown Source)
    	at java.awt.EventQueue$2.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)

    I have tried to change the URL path, but not solving my problem.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: My Applet is giving error with I communicate with servlet.

    Is the error message you posted shown in the browser's java console?
    at com.AppletCallingServlet.paint(AppletCallingServle t.java:34)
    What does the source code that is causing the error look like?

    Does the server find the servlet code?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: My Applet is giving error with I communicate with servlet.

    Quote Originally Posted by Norm View Post
    Is the error message you posted shown in the browser's java console?

    What does the source code that is causing the error look like?

    Does the server find the servlet code?

    My Applet causing a error at the following line.
    ObjectInputStream input = new ObjectInputStream(servletConnection.getInputStream ());
    and How server find the servlet code?
    Last edited by ganesh.gothi@gmail.com; 05-30-2012 at 04:56 PM.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: My Applet is giving error with I communicate with servlet.

    How server find the servlet code?
    That is very important. You need to read the doc for the server to see where and how to place the class files for the servlets.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Why is out.println giving me a compiling error?
    By dragstang86 in forum New To Java
    Replies: 5
    Last Post: 06-20-2011, 02:37 AM
  2. JavaCompiler giving an error WITHOUT ide
    By divs1210 in forum Advanced Java
    Replies: 9
    Last Post: 04-09-2011, 01:04 AM
  3. Java code giving error
    By alfarida in forum New To Java
    Replies: 3
    Last Post: 11-10-2010, 07:11 PM
  4. Giving Inputs to Java Applet
    By rasikh in forum Java Applets
    Replies: 2
    Last Post: 10-05-2009, 03:08 PM
  5. Replies: 1
    Last Post: 07-06-2007, 05:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •