Why is RemoteException suppressed?

Hi, I'm using Weblogic 5.1.If I have a Weblogic RMI client talking to a Weblogic RMI server, and the server goes down, the client will hang went it tries to invoke a method on the no-longer valid remote object in that server. In the Java RMI implementation, a RemoteException would be thrown on the client. Why is this suppressed in Weblogic's implementation? It doesn't make sense to hang up clients instead of letting them know that there's a communctation problem.Rob

I just tried that and got this:
java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:86)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:210)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
--------------- nested within: ------------------
weblogic.rjvm.PeerGoneException:
- with nested exception:
[java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read]
at weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.java:76)
at Hello_WLStub.sayHello(Hello_WLStub.java:85)
at HelloClient.main(HelloClient.java:63)
What is it your client (or server) does that would cause it to hang?
Robert Babinski wrote:
Hi, I'm using Weblogic 5.1.If I have a Weblogic RMI client talking to a Weblogic RMI server, and the server goes down, the client will hang went it tries to invoke a method on the no-longer valid remote object in that server. In the Java RMI implementation, a RemoteException would be thrown on the client. Why is this suppressed in Weblogic's implementation? It doesn't make sense to hang up clients instead of letting them know that there's a communctation problem.Rob

Similar Messages

  • Why concatenate statement suppressing spaces !!

    <i>Hello Friends,
                  I like give some spaces in a concatenate statement, but it is suppresing the spaces.
    for ex: <b>concatenate 'sundar' '      ' 'g' into name</b>.
    but the name contains <b>'sundarg'</b> only.
    Thank you for your valuable time.
    Senthil</i>

    hi senthil
    <b>
    Syntax:</b>
    CONCATENATE dobj1 dobj2 ...  INTO result 
    <b>                   [SEPARATED BY sep].
    Example:</b>
    DATA: t1(10) TYPE c VALUE 'We',
          t2(10) TYPE c VALUE 'have',
          t3(10) TYPE c VALUE 'all',
          t4(10) TYPE c VALUE 'the',
          t5(10) TYPE c VALUE 'time',
          t6(10) TYPE c VALUE 'in',
          t7(10) TYPE c VALUE 'the',
          t8(10) TYPE c VALUE 'world',
          result TYPE string.
    CONCATENATE t1 t2 t3 t4 t5 t6 t7 t8
                INTO result.
    CONCATENATE t1 t2 t3 t4 t5 t6 t7 t8
                INTO result SEPARATED BY space.
    <b>output:</b>
    We have all the time in the world

  • Cross Tab keeps suppressing rows with no data

    I have a Crystal Report that is using a Cross Tab.  I have 2 rows in the cross tab the first row is the Month name and the second row is the Day Number of the month, and the report will print the Month Name on the left followed by all the Calendar Day Numbers in the month.
    The problem is that when there is no data for a Day Number row the entire row is not shown.  So you might have day number 1, 2, 3 and then jumps to maybe 6.  I found that the ones the cross tab was not showing did not contain any data.  I just need the calendar day number to at least print so the days read sequentially instead of jumping to 6 or another number.
    Is there any way to show the rows even if they don't contain any data?
    I have right clicked and gone into the Cross Tab expert and there isn't anything checked to suppress rows.  I don't understand why its still suppressing rows!
    Is there a global report option that I missed that says "suppress rows when there are no records"?
    Thank you all in advance,
    I am using Crystal Reports XIR2 with Service Pack 4

    I am still not getting all rows to show up on the report.   The rows that are not showing up contain no data in the cross tab but the row still needs to show.
    The only reason I got it to work before was because I selected all values for the columns parameter so it brought back everything in the database that was why it was able to show all values.
    I have two tables one is a date database and contains all the dates till 2012.  The other is the product data which contains the product code and qty that the cross tab summarizes.
    I have done a left outer join from the product data to the date database, and I am still not able to get all the dates to list for the selected time range. 
    I was able to get the dates to show up when I right clicked the link and modified the link properties.  I chose Left Outer Join and then under Link Type I selected ">" in the database expert dialog.  This brought back all the dates but the data in the report was all the same.  Probably just the first record repeated all down the page.
    Any ideas how to fix this problem?

  • Doubt: NullPointerException instead of RemoteException???

    Hi,
    Scenario:
    1. An external object (hosted by another process) registers itself in WebLogic
    JNDI by invoking bind
    2. WebLogic EJBs invoke the external object, everything is OK
    3. Process hosting the external object goes down
    4. Remote reference still exists in JNDI
    5. Invoking the remote object throws the following exception:
    2002-09-09 15:54:13,492 ERROR [ExecuteThread: '6' for queue: 'default'] cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean
    - Failed to send message to clientconnector: Test-SMSC
    java.lang.NullPointerException
         at weblogic.transaction.internal.PropagationContext.getVersion(PropagationContext.java:646)
         at weblogic.transaction.internal.PropagationContext.writeExternal(PropagationContext.java:165)
         at weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:92)
         at weblogic.common.internal.ChunkedObjectOutputStream.writeObjectWL(ChunkedObjectOutputStream.java:113)
         at weblogic.rjvm.MsgAbbrevOutputStream.setTxContext(MsgAbbrevOutputStream.java:111)
         at weblogic.rmi.internal.BasicOutboundRequest.setTxContext(BasicOutboundRequest.java:143)
         at weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:95)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:116)
         at cz.oskarmobil.is.bmg.connectivity.tcpip.UCPClientConnector_WLStub.sendMessage(Unknown
    Source)
         at cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean.sendMessage(UCPPostprocessorBean.java:294)
         at cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean.sendMessage(UCPPostprocessorBean.java:237)
         at cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean.onMessage(UCPPostprocessorBean.java:177)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:348)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:282)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:263)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2309)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2232)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    Why not RemoteException??? Why NullPointerException??? Wouldn't be RemoteException
    the right exception in this case?
    Please clarify this, since I thought it is enough to catch only RemoteException
    and relookup the object but now seems NullPointerException is also needed to be
    catched.
    Or, do I miss something?
    /SB

    while inserting data inserted into Temp_EmployeeDetails1, but not inserting in EmployeeDetails1,
    Because it is an INSTEAD OF trigger; instead of directly inserting the data into the base table the Trigger is fired and you have to insert the data on your own, e.g. after validationg or modifying the data.
    See
    INSTEAD OF INSERT Triggers /
    Designing INSTEAD OF Triggers
    Use an AFTER Trigger instead or modify your INSTEAD OF Trigger =>
    create trigger [dbo].[tr_emp1]
    on [dbo].[Employeedetails1]
    instead of insert
    as
    begin
    insert into Emploeeydetails1
    [EmployeeID],
    [Employeename],
    [Deptname]
    select ins.[EmployeeID],
    ins.[Employeename],
    ins.[Deptname]
    from inserted ins
    insert into Temp_Emploeeydetails1
    [EmployeeID],
    [Employeename],
    [Deptname]
    select ins.[EmployeeID],
    ins.[Employeename],
    ins.[Deptname]
    from inserted ins
    end
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to best handle RemoteExceptions

    Hi I'm writing some code and would like get some suggestions.
    The application is a remote control software to control server. Sort of remote control panel over TCP/IP.
    I've got a prototype running based on RMI which works nicely.
    The RMI communication between the remote control and the server software is implemented as a set of interfaces that extend the Remote interface and thus every method is declared to throw RemoteException. There are hundreds of little methods, basically one method for each actionPerformed() method in each swing JButton/Action component in the remote control.
    My 'problem' is as follows.
    Now because the RemoteException is checked exception I need to try/catch this in each and every place where I do call a remote method. And like I said there are hundreds of these. And there is realy only one course of action the remote control application can do when it gets a RemoteException, it must restart from scratch and establish a new RMI connection.
    So my code is littered with hundreds of try/catch block that all call one function to re-establish the connection.
    This seems patently silly, is there a better way to do this?
    More on the philosophical side, why is RemoteException checked? Or more to the point, why every remote method needs to throw RemoteException?
    The golden rule is if the caller can take some corrective action make the exception checked otherwise unchecked.
    The RMI underlying TCP/IP protocol is so robust that a RemoteException is 99.9% of the time and indication of broken socket connection. So what can my code do about this, except to catch it and report it? And more to the point, this really depends on the application. Most of the time my code can do little about this so it should be unchecked, ie I handle it if I care but can leave it to the system level catch all be handled if I so desire. Otherwise my code is full of those useless try/catches.
    br Kusti
    PS
    (A related side note here that many RMI programmers might want to consider and think about how to handle is this rather common case. In Windows if you connect a network cable to a laptop with WLAN, all sockets gets reset even though the WLAN over which an RMI connection is running is just fine but RMI connection gets broken. So this is fairly common real life situation in from which I would like to gracefully and silently recover, after all, from users point of view everything is and should appear to be ok, just a cable was inserted. Now I can of course handle this but the code is not very elegant.)

    The RMI underlying TCP/IP protocol is so robust that a RemoteException is 99.9% of the time and indication of broken socket connection.This is untrue. The remote server could be down, the remote JVM could be down, or the remote application could have thrown an exception, including a RemoteException. There are lots of reasons for a RemoteException. And if it is a broken socket connection there is still the question of whether or not the remote call has completed, i.e. whether the connection broke while sending the request or receiving the reply. And if it broke receiving the reply there is the further question of whether the remote call succeeded or not, which you cannot establish without receiving the reply.
    So what can my code do about this, except to catch it and report it?Your code needs to make an attempt to figure out which of those conditions above has occurred. If your transactions are idempotent and you can establish that the exception occurred either while sending the request or receiving the reply, you can just retry the call.
    Basically in RMI and networked applications generally you have to deal with the possibility of partial failure. Correct exception handling is of the essence of RMI programming. It can't be just treated as some kind of a nuisance. The concept of RemoteException as an unchecked exception doesn't hold water for a moment, unless you are prepared to advocate the same for IOException.

  • Sqlplus suppress /&1

    Hi,
    I have a generic statement like this:
    startup nomount pfile=/&&1/dbs/init&&2..ora;
    calling the script on Solrais 5.9 with:
    sqlplus / @mydb ${ORACLE_HOME}     ${ORACLE_SID}
    shows this:
    LRM-00109: could not open parameter file '//oracle/ora92/dbs/initSMEP1.ora'
    What happened to my &&1 ????
    Why ampersand is suppressed behind a / but well identified if another character is leading ? escaping it does not help (of course, that's not logic !)
    thanks for any tip
    LaoDe

    Problem solved ! stupid error from my own !
    I just forgot to copy init.ora to its home, so variable was empty :-(((
    Thanks for listening anyway

  • Subclassing RemoteException

    Dear All,
    I want to differentiate between various errors that may happen on server side and then take appropriate actions on client side. I thought to do it by subclassing RemoteException and catching the appropriate subclasses. However, it is always RemoteException what is actually thrown, with subclass nested in it.
    The only thing that works is:
    catch (RemoteException re) {
       if (re.detail instanceof ASubclass)
         do what you want;
    }But is not too pretty.
    Can someone tell me why is RemoteException supposed to work this way?
    Thanks

    Know your dilemma.
    The getMessage()::RemoteException doesn't always return a message. Even when you get something it may not reflect the true error.
    Remote Exception is the superclass. Meaning everything under the sun is pushed into it.
    You have to trap the error on the Server side. This is not so easy. What we ended up doing was editing the _Stub Class by putting in printStackTrace(), (and other code), in the catch statements. It ain't pretty, but it worked.
    You can get the _Stub source by running rmic with the -keepgenerated option.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

  • Disputes for Credit Notes are not displayed in Biller Direct

    Issue: Back end ECC, allows us to create disputes on stand alone credit notes, but on the Biller Direct front end we are not able to see the disputes created.
    Description in detail:
    1. When a dispute is created on a credit note, system treats it as a Customer Disputed Credit Memo (CDIS_CRED) and it is created in ECC with relation F6.
    2. On the Biller Dircet Front end , standard actually display disputes for a Invoice created with relation F1 and F2. So we are not able to see the Customer Disputed Credit Memos.
    3. Front End (Biller Direct) allows only open invoices to be disputed and not credit notes, even though it is allowed in ECC.
    We would like to know if you have come across this scenario before and have resolved it either through customization or Configuration.
    Advice/Recommendations will be greatly appreciated.

    Hi Dave,
    I just saw this thread now and I am glad I can share the solution with you:
    For View: PRDIOOV/OBJECTOV, debug method GET_LIST_OF_STATIC_VIEWS and find out why system is suppressing some assignment blocks.
    For some reasons, SAP has included these methods in Product Overview page which are meant to suppress some Assignment Blocks depending upon their usability.
    Just redefine this method and delete the views from the Static Views Result List. Following is the sample code:
    CALL METHOD SUPER->GET_LIST_OF_STATIC_VIEWS
      RECEIVING
        RT_RESULT = rt_result.
    DELETE rt_result WHERE viewid = 'CUSRQMSLAPro.SRQM_SLAPRO/MainWindow'.
    DELETE rt_result WHERE viewid = 'SrvEnt.PRDSRV/SrvEntOVE'.
    DELETE rt_result WHERE viewid = 'ZIOBJECT_VC/VC'.
    Hope this helps.
    Thanks
    Vishal

  • Missing few Condition types in sales order

    Dear Experts
    I have come across an issue in the sales order. And FYI, no configuration change has happened recently. And also, this issue has happened in few sales order only.
    OVKK: Pricing Procedure Determination
    *S.Org  SN12
    Dist.chan   DM   
    Division V1
    Doc.pricing. proc  A
    Customer.prici proced  6 
    Pricing procedure  ZSALES
    And ZSALES pricing procedure is having 5 condition types to update in sales order. But in few sales order, 2 of the condition types are missing in sales order.
    So, I have checked in customer master for customer pric. procedure and it is maintained as 6 and Doc.pricing procedure is also maintained as A as maintained in OVKK.
    And the sales order too have been created for the respective order type having doc pricing prcoed as A and for the sales area maintained in OVKK.
    I find this issue as strange. Can any one of you help me out to solve this issue as it is very urgent.
    Thank you very much.
    Regards
    Rajesh
    Edited by: RajeshR01 on Feb 14, 2012 2:45 PM

    Hello Rajesh,
    1. Am entering material in line item and clicking enter button
    and can able to see all the 5 condition types in the condition tab.
    But when I delete material in the line item manually, without clicking
    the icon 'Delete icon' and again entering the material
    and pressing 'Enter' button. When I am going to condition tab this
    time, as mentioned earlier 2 condition types only missing (Say Ex
    ZABC and ZXYZ) and able to save sales order normally.
    How to overcome this?
    As per SAP standard, when you perform ANALYSIS in the material line item CONDITION tab for a Sales Order, all the CONDITION types related to the Pricing procedure will be reflected. Here you will find information whether any condition type got suppressed and why it got suppressed...If any pricing routines are deactivating any condition type, you will get the information in this Analysis tab.
    When you say that the condition types are not visible in the Analysis button, it is making me perplexed...
    As per latest observation, the condition types are disappering after DELETE operation is done signify that the database is not getting refreshed instantly...
    Can you tell me whether you are conducting this activity at IDES sandbox or at Client Server ? If this problem is detected at Client server, has the client raised any questions ???
    Regards,
    Sarthak

  • How to prevent "Sign in" dialog on first launch of Visual Studio Express 2013?

    I am installing Visual Studio Express 2013. When I launch application shortcut for first time, It shows "sign in" window, which I want to hide for the users. This window also overrides all my settings (e.g. disabled "automatic check for
    updates"). Is there any way to prevent this dialog from appearing?

    Hi,
    >>I was looking for file or registry settings to suppress this dialog
    As far as I know, there is no way to realize this. It is by design. Since the users will sign in later, why need to suppress the dialog. What's more, this is an express edition, so you can't find any third-party add-in to help hide the dialog because Visual
    Studio Express doesn't support third-party add-ins. The only way you want the dialog not showing is to click "cancel" button the first time the dialog pop up. After that, you still can sign in if you want to. Click "Help", choose "register product", then
    you can sign in the appearing dialog.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Z10 not showing all emails in folders (imap + gmail imap)

    Hi
    My Z10 is not showing all the emails in my imap email accounts (inc gmail).  e.g. my inbox has 20 messages but the z10 only shows 10 of them.  Same issue applies on some other folders.
    Issue also applies on gmail imap account but does not seem to occur on my exchange account.
    It also only appears to be affecting emails that are approx 1 or 2 weeks ago in this month.
    Please help!

    Hello,
    Please check carefully your settings for your GMail account, especially the portion concerning "Sync Timeframe" (if visible to you, it depends on the integration method).
    Check carefully also how these are labeled on GMail...Gmail technically uses labels and not folders, and the BB must interpret the labels into folders. So if a stray label is applied to these items, then that may be why they are suppressed from view.
    You can also try removing and re-integrating the problem account.
    You can also try ringing up your mobile service provider for formal support and potential escalation to BlackBerry for enhanced formal support.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Why such sorry sound quality on iTunes? On some of my purchases the sound level is suppressed on the audio. On others the volume is so low that if I have it set for another song and a new one starts I have to increase the volume to hear it.

    Why such sorry sound quality on iTunes? On some of my purchases the sound level is suppressed on the audio. On others the volume is so low that if I have it set for another song and a new one starts I have to increase the volume to hear it.
    There is so much distortion on some of the music I have to play it with QuickTime to get a "clean" track.
    What can be done to get a consistent volume level or is this another typical Apple product that you have to take what you get and be happy because it's not a Microsoft product?

    If that's the best you can do why don't you get on another forum?

  • Java.rmi.RemoteException: Protocol error reported by the card! why?

    Hello,
    I am currently trying to run the JCK 2.2.1 SecureRMIDemo using SmartCardIO instead of OCF, but getting an error:
    java.rmi.RemoteException: Protocol error reported by the card
    (in my last post I succesfully ran the RMIDemo using my SmartCardIO implementation, see http://forums.sun.com/thread.jspa?threadID=5405634&tstart=15)
    So here is what I did:
    - I succesfully loaded the server app (com.sun.javacard.samples.SecureRMIDemo) on the card without changes.
    - I created an new accessor class: public class PINCardAccessor extends SmartCardIOAccessor (I wrote SmartCardIOAccessor for the RMIDemo, it should work fine as an accessor)
    - The contents of PINCardAccessor class and SecureOCFCardAccessor are the same, just the class declration makes the difference
    - Here is the most important part of my main method:
                   ca = new PINCardAccessor(false);
                   JavaCardRMIConnect  jcRMI = new JavaCardRMIConnect(ca);                         
                   jcRMI.selectApplet(appAID);
                   // send PIN
                   System.out.println("Sending PIN...");
                if (! ((PINCardAccessor) ca).authenticateUser( PRINCIPAL_APP_PROVIDER_ID ))
                     System.out.println("Wrong PIN!");
                     System.exit(0);
                   Purse myServ = (Purse) jcRMI.getInitialReference();
                   if(myServ == null)
                      throw new Exception("Received null instead of the initial ref");
                   // print balance
                   System.out.println("Balance: "+myServ.getBalance());And finally here is the debug output:
    accessor: select command
    0 a4 4 0 a a0 0 0 0 62 3 1 c a 1 7f
    90 0 6f 42 6e 40 5e 3e 2 2 38 81 33 f1 0 26 63 6f 6d 2f 73 75 6e 2f 6a 61 76 61 63 61 72 64 2f 73 61 6d 70 6c 65 73 2f 53 65 63 75 72 65 52 4d 49 44 65 6d 6f f 53 65 63 75 72 65 50 75 72 73 65 49 6d 70 6c
    90 0 6f 42 6e 40 5e 3e 2 2 38 81 33 f1 0 26 63 6f 6d 2f 73 75 6e 2f 6a 61 76 61 63 61 72 64 2f 73 61 6d 70 6c 65 73 2f 53 65 63 75 72 65 52 4d 49 44 65 6d 6f f 53 65 63 75 72 65 50 75 72 73 65 49 6d 70 6c
    Sending PIN...
    80 39 0 0 4 12 34 0 46 7f
    90 0 0 0
    Le=2
    csum1=0
    csum2=0
    90 0
    80 38 2 2 6 33 f1 ec a8 ff b8 7f
    90 0 99 0 6 ff 9f
    Le=5
    csum1=-97
    csum2=-97
    90 0 99 0 6
    java.rmi.RemoteException: Protocol error reported by the card
         at com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory.throwError(Unknown Source)
         at com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory.throwException(Unknown Source)
         at com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory.getObject(Unknown Source)
         at com.sun.javacard.ocfrmiclientimpl.JCRemoteRefImpl.parseAPDU(Unknown Source)
         at com.sun.javacard.ocfrmiclientimpl.JCRemoteRefImpl.invoke(Unknown Source)
         at com.sun.javacard.samples.SecureRMIDemo.SecurePurseImpl_Stub.getBalance(Unknown Source)
         at SecureClient.main(SecureClient.java:60)Please help me, I cant find the reason for this exception.
    thank you
    sebastaian

    Oh, thanks for pointing at the JCRE Spec, it is very informative, but i still have not found the problem yet.
    If i understand everything right, the communication's flow is
    SecureClient <-> PINCardAccessor <-> SmartCardIOAccessor <-> MySecurityService <-> SecurePurseImpl (with help of SecurePurseApplet)
    probably i made a mistake in a protocol of one or more layers.
    - MySecurityService, SecurePurseImpl and SecurePurseApplet are EXACTLY the one's from com.sun.javacard.samples.SecureRMIDemo of JCDK 2.2.1, so there cant be any mistake (?).
    - SmartCardIOAccessor worked fine in my RMIDemo tests, see http://forums.sun.com/thread.jspa?threadID=5405634&tstart=15 - there is also the implementation)
    - SecureClient must be obviously correctly
    so maybe it's something about PINCardAccessor? hmm...i havent found anything, but here is the complete code:
    import javax.smartcardio.CardException;
    * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
    * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    * @(#)SecureOCFCardAccessor.java     1.11 03/07/08
    public class PINCardAccessor extends SmartCardIOAccessor {
        public PINCardAccessor(boolean debug) throws CardException {
              super(debug);
         private static final byte INS_SELECT   = (byte)0xA4;
        private static final byte APDU_CMD_MASK = (byte)0xFC;
        private static final byte CLA_ISO7816 = (byte)0x00;
        private static final byte CLA_AUTH = (byte)0x80;
        private static final byte INS_AUTH = (byte)0x39;
        private static final boolean debug2 = false;
        /** Modifies the data and calls super.sendCommandAPDU to perform the actual send.
         * The data returned from the smart card is returned by this method within
         * the <CODE>ResponseAPDU</CODE> object
         * @param apdu The command APDU to be sent to the smart card
         * @return The response APDU returned from the card. <CODE>null</CODE> if none available.
         * @throws Exception if a communication error or timeout occurred
        public byte[] exchangeAPDU( byte[] sendData ) throws java.io.IOException{
            System.out.println("Send Data:"+SmartCardIOAccessor.getHexString(sendData));
            final boolean select = isSelect(sendData);
            byte[] dataWithChecksum;
            if(select) {
                dataWithChecksum = new byte[ sendData.length ];
                System.arraycopy(sendData, 0, dataWithChecksum, 0, sendData.length);
            else {
                dataWithChecksum = new byte[ sendData.length + 2];
                System.arraycopy(sendData, 0, dataWithChecksum, 0, sendData.length-1);
                dataWithChecksum[dataWithChecksum.length-1] = sendData[sendData.length-1];
                int Lc = dataWithChecksum[4];
                short csum = 0;
                for(short n = 5; n<Lc+5; ++n) {
                    csum += sendData[n];
                dataWithChecksum[Lc+5] = (byte) (csum>>8);
                dataWithChecksum[Lc+6] = (byte) (csum);
                dataWithChecksum[4] += 2;  // increase Lc
            if(debug2) {
                for(int i=0; i<dataWithChecksum.length;++i) {
                    System.out.print(Integer.toHexString(dataWithChecksum[i] & 0x00FF) + " ");
                System.out.println();
            byte[] receiveDataWithChecksum =  super.exchangeAPDU( dataWithChecksum );
            byte[] receiveData;
            if(debug2) {
                for(int i=0; i<receiveDataWithChecksum.length;++i) {
                    System.out.print(Integer.toHexString(receiveDataWithChecksum[i] & 0x00FF) + " ");
                System.out.println();
                System.out.println();
            if(!select)  // verify the checksum
                int Le = receiveDataWithChecksum.length - 2;   // 2 bytes reserved for SW
                if(debug2) {
                    System.out.println("Le=" + Le);
                short csum1 = 0;
                for(short n = 2; n<Le; ++n) {
                    csum1 += receiveDataWithChecksum[n];
                short csum2 = (short)
                (receiveDataWithChecksum[receiveDataWithChecksum.length - 2]<<8)
                |
                (receiveDataWithChecksum[receiveDataWithChecksum.length - 1] & 0x00FF)
                if(debug2) {
                    System.out.println("csum1=" + csum1);
                    System.out.println("csum2=" + csum2);
                System.out.println("csum1=" + Integer.toHexString(csum1));
                System.out.println("csum2=" + Integer.toHexString(csum2));
                if(csum1 != csum2) throw new java.io.IOException("Wrong checksum on returned data");
                receiveData = new byte[receiveDataWithChecksum.length-2];
                System.arraycopy(receiveDataWithChecksum, 0, receiveData, 0, receiveData.length);
            else {
                receiveData = new byte[receiveDataWithChecksum.length];
                System.arraycopy(receiveDataWithChecksum, 0, receiveData, 0, receiveData.length);
            if(debug2) {
                for(int i=0; i<receiveData.length;++i) {
                    System.out.print(Integer.toHexString(receiveData[i] & 0x00FF) + " ");
                System.out.println();
                System.out.println();
            System.out.println("Receive Data:"+SmartCardIOAccessor.getHexString(receiveData));
            return receiveData;
        boolean authenticateUser( short ID ){
            byte[] externalAuthCommand = new byte[8];
            externalAuthCommand[0] = CLA_AUTH;
            externalAuthCommand[1] = INS_AUTH;
            externalAuthCommand[4] = 2;  // Lc
            externalAuthCommand[5] = (byte)(ID>>8);
            externalAuthCommand[6] = (byte)ID;
            externalAuthCommand[7] = 0x7F;
            try {
                byte[] response = this.exchangeAPDU( externalAuthCommand );
                if(response[0] != (byte)0x90 || response[1] != 0x00) return false;
                else return true;
            }catch (Exception e){
                return false;
        private boolean isSelect(byte[] buffer) {
            if(buffer.length < 2) return false;
            if((buffer[0]&APDU_CMD_MASK)==CLA_ISO7816 && buffer[1]==INS_SELECT) {
                if(debug2) {
                    System.out.println("accessor: select command");
                return true;
            else {
                return false;
    }

  • Why suppressed grand total in crosstab still occupy the space in report?

    I have suppressed the grand total in crosstab in Crystal Reports 2008.
    It's not shown in crosstab correctly.
    However, the grant total is still occupying the space in the report layout.
    How is that?
    Isn't it strange?

    Hi Graham,
    I have one more interesting finding.
    Because I haven't found the Extreme XML or mdb, I have downloaded the "XML data sources for the Crystal Reports 2008 sample reports" from "Business Objects Downloads"
    I have tried to use the XML balance_sheet1 as datasource and set as below:
    Rows - Account_Type
    Columns - Account_Name
    Summerized Fields - Amount
    There should be five rows and lots of columns.  In design mode, the Grand total field is taking space as usual and I can only align the Page Header border right next to it.
    However, after reviewing data, the ONE row in design mode is "expanded" to FIVE rows to adjust the real data.
    It's found that the Grand total field is NOT taking space and the Page header section is closed next to the data row in crosstab.
    And so I wonder whether it's due to the special data problem in my crosstab.
    My crosstab is special and It's designed to have EXACT ONE row only, all the detail are placed in summerized fields and so that means only the columns will expand depending on the real data.
    I did this to the XML balance_sheet1 as well by making a dummy Text formula field as Rows fields and make the summerzed fields have several fields and my case appears.
    I believe there is some BUG for this case.

  • Why does Firefox open with both my Homepage and the 'Welcome to Firefox' tab, and how can I suppress the 'Welcome to Firefox' page?

    When Firefox loads, both my Homepage and the 'Welcome to Firefox' pages open. How do I suppress the 'Welcome to Firefox' page/tab?

    Hi Sean,
    Try this:
    # Type about:config in the address bar
    # Click ''I'll be careful, I promise'' if prompted
    # In the Filter input field type ''startup''
    # Double click on startup.homepage_override_url
    # Delete the text string and click ''OK''
    # Close Firefox and reopen the window to verify that it has worked.
    It's a bit more "technical" than most people want, but it should work.

Maybe you are looking for

  • How to schedule two jobs from two different work repository at a time?

    Hi All, I have a scenario where I want to schedule two jobs at a time from two work repository. Explanation: Master Repository-A Work Rep-B Work Rep-C Now I need to schedule two scenario one from Work rep B and other from Work Rep-C As we know that o

  • Acrobat Pro 9.4 - Edit Preferences - Failed to Load Application Resource

    I have tried all types of searches and can't seem to nail down an answer to this issue. I am currently running Acrobat Pro 9.4.2 in Windows 7 - 64bit. I can't pinpoint exactly when this issue started, but I am unable to access the Preferences from th

  • When Working With Your iMac Do You: Stand Up or Sit Down?

    Hi. New studies show that it's better for health and creativity to stand up for hours while working (with legs moving from time to time) vs. sitting down or is sitting down with a very good chair better than standing up if you want to have a clear mi

  • Problem Installing Java Servlets Package

    I downloaded a sample servlet program which imports classes from the Java Servlets Package. I have the JDK 1.2 which does not come with the servlet classes (javax.servlet and javax.servlet.http). So I then downloaded them from java.sun.com. They come

  • Facing an issue while Bookmarking a report in the query

    Hi, I opened a report in the portal and executed it. I try to bookmark a page with all my desired factors i want in my query . and when i bookmark, it diverts me back to an older query that i've created and all of the links to my previous bookmarks a