Token resolution of virtual method in javacard
Please help me out how to map the token value of virtual method in the case of internal class reference.
Hi chandufo,
I'm agree with safamer, context is only an identifier.
It's structure may be like this:
context{
u1 context_id
u2 package_addr;
u2 applet_instance_addr;
** if context is JCRE context, all above entry may be *0xFF*. Otherwises, context_id is increment
Switching context can implement PUSH, POP.
So that, in your structure of FRAME must be included context_id field like this:
typedef struct frame {
u1 last_pc;
u2 *lvars;
u2 *ostack;
method_info *mi;
class_info *ci;
struct frame *prev;
u1 context_id;
} Frame;
hi @Shane, do you agree with me?
Edited by: hoaibaotre on Jul 1, 2011 5:26 PM
Similar Messages
-
How to do screen resolution in session method
hi guru how to do screen resolution in session method.
please tell me.
regards
subhasisSometime back this is refered in SDN :
Check table <i>CTU_PARAMS</i> and field <i>DEFSIZE</i> for setting fixed line of table control.
CALL TRANSACTION 'VA01' USING it_bdcdata
OPTIONS FROM OPT
MESSAGES INTO it_mesg.
opt of type ctu_params.
WA_CTU_PARAMS-DISMODE = 'N'. "no screen mode
WA_CTU_PARAMS-UPDMODE = 'S'. "synchronus update
WA_CTU_PARAMS-NOBINPT = 'X'.
WA_CTU_PARAMS-NOBIEND = 'X'.
WA_CTU_PARAMS-DEFSIZE = 'X'. "Default size
Default size will play good role in terms of resoultion. in one system in table control you can see 10rows, but in others system it will show 20 records. it depends on resoultion. but when you set the default size then it will take same (default screen size) in all the systems when you run BDC.
Thanks!! -
How to handle screen resolution in session method
how to handle screen resolution in session method without bdc_insert .
Hello,
Why do need that for? Is it to add rows on a table control??
If it does, add new rows by using the add button instead of adding into the table control directly to each row.
Bye
Gabriel. -
Virtual methods- abstract methods
Hi, I need to get this clear in my head.
In C++ you had virtual methods()
If a method was virtual this made the enclosing class abstract.
There is no such thing as abstract methods in C++?
In java, if you have an abstract method your enclosing class becomes abstract.
There is no such thing as a virtual method in java.
is all the above correct?
Thanks ... JHi, I need to get this clear in my head.
In C++ you had virtual methods()
If a method was virtual this made the enclosing class abstract.
There is no such thing as abstract methods in C++?Incorrect.
Abstract methods have no implementation. You can have those in C++. If I remember correctly, they'd look something like this:
public void foo() = 0;
In java, if you have an abstract method your
enclosing class becomes abstract.
There is no such thing as a virtual method in java.Incorrect.
All methods in Java are virtual by default. Every method is fair game to be overridden by a subclass. You mark them with the final keyword to prohibit overriding.
All methods in C++ are final by default. You can't override any method in a subclass unless you mark it with the virtual keyword. (This was keeping the Bjarne's philosophy of "only pay for what you use".)
% -
Is every method of java a Virtual method ?
Hi,
Is every method of java a Virtual method ? Can any methods be overridden ? Is that making use of double pointer ?
Edited by: shyam1 on Sep 22, 2010 10:44 PMshyam1 wrote:
jverd wrote:
shyam1 wrote:
Hi,
Is every method of java a Virtual method ?Every non-final, non-private, non-static method can be considered "virtual," although Java doesn't use that term as far as I know.
Can any methods be overridden ? Every non-final, non-private, non-static method can be overridden. Any method that is private, static, or final, cannot be.
Is that making use of double pointer ?
And I am telling you that it is not defined and not relevant.
>>
That is not specified, and is an irrelevant implementation detail.i am asking that, to make every method ( non-final, non-private, non-static method) overridable does java is using any concept called double pointer ?
IT. IS. NOT. DEFINED. An implementation is free to do it however it wants.
Why do you care? Why do you think it matters? -
Screen Resolution in Virtual Box
Okay, my next obstacle.
I installed guest additions as the wiki instructed:
https://wiki.archlinux.org/index.php/Vi … _Additions
and have xorg installed, but with the minimum xorg-server package.
I read another forum post from awhile ago about hardcoding resolution in a GRUB config file, but I don't have the config file they spoke of, and I can't seem to find the post anymore.
Screen resizing doesn't appear to work. In changing the size of the virtual box window, the screen resolution remains the same. I'm not exactly sure shared-clipboard is working either, though I don't have a definitive test for that.
Syncing the host time and guest time seems to have worked though.
How do I go about enabling screen-resizing? I would prefer if it auto-resized based on the virtualbox window size, instead of hardcoding a bigger resolution. If that's possible.I'm not entirely sure what you mean by the minimum xorg-server package - just X with no desktop environment or window manager? If so, I think that might be the issue. As an experiment, you could clone your installation in Virtualbox, and install Xfce on the clone. If you can resize the window with Xfce running, then you know you have everything configured properly.
For hard-coding a resolution at boot time, you can put "vga=792" in your grub config file. I use syslinux, so I can't tell you for sure about grub. But in syslinux, mine looks like this:
APPEND root=/dev/sda1 ro vga=792
You can google the keywords "vga resolution codes" to find codes for other settings, but 792 will give you 1024x768 with 24 bits.
Sorry I'm not much of an expert, but hopefully that will give you some avenues to pursue. -
How to give a value in Token when Conc prog method registered as pl/sql typ
Hi
We have a report which will generate invoices for a given Operating Unit at one time.i.e Conc Prog1
We have a customised pl/sql package which submits the above report conc prog for all Operating Units with the required parameters for the report.i.e Conc Prog2
When i saw the conc prog2 somehow values has been entered TOKEN field eventhough the conc prog method is pl/sql.this was done earlier than me who developed this intially.
Now i need to include one parameter to this concprog2.when i try to include a parameter to it the TOKEN filed is grayed out(not updatable/eneterable a value).
So could anyone please tell me how i can add a parameter with token value for pl/sql type method conc progs.
Thanks,
MallaHi parag,
You mean to say i have to write like this :--
if (pageContext.getParameter("apply")!=null)
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject accountsViewObject =
(OAViewObject)am.findViewObject("ArBusPurAllVO");
if (accountsViewObject!=null)
OARow row = (OARow) accountsViewObject.getCurrentRow();
if (row.getAttribute("GlIdRev") == null || row.getAttribute("GlIdRev").equals(""))
//call your function here and say row.setaatribbute= revenue_acct_id from your function.
if(s8.equalsIgnoreCase("BILL_TO")) {
try {
Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
String Query = "select SDS_CUST_BILL_INFO(:1,2) from dual";
PreparedStatement stmt = conn.prepareStatement(Query);
stmt.setInt(1, orgid);
ResultSet resultset = stmt.executeQuery();
if(resultset.next()) {
String revenuenum = resultset.getString(1);
row.setaatribbute(revenuenum) ;
} catch(SQLException se) {
se.printStackTrace();
throw new OAException("Error in Staffing Query"+se, OAException.ERROR);
if (row.getAttribute("GlIdRec") == null || row.getAttribute("GlIdRec").equals(""))
//call your function here and say row.setaatribbute=rec_acct_id from your function.
if(s8.equalsIgnoreCase("BILL_TO")) {
try {
Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
String Query = "select SDS_CUST_BILL_INFO(:1,2) from dual";
PreparedStatement stmt = conn.prepareStatement(Query);
stmt.setInt(1, orgid);
ResultSet resultset = stmt.executeQuery();
if(resultset.next()) {
String receivablenum = resultset.getString(1);
row.setaatribbute(receivablenum) ;
} catch(SQLException se) {
se.printStackTrace();
throw new OAException("Error in Staffing Query"+se, OAException.ERROR);
super.processFormRequest(pageContext, webBean);
Am I, correct parag please tell me, if this works i will send u mail again that it is working fine .
my mail id is [email protected] -
Generating token for javacard framework?
Hi,
I am implementing JCRE and it needs to support all APIs that are specified by Oracle JCRE.
It means that beside the coding/ implementation of each class and method, My framework needs to have tokens of each class, method and field as same as tokens of corresponding Oracle API classes, methods and fields.
I don't know if there is a special rule to set token for each framework related item? Or Tokens will be changed if there are changes in framework?
thanks,Stratos,
Thanks for your inputs,
I changed the code as you suggested , now my whole code looks like :
<%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
<%
boolean loginSuccessful = false;
IEnterpriseSession boEnterpriseSession = null;
String username = "user";
String password = "Password";
String cmsname = "Server";
String authenticationType = "secEnterprise";
try {
//Log in.
boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
if (boEnterpriseSession == null) {
out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
} else {
loginSuccessful = true;
} catch (SDKException sdkEx) {
out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");
if (loginSuccessful) {
ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
//String logonToken = boLogonTokenMgr.getDefaultToken();
String infoViewURL = null;
String tokenParam = null;
String redirectURL = null;
infoViewURL = "http://Server:8080/InfoViewApp/logon.jsp";
tokenParam = "ivsLogonToken=" + logonToken;
redirectURL = infoViewURL + "&" + tokenParam;
pageContext.forward( "openDocument.jsp?iDocID=" + 4668 + "&token=" + tokenParam);
%>
But I am still getting the Infoview Login Page . The url on the login page is
http://server:8080/OpenDocument/opendoc/logonTrustedAuth.do?appKind=InfoView&iDocID=4668&isApplication=true&token=ivsLogonToken%server%3A6400%4021181JIipxt70VM0kd90v21179JFd4dHn7kW2FKSBi
We can see that a token is being generated and appended to this url but it is not passing the user name and password.
Please let me know what you think about this. -
Tokens are diffirent between CAP file and Export File
hi Safamer, hi all guys.
firstly, thanks all for concerning my issue.
As i know, java card technology link components base on TOKEN.
But the question is: the token in Export file and in the CAP file are different. So, how can off-card installer can link everything.
For example.
My_Package1:
Class1:
protected field1
private field2
public filed3
---> in the ExportFile, i have token for filed1 and field3 are 0 and 1 correspondingly. But in the CAP, these are not.
Thanks for your answer.
Edited by: hoan_micheal on Jun 14, 2011 1:41 AMdear guys!
I check very careful for this issue. And the results are:
- With the instance Field, virtual method ( i mean non-static), the token in the ExportFile and the token in the CAPFile is SAME
- with the static Filed and STATIC Method, the token is different and i don't see any rule to link these tow value. For example
--------------------------------------------------------------------CAP file --------------------------------------------ExportFile
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\public----------private --------------------------------------token
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\token-----------token------------------------------------------
public........static short sf1....=......1------------12---------------------------------------------------------->0
private......static short sf2....=......2----------------------------21
protected..static short sf3....=......3------------14---------------------------------------------------------->1
private......static short sf4....=......4----------------------------23
public .......static short sf5....=......5------------16---------------------------------------------------------->2
public...... static short sfn1-------------------------0----------------------------------------------------------> 3
private......static short sfn2--------------------------------------- 6
protected..static short sfn3-------------------------2----------------------------------------------------------> 4
...............static short sfd1....=.....7-------------------------- 25
..............static short sfd2....=.....8
public......static byte sb1....=......1------------18---------------------------------------------------------->5
private......static byte sb2....=......2---------------------------27
protected.static byte sb3....=......3------------19---------------------------------------------------------->6
private......static byte sb4....=......4---------------------------28
public...... static byte sb5....=......5------------20---------------------------------------------------------->7
public ......static byte sbn1-----------------------4------------------------------------------------------------->8
private......static byte sbn2-------------------------------------------10
protected..static byte sbn3-----------------------5 ---------------------------------------------------------->9
...............static byte sbd1....=....10------------------------------29
...............static byte sbd2-------------------------------------------11
- with the Class in a package, the token is diffent. For example.
Package library{----------------------------exportFile Token----------------------------CapFIle--- the Offset in the Class Component
............. Class1--------------------------->not ---------------------------------------------->0
public.....Class2---------------------------->0-------------------------------------------------->1
public.....Class3---------------------------->1-------------------------------------------------->2
............Class4---------------------------->not------------------------------------------------>3
public.....Class5---------------------------> 2 ------------------------------------------------> 4
Those are really different. Could you help me to understand this.
Thanks a lot -
Hi,I want to use native methods on JavaCard.
"JavaCard 2.1.1 Virtual Machine Specification" said that JavaCard 2.1.1 does not support native methods.
But, "JavaCard Technology for Smart Cards" said that ROM applets and Preissuance applets are allowed to declare native methods.
Which is right?
If the latter is right, how can I download preissuance
applets with native methods?
thank youThere is nothing wrong with the ROM for a bank. Believe me when I say that if there were issues, Visa/Global Platform wouldn't deploy the millions it has already. The process is more than you can imagine.
Reissue isn't reformatting a card. The ROM is read-only. Can't be written to again. The reissue would involve issuing a new card.
What sits in ROM ? The JCVM, Global Platform, extended applets for the Global Platform ( ie. Visa Debit/Credit ), etc.
Since you are inquiring because of a financial applet, I recommend you spend a lot of time reading the Global Platform specifications. The bulk of your time will be spent implementing it. You won't have anything to do with the ROM. Whomever the bank chooses for cards will be responsible for that. You're focus would be the post-issuance applets. -
Unable to call Web Service with Username Token
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
I posted this in the JDeveloper forum but got no response.
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
I have JDeveloper 10g release 3.
I created a regular Java application. Added a Web service proxy with no special mappings or anything. Right clicked on the proxy and said "Secure Proxy". I only used basic plain text username token. Added a method to my class that call instantiates a client, and called the operation.
However when I run this I get the following error message.
SEVERE: No username found
Error::oracle.j2ee.ws.common.soap.fault.SOAP11FaultException: No username found
The Web Service Security Proxy Wizard created an xml in my src file, that I updated to put the username and password of the web service. Below is the xml file.
<oracle-webservice-clients xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://xmlns.oracle.com/oracleas/schema/oracle-webservices-client-10_0.xsd'>
<webservice-client>
<service-qname namespaceURI="http://tempuri.org/SOAPTestWS/Service1" localpart="Service1"/>
<port-info>
<wsdl-port namespaceURI="http://tempuri.org/SOAPTestWS/Service1" localpart="Service1Soap"/>
<runtime enabled="security">
<security>
<inbound/>
<outbound>
<username-token name="myusername" password="xxxxx" password-type="PLAINTEXT" add-nonce="false" add-created="false"/>
</outbound>
</security>
</runtime>
<operations>
<operation name='TryMe'>
</operation>
</operations>
</port-info>
</webservice-client>
</oracle-webservice-clients>
And this configuration file is processed in the stub file.
setupConfig("project2/runtime/Service1Soap_Stub.xml");
What am I doing wrong. I cannot find any documentation on the secure web service client wizard and it's generated code.
Thanks, MIke L.Mike,
I updated the 3 xml files with the name and password and I get a different error now ...
WARNING: Unable to connect to URL: https://dssd001.ca.boeing.com:443/bartinterface/SOAP/resSetup.cgi due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: javax.net.ssl.SSLException: SSL handshake failed: X509CertChainIncompleteErr
java.rmi.RemoteException: ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: javax.net.ssl.SSLException: SSL handshake failed: X509CertChainIncompleteErr
I am using the simple text based username auth, but jdev for some reason still goes and looks for the x509 cert? How did you get yours to work?
Thanks
Sriram -
Pros and cons of various dual boot and virtual options?
I have purchased a 500 GB hdd 8 GB RAM Macbook Air with the intent of being able to run a few PC programs (i.e., no Mac versions) a few times a week, both of which are radiology image viewing programs. I can cover other programs with Mac software versions.
Years ago I worked briefly with a computer that used Parallels. It seemed to be OK--in fact, there was a compatilbility mode that allowed me to run PC programs along with the native Mac programs, so it must have been a virtual setup.
With this new hardware, I can make my own choice about whether to do a frank dual boot or whether to run Windows 7 as a virtual machine, I guess, under Parallels or VMWare. I would appreciate any input from people who have experience with doing any of the combinations, including comments about how difficult the installation is/was and whether there is a noticeable slow-down because of use of resources, particularly with the virtual methods. My Air boots quite quickly--does the boot time into Win 7 with Boot Camp extend boot time significantly? What other questions should concern me? (one other question that I asked in a different part of the forum concerns the difference between PC and Mac keyboards and how that is handled with dual boot or virtual machines...)
Thanks
Ken KThere are some other options for running PC programs on your Mac besides installing Windows, which have the great advantage of not requiring Windows on your Mac, which is like putting a turd on your hamburger. Two options I have used are Wine winebottler.kronenberg.org and Crossover Run Windows on Mac and Linux, easily and affordably - CodeWeavers . Crossover is a bit easier to use, and Wine is free. Not every PC app will work on them, but many do.
Running a virtual machine will definitely be slower than boot camp. How slow will depend on the app and how much RAM it needs. MRIs and CTs with a lot of images can use a lot of disk space and memory.
If you have windows on your Mac you will need virus protection at least on the Windows part, which will slow your Mac down more.
I have used OsiriX for Mac, and it works well. OsiriX (Mac) - Download -
Hi
I am having a strange problem in my application. I have a virtual method in a base class which I override in the sub class. In my application I instantiate the subclass . This virtual function is then called from a function in the base class . Most of the time this works okay i.e. the overriden function from the subclass gets called but sometimes , for some reason , the base class function gets called , although I verified that the subclass has been instantiated properly.
Any ideas what the problem could be ? . Is there any way to debug this , or view the virtual funtion table.
Any help would be highly appreciated.
Thanks
Santosh1. Probably you have slicing problem, it happens when you are passing your derived class object where you have defined to pass base class object. In this case your derived class object will be sliced and you will have base class object.
You have two solutions-
1. First thing is you should define the functionality of this function in the base class, bcs it seems this functionality belongs to base class as you are trying to use it there.
2. Dynamically cast the object to your derived class and then call the function. See if it helps. -
Hi,
In Indesign SDK there is a class IActionComponent having two pure virtual functions:
virtual void
UpdateActionStates(IActiveContext* ac, IActionStateList *listToUpdateGSysPoint mousePoint = kInvalidMousePoint, IPMUnknown* widget = nil) = 0;
virtual void
DoAction(IActiveContext* ac, ActionID actionID, GSysPoint mousePoint = kInvalidMousePoint, IPMUnknown* widget = nil)= 0;
But, the child class
class WIDGET_DECL CActionComponent : public IActionComponent
implements only UpdateActionStates function and not DoAction function.
There is no compilation error and the code is running fine..HOW
Can some one please explain me?Oops!!! there is a small correction in my C++ program. The JunkMethod is being called from the constructor...like the following code.
#include <iostream.h>
#include <stdlib.h>
class Base
public:
Base()
cout<<"In Base Class constructor..."<<endl;
JunkMethod();
void JunkMethod()
TestAbsFunc();
virtual void TestAbsFunc()= 0;
class TestAbstract:public Base
public:
TestAbstract()
cout<<"In Extend Class constructor..."<<endl;
void TestAbsFunc()
cout<<"In TestAbsFunc...."<<endl;
int main()
TestAbstract test;
return 0;
}You can see the change in the constructor of the Base class. JunkMethod is being called, just to bluff the compiler to call the virtual method (so that it won't crib saying that abstract method cannot be called from the constructor). When Java is supporting this functionality without giving any errors, C++ gives errors when you call an abstract method from the constructor or fails to execute when I do some work around like this. Isn't it a drawback of abstract funcationality supported by C++ (I'm not sure if it's a drawback or not)
Regards,
Kalyan. -
Equivelant of "virtual function" from C++ in Java?
I have a Java class which implements a network protocol. There are certain types of packets that my Java class will handle internally. Then again there are other types of packets my Java class needs to pass on to the Java MIDlet that is running this code (importing the package which implements the network protocol and using the class). In C++ I would make this all one class which has a virtual function OnReceive(). Then the C++ application using the class would provide their own implementation for OnReceive and every packet that my network code didn't know what to do with would be passed on to the new OnReceive. How can I do the same in Java? I would like to be able to create a new project, import my package which has the networking code in it. And code up a method that is specific to the application using the networking package. That way I only code one method to handle the packets that my networking code does not care about. I hope someone understands what I am getting at here, it is not so easy to explain.
Make your class abstract, define the pure virtual methods you want subclasseses to provide implementation for (using the abstract keyword in their definition) and you should be good.
public abstract class MyClass {
public void concreteInitThing() {
// your code here
public abstract void specificImplementation();
public class ConcreteImplementationOfMyClass extends MyClass {
public void specificImplementation() {
// Your code here
}I hope that helped
Lee
Maybe you are looking for
-
How to transfer photos from one rhyme to another?
how to transfer photos from one rhyme to another?
-
Input field in a table view control
Hi, I have a table view control, with input field in one of the columns. That is meant for entering some values. My problem is when i am entering a 3 input field with value and then by using mouse control i enter say 20th input fiel
-
BT is the worst company I have ever dealt with - c...
I need all my composure whilst writing this post to avoid using bad language because frankly I wish to mutilate the idiot(s) responsible for the utterly woeful customer experience I continue to have with BT and it's wretched call centre. Searching th
-
Planning sequence in Process chain
HI, I have used Planning sequence in process chain, But while executing it, it throws a following message "Inconsistent input parameter (parameter: <unknown>, value <unknown>)"" Any Guess?? Regards, Meiy
-
Horizontal menu bar - increase the height and center the vertical treat position.
I am using SpryMenuBarHorizontal.css and want to increase the height of a horizontal menu bar 20 28px and have the menu names move to be centered vertically, rather than be aligned at the top. Can anyone help me figure out how to do this?