Server/client application

i'm just starting to learn about server/client applications and i'm a little confused about actually implementing them.
my client will be an applet which can be accessed over the internet. i want the applet to be able to read/write to the server.
now my question is, how can i start up the server program?
i would want it to initialize and run, only when the user has gone to the website that uses the applet.

look at using a Servlet, running under Tomcat (download the Java Web Services Developer pack from java.sun.com
here's what the servlet looks like:
mport javax.servlet.*;
import java.util.*;
import java.net.*;
public class ServletTest extends GenericServlet
/** servlet is initialising */
public void init()
System.out.println("ServletTest initializing");
/** servlet wascalled bt client */
public void service(ServletRequest request,ServletResponse response)
try
byte[] data=new byte[100];
ServletInputStream inputStream=request.getInputStream();
int read=inputStream.read(data);
String string=URLDecoder.decode(new String(data,0,read),"UTF-8");
System.out.println("read "+read+" bytes: "+string);
inputStream.close();
ServletOutputStream outputStream=response.getOutputStream();
Date date=new Date();
outputStream.write(date.toString().getBytes());
outputStream.close();
catch(Exception ex)
ex.printStackTrace();
/** servlet is being destroyed */
public void destroy()
System.out.println("ServletTest terminating");
here's what the client looks like:
mport javax.servlet.*;
import java.util.*;
import java.net.*;
public class ServletTest extends GenericServlet
/** servlet is initialising */
public void init()
System.out.println("ServletTest initializing");
/** servlet wascalled bt client */
public void service(ServletRequest request,ServletResponse response)
try
byte[] data=new byte[100];
ServletInputStream inputStream=request.getInputStream();
int read=inputStream.read(data);
String string=URLDecoder.decode(new String(data,0,read),"UTF-8");
System.out.println("read "+read+" bytes: "+string);
inputStream.close();
ServletOutputStream outputStream=response.getOutputStream();
Date date=new Date();
outputStream.write(date.toString().getBytes());
outputStream.close();
catch(Exception ex)
ex.printStackTrace();
/** servlet is being destroyed */
public void destroy()
System.out.println("ServletTest terminating");

Similar Messages

  • Python Server/Client Application Development

    Hey All!
    I am writing a basic proof of concept server/client application for a project I am working on.
    My goal is this:
    1) End user launches client.
    2) Client connects to server.
    3) User selects one or more files to send to server.
    4) Server saves a copy of each file.
    5) Server terminates connection.
    5) Server processes each file.
    6) Upon completion of the processing server sets a "processing completed flag."
    7) Client periodically checks with server for "processing completed flag."
    8) Client securely reconnects
    9) Client downloads processed files.
    I have no background in programming servers/clients so this will be a learning experience for me and the workflow described above may change as I learn more about how this all works. Currently my hope is to first implement a system that will stay connected while the files are processed and once I have a better understanding as to how that works I can add more complexity to the system.
    I will be writing this in Python 3.3 and the server will be hosted on a server which will (for now) be running Arch.
    This thread will act as a sort of development journal but feel free to comment or post suggestions. I will for sure have questions as I go along too!

    brettski wrote:Turns out the best way (so far as I can tell) is to go integer -> string -> byte and then byte -> string -> integer..
    Do you mean regular, non-byte strings? That cannot possibly be the best way to do it. It would be like using Russian as an intermediary language for translating Spanish to French.
    Maybe the following will set you on the right path:
    http://stackoverflow.com/questions/6187 … -in-python
    http://stackoverflow.com/questions/4445 … int-python
    Looking further, this is probably the right way to do it:
    some_int = 57
    bytes = struct.pack('i', bytes)
    sock.send(bytes)
    See http://docs.python.org/3/library/struct.html for details.
    As for threaded servers, you may find some useful examples here.

  • Does a sql server client application needs to be modified to allow it to have benefits of running on a SQL Server 2012 cluster?

    I have a client application in c++ which interacts with sql server database. My question is whether I need to make any changes to the client application code to allow it to have the benefits of running on a SQL server 2012 cluster environment. 
    To elaborate more on my query my concern is for e.g if my application has called an api to execute a sql query and during
    the execution of this query the sql server (part of the cluster) goes down then as per my understanding the sql cluster would ensure that another node takes up the task from the current sql server which has gone down. Is this transition transparent to the
    client application or in such a case my client application needs to again make a new connection and again execute the query?

    Hello,
    Just as Shanky post above, When you connected to a database in an availability group and specify the availability group listener in the connection string, if the availability group fails over, the original connection is broken, your application
    should try a new connection after the failover.
    So, when connect to an availability group, please try to increasing connection timeout and implementing connection retry logic to increase the probability of successful connection.
    Reference:SqlClient Support for High Availability, Disaster Recovery
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    Fanny Liu
    TechNet Community Support

  • Forwarding messages server -- clients

    hey guys im still having trouble with my server/client application. I have created a TCP connection orientated client/server application which allows multiple clients to be connected to the one server. my problem is, is that i want the server to "forward" the messages recieved by one client to all the others and i am having trouble doing this.. would a hashtable be my best option?!?!?
    Thanking you guys in advance.. dave-o

    I have your same problem.
    One solution I though was to keep track of the number of clients and then fordward to all of them except to the one which send the data.
    Would be nice if some one give us more ideas.

  • TELNET Server-Client Error

    I have created a server-client application wherein my client sends a text file to the server. Both the server & client applications are configured using the TELNET VI's. When the Server end is connected to the internet through a dial-up connection & client is connected through either dial-up or through any broad-band service(static IP) data exchange takes place.
    But if I connect the Server end to the internet through any broad-band connection it shows error 56. Have set time-out as -1, so i think time-out should'nt be a problem.
    Is it that listeners created in the Server application are built only to receive data from a dial-up connection & not through any broad-band connection.
    Jalpa

    Is there a reason you are using Telnet. There are example that ship with LV that show communications using a TCP connection. When communicating between two instances of LV you might also want to consider VI Server and a communications mechanism.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Search Server 2010 Express: Open a PDF document from list of search results invokes adobe reader client application with error

    Hi community,
    I set up search server 2010 express on a windows 2008 r2 server.
    The Adobe PDF iFilter 9 64 bit is installed and search is correctly configured to find PDF-files.
    When doing a search and clicking on a link of the result page, the PDF is not opened in the browser, instead the adobe reader XI client application (11.0.04) is invoked and an error raised like "could not open document .. check syntax of url..."
    Right click on a link to open in new tab works fine. And PDF-Files from other arbitrary Internet Sites opens in browser correctly. Moreover when configure Adobe Acrobat Pro 9 as default application on the client it also open in Browser correctly.
    I noticed googling the web there are several challenges when dealing with PDF-files in sharepoint. The following settings are made so far:
    1. In IE: Add-On to open PDF in Browser is enabled for all sites.
    2. Client Integration is enabled
    3. The OpenControl attribute in the DOCICON.xml is left empty OpenControl="" for the pdf entry.
    4. The Browser File Handling is set to "Permissive".
    Please feel free to ask for more information if needed.
    I appreciate any help on this. I don't know what to do further.
    Thanks in advance.

    Thanks for the reply.
    Before responding to your points I want to give a little more context:
    We have an intranet based on pure html and a little aspx containing many of those pdf- files. By clicking on the links in the intranet the files open correctly in browser handled by the adobe plugin. Now we set up this search server crawling the file system
    accessed through a share to the root folder of the intranet. In the search server settings a host mapping rule is applied to replace the file://[share] with http://[intranet host+domain+port] to access files over http.
    And now to answer your question. The resulting urls are the same, copying the link from intranet and copying the link from the search result (except some case issues).
    The event viewer not seem to show any errors on this, though I'm not very familiar using it.
    If any further information are from interest and any ideas come to your mind - please let me know.
    Thanks.

  • Best practice for client-server(Socket) application

    I want to build a client-server application
    1) On startup.. client creates connection to Server and keeps reading data from server
    2) Server keeps on sending different messages
    3) Based on messages(Async) from server client view has to be changed
    I tried different cases ended up facing IllegalStateChangeException while updating GUI
    So what is the best way to do this?
    Please give a working example .
    Thanks,
    Vijay
    Edited by: 844427 on Jan 12, 2012 12:15 AM
    Edited by: 844427 on Jan 12, 2012 12:16 AM

    Hi EJP,
    Thanks for the suggestion ,
    Here is sample code :
    public class Lobby implements LobbyModelsChangeListener{
        Stage stage;
        ListView<String> listView;
        ObservableList ol;
         public Lobby(Stage primaryStage) {
            stage = primaryStage;
               ProxyServer.startReadFromServer();//Connects to Socket Server
             ProxyServer.addLobbyModelChangeListener(this);//So that any data from server is fetched to Lobby
            init();
        private void init() {
              ProxyServer.getLobbyList();//Send
            ol = FXCollections.observableArrayList(
              "Loading Data..."
            ol.addListener(new ListChangeListener(){
                @Override
                public void onChanged(Change change) {
                    listView.setItems(ol);
         Group root = new Group();
        stage.setScene(new Scene(root));
         listView = new ListView<String>();
        listView.maxWidth(stage.getWidth());
         listView.setItems(ol);
         listView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        istView.setOnMouseClicked(new EventHandler<MouseEvent>(){
                @Override
                public void handle(MouseEvent t) {
    //                ListView lv = (ListView) t.getSource();
                    new NewPage(stage);
         root.getChildren().add(listView);
         @Override
        public void updateLobby(LobbyListModel[] changes) {
    //        listView.getItems().clear();
            String[] ar = new String[changes.length];
            for(int i=0;i<changes.length;i++)
                if(changes!=null)
    System.out.println(changes[i].getName());
    ar[i] = changes[i].getName();
    ol.addAll(ar);
    ProxyServer.javaProxyServer
    //Implements runnable
    public void run()
         ......//code to read data from server
    //make array of LobbyListModel[] ltm based on data from server
         fireLobbyModelChangeEvent(ltm);
    void addLobbyModelChangeListener(LobbyModelsChangeListener aThis) {
    this.lobbyModelsChangeListener = aThis;
         private void fireLobbyModelChangeEvent(LobbyListModel[] changes) {
    LobbyModelsChangeListener listner
    = (LobbyModelsChangeListener) lobbyModelsChangeListener;
    listner.updateLobby(changes);
    Exception :
    java.lang.IllegalStateException: Not on FX application thread; currentThread = Thread-5
             at line         ol.addAll(ar);
    But ListView is getting updated with new data...so not sure if its right way to proceed...
    Thanks,
    Vijay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Client-server database application...

    Hi there!
    I'm about to write a database-application and I wonder if the following approach is to prefer or not:
    I want to use a MySQL-database and there shall be about eight client-applications which all shall be able to use it. I think of solving the above with RMI (I want to create/deploy a server wich will contain all the different SQL-queries on the same site as where I install the MySQL-database ). From the clients I just, with RMI, invoce the methods on the server which contains the different queries I want to use. In other words all the database-functionality is located on the server somewhat like stored procedures. To make it work each client must be assigned a thread of its own on the server...is this right?
    The advantages of the above which I can think of is: I just need to stuff one J/Connector driver in the JRE (on the server). Another is that I can use the nameservice of RMI... are there others?
    Is the above a good / usual or even bad approach?
    Is it more usual or even better to just provide the database-functionality (SQL-queries) in the clients and provide every client with the J/Connector driver?
    Thanks in advance!

    You noted that there will be "eight client-applications" - does that refer to eight users or eight programs using the database? This is important in determining your course of action.
    If you're talking about a small number of concurrent users (you have to define small), then you'll probably better off trying to do all the data/business logic in the app. If you're talking about a large number of concurrent users (again, your definition), your client/server paradigm might be better.
    To complicate things, unless you're doing this as a learning-on-your-own project (e.g. not getting paid for it), this is where you might want to evaluate using J2EE technoligies for your server-side implementation. Writing your own server is not a trivial task (been there, done that - pre-J2EE, of course): there's a lot of things you have to figure out how to handle. Well, that's true of even using J2EE, but there's some portion of what your server would need to do already taken care of in an application server.

  • Authentication in Client/Server form Application

    Hi
    My client/server application is not using oracle authentiacation, I have maintained user table from that user is authenticated, but any user logins in a application it uses same oracle username/PWD which I currently hardcoded in a forms 6i (C/S type on logon event) application.
    My client is located in different geographicaly location, when I change oracle database password I need to compile client application and diployed it again.
    Is there any way that I can avoid this. I don't want to give database Un/Pwd to any client user. He only have application username and password.
    Thanks
    Sudarshan

    Hello,
    While installing developer you can select components to
    Install, Options listed are Forms runtime and Reports runtime.
    and it will make your work done.
    Adi

  • Client application freezes permanently when one user logoff and another user take that session on windows server 2008 r2

    Hi,
    we have windows server 2008 r2 and In our application there are three server and on e client application.
    My client application freezes on a specific scenario.
    Steps taken to hang are following:-
    1. start client application
    2. open an module named by XYZ
    3. login to remote machine with another session./ Another user login from their computer.
    4. connect with the session which have client application opened.
    5. Whenever the session is forcibly taken client application becomes unresponsive.

    Hello,
    The Windows Desktop Perfmon and Diagnostic tools forum is to discuss performance monitor (perfmon), resource monitor (resmon), and task manager, focusing on HOW-TO, Errors/Problems, and usage scenarios.
    Since your post is off-topic, I am moving it to the
    off topic forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Ways to Configure Which UNIX Server a PC Client Application Communicates With

    We have several different MS VC++ "fat client" applications that we want to run
    on the same NT 4.0 PC.
    Each application uses the Tuxedo 7.1 client to communicate with Tuxedo services
    located on a UNIX server.
    Each application needs to communicate with a different UNIX server (e.g., application
    A1 needs Tuxedo
    service T1 located on UNIX server S1, application A2 needs Tuxedo service T2 located
    on UNIX server
    S2). We'd like to load the Tuxedo 7.1 client software in such a way that each
    individual application
    controls which server it uses. One way to do that is through registry entries
    specific to each application.
    We are looking for some documentation or tips on other/better ways to configure
    which server the PC
    application communicates with. We are also looking for some documentation or
    tips on how to best
    configure an application that needs to subscribe to services from several different
    servers (e.g.,
    application A needs Tuxedo service T1 on server S1 and Tuxedo service T2 on server
    S2). Thanks.

    Matt,
    This sounds quite unusual, and I am not sure why you want to do things this way.
    Generally, I would expect that the services would be distributed on the server side over
    different boxes as you describe, but the location would be transparent to a client app.
    which would tpinit once, and Tuxedo would route the requests appropriately. Maybe that's
    not how you want to do things because the apps are all logically independent? I'm not
    sure about that though, since you describe needing services on different servers in
    individual clients... Can you do the integration at the back end?
    To do what you describe, however, you need to control the value of the WSNADDR
    environment variable before you call tpinit() - it is the network address in this
    variable that tells the client libraries which server to connect to. Simply set the
    value (from a command line parameter, the registry, an ini file or wherever) with the
    tuxputenv() API before you call tpinit()
    In Tuxedo 7.1 and higher, it is also possible to connect to multiple different servers
    simultaneousy by calling tpinit multiple times and having multiple contexts in the
    client.
    I hope that helps.
    Regards,
    Peter.
    Got a Question? Ask BEA at http://askbea.bea.com
    The views expressed in this posting are solely those of the author, and BEA
    Systems, Inc. does not endorse any of these views.
    BEA Systems, Inc. is not responsible for the accuracy or completeness of the
    information provided
    and assumes no duty to correct, expand upon, delete or update any of the
    information contained in this posting.
    Matt wrote:
    We have several different MS VC++ "fat client" applications that we want to run
    on the same NT 4.0 PC.
    Each application uses the Tuxedo 7.1 client to communicate with Tuxedo services
    located on a UNIX server.
    Each application needs to communicate with a different UNIX server (e.g., application
    A1 needs Tuxedo
    service T1 located on UNIX server S1, application A2 needs Tuxedo service T2 located
    on UNIX server
    S2). We'd like to load the Tuxedo 7.1 client software in such a way that each
    individual application
    controls which server it uses. One way to do that is through registry entries
    specific to each application.
    We are looking for some documentation or tips on other/better ways to configure
    which server the PC
    application communicates with. We are also looking for some documentation or
    tips on how to best
    configure an application that needs to subscribe to services from several different
    servers (e.g.,
    application A needs Tuxedo service T1 on server S1 and Tuxedo service T2 on server
    S2). Thanks.

  • Final cut server not serving java client application

    weird situation. today i went to download the java client for final cut server 1.5.1 at my normal address and the webpage came up welcome.. with the ability to download the client application as normal but when i pressed the button to download nothing happened.
    anyone have any ideas how to resolve this? manually removed all of the client java cache on the client machine and also reinstalled fcs 1.5.1 on the server with a restore of the database without any change in functionality. any ideas?

    hello ben,
    thanks for taking your time to help me with the issue i am seeing here. I will do my best to read into what you said and explain.
    1. Network User Permissions Problems.
    maybe you can explain, but i have not authenticated against anything at this point, just went to the normal.. "http://FQDN/finalcutserver"... the normal fcserver webpage comes up but when i click download it does not give me the ability to download the java applet or run a script that maybe delivers the java applet.
    maybe i am not understanding, but what about what i am experiencing looks like a permission issue? permission for fcserver to distribute the java applet to a user who goes to the final cut server web page to download the client?
    If that is the case, would you know where to start looking for permission issues?
    2. Verfy the web server services and comb through the user permissions and services on the server.
    The web services, service is on and when i look at the logs with any reference of final cut server, this is what i see right after when i try to download the client app.
    File does not exist:/Library/WebServer/Documents/FinalCutServer, referer: http://FQDN/~localadmin/webstart/content.php
    as far as the user permissions, what should i look for? there are very few users, the local admin, the open directory admin and 1 other user in od.
    with regard to services running on server 10.6.1 and how they affect final cut server.. checked use of how i would use AFP, DNS lookups, OpenDirectory & network homes, and Web services and appear to be working as far as i can tell.
    hope the above information helps. thanks in advance for helping troubleshoot.

  • Error while invoking a Dataservice from client application

    Hi,<br><br>
    Code snippet of Client to invoke DataService is....<br><br>
    Hashtable h = new Hashtable();<br>
    h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");<br>
    h.put(Context.PROVIDER_URL,"t3://10.1.5.31:7001");<br>
    h.put(Context.SECURITY_PRINCIPAL,"weblogic");<br>
    h.put(Context.SECURITY_CREDENTIALS,"weblogic"); <br>
    Context context = new InitialContext(h);<br>
    DataService ds =DataServiceFactory.newDataService(context, "HLCApp","ld:HLCAppDataServices/com/pfizer/hlc/dataservices/HCP_DETAILS"); <br>
    <u>DataObject obj= (DataObject) ds.invoke("HCP_DETAILS", null);</u><br>
    System.out.println(" HCP details : \n" + obj);
    <br><br><br>
    The line(which is underlind) is causing the error(I checked by putting some System.outs).
    <br>
    While invoking a DataService from the Client application(Java Client) I am getting the following error in the console.
    <br><br>
    Exception in thread "main" com.bea.ld.dsmediator.client.exception.SDOMediatorExc
    eption: com.bea.ld.dsmediator.client.exception.SDOMediatorException: weblogic.rj
    vm.PeerGoneException: ; nested exception is:
    java.io.EOFException
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invoke(XmlDataService
    Base.java:114)
    at com.pfizer.hlc.DSClient.HCP.main(HCP.java:23)
    Caused by: com.bea.ld.dsmediator.client.exception.SDOMediatorException: weblogic
    .rjvm.PeerGoneException: ; nested exception is:
    java.io.EOFException
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invokeQuery(XmlDataSe
    rviceBase.java:183)
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invoke(XmlDataService
    Base.java:102)
    ... 1 more
    Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
    java.io.EOFException
    at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
    ava:108)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:290)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:248)
    at com.bea.ld.Server_ydm4ie_EOImpl_816_WLStub.executeFunction(Unknown So
    urce)
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invokeQuery(XmlDataSe
    rviceBase.java:157)
    ... 2 more
    Caused by: java.io.EOFException
    at weblogic.rjvm.t3.T3JVMConnection.endOfStream(T3JVMConnection.java:897
    at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.ja
    va:599)
    at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:549)
    at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:707)
    at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:654)
    at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
    82)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
    32)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    <br><br><br><br>
    <b>And in the server's log file the exception is like below</b><br><br>
    <Nov 1, 2006 4:29:31 PM IST> <Error> <RJVM> <gsipl-c2-8> <cgServer> <ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <BEA-000503> <Incoming message header or abbreviation processing failed
    <b>java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940</b>
    java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940
         at java.io.ObjectStreamClass.initNonProxy(Ljava.io.ObjectStreamClass;Ljava.lang.Class;Ljava.lang.ClassNotFoundException;Ljava.io.ObjectStreamClass;)V(Unknown Source)
         at java.io.ObjectInputStream.readNonProxyDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
         at java.io.ObjectInputStream.readClassDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
         at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
         at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:33)
         at java.io.ObjectInputStream.readExternalData(Ljava.io.Externalizable;Ljava.io.ObjectStreamClass;)V(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
         at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
         at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
         at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
         at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:212)
         at weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.java:251)
         at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:748)
         at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:782)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    <br><br><br>
    <b>My workstation environment is</b>
    Weblogic 8.1 SP6,Aqualogic 2.0 ,os is WindowsXP and JDK is jrockit81sp6_142_10.
    <br><br><br>
    Does anyone have any idea, why i am getting this error.
    <br><br>
    Thanks,<br>
    Suresh varma.

    Hi Suresh varma
    Did you get any answer for your problem?
    I'm having the exact same problem. Working with Weblogic 8.1 SP6 and getting this strange message whenever I'm calling my data service.
    I've followed the guidlines given on the URL posted here, and still getting the same message.
    Let me know if you have any idea.
    Cheers
    Rod

  • Regaring file from FTP server to application server

    Hi frnds,
    Below is my code where i am transferring Presentation server file to FTP server.
    Now i want to transfer that file from FTP server to application server.
    any help. below i am providing my code.
    <code>
    *& Report  demo
    report  z_demo_ftp.
    Variables declaration
    data : mi_handle type i,
           pwd       type char30,
           slen      type i,
           key type i value 26101957,
           it_file2 type filetable,
           w_file2 like   line of it_file2,
           l_rc type i,
           v_index type i,
           v_file(30) type c,
           v_path(100) type c,
           v_path_tmp(100) type c.
    *Internal table declaration
    data: begin of mtab_data occurs 0,
           line(132) type c,
          end of mtab_data.
    Selection scree parameters
    parameters: p_file type string default 'C:\'.
    Get the file path
    at selection-screen on value-request for p_file.
      data: p_file1 type string.
      p_file1 = p_file.
      call method cl_gui_frontend_services=>file_open_dialog
        exporting
          default_filename        = p_file1
        changing
          file_table              = it_file2
          rc                      = l_rc
        exceptions
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        read table it_file2 into w_file2 index 1.
        p_file = w_file2-filename.
        clear w_file2.
        refresh it_file2.
        split p_file at '\' into table it_file2.
        describe table it_file2 lines v_index.
        read table it_file2 into w_file2 index v_index.
        concatenate 'put' w_file2-filename into v_file separated by space.
        delete it_file2 index v_index.
        clear w_file2.
        loop at it_file2 into w_file2.
        if sy-tabix = 1.
        v_path = w_file2-filename.
        endif.
        if sy-tabix ge 2.
        concatenate v_path '\' w_file2 into v_path.
        endif.
        endloop.
        concatenate 'lcd' v_path into v_path_tmp separated by space.
      endif.
    Start of selection
    start-of-selection.
    pwd = 'file456'.
    slen = strlen( pwd ).
    call function 'HTTP_SCRAMBLE'
      exporting
        source      = pwd
        sourcelen   = slen
        key         = key
      importing
        destination = pwd.
    Connect to FTP
    call function 'FTP_CONNECT'
      exporting
        user            = 'client'
        password        =  pwd
        host            = 'saturn'
        rfc_destination = 'SAPFTP'
      importing
        handle          = mi_handle
      exceptions
        not_connected   = 1
        others          = 2.
    if sy-subrc = 0.
    Excute FTP command
    call function 'FTP_COMMAND'
        exporting
          handle        = mi_handle
          command       = 'cd staff
        tables
          data          = mtab_data
        exceptions
          tcpip_error   = 1
          command_error = 2
          data_error    = 3
          others        = 4.
    Excute FTP command
          call function 'FTP_COMMAND'
        exporting
          handle        = mi_handle
          command       = v_path_tmp
        tables
          data          = mtab_data
        exceptions
          tcpip_error   = 1
          command_error = 2
          data_error    = 3
          others        = 4.
    Excute FTP command
      call function 'FTP_COMMAND'
        exporting
          handle        = mi_handle
          command       = v_file
        tables
          data          = mtab_data
        exceptions
          tcpip_error   = 1
          command_error = 2
          data_error    = 3
          others        = 4.
      if sy-subrc = 0.
        loop at mtab_data.
          write: / mtab_data.
        endloop.
      endif.
    endif.
    *FTP disconnect
    call function 'FTP_DISCONNECT'
      exporting
        handle = mi_handle
      exceptions
        others = 1.call function 'FTP_DISCONNECT'
      exporting
        handle = mi_handle
      exceptions
        others = 1.
          end-of-selection.
    </code>
    so what more code shuld i write.
    regards,
    kamal

    Hi Che Eky  ,
                          Actually the above code is for putting the presentation server file to FTP Server.
    But now i need to Put the same file present in the FTP server to Application server.
    So any help or code which will be helpful.
    regards,
    kamal

  • Java.nio select() method return 0 in my client application

    Hello,
    I'm developing a simple chat application who echo messages
    But my client application loop because the select() method return 0
    This is my code
    // SERVER
    package test;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    public class Server {
         private int port = 5001;
         public void work() {               
              try {
                   ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
                   serverSocketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(port);               
                   serverSocketChannel.socket().bind(isa);
                   Selector selector = Selector.open();
                   serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);
                   System.out.println("Listing on "+port);
                   while(selector.select()>0) {
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();) {
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isAcceptable()) {
                                  ServerSocketChannel keyChannel = (ServerSocketChannel)key.channel();                              
                                  SocketChannel channel = keyChannel.accept();
                                  channel.configureBlocking(false);                              
                                  channel.register(selector, SelectionKey.OP_READ );
                             } else if (key.isReadable()) {
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  String m = Help.read(keyChannel );
                                  Help.write(m.toUpperCase(), keyChannel );
              } catch (IOException e) {                                             
                   e.printStackTrace();                         
         public static void main(String[] args) {
              Server s = new Server();
              s.work();
    // CLIENT
    package test;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class Client extends JFrame  {
         private String host = "localhost";
         private int port = 5001;
         private SocketChannel socketChannel;
         private Selector selector;
         public void work() {               
              try {
                   socketChannel = SocketChannel.open();
                   socketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(host, port);               
                   socketChannel.connect(isa);
                   selector = Selector.open();
                   socketChannel.register(selector, SelectionKey.OP_CONNECT | SelectionKey.OP_READ );
                   while(true) {
                        selector.select();
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();) {
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isConnectable()) {
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  if (keyChannel.isConnectionPending()) {
                                       System.out.println("Connected "+keyChannel.finishConnect());                                                                           
                             } else if (key.isReadable()) {                                                                                                                                                           
                                  SocketChannel keyChannel = (SocketChannel) key.channel();                                             
                                  String m = Help.read(keyChannel);
                                  display(m);                                                                                                                                                                                                                   
              } catch (IOException e) {                                             
                   e.printStackTrace();                         
         private void display(final String m) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        area.append(m+"\n");
                        textFieed.setText("");
         private void sendMessage(final String m) {
              Thread t = new Thread(new Runnable() {               
                   public void run() {                                                                                
                        try {                         
                             Help.write(m, socketChannel);
                        } catch (IOException e) {               
                             e.printStackTrace();
              t.start();                    
         public Client() {
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(1);
              textFieed.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode()== KeyEvent.VK_ENTER) {
                             String m = textFieed.getText();
                             sendMessage(m);     
              area.setEditable(false);
              getContentPane().add(textFieed, "North");
              getContentPane().add(new JScrollPane(area));
              setBounds(200, 200, 400, 300);
              show();
         private String messageToSend;
         private JTextArea area = new JTextArea();
         JTextField textFieed = new JTextField();
         public static void main(String[] args) {
              Client s = new Client();
              s.work();
    // HELPER CLASS
    package test;
    import java.io.IOException;
    import java.nio.ByteBuffer;
    import java.nio.CharBuffer;
    import java.nio.channels.SocketChannel;
    import java.nio.charset.Charset;
    import java.nio.charset.CharsetDecoder;
    import java.nio.charset.CharsetEncoder;
    public class Help {
         private static Charset charset = Charset.forName("us-ascii");
         private static CharsetEncoder enc = charset.newEncoder();
         private static CharsetDecoder dec = charset.newDecoder();
         private static void log(String m) {
              System.out.println(m);
         public static String read(SocketChannel channel) throws IOException {
              log("*** start READ");                              
              int n;
              ByteBuffer buffer = ByteBuffer.allocate(1024);
              while((n = channel.read(buffer)) > 0) {
                   System.out.println("     adding "+n+" bytes");
              log("  BUFFER REMPLI : "+buffer);
              buffer.flip();               
              CharBuffer cb = dec.decode(buffer);          
              log("  CHARBUFFER : "+cb);
              String m = cb.toString();
              log("  MESSAGE : "+m);          
              log("*** end READ");
              //buffer.clear();
              return m;                    
         public static void write(String m, SocketChannel channel) throws IOException {          
              log("xxx start WRITE");          
              CharBuffer cb = CharBuffer.wrap(m);
              log("  CHARBUFFER : "+cb);          
              ByteBuffer  buffer = enc.encode(cb);
              log("  BUFFER ALLOUE REMPLI : "+buffer);
              int n;
              while(buffer.hasRemaining()) {
                   n = channel.write(buffer);                         
              System.out.println("  REMAINING : "+buffer.hasRemaining());
              log("xxx end WRITE");

    Here's the fix for that old problem. Change the work method to do the following
    - don't register interest in things that can't happen
    - when you connect register based on whether the connection is complete or pending.
    - add the OP_READ interest once the connection is complete.
    This doesn't fix all the other problems this code will have,
    eg.
    - what happens if a write is incomplete?
    - why does my code loop if I add OP_WRITE interest?
    - why does my interestOps or register method block?
    For code that answers all those questions see my obese post Taming the NIO Circus
    Here's the fixed up Client code
    // CLIENT
    package test
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class Client extends JFrame  {
         private String host = "localhost";
         private int port = 5001;
         private SocketChannel socketChannel;
         private Selector selector;
         public void work() {
              try {
                   socketChannel = SocketChannel.open();
                   socketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(host, port);
                   socketChannel.connect(isa);
                   selector = Selector.open();
                   int interest = 0;
                   if(socketChannel.isConnected())interest = SelectionKey.OP_READ;
                   else if(socketChannel.isConnectionPending())interest = SelectionKey.OP_CONNECT;
                   socketChannel.register(selector, interest);
                   while(true)
                        int nn = selector.select();
                        System.out.println("nn="+nn);
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();)
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isConnectable())
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  System.out.println("Connected "+keyChannel.finishConnect());
                                  key.interestOps(SelectionKey.OP_READ);
                             if (key.isReadable())
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  String m = Help.read(keyChannel);
                                  display(m);
              } catch (IOException e) {
                   e.printStackTrace();
         private void display(final String m) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        area.append(m+"\n");
                        textFieed.setText("");
         private void sendMessage(final String m) {
              Thread t = new Thread(new Runnable() {
                   public void run() {
                        try {
                             Help.write(m, socketChannel);
                        } catch (IOException e) {
                             e.printStackTrace();
              t.start();
         public Client() {
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(1);
              textFieed.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode()== KeyEvent.VK_ENTER) {
                             String m = textFieed.getText();
                             sendMessage(m);
              area.setEditable(false);
              getContentPane().add(textFieed, "North");
              getContentPane().add(new JScrollPane(area));
              setBounds(200, 200, 400, 300);
              show();
         private String messageToSend;
         private JTextArea area = new JTextArea();
         JTextField textFieed = new JTextField();
         public static void main(String[] args) {
              Client s = new Client();
              s.work();

Maybe you are looking for

  • I still haven't got the email for the 1 Year Creative Cloud with Adobe MAX

    No Email for my 1 Year Ceative Cloud Membership I purchased my Adobe MAX Full Conference Pass on the 24th of January. Its been about 14 days since then and i still have not recived my 1 Year Adobe Creative Cloud Membership from buying the pass. I hav

  • How to get selected row of an advanced table

    Hi All, I have created an advanced table with 5 rows and i can also add rows in that. Here my requirement is i want to get the data of a row which i have selected. There are 5 rows. i have entered data into all 5 rows. Suppose i have selected 3rd row

  • Upgraded to ios4, confused how to used ipod feature now?

    after recently installing the new software im now confused as to how i can use my i pod. When i go into it the 'songs' it says i have none, all my music is still available to view as albums but you seem to have to create playlists from the 'songs' se

  • Grid Control and Data Guard Setup

    Hi, I have 4 PCs on which I wish to test the following: 1. OEM Grid Control 10.2 - Console + Service + Agent 2. Data Guard feature with Broker 3. Standby Setup for a Primary Database. I will create the Primary DB on one Linux PC. Standby DB using Gri

  • Install Real Application Clusters (RAC) and Automated Storage Management (A

    Do I have to install Real Application Clusters (RAC) and Automated Storage Management (ASM) for ETL I have installed Oracle 10g Release 1 on WIndows 2000 with datawarehousing option. Is it ok Or do I need to install Oracle database again. Please help