• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A strange problem about the independent client

 
Xin Gang Sun
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I find a new strange problem when I just want to submit. But no troubles according to the instructions.html.
I have four packages in the suncertify, they are client, common, server and db. The runme.jar is OK in the 3 modes. Then I have a test that make a client.jar which contains the client-side needed(suncertify.client & suncertify.common packages). I start a server by "java -jar runme.jar server", then I start a client by "java -jar client.jar" and the client-side GUI appears. It is strange that the client can not connect to the server. The "runme.jar"-client is OK, but "client.jar"-client is not. All of the classes it needs are in the client.jar with a new entry point, but the common entry point.
It puzzled me, though it is unnecessary according to the instructions.html.
If some friend understand, please tell me.
Thanks.
 
Roel De Nijs
Sheriff
Posts: 10430
133
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Xin,

Let me make some things clear to you:
  • you don't need a client.jar, only a runme.jar! For what reason do you want to create a client.jar
  • if you have to call "java -jar runme.jar -client" in order to start the standalone client, you will fail automatically (unless your instructions are different than mine). The allowed arguments are "alone", "server" and no argument for starting the client in networked mode.


  • So if your client.jar does not work, why create it? It is not required!

    Kind regards,
    Roel
     
    Xin Gang Sun
    Greenhorn
    Posts: 17
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Roel,
    I know that. I will submit with the runme.jar and I don't want a automatic failure. Thank you and don't worried about that.
    I just try to separate the client-side and find some problems. There is no problem in my submission.
    Thanks.
     
    K. Tsang
    Bartender
    Posts: 3508
    16
    Android Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Xin, I see you try sepearating the classes into client and server jars. Well indeed it's not necessary for submission but in reality, it wouldn't run as you expected. Why? Let see. Stand-alone client talks to the local db - works fine because you should have the db files with the gui files. Now server, the setup window may run but it will not able to connect ... of course unless you include the db files in the server jar, which makes the gui setup not able to run - because ...

    Anyway it's the main class. some where you have new Client() or new Server() which makes all those files linked together making it inseparable. Of course you could always make separate main classes.
     
    Xin Gang Sun
    Greenhorn
    Posts: 17
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you,
    but I just separated cliend-side in the networking mode. In my thought, it has all it needs.
    Not mind, I'm going to submit.
    Good luck, friends.
     
    Roberto Perillo
    Bartender
    Posts: 2271
    3
    Eclipse IDE Java Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Howdy, Xin!

    Champion, I understand your approach and the way you want to test your application. As long as you submit everything in a runme.jar and stick to the rules, you may perform any tests you want without any problem.

    Now, if I undestood your problem, you are able to start the server, but you can't have a client connect to it with success... is it correct? Are you able to connect to it if you have only one .jar file? If so, then I'd say that's sort of weird...
     
    Xin Gang Sun
    Greenhorn
    Posts: 17
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes, Roberto,
    you are right, use all of classes is ok, but use the enough classes is not. It is strange.
     
    Roel De Nijs
    Sheriff
    Posts: 10430
    133
    AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Xin,

    Do you get any stacktrace? Or could you just not connect without any exception?

    Kind regards,
    Roel
     
    Xin Gang Sun
    Greenhorn
    Posts: 17
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Roel,
    Do you get any stacktrace? Or could you just not connect without any exception?

    Just catch a RemoteException, said that it can not connect to the server-side when the server is already running. The port and ip is correct. But server and client (networking mode) use different jar file.
    Not mind, I submitted it yesterday, no such problem in my submission.
    Thanks.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic