Page 2 of 2 FirstFirst 12
Results 21 to 31 of 31
  1. #21
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: java class constructor is not executed

    You could pass a null value for call parameter in the constructor. That would not keep the println in the constructor from being executed.

    Did you change this line:
    SendRTPStream rtp = new SendRTPStream( this, loop, call );
    to this:
    XXSendRTPStream rtp = new XXSendRTPStream( this, loop, call );
    Last edited by Norm; 05-15-2012 at 04:44 PM.
    If you don't understand my response, don't ignore it, ask a question.

  2. #22
    lostchild is offline Member
    Join Date
    May 2012
    Posts
    14
    Rep Power
    0

    Default Re: java class constructor is not executed

    :)))))

    yes I did... of course.

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

    Default Re: java class constructor is not executed

    With problems like this, here is no "of course". Everything must be clearly stated.

    Without code to test with, I have nothing more to suggest.
    If you don't understand my response, don't ignore it, ask a question.

  4. #24
    lostchild is offline Member
    Join Date
    May 2012
    Posts
    14
    Rep Power
    0

    Default Re: java class constructor is not executed

    sorry about that norm. you are right.

    just tried what you suggested, to pass the null instead of call: XXSendRTPStream rtp = new XXSendRTPStream( this, loop, /*call*/ null );
    and it's all same. I still do NOT see the first printf line of the constructor

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

    Default Re: java class constructor is not executed

    Let us know what it was when you figure it out.
    If you don't understand my response, don't ignore it, ask a question.

  6. #26
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: java class constructor is not executed

    I would double check the version of the class is the same in the jar file, which should be easy to do with the XXX version.
    Honestly.
    Java doesn't do magic.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #27
    lostchild is offline Member
    Join Date
    May 2012
    Posts
    14
    Rep Power
    0

    Default Re: java class constructor is not executed

    I have done the following test:
    in the main thread I've put the following:

    Java Code:
    		System.out.println("test before");
    		XXSendRTPStream xx = new XXSendRTPStream (null, false, null);
    		System.out.println("test after");
    basically eliminating the rest of code. it's the simplest form of the class.
    and this worked fine!!!!!!!

    the output:
    C:\Users\lostchild\workspace>java -jar callenforce.jar
    test before
    we are in SendRTPStream creator
    test after


    so, I think we can conclude that the class is OK. and there is no duplicate class or old version or something like that.

    although, it's still a mystery.

    please if anyone has any idea, let me know. I'm kinda desperate! :-\

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

    Default Re: java class constructor is not executed

    Try adding the code back bit by bit and test after every restore to see if any other piece of the code is impacting that constructor.

    To be consistent: we are in XXSendRTPStream creator
    If you don't understand my response, don't ignore it, ask a question.

  9. #29
    lostchild is offline Member
    Join Date
    May 2012
    Posts
    14
    Rep Power
    0

    Default Re: java class constructor is not executed

    Norm...

    That was the plan exactly.
    but unfortunately I will not be able to do it any more. because it's fixed now.

    but the only difference is that I've added jmf.jar libraries to the manifest classpath.
    I'm using jmf to stream media.

    but I'm really surprised because it never gave an exception of classdefnotfound or anything like that!!! so I never thought of that!

    Thanks a ton anyway! You've been of much help. and the replies were almost instantaneous which is appreciated.

    Regards,

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

    Default Re: java class constructor is not executed

    I guess Tolls was wrong. Sounds like magic.
    If you don't understand my response, don't ignore it, ask a question.

  11. #31
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: java class constructor is not executed

    I would still lay good odds on it being an old version of the class in the jar file.
    Completely reworking the app forced it to be rebuilt.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 1
    Last Post: 05-08-2012, 09:40 PM
  2. My first java program could not be executed..help
    By miaaa00 in forum New To Java
    Replies: 7
    Last Post: 03-21-2011, 08:07 AM
  3. Accessing Constructor from another Class
    By Java-Guy in forum New To Java
    Replies: 4
    Last Post: 01-19-2011, 04:41 AM
  4. Replies: 0
    Last Post: 12-19-2007, 09:10 AM
  5. Replies: 0
    Last Post: 12-19-2007, 09:01 AM

Posting Permissions

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