Hi,

I think the problem is that your ssock object is not assign, you only assign
it as null but in the try block
you try to use this object's accept method, but it is still null, thus the
"java.lang.NullPointerException" error

    GSIServerSocket ssock = null;
     ...
     ...
    try{
      sock = (IaikGSISocket)ssock.accept();


HTH

Best Regards,

Lim Yong How
Software Engineer
Ryeson Security International
180B Bencoolen Street #10-01/02 The Bencoolen Singapore 189648
www.ryeson.com <http://www.ryeson.com>

____________________________________________________________________________
________________________

The information contained in this e-mail message is intended only for the
use of the person or entity to whom it is addressed and may contain
information that is CONFIDENTIAL and may be LEGALLY PRIVILEGED and exempt
from disclosure under applicable laws. If you read this message and are not
the addressee you are notified that use, dissemination, distribution, or
reproduction of this message is prohibited. If you have received this
message in error, please notify us immediately and delete the original
message.
____________________________________________________________________________
__________________



-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API
Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of SUBSCRIBE
EJB-INTEREST J.H,Feng
Sent: Saturday, 28 December, 2002 10:14 AM
To: [EMAIL PROTECTED]
Subject: About Servlet as a Service.


Hi,
   My needs is below:
   I want to have a servlet ,which initiate a ServerSocket , then waiting
for client's connection. the client is
a Applet.I do is in my servlet.
////////////////////////////////////////////////////////////////

 public void init() throws ServletException {
    //class server i defined in another file.
    server server1=new server(8888);
    GSIServerSocket ssock = null;
    IaikGSISocket sock;
    GlobusProxy proxy = null;
    InputStream in = null;
    OutputStream out = null;
    try{
      sock = (IaikGSISocket)ssock.accept();
      out = sock.getOutputStream();
      in = sock.getInputStream();
      proxy = sock.handleDelegation();
    }catch(IOException e){
      System.out.println("Error:accept!");
      e.printStackTrace(System.err);
    }
 }
////////////////////////////////////////////////////////////////
I test my servlet,Errors,have you any idea to do this?thanks a lot.


java.lang.NullPointerException
        at demoservlet.Servlet1.init(Servlet1.java:37)
        at javax.servlet.GenericServlet.init(GenericServlet.java:258)
        at
com.caucho.server.http.Application.createServlet(Application.java:3103)
        at
com.caucho.server.http.Application.loadServlet(Application.java:3054)
        at
com.caucho.server.http.QServletConfig.loadServlet(QServletConfig.java:418)
        at
com.caucho.server.http.Application.getFilterChainServlet(Application.java:27
94)
        at
com.caucho.server.http.Application.buildFilterChain(Application.java:2750)
        at com.caucho.server.http.Invocation.service(Invocation.java:310)
        at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:244)
        at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
        at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
        at java.lang.Thread.run(Thread.java:536)





J.H,Feng

___________________________________________________________________________
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

___________________________________________________________________________
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