RE: code falls apart when add this to idl: string getClient1Name();

I have a counter object that has at most two clients connected to it.
I do not want the same two clients in the regClients String[]. Since restriction is that we only want two registered clients we can just check position one of array. Note array starts from position 0.
When I add function getClient1Name(), results in error
All other code works.
module Cbackcom
  interface Cback
  { void callback(in long par);
  interface Counter
  { void regist(in Cback objRef, in string client);
    void finish(in string client);
    void action(in long num);
    long  getClientNo();
    string getClient1Name();  //
here is my servant class in the server class
class CounterServant extends _CounterImplBase
{ private int      actclient;
  private Cback [] clients;
  private String[] regclients;
  private int      number;
  // constructor
  CounterServant()
  { number    = 0;
    actclient = 0;
    clients   = new Cback[2];
    regclients= new String[2];
    System.out.println("SERVER SIDE");
    System.out.println("counter servant started");
  ///return the current number of clients
  public int getClientNo()
   return actclient;
  public String getClient1Name() {
    String returnString = ""; //null string
   if (regclients[0] !=null)
     returnString = regclients[0];
    return returnString;
here is the client class:
class CbackServant extends _CbackImplBase
{ public void callback(int num)
  { System.out.println("CLIENT SIDE");
    System.out.println("counter's current value = " + num);
public class CbackcomClient
  public static void main(String args[])
  { try
    { // create and initialize the ORB
      //note client is read from command prompt
      //it is read at execution time
       String client = new String(args[2]);
      // get the root naming context
      // resolve the Object Reference in Naming
      Counter countRef = CounterHelper.narrow(ncRef.resolve(path));
      CbackServant cbackRef = new CbackServant();
      int clientNO = countRef.getClientNo();
      if (clientNO <= 1)
          System.out.println("current client number is: " + clientNO );
          System.out.println("check if already a registered client");
   /********* problem occurs here please help ******/      
          String client1 = ""; //null value string
       if(clientNO == 1)
          client1 = countRef.getClient1Name();
          if (client.equals(client1) )
              System.out.println("sorry your already a registered client");
       orb.connect(cbackRef);
                 countRef.regist(cbackRef, client);
     catch (Exception e)
     { System.out.println("ERROR : " + e) ;
       e.printStackTrace(System.out);
here is the error:
java CbackcomClient -ORBInitialPort 1030 Sid
making first check
current client number is: 0
check if already a registered client
ERROR : org.omg.CORBA.BAD_PARAM:   minor code: 1 completed: Maybe
org.omg.CORBA.BAD_PARAM:   minor code: 1 completed: Maybe
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.<init>(Throwable.java:94)
        at java.lang.Exception.<init>(Exception.java:42)
        at java.lang.RuntimeException.<init>(RuntimeException.java:47)
        at org.omg.CORBA.SystemException.<init>(SystemException.java:49)
        at org.omg.CORBA.BAD_PARAM.<init>(BAD_PARAM.java:74)
        at org.omg.CORBA.BAD_PARAM.<init>(BAD_PARAM.java:50)
        at org.omg.CORBA.BAD_PARAM.<init>(BAD_PARAM.java:39)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance0(Compiled Code)
        at java.lang.Class.newInstance(Compiled Code)
        at com.sun.CORBA.iiop.ReplyMessage.getSystemException(ReplyMessage.java:75)
        at com.sun.CORBA.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:85)
        at com.sun.CORBA.idl.RequestImpl.doInvocation(Compiled Code)
        at com.sun.CORBA.idl.RequestImpl.invoke(RequestImpl.java:219)
        at Cbackcom._CounterStub.getClient1Name(_CounterStub.java:66)
        at CbackcomClient.main(Compiled Code)Please help

Please reply...
I have programmes block
I do not know what I am doing wrong.
To me the answer seems logical to me..
Here is the idl:
module Cbackcom
//here is the code that goes wrong
string getClient1Name();
here is my servant class in the server class
                             class CounterServant extends _CounterImplBase
                             { private int actclient;
                             private Cback [] clients;
                             private String[] regclients;
                             private int number;
                             // constructor
                             CounterServant()
                             { number = 0;
                             actclient = 0;
                             clients = new Cback[2];
                             regclients= new String[2];
                             System.out.println("SERVER SIDE");
                             System.out.println("counter servant started");
                             ///return the current number of clients
                             public int getClientNo()
                             return actclient;
                             public String getClient1Name() {
                        **** simple returning of client returned at position 0 of array
perhaps should change code here *****
                             here is the client class:
                             class CbackServant extends _CbackImplBase
                             { public void callback(int num)
                             { System.out.println("CLIENT SIDE");
                             System.out.println("counter's current value = " + num);
                             public class CbackcomClient
                             public static void main(String args[])
                             { try
                             { // create and initialize the ORB
                             //note client is read from command prompt
                             //it is read at execution time
                             String client = new String(args[2]);
                             // get the root naming context
                             // resolve the Object Reference in Naming
                             Counter countRef = CounterHelper.narrow(ncRef.resolve(path));
                             CbackServant cbackRef = new CbackServant();
                             int clientNO = countRef.getClientNo();
                             if (clientNO <= 1)
                             System.out.println("current client number is: " + clientNO );
                             System.out.println("check if already a registered client");
                             /********* problem occurs here please help ******/
                             String client1 = ""; //null value string
                             if(clientNO == 1)
                             client1 = countRef.getClient1Name();
plz help...

Similar Messages

  • Preview mode fall apart when viewed on different workstation

    Has anyone had this problem: a page's DPS funtion works fine when viewed in the overlay creator's preview mode on one mac and not at all on another. They are authored from the same version of InDesign CS5.5 using two different computers.
    Thanks in advance for any insight.

    You’re going to need to be more specific.
    Bob

  • I creating firefox extension when add this into firefox all works right but when i open a new link show a dialog box with message "Error: document body is null"

    I am creating firefox extension (No error in extension because it work fine in chrome). But it show box with error "Error: document.body is null" why

    Thanks for reply cor-el &jscher2000
    i am not using "window.content.document.body".
    we send some screenshots for understanding problem
    i created this extension for firefox, chorme
    It Works fine in chrome but in firefox show error(Which have no effect on my extension or other browsing).

  • Why does my page fall apart when I zoom out in google?

    I have text over boxes and the whole page goes askew in google unless I view it at 100% zoom.  What gives?  Any ideas how to fix this?  I tried locking all objects on the page to no avail...

    The problem is caused by very small rounding differences between Muse and Chrome that result in off-by-a-pixel measurements (only in Chrome), which in turn causes things to jump to where they next fit in the flow.
    We've revised our calculations to avoid this in the next major release of Muse, which is due out in the next couple weeks. Until then, I don't have a workaround for you.
    It would be helpful if you could send us your .muse file at [email protected] along with a link to this thread so I can verify our changes do in fact address this for your file. If the file is larger than 20Mb you can use a service like Adobe SendNow, SendThisFile or WeTransfer. Thanks.

  • Problem when Add Serial Number for Goods Receipt PO Document

    Dear All,
    In my App I have function to Add goods receipt PO and Serial for these items of this document as code bellows:
    oGrp = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
                'Add Header Goods Receipt
                oGrp.CardCode = "CC1"
                oGrp.CardName = "Card Code 1."
                oGrp.DocDate = now
                oGrp.DocDueDate = now
                oGrp.TaxDate = now
                Dim Qty As Int32 = 2
                For i As Integer = 0 To Qty - 1
                    oGrp.Lines.SerialNumbers.SystemSerialNumber = 1
                    oGrp.Lines.SerialNumbers.ManufacturerSerialNumber = "MSR01" & "-" & i
                    oGrp.Lines.SerialNumbers.InternalSerialNumber = "ISR01" & "-" & i
                    oGrp.Lines.SerialNumbers.SetCurrentLine(i)
                    oGrp.Lines.SerialNumbers.Add()
                Next
                oGrp.Lines.ItemCode = "YMY2H-BLACK"
                oGrp.Lines.ItemDescription = "My Item"
                oGrp.Lines.Currency = "USD"
                oGrp.Lines.Quantity = Qty
                oGrp.Lines.Price = 10000
                oGrp.Lines.DiscountPercent = 0
                RetVal = oGrp.Add()
                If RetVal <> 0 Then
                    oCompany.GetLastError(ErrCode, ErrMsg)
                    Return -1
                Else
                  End If
    When Add this document I have Error : "You should use existing serial/batch numbers for this document type ". Please help me fix this problem. In my SAP doesn't have Serial for these item. Please let me know How to add serial master data?
    Thanks & Regards

    Dear,
    Thanks for your support but when I chaged code as bellows:
    oGrp = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
                'Add Header Goods Receipt
                oGrp.CardCode = "CC1"
                oGrp.CardName = "Card Name."
                oGrp.DocDate = MyArrContainDocInfo(2)
                oGrp.DocDueDate = MyArrContainDocInfo(3)
                oGrp.TaxDate = MyArrContainDocInfo(4)
                Dim Qty As Int32 = 2
                oGrp.Lines.ItemCode = "YMY2H-BLACK"
                oGrp.Lines.ItemDescription = "My Item"
                oGrp.Lines.Currency = "USD"
                oGrp.Lines.Quantity = Qty
                oGrp.Lines.Price = 10000
                oGrp.Lines.DiscountPercent = 0
                For i As Integer = 0 To Qty - 1
                    oGrp.Lines.SerialNumbers.SetCurrentLine(i)
                    oGrp.Lines.SerialNumbers.SystemSerialNumber = i
                    oGrp.Lines.SerialNumbers.ManufacturerSerialNumber = "MSR01" & "-" & i
                    oGrp.Lines.SerialNumbers.InternalSerialNumber = "ISR01" & "-" & i
                    oGrp.Lines.SerialNumbers.Add()
                Next
                RetVal = oGrp.Add()
                If RetVal <> 0 Then
                    oCompany.GetLastError(ErrCode, ErrMsg)
                    Return -1
                Else
                              End If
    I have the same Error: "You should use existing serial/batch numbers for this document type". I try config in Gerneral Setting Form as image bellow: [http://www.hoanghaicap.com/GS.png|http://www.hoanghaicap.com/GS.png]. Please help me fix this problem. I try Add Goods receipt PO with items manage by Serial it's OK but by SDK it's not OK.
    Thanks & Regards,
    Edited by: Tao lao on Mar 10, 2010 2:44 AM

  • AI graphic falls apart in Premiere Pro CS6

    Hey guys,
    I've brought a very simple vectored graphic (png from illustrator) into premiere CS6 to use as a logobug in the lower right corner.
    So here's what my timeline looks like. All white with logobug(intro), footage of speaker with logobug(middle), and then all white with logobug(end).
    Here's what's driving me crazy.
    When I render and export this really short sequence, the graphic(logobug) at the beginning falls apart. By this I mean that it looks pixelated and like a copy of a copy. Just looks crappy.
    But when the speaker footage starts, the graphic/logobug all of a sudden looks real sharp. And at the end when the speaker's footage is done and it's just the logobug over white, the logobug looks GREAT.
    I have no idea what's going on here? The logo bug looks horrible in the beginning and then great over the middle and at the end. I've tried exporting it as multiple file types. I've asked the graphic artist to redo the art and give me a different copy. But same results.
    timeline is 640by480, 60fps dslr footage with the png vectored logobug from the graphic artist, and he made it in illustrator
    Specs: 580gtx, 16g ram, 2 HDs, with CS6 Production Suite
    Thanks a bunch!

    For starters, PNG can't hold vector graphics, only rasterized.  Which means any scaling you do could degrade the image.
    Having said that, can you upload the export so we can see what you see?
    http://www.depositfiles.com/en/

  • I got an itunes giftcard for my birthday and when i tried to add it on my balance on my ipod touch it says the code you entered is not  recognized as a valid code. but i just got this card brand new for my birthday.

    i got an itunes giftcard for my birthday and when i tried to add it on my balance on my ipod touch it says the code you entered is not  recognized as a valid code. but i just got this card brand new for my birthday.

    Make sure you're using the correct code. For most iTunes cards, the code is under the scratchoff area on the back of the card. For more information, see this support article:
    http://support.apple.com/kb/TS1292
    If you can't get to work after perusing that page, contact the iTunes Store Support; instructions are at the bottom of that article.
    Regards.

  • Dreamweaver CS3- Add this button code help

    Hi, I have a problem in Dreamweaver CS3. The problem is that when I insert my add this button code, in to the codeing area, it does not work.
    When I open my page in chrome, it simply says 'more shraeing services'. I will copy the code, in to this discussion. I would be greaftful if someone
    can help me resolve this problem, so I can get the add this button to work on my site. The final bits of code are as follows-
    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_compact"></a>
    <a class="addthis_counter addthis_bubble_style"></a>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4dd57258352fac8e"></script>
    <!-- AddThis Button END -->
    <!-- Place this tag where you want the +1 button to render -->
    <g:plusone></g:plusone>
        </div>
       </form>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
    <script type="text/javascript" src="http://www.google.com/cse/t13n?form=cse-search-box&t13n_langs=am%2Cel%2Cml%2Cpa%2Cta%2Car% 2Cgu%2Cmr%2Cru%2Cte%2Cti%2Csa%2Cne%2Chi%2Cbn%2Cen%2Ckn%2Cfa%2Csr%2Cur"></script>
    <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
    <script type="text/javascript" src="http://www.google.com/cse/query_renderer.js"></script>
    <div id="queries"></div>
    <script src="http://www.google.com/cse/api/partner-pub-5783950232732081/cse/4522012035/queries/js?oe=UT F-8&callback=(new+PopularQueryRenderer(document.getElementById(%22queries%22))).render"></script>
      </div>
      <div align="center"></div>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4dd57258352fac8e"></script>
    <!-- AddThis Button END -->
    </div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>
    Is there anything in this piece of code I should edit in order to make the add this button work? Many thanks

    A link to your page would be the best possible way to get help with this. 
    Code fragments don't tell the whole story.
    Nancy O.

  • I am getting an error code of "0" when trying to buy an in app purchase. what is this error?

    i am getting an error code of "0" when trying to buy an in app purchase. what is this error?

    In your first post you wrote
    It is telling me I need 6MB of additional free space
    And in your second post
    Importing to internal hard drive 6.85GB available
    Even assuming that the GB was a typo and should be MB you're still on the hairy edge.

  • I put a Favicon on my website, which can be seen in the adress line and the tab header. However, when I add this site to the bookmarks, it doesn't show it's favicon.

    I put a Favicon on my website, which can be seen in the adress line and the tab header. However, when I add this site to the bookmarks, it doesn't show it's favicon. I have tried deleting and creating a bookmark and also refreshing the webpage or clicking on the bookmark. I don't know what else to do. I use Firefox 4.0.1

    I'm getting favicons for most of my bookmarks, so there might be some issue with the coding or the image format.
    Do you use a tag like this in your page?
    <link rel="shortcut icon" href="/path/to/favicon.ico"/>

  • There was an error installing this update. Please quit and try again later. Error Code: U44M1I210  I keep getting this error when trying to update

    There was an error installing this update. Please quit and try again later. Error Code: U44M1I210  I keep getting this error when trying to update

    Hi,
    You can visit Error U44M1I210 | Install updates and see if it works.
    Regards
    Kishan

  • TS3694 when restoring my iphone i get an error code of 1015 , why is this and how do i restore my phone as now its stuck in recovery mode ?

    when restoring my iphone i get an error code of 1015 , why is this and how do i restore my phone as now its stuck in recovery mode ?

    Errors related to downgrading iOS
    The required resource cannot be found: This alert message occurs when your device has a newer version of iOS than what is available in iTunes. When troubleshooting a device that presents this alert message, go to Settings > General > About and check the version of iOS on the device. If it is newer than the latest released iOS version, the device may have a prerelease developer version of iOS installed. Installing an older version of iOS over a newer version is not supported.
    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.

  • When attempting a restore from Time Machine I get error code -8004. What is this and how can I correct it?  Thanks

    when attempting a restore from Time Machine I get error code -8004. What is this and how can I correct it?  I use OX 10.9.3
    Thanks

    Run it in compatibility mode and input the credentials.
    Mylenium

  • When synchig my iphone to my itunes, I get an error message at the end with code 1150.  What is this error code and what does it mean?

    When synching my iphone to my itunes, I get an error message at the end with code 1150.  What is this error code and what does it mean?

    try uninstalling and reinstalling itunes on your computer. here is a link for that http://support.apple.com/kb/HT1925

  • I have cs4. Had to rebuild my mac OS after malware infected it. Now getting an error code 150:30 when trying to open PS. Can this be fixed or do I have to upgrade to cs6?

    I have cs4. Had to rebuild my mac OS after malware infected it. Now getting an error code 150:30 when trying to open PS. Can this be fixed or do I have to upgrade to cs6?

    150:30 means licensing is broken. It's a common CS4 error. On Macs it usually happens when Photoshop is retrieved from backup or migrated from another Mac. Photoshop is never meant to be moved that way. As advised, you should uninstall and reinstall from your discs.
    Sine reinstall only apply the base install and the CS4 Help > Update function is outdated, you will have to manually download and install your updates from here:  Product updates for Bridge and Photoshop.
    Gene

Maybe you are looking for

  • Auto creation of Purchase order by heuristic

    Hello Experts, In my project, Heuristic is creating "Purchase orders" automatically, which should have been created by planners only. Sometimes, it creates it without even creating "Purchase requisitions" and sometimes with PurReq. Has any one faced

  • Opening a Photoshop PSD in Bridge to Camera Raw

    I am using a book "THe HDR Book" by Rafael Concepcion. He talks about using Bridge to open a Photoshop image by right clicking and choosing "Open in Camera Raw" But when I try this, there is no option to open a Photoshop Image in Camea Raw Am I missi

  • Escaping special characters

    Environment: Client: win2k sp4, 10.2 client Server: 9.2 on solaris 9 Is there any way to set an escape character? Many times we have '&' characters in strings in procedures, and when I try to compile them sqldeveloper prompts for a value thinking tha

  • IMAC als externer Monitor

    Hi, i will use my iMAC 27'' (Model: Middle 2011) as an external monitor. The signal should come from an Laptop Dell Latitude E6230 over an "HDMI to thunderbold"  cable. The cable is from my apple shop and named "Mini displayPort HDMI Cable". After re

  • RAW files appear as negative images. Please explain.

    I imported RAW images from a card reader and selected DNG. In the Library, the images appear as blotches of color or presents or whatever. I've tried to find a solution for a week, but have not succeeded. It's really quite frustrating because I'm sur