Tips for Client-Server project please...

I've written a few Java apps (some very simple, some not quite so simple) so far and I think I'm ready to begin tackling my big goal. I want to create a distributable client desktop application that will actually be very simple in functionality. I want the clients to be able to connect to a server (that I will also be creating) for authentication and then allow automated messages to be sent to other clients also connected to the network. I'd like any links to tutorials, libraries, and anything else that would help point me in the right direction. Thanks!

Actually, if you're on about clients sending messages to each other, then you're not really talking about client-server apps at all. You're veering off into JMS territory, maybe even ESB territory(but probably not). Have a butchers at ActiveMQ, and Camel, both from Apache, for that.
Either way, I wouldn't bother creating your own server, just use an existing one. Jetty's nice and lightweight, and easy to embed. You're about to say "I'd rather create my own" but it's a bothersome task that people far more skilled than you (and me, before you take offence) have already done much better than you ever will. Take advantage of that fact, and concentrate on the specifics of your own app.

Similar Messages

  • Help in client server project

    Asalam-o-Alikum!
    I m writing client server project. In that project there are many classes that are being used in both (client application and server application). Im using JCreator and also netbeans 5.5 IDE. Plz anyone can help that should i design 1 project for cilent and server. or 2 different projects 1 for client and 1 for server. If i have to use 2 different projects than how can I make available those classes to both projects (client and server) that are being shared by client and server. and i have to make 1 project than how can i run both client and server separately.
    thanks in advance.

    Aslam-o-Alikum!
    I am designing a new project that depends on another project. I want to use the classes made in previous project into my new project. Someone (as above) has told me to make the jar file of that class and set the class path to that jar file. Anyone can further tell me that how can set the class path of that project into my new project. And how to import the classes from that project that i have made previously???
    Example:
    I am designing project name "A" and i have to use a class "b" that not the part of project "A". But actually it is part of project "B". That i have made previously. Please tell how this can be achieved? making jar file of project "B" is right answere then how can i set the path of project "B" in project "A". and how to import class "b" into project "A". I am using JCreator pro 4.0
    This is the summary of obove posts. so plz dont read above posts just read this and plz help me if u could.
    Plz reply me with a simple example.
    Thanks in advance...!

  • Help-Is 9ias a necessity even for client server deployment of forms6i

    Hi
    Is 9Ias a necessity even for client server deployment of forms6i using developerSuite. I have been told that Oracle no longer markets Forms Server?
    Ganesh.

    No for client server deployment you don't need iAS.
    On the second issue Forms server (the bit of forms used to web deploy) is no longer sold stand-alone - it is part of the iAS suite.

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • JavaFX as a SaaS/ How good is it for Client-Server work?

    I was under the impression that FX could be used to produce a Client-Server application as well as SaaS.
    a member of another forum said "I'm sure you meant to say "Desktop". JavaFX will not be making inroads on the web as a client-side technology."
    To which I said
    There have been examples of FX used with EE
    http://www.oracle.com/technetwork/java/javafx/samples/index.html
    http://docs.oracle.com/javafx/2/overview/jfxpub-overview.htm
    Sales Dashboard (DataApp)
    DataApp is a client-server application for a fictional global automobile company called Henley Car Sales. Automobile sales are simulated on an EJB server using JavaDB, and the data is available via Derby and a RESTful web service. The client demonstrates a variety of data presentations by using a mix of FXML and JavaFX.
    I thought originally that JavaFX was "Desktop" only also, until I found this example. I couldn't get it to run due to some weird Database line read issue that others also had. I'm not sure if this is now due to FX's integration, or if this was something new, but I believe I have seen another FX client-server app as well.
    I'm not that familiar with the client-server side of Java yet, so if you have other Information I would like to know, because I am looking to design a Client-Server app with FX, and I don't see why it would be an issue, unless there are huge limitations."
    He ended up saying "Those are still desktop apps. Sure, they are client-server in that they connect to a remote database. But they are still traditional fat-client apps rather than web-based thin-client SAAS web applications which, these days, most people will think of when you say "client".
    My point is to be more precise when you use the word "client".
    But if your point is just that JavaFX is taking over from Swing for the limited areas in which Swing is used, I have no insight into that area."
    Now I don't really like attitudes when I get my question answered, but the high and mighty needs to stop. It clearly says Client-Server so I don't know why it's being denounced by this dude who thinks he obviously knows better.
    Anyways he talks about it only being able to connect to a DB, to which it says it uses EE tech such as EBJ, Restful, and Derby, so that's more than just DB right(I don't know since I havent' learned that yet)?
    It seems as if he's saying that only EE code can go up on a server? Or can SE code go up there as well?
    I'm looking to design a SaaS software with FX, so if this isnt' possible I would like to know possible other options(or just having all of the gui work on the client, and the rest on the backend)???
    Thanks!
    ~KZ
    Edited by: KonradZuse on Apr 30, 2013 11:26 AM

    This response is not a tutorial, I hope it gives you some verbiage to use in further searches.
    SaaS to me means that the service is running on the server. If you have the server and permission to run java apps there then you can use Java FX by having the server shuttle requests to the Java FX app. But this is probably not the intent of Saas (it would be more appropriate to use a java implemented web service).
    If you are using Netbeans then it is very easy to create demo projects; use "File/New Project" to run them on your local computer.
    Example File/New Project/Java Web/Web Application will give you a hello world web site very quickly. This will 1) start either tomcat or glassfish as the server. 2) launch an html page with "hello world". then you can use java script to talk with the server via ajax. Using this approach you are going to need to study JSP or J2EE stuff.
    After this is running you could start one of the Java Fx examples in Netbeans: File / New Project / Samples / WebViewBrowser. This will start a javaFX app that acts like a browser and runs on the client.
    So, start the "hello world" app in netbeans by right clicking it in the project pain and selecting "debug". Then start the webviewBrowser app the same way to load that web page that has "hello world" in it as all browsers do. In the WebviewBrowser (which is java fx) you can get at the javascript in the web page and do all kinds of stuff. You'll need to search for webviewBrowser examples.
    The above all assumes a Netbeans solution. But, as you probably know, there are no rules. The server can be in C++ and the client in C (or any other language). The server and client usally communicate via http or tcp. So you could have a server written in java (maybe J2ee or you can rewrite a http server from scratch which isn't that hard - search for "HttpServletRequest and HttpSession" ) and the client can be in Java FX (where the Java FX talks directly with the server via http (no javascript or web page in the middle) again there are probably hundreds of libraries to talk to a http server).
    I use HttpServletRequest and HttpSession on the server side with MySQL and xml. On the client I use javaScript but I am moving to a strictly Java FX solution. This will give me close to 100% java on both sides and for my purposes this will work. (I may need a little html in the middle for drag and drop installation.) I am hoping that work continues with porting Java FX to most devices: Android, IOS, WinPhone. It is already on Linux, Windows Desktops and Mac.
    Edited by: KevinPas on May 1, 2013 9:50 AM
    Edited by: KevinPas on May 1, 2013 9:56 AM

  • MUDE for client-server configuration

    I can easily connect from a client remotely to a server hosting OBIEE, by creating a ODBC system DSN that points to
    the server, and choosing this DSN from the list of available DSN from Administration => file => open => online. works
    perfectly
    When I configure projects at OBIEE server as a Multiuser Development Environment, I can not connect from a client remotely to a server. Administration => file => nultiuser => checkout does not give me an option to choose the system DSN for remote server
    Can someone clarify steps to configure MUDE in a client-server environment
    Thanks

    Amrita,
    In the article by Venkat, that you referred to in your response , I read the article, I have a few questions
    1. When I install OBIEE, the Master Repository automatically created at the c:\OracleBi\server\Repository directory
    When you create projects, they are created in the Master Repository.
    Do I then copy the master repository to Shared Network directory, ex. N:\SharedRepository
    2. When i start the AdminTool from the client m/c, how will the client knows to connect the remote server
    I have not gotten to this part yet, just want to clarify, if any configuration necessary on the client side,
    before file => Multiuser => checkout
    Thanks

  • Pjc for client-server mode

    hi,
    i have been using pjc for customized text field and text area and have successfully implemented it on windows and sun solaris. we have used pjc for working in non english character set so that the user can directly type in the required character set without any supporting application to enable new keyboard mapping. but i have a serious problem.
    these customized components work only on the webforms mode.i.e. on browser or applet. they dont work in the normal client server mode. is it possible that i can have them running in the normal runtime also. if yes then how and if not what is the work around for achieving the same without much effort.
    awaiting a prompt reply.
    thanks in advance,
    regards,
    Yousuf.
    Delhi.

    Dear Yousof,
    I want to do the same thing that u'vve already acheived, I want to customize oracle forms texfields and instead of EXTENDING VTextfield I want to extend JTextfield and ofcourse implementing IView interface.
    But I get problems, would u mind be kind enough to instruct me in doing that?
    Best regrds,
    Sasan

  • Can i use forms 9i or 10g for client/server applications

    Right now, we are using oracle 9i DB and developer suite 10g. I have to build a client/server application. In one of the OTN articles, it says that from forms 9i onwards, it's not supporting client/server applications. Do i have to use 6i for this.
    Thank You.
    Sree.

    That's right. Only web deployment is support from 9i onwards. Bad decision since Oracle seems to ignore their customer's view

  • Can i use forms 9i for client server applicaitons

    Hi,
    I have to build a client/server application.Right now, we are using oracle 9i and developer suite 10g. In one of the articles on OTN, it says that from forms 9i onwards, it's not supporting client/server model. Do i have to use 6i for this.
    Thank you.
    Sree.

    The last Forms version that can be run in c/s mode is 6i.

  • Small client server project.  deisgn idea good or bad?

    Hi,
    I have a question:
    I have this plan to make a small Swing based GUI on the client machine (that I would like a novice user to be able to double click on to launch) which needs to connect to a Server side component , I am thinking a simple Servlet or JSP page. Then what needs to happen is a few messages are transferred to ascertain the users identity for authenitcation as so:
    1. Client -> Server 2. Server -> Client 3. Client -> Server. Access gratned or not for access to restricted web page (imagine inbox e-banking etc)
    So the main questions are:
    1. Can I make a small Swing based GUI App, NOT an applet as I need to read from the client, that can be easily launched by an idiot ;)
    2. Can that small app converse with a Servlet in the manner described above.
    3. Kinda like 2. Can the Client App launch a browser window to that when the messages are done the user can then get into the area the server has granted them access to (depending on the messages).
    I would really appriciate the help. I have looked about on the internet and in books but I never really got a succinct picture this would be possible.
    Thanks!

    I have this plan to make a small Swing based GUI on
    the client machine (that I would like a novice user
    to be able to double click on to launch) which needs
    to connect to a Server side component , I am thinking
    a simple Servlet or JSP page. That will involve writing an applet.
    1. Can I make a small Swing based GUI App, I don't know if you can or not! It's certainly possible...
    NOT an applet See above.
    as I need to read from the client, That's not a restriction. You can sign your applets.
    that can be easily launched by an idiot ;) Once again, that's up to you.
    2. Can that small app converse with a Servlet in the
    manner described above.Yes.
    3. Kinda like 2. Can the Client App launch a browser
    window to that when the messages are done the user
    can then get into the area the server has granted
    them access to (depending on the messages).Yes.
    I would really appriciate the help. I have looked
    about on the internet and in books but I never really
    got a succinct picture this would be possible.It is! Good luck, and happy coding! If you need some resources, check out the following:
    The Java� Tutorial - Trail: Creating a GUI with JFC/Swing
    The Java� Tutorial - Trail: Writing Applets
    Trail: Getting Started - Lesson: The Anatomy of an Applet
    Java Applet Tutorials
    The Java� Tutorial - I/O: Reading and Writing (but no 'rithmetic)

  • Framework for client-server Architecture in Java !!!! With swing

    Hi,
    Considering the scenario where we are having the Client-Server application and the rich clients at the client place , based on the frames.I have though of the logic as :
    Client -----------> ClientComponentframeWorkObject(Genric Objects) ---------> reading the data from the configurable files to find where to take the user action ---------> will call the Servercomponetobject(Generic objects) can be Servlet or just a object which connects to the server(DB).I have been able to find the open-source frame work at the Apache ,all covering the server-side framework so i though of doing some work with the framework covering the client(swing) -server Archetect.Even I dont know how the existing server side framework support the swing client.
    I would appericiate if someone who had worked on the client server requirement with java , could share the knowledge about the framework being used in the existing work.
    regards
    Vicky

    Hi,
    GENERIC CLIENT COMPONENT:
    package com.nst.clientcomp;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public abstract class ClientComp extends JFrame
      protected JFrame currentframe;     
      protected JPanel  panel;
      public ClientComp()
           // To decide if the ClientComp to be Frame or the Panel.
        //panel=this;     
        //currentframe=new JFrame();
        panel=new JPanel();     
        currentframe=this;
      // Just Concentrate on the GUI , look and feel here .......And the user action will generate
      // generate the event which should call the callNextView()..The component developer have to
      // concentrate on the writing the display() and the callNextView()..
      public abstract void display() ;
      // This is the Final action.Template Pattern being Called
      public String action()
           readServerObj();
           processContent();
           display();              
           return null;
       Reading of the value object which is being Passes from the Server.As per the Design it is
       called VOFS and will be read here.Here
       1) Connect to the Server
       2) Pass the VOFC through the socket connection
       3) Also obtain the VOFS(Value object from server) 
       In certain application it can be implemented here
      public Object readServerObj()
            System.out.println("Hello from ServerObj!!! Should be implemented ");
            return null;
       Processing the Sever Value Object, which is basically as VOFS.It is processed by the
       Client.And infact the Value object from Client(VOFC) should be generated here for next
       user interaction from the Client.
      public void processContent()
            System.out.println("Hello from processContent !!! Should be implemented ");
      // Clear the Frame
      private void cleanUp()
         currentframe.dispose();
         Contains the place where next view takes.Before this is invoked the cache copy of the
         StateObject should be stored in the appropriate Data Structure......      
      public void callNextView(ClientComp com)                     
            panel.removeAll();
            com.action();
            cleanUp();
    }   COMONENTS AS PER THE FRAMEWORK :
    package com.nst.clientcomp;
    import javax.swing.*;
    import java.awt.event.*;
    public class Comp1 extends ClientComp implements ActionListener
      JTextField t,t1;     
    //Default display , displaying the screen.This should be the abstract method
      public void display()
        JLabel l=new JLabel("UserName");
        t=new JTextField(10);
        JLabel l1=new JLabel("Password");
        t1=new JPasswordField(10);
        t.setText("admin");
        t1.setText("admin");
        JButton b=new JButton("Login");
        b.addActionListener(this);
           panel.add(l);
           panel.add(t);
           panel.add(l1);
           panel.add(t1);
           panel.add(b);
           currentframe.getContentPane().add(panel);
           currentframe.setSize(400,400);
           currentframe.setVisible(true);      
      public static void main(String ar[]) throws Exception     
           ClientComp c1 = (ClientComp)(Class.forName(ar[0])).newInstance();
           c1.action();             
           System.out.println("Hello11");
      public void actionPerformed(ActionEvent e)
           //Do someprocessing if required
           if(t.getText().equals("admin")&&t1.getText().equals("admin"))
           callNextView(new Comp2());  
           else
            System.out.println("invalid login");     
    } Similarly you can develop the other components and you have to take care of the display() and the user action Event which eventually calls the callNextView.I hope there might be the cases where this has been implemented ..
    Regards
    Vicky

  • Need Help for client - server - client question [Sockets]

    Hi
    I have read the http://java.sun.com/docs/books/tutorial/networking/sockets/index.html tutorial and made this Knock Knock Application.
    But now, I want that one client can view all the other clients which are connected to the server, and interract with a selected cleint over the server (client - server - client).
    But I have no idea how to build such a registration concept?
    A concrete hint (or link) how to realise this would be very helpful. I searched all the internet for examples, but I dont found a simple example.
    Thanks in advance
    greeds

    wSam,
    It appears that Sun considers RMI to be simpler, although less efficient than the alternative:
    http://java.sun.com/developer/technicalArticles/ALT/sockets/
    This article also talks about object serialization, which I am a fan of. Suppose that you want to send a data structure containing lots of information (like all connected users). You can actually pass an object (rather than text) across the network using ObjectOutputStream and receive it on the other end with ObjectInputStream. You might create your own Command class for passing objects between the client and server instead of using RMI. The Command class might hold flags that indicate which method should take place on the remote machine (i.e. send chess move command).

  • Doing research for undergrad student project - Please help!

    All
    I'm doing research for a Computer Science project and could use some help. The project we have chosen is to develop a web-based application using web 2.0 techniques like AJAX. Not sure if the details of the application are pertinent to my question, so I won't post them at this point. Basically, we are trying to make a personal web finance app in a browser, similar to http://www.buxfer.com.
    We are currently working through the software engineering phases of development, but we need to decide what our server platform will be and put something together.
    I recently attended a Sun Developer Days conf in Atlanta, and I like a lot of the new "web stack" support that is offered. Here is what we are thinking of using:
    Server apps:
    Operating System:     Solaris 10 (should we go with opensolaris? whats the difference?)
    Application Server:     Glassfish (Java EE 5) (or should we use Tomcat?)
    Web Server:     Sun Java System Web Server (or should we use Apache?)
    Database:          MySQL (or should we use Postgre?)
    Version Control:     Subversion (is this needed? will have 5 students collaborating on project)
    Client developer tools:
    IDE:          Netbeans 6
    Web 2.0 Framework:     GWT (Google Web Tookit)
    Does this stack make sense?
    Are there any tutorials or guides to help me set this up???
    thanks,
    overwhelmed student

    We are currently working through the software engineering phases of development, but we need to decide what our server platform will be and put something together.
    I recently attended a Sun Developer Days conf in Atlanta, and I like a lot of the new "web stack" support that is offered. Here is what we are thinking of using:
    Server apps:
    Operating System:     Solaris 10 (should we go with opensolaris? whats the difference?)OpenSolaris is a moving target, Solaris in theory is not. But then again, why not Windows, *BSD or any flavor of Linux?
    Application Server:     Glassfish (Java EE 5) (or should we use Tomcat?)Tomcat is a "reference" platform. From what I've seen Glassfish is the "next" version. Why not BEA or Websphere?
    Web Server:     Sun Java System Web Server (or should we use Apache?)Or Zeus for that matter.
    Database:          MySQL (or should we use Postgre?)Or Oracle of MS SQL server or Sybase?
    Version Control:     Subversion (is this needed? will have 5 students collaborating on project)Or CVS.
    Client developer tools:
    IDE:          Netbeans 6
    Web 2.0 Framework:     GWT (Google Web Tookit)There is nothing to help anyone give you tips on which way to go. A simple list of software is just a simple list of software. As you flesh out your project you also need to flesh out which each app can provide and hopefully then things get easier. You list no reason why you should tilt towards one app or another. Start with cost and go from there.
    alan

  • Tips for using the Forum - please read

    I saw this posted on another forum and thought it might help people here understand how to use the Forum and get more benefit from being here:
    Forum Tip: to reply to a post, please use the "Reply" button next to the message (the “arrow” button, second from the left), not the "Reply to the Original Message in this Topic" link.
    Forum Tip: if you have a problem and would like the best personal attention from experienced forum members do not Hi- Jack someone else's post in an attempt to solve your own problem..... start your own topic.... on the surface a lot of problems appear exactly the same..... they very seldom are.... by all means add to someone else's thread but do not use it as a means of solving your own problem.
    Forum Tip: try and describe your problem in your topic heading..... things like 'HELP' are useless.... many good people may pass your post without reading it.... and please, please supply vital info..... what computer, system, application.... version of.... what have you done to fix the problem..... give a full description of the problem and no SHOUTING or bumping allowed.
    Forum Tip: I would also add that it is important that you proof-read your post asking for help before you hit that "post message" button. But if you do make a mistake, or discover that your post is unclear then use the "Edit" button to make changes. The "Edit" button is the one with the pencil on it.
    Forum Tip: What do the different buttons by each message do?
    From left to right, the function of each button is explained below: ??Envelope icon = Email this post. ?Curved arrow = Reply to this message. ?Pencil icon = Edit this message. ?Trash can = Delete this message. ?Purple ribbon with small + sign = Bookmark this post. ?Large - sign = Rate this post negative. ?Large + sign = Rate this post positive. ?Blue or gray bar = Display the ratings on this post. ?
    Pause the mouse pointer on an icon and Help will be displayed.?
    Forum Tip: From the Apple Help and Terms of use files.
    State your question clearly. Include as much information as you can about your issue.
    At minimum, include:
    The operating system you're using and its version.
    The names and versions of other relevant products.
    A complete description of computer and connected peripherals.
    What you were doing when you ran into this issue.
    Example: I'm using Mac OS X 10.3.4 on a 20-inch flat panel iMac with 768 MB of RAM and 15 GB free space on my hard disk. I have an X-brand PDA connected via its USB cradle. iCal 1.5.2 unexpectedly quits when I add an event.
    Forum Tip: Test your answer. Make sure your answer works on your own computer before you post it. Do not guess.
    Forum Tip: Spend some time reading the discussion forums before you post. In the case of the most common problems the question has already been answered and you can find the answer by using the "Search" field in the upper right corner of the page. A simply search on the forms will provide a solution to this problem.
    TIP: Use the Apple Knowledge-base and Support pages for individual products. All of the most common problems can be solved by articles already posted to the K-BASE. Here is the link to the article providing the answer to the above example: Some songs in your iTunes library aren't copied to your iPod.
    The Apple Support Pages are a wealth of information that can help you solve problems and learn about your Macintosh and Apple products.
    Forum Tip: If you post a problem on the forums and then later on found the solution to it by yourself, and no one has posted in your thread, feel free to post in your thread letting others know how you solved the problem. This may help others who would otherwise need a solution for the same similar problem you had.

    Hey Jeff just wanna thank you for taking your time making this post. I just wanted to say hopefully it will help a lot of people. But awhile ago I was thinking and probably will start soon a FAQ post where I add in the most commonly questions people post in here. For example:
    What is the best protective case for the Nano?
    *List many good sites with good cases*
    How Do I reset my Nano?
    Answere here...can't think on top of my head
    Why wont my Nano turn on?
    Reset
    Of course it will be more detailed but you see my point?

  • Use of servlet http tunneling for client server communication

    Hello I am having a problem connecting a simple client applet to a server application. I can connect the two directly using sockets. However, when I try to connect the two via a servlet the input stream cannot be accessed. The application is purely for demonstration. Here is some of the source code
    A servlet for http tunneling
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class SocketServlet extends HttpServlet
         ServletInputStream servletinput;
         ServletOutputStream servletoutput;
         Socket socket;
         DataOutputStream dataoutput;
         DataInputStream datainput;     
         public SocketServlet()
    public void init(ServletConfig servletconfig) throws ServletException
    super.init(servletconfig);
    log("Socket servlet initialized.");
         public void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException
    try
    servletinput = request.getInputStream();
    socket = new Socket( InetAddress.getByName( "127.0.0.1" ), 5000 );
    dataoutput = new DataOutputStream( socket.getOutputStream() );
    try
                        byte[] inbytes = new byte[1024];
                        servletinput.read( inbytes );
                        String inmessage = new String( inbytes );                    
                        dataoutput.writeBytes( inmessage );
    catch(IOException ioex)
    dataoutput.flush();
    datainput = new DataInputStream( socket.getInputStream() );
    servletoutput = response.getOutputStream();
    try
    byte[] outbytes = new byte[1024];
    datainput.read( outbytes );
    servletoutput.write( outbytes );
    catch(IOException ioex)
    servletoutput.flush();
    servletoutput.close();
    catch(Exception ex)
    // Server.java
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Server extends JFrame {
    private JTextField enter;
    private JTextArea display;
    DataOutputStream output;
    DataInputStream input;
    public Server()
    super( "Server" );
    Container c = getContentPane();
         enter = new JTextField();
         enter.setEnabled( false );
         c.add( enter, BorderLayout.SOUTH );
    display = new JTextArea();
    c.add( new JScrollPane( display ),
    BorderLayout.CENTER );
    setSize( 300, 150 );
    show();
    public void runServer()
    ServerSocket server;
    Socket connection;
    int counter = 1;
    try {
    // Step 1: Create a ServerSocket.
    server = new ServerSocket( 5000, 100 );
    while ( true ) {
    // Step 2: Wait for a connection.
    display.setText( "Waiting for connection\n" );
    connection = server.accept();
    display.append( "Connection " + counter +
    " received from: " +
    connection.getInetAddress().getHostName() );
    // Step 3: Get input and output streams.
    output = new DataOutputStream(
    connection.getOutputStream() );
    input = new DataInputStream(
    connection.getInputStream() );
    display.append( "\nGot I/O streams\n" );
    // Step 4: Process connection.
    String message =
    "SERVER>>> Connection successful";
    output.writeBytes( message );
    enter.setEnabled( true );
                   display.append( "\nConnected\n" );
    do {
    try {
                        byte[] mess = new byte[1024];
    input.read( mess );
    display.append( "\n" + message );
    display.setCaretPosition(
    display.getText().length() );
                   catch (IOException ioex )
    } while ( !message.equals( "CLIENT>>> TERMINATE" ) );
    // Step 5: Close connection.
    display.append( "\nUser terminated connection" );
    enter.setEnabled( false );
    output.close();
    input.close();
    connection.close();
    ++counter;
    catch ( EOFException eof ) {
    System.out.println( "Client terminated connection" );
    catch ( IOException io ) {
    io.printStackTrace();
    private void sendData( String s )
    try {
    output.writeBytes( "SERVER>>> " + s );
    display.append( "\nSERVER>>>" + s );
    catch ( IOException cnfex ) {
    display.append(
    "\nError writing object" );
    public static void main( String args[] )
    Server app = new Server();
    app.addWindowListener(
    new WindowAdapter() {
    public void windowClosing( WindowEvent e )
    System.exit( 0 );
    app.runServer();
    // Fig. 21.4: Client.java
    // Set up a Client that will read information sent
    // from a Server and display the information.
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.zip.*;
    public class Client extends Applet implements ActionListener {
    private TextField enter;
    private TextArea display;
    DataOutputStream output;
    DataInputStream input;
    private Button button, button2;
    URLConnection connection;
    private byte[] bytes1, bytes2;
    private String message, message2;
    public void init()
    setLayout( new BorderLayout() );
    enter = new TextField( " Enter text here " );
    enter.setEnabled( false );
    enter.addActionListener( this );
    add( enter, BorderLayout.NORTH );
    display = new TextArea( 4, 30 );
         display.setEditable( false );
    add( display, BorderLayout.CENTER );
         button = new Button( "Connect" );
         button.addActionListener( this );
         add( button, BorderLayout.SOUTH );
    public void runClient()
    Socket client;
    try {
    // Step 1: Create a Socket to make connection.
    display.setText( "Attempting connection\n" );
              URL currentpage = getCodeBase();
              String protocol = currentpage.getProtocol();
              String host = currentpage.getHost();
              int port = 8100;
              String urlsuffix = "/servlet/SocketServlet";
              URL dataurl = new URL( "http://localhost:8100/servlet/SocketServlet" );
              connection = dataurl.openConnection();
    connection.setDoOutput(true);
    connection.setDoInput(true);
    connection.setRequestProperty("Content-type", "application/octet-stream");
              connection.setUseCaches( false );
              display.append( "\nConnected to: " + host );          
    // Step 2: Get the output streams.
    output = new DataOutputStream(
    connection.getOutputStream() );
              display.append( "\n got output stream\n" );
              // Step 3 get input connection
              try
              display.append( "\nAttempting to connect to input stream\n" );
                   input = new DataInputStream( connection.getInputStream() );
                   bytes1 = new byte[1024];
                   input.readFully( bytes1 );
                   display.append( "\nGot input stream\n" );
                   message = new String( bytes1 );
                   display.append( "\n" + message + "\n" );          
              catch ( IOException ioex )
              // Step 3: Process connection.
              enter.setEnabled( true );
              do {
              try {
    bytes2 = new byte[1024];
              input.readFully( bytes2 );
              message2 = new String( bytes2 );
              display.append( "\n" + message2 );
              display.setCaretPosition(
              display.getText().length() );
              catch ( IOException ioex ) {
              display.append(
              "\nUnknown object type received" );
              } while ( !message.equals( "SERVER>>> TERMINATE" ) );
    // Step 4: Close connection.
    display.append( "Closing connection.\n" );
    output.close();
    input.close();
         catch (MalformedURLException mfe )
    catch ( EOFException eof ) {
    System.out.println( "Server terminated connection" );
    catch ( IOException e ) {
    e.printStackTrace();
    private void sendData( String s )
    try {
    message = s;
    output.writeBytes( "CLIENT>>> " + s );
    display.append( "\nCLIENT>>>" + s );
    catch ( IOException cnfex ) {
    display.append(
    "\nError writing object" );
    public void actionPerformed( ActionEvent e )
         if ( e.getActionCommand() == "Connect" )
              runClient();
         else
              sendData( e.getActionCommand() );
    public static void main(String args[])
    Frame f = new Frame("Chat Client");
         Client c = new Client();
         c.init();
         f.add("Center", c);
         f.setSize(300, 150);
         f.show();
    the connection appears to fail at client step 3, any help is super, thanks
    Aidan

    Hi,
    In your client you are trying to open OutputStream even though you are not using it.
    So there are two solutions here.
    1. If you dont need OutputStream your code shoud look like this
    try {
    // Step 1: Create a Socket to make connection.
    display.setText( "Attempting connection\n" );
    URL currentpage = getCodeBase();
    String protocol = currentpage.getProtocol();
    String host = currentpage.getHost();
    int port = 8100;
    String urlsuffix = "/servlet/SocketServlet";
    URL dataurl = new URL( "http://localhost:8100/servlet/SocketServlet" );
    connection = dataurl.openConnection();
    //connection.setDoOutput(true);
    connection.setDoInput(true);
    connection.setRequestProperty("Content-type", "application/octet-stream");
    connection.setUseCaches( false );
    display.append( "\nConnected to: " + host );
    // Step 2: Get the output streams.
    //output = new DataOutputStream(
    //connection.getOutputStream() );
    //display.append( "\n got output stream\n" );
    display.append( "\n Not interested in output stream\n" );
    //Step 3 Inpustream related
    // Step 4: Close connection.
    display.append( "Closing connection.\n" );
    //output.close();
    input.close();
    1. If you need OutputStream, close your OutputStream before even trying to get InputStream, your code should like this
    try {
    // Step 1: Create a Socket to make connection.
    display.setText( "Attempting connection\n" );
    URL currentpage = getCodeBase();
    String protocol = currentpage.getProtocol();
    String host = currentpage.getHost();
    int port = 8100;
    String urlsuffix = "/servlet/SocketServlet";
    URL dataurl = new URL( "http://localhost:8100/servlet/SocketServlet" );
    connection = dataurl.openConnection();
    //connection.setDoOutput(true);
    connection.setDoInput(true);
    connection.setRequestProperty("Content-type", "application/octet-stream");
    connection.setUseCaches( false );
    display.append( "\nConnected to: " + host );
    // Step 2: Get the output streams.
    output = new DataOutputStream(
    connection.getOutputStream() );
    display.append( "\n got output stream\n" );
    //I'll do whateve I've to do with outputstream
    //done with output stream closing
    output.close();
    //Step 3 Inpustream related
    // Step 4: Close connection.
    display.append( "Closing connection.\n" );
    //output.close();
    input.close();
    hope this works
    all the best,
    Raj

Maybe you are looking for

  • MacBookPro5,1 + Install Mac 10.9.3 = restart loop (safe boot only)

    Tried installing 10.9.3 from 10.6.8 on my MacBookPro5,1 on 2014/06/03; it goes into a startup loop since then and only starts in Safe mode. I am thankful that Mavericks' Safe mode allows internet browsing; but I have searched in vain so far for a sol

  • Function modules for F881 and F889

    Hi, is there some function module ( or ? ) to create records by F881 and F889, i don't want to use batch input method... thanks for your help. Pedro

  • Need Help with Font - Style -  Size

    how do you keep these the same size and style on all pages? example font and size will be the same but style wont. when i try set the same style the size changes, and if you set size the style changes.

  • Converting a 16:9 video for iPod

    I exported from FCP a 16:9 video using Compressor for use on an iPod. When I play it though it looks squished horizontally and the people look thinner. Is there something else I need to do to get this to look right?

  • Hard Drive Icon (Macintosh HD) Disappeared - How do I get it back

    Hi, My Macintosh HD Icon that has been at the top right of my desktop forever is gone. Anyone know how to restore it? Getting to the hard drive now is a pain. Thanks.