Exceptions method signatures while extending/implementing

Suppose If i have some throws clauses in my method signatures in an interface.Now if i define a class which implements this interfcae and while implementing i do not give the throws clause in the signature then i should expect a compilation error.Which is not the case.Can someone tell me the reason for this.

The throws cause is not part of the method signature. It is OK for a implementing method tp promise to throw fewer exceptions (in this case none) but it would not be OK for it to threaten to throw more exceptions.
The general model is that an implementation or override of a method must require no more and provide no less.
Chuck

Similar Messages

  • Changing exception clause in method signature when overwriting a method

    Hi,
    I stumbled upon a situation by accident and am not really clear on the details surrounding it. A short description:
    Say there is some API with interfaces Foo and Bar as follows:
    public interface Foo {
       void test() throws Exception;
    public interface Bar extends Foo {
       void test();
    }Now, I find it strange that method test() for interface Bar does not need to define Exception in its throws clause. When I first started with Java I was using Java 1.4.2; I now use Java 1.6. I cannot remember ever reading about this before and I have been unable to find an explanation or tutorial on how (or why) this works.
    Consider a more practical example:
    Say there is an API that uses RMI and defines interfaces as follwows:
    public interface RemoteHelper extends Remote {
       public Object select(int uid) throws RemoteException;
    public interface LocalHelper extends RemoteHelper {
       public Object select(int uid);
    }As per the RMI spec every method defined in a Remote interface must define RemoteException in its throws clause. The LocalHelper cannot be exported remotely (this will fail at runtime due to select() in LocalHelper not having RemoteException in its clause if I remember correctly).
    However, an implementing class for LocalHelper could represent a wrapper class for RemoteHelper, like this:
    public class Helper implements LocalHelper {
       private final RemoteHelper helper;
       public Helper(RemoteHelper helper) {
          this.helper = helper;
       public Object select(int id) {
          try {
             return (this.helper.select(id));
          } catch(RemoteException e) {
             // invoke app failure mechanism
    }This can uncouple an app from RMI dependancy. In more practical words: consider a webapp that contains two Servlets: a "startup" servlet and an "invocation" servlet. The startup servlet does nothing (always returns Method Not Allowed, default behaviour of HttpServlet), except locate an RMI Registry upon startup and look up some object bound to it. It can then make this object accessible to other classes through whatever means (i.e. a singleton Engine class).
    The invocation servlet does nothing upon startup, but simply calls some method on the previously acquired remote object. However, the invocation servlet does not need to know that the object is remote. Therefore, if the startup servlet wraps the remote object in another object (using the idea described before) then the invocation servlet is effectively removed from the RMI dependancy. The wrapper class can invoke some sort of failure mechanism upon the singleton engine (i.e. removing the remote object from memory) and optionally throw some other (optionally checked) exception (i.e. IllegalStateException) to the invocation servlet.
    In this way, the invocation servlet is not bound to RMI, there can be a single point where RemoteExceptions are handled and an unchecked exception (i.e. IllegalStateException) can be handled by the Servlet API through an exception error page, displaying a "Service Unavailable" message.
    Sorry for all this extensive text; I just typed out some thoughts. In short, my question is how and why can the throws clause change when overwriting a method? It's nothing I need though, except for the clarity (e.g. is this a bad practice to do?) and was more of an observation than a question.
    PS: Unless I'm mistaken, this is basically called the "Adapter" or "Bridge" (not sure which one it is) pattern (or a close adaptation to it) right (where one class is written to provide access to another class where the method signature is different)?
    Thanks for reading,
    Yuthura

    Yuthura wrote:
    I know it may throw any checked exception, but I'm pretty certain that an interface that extends java.rmi.Remote must include at least java.rmi.RemoteException in its throws clause (unless the spec has changed in Java 1.5/1.6).No.
    A method can always throw fewer exceptions than the one it's overriding. RMI has nothing to do with it.
    See Deitel & Deilte Advanced Java 2 Platform How To Program, 1st Ed. (ISBN 0-13-089650-1), page 793 (sorry, I couldn't find the RMI spec quick enough). Quote: "Each method in a Remote interface must have a throws clause that indicates that the method can throw RemoteException".Which means that there's always a possibility of RemoteException being thrown. That's a different issue. It's not becusae the parent class can throw RE. Rather, it's because some step that will always be followed is declared to throw RE.
    I later also noticed I could not add other checked exceptions, which made sense indeed. Your explanation made perfect sense now that I heard (read) it. But just to humour my curousity, has this always been possible? Yes, Java has always worked that way.
    PS: The overwriting/-riding was a grammatical typo (English is not my native language), but I meant to say what you said.No problem. Minor detail. It's a common mistake, but I always try to encourage proper terminology.

  • Could not resolve method to a component implementation

    Hello,
    I have created an action script class extending httpservice while using in mxml page i am trying to set some requests.
    Example
    <Utils:CustomHTTPService id="httpGetAllStations" url="Stations.aspx" method="POST" resultFormat="e4x"
            result="httpGetAllStationsResultHandler(event)" fault="httpGetAllStationsFaultHandler(event)">
            <Utils:request>
                 <method>{onMove}</method>
            </Utils:request>
        </Utils:CustomHTTPService>
    but this line (<method>{onMove}</method>) throws error(Could not resolve <method> to a component implementation).
    How can i resolve this?
    Thanks in Advance.

    yeah, i know that
    are you sure you have xmlns:mx="xmlns:mx="http://www.adobe.com/2006/mxml"

  • No Method Signature - initQuery error after VO Substitution

    Hi All,
    I have done a VO Substitution for "NewBankAccountVOImpl". Below is the exact Requirement,
    iReceivables -> Query for a given Customer -> Go to accounts Tab -> Try to Pay off an invoice -> You get an option choose Payment Method as "New Bank Account" ->
    Now there are three field Routing Number, Account Number and Account Holder
    I need to restrict Account Number to minimum three characters. In 11.5.10 Oracle do not have this validation.
    So I checked out the place where the Routing Number and Account Number Validation happen i.e "NewBankAccountVOImpl" and extended the same to custom VOImpl and copied all the standard code to my custom code as below,
    package mercury.oracle.apps.ar.irec.accountDetails.pay.server;
    import oracle.apps.ar.irec.accountDetails.pay.server.NewBankAccountVOImpl;
    import oracle.apps.ar.irec.accountDetails.pay.server.NewBankAccountVORowImpl;
    import java.sql.Types;
    import java.lang.String;
    import oracle.apps.ar.irec.accountDetails.pay.utilities.PaymentUtilities;
    import oracle.apps.ar.irec.framework.IROAViewObjectImpl;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.*;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.jbo.RowIterator;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OraclePreparedStatement;
    // --- File generated by Oracle Business Components for Java.
    // --------------- Modification History --------------------------
    // Date Created By Description
    // 04/01/2011 Veerendra K Account Number Validation to raise
    // error if Account Number entered is
    // less than 3 Digits
    public class MMARNewBankAccountVOImpl extends NewBankAccountVOImpl
    * This is the default constructor (do not remove)
    public MMARNewBankAccountVOImpl()
    public void initQuery()
    if(!isExecuted())
    executeQuery();
    reset();
    // Wrapper Method to validate Routing Number and Account Number
    public void validateNewBankAccount()
    OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
    RowSetIterator rowsetiterator = createRowSetIterator("iter");
    rowsetiterator.reset();
    NewBankAccountVORowImpl newbankaccountvorowimpl = (NewBankAccountVORowImpl)rowsetiterator.next();
    rowsetiterator.closeRowSetIterator();
    OAException oaexception = null;
    //object obj = null;
    int i = validateRoutingNumber(newbankaccountvorowimpl.getStrippedRoutingNumber());
    if(i == 0)
    OAException oaexception1 = new OAException("AR", "ARI_INVALID_ROUTING_NUMBER");
    if(oaexception == null)
    oaexception = oaexception1;
    else
    oaexception.setNextException(oaexception1);
    } else
    if(i == 2)
    OAException oaexception2 = new OAException("AR", "ARI_CREATE_BANK_ACCOUNT");
    if(oaexception == null)
    oaexception = oaexception2;
    else
    oaexception.setNextException(oaexception2);
    // Added by VEERENDRA KODALLI to limit addition of New Bank Account with Minimum 3 Digits
    if(validateBankAccountNumber(newbankaccountvorowimpl.getStrippedBankAccountNumber()))
    // Define Exception with FND Message MMARI_INVALID_BA_NUMBER
    OAException oaexception4 = new OAException("AR", "MMARI_INVALID_BA_NUMBER");
    if(oaexception == null)
    oaexception = oaexception4;
    else
    oaexception.setNextException(oaexception4);
    // Method to Validate if Entered Account Number and Routing Number Combination already exist
    if(validateDuplicateBankAccountNumber(newbankaccountvorowimpl.getStrippedBankAccountNumber(), newbankaccountvorowimpl.getStrippedRoutingNumber(), newbankaccountvorowimpl.getAccountHolderName()))
    OAException oaexception3 = new OAException("AR", "ARI_DUPLICATE_BA_NUMBER");
    if(oaexception == null)
    oaexception = oaexception3;
    else
    oaexception.setNextException(oaexception3);
    if(oaexception != null)
    oaexception.setApplicationModule(oaapplicationmoduleimpl);
    throw oaexception;
    } else
    return;
    // Method to Validate Routing Number
    public int validateRoutingNumber(String s)
    boolean flag = PaymentUtilities.checkDigits(s);
    if(!flag)
    return 0;
    OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
    OADBTransaction oadbtransaction = (OADBTransaction)oaapplicationmoduleimpl.getDBTransaction();
    if(oadbtransaction.isLoggingEnabled(2))
    oadbtransaction.writeDiagnostics(this, "Start validateRoutingNumber", 2);
    String s1 = "BEGIN :1 := ARP_BANK_DIRECTORY.is_routing_number_valid(:2,:3); END;";
    OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransaction.createCallableStatement(s1, 1);
    int i = 0;
    try
    oraclecallablestatement.registerOutParameter(1, -5, 38, 38);
    oraclecallablestatement.setString(2, s);
    oraclecallablestatement.setString(3, "ABA");
    oraclecallablestatement.execute();
    i = oraclecallablestatement.getInt(1);
    catch(Exception exception1)
    exception1.printStackTrace();
    throw OAException.wrapperException(exception1);
    finally
    try
    oraclecallablestatement.close();
    catch(Exception exception2)
    throw OAException.wrapperException(exception2);
    // Debug Message
    if(oadbtransaction.isLoggingEnabled(2))
    oadbtransaction.writeDiagnostics(this, "End validateRoutingNumber", 2);
    return i;
    // Method to Validate Duplicate Account Number
    public boolean validateDuplicateBankAccountNumber(String s, String s1, String s2)
    OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
    OADBTransaction oadbtransaction = (OADBTransaction)oaapplicationmoduleimpl.getDBTransaction();
    if(oadbtransaction.isLoggingEnabled(2))
    // Debug Message
    oadbtransaction.writeDiagnostics(this, "Start validateDuplicateBankAccountNumber", 2);
    String s3 = "BEGIN :1 := AR_IREC_PAYMENTS.is_bank_account_duplicate(:2,:3,:4); END;";
    OracleCallableStatement oraclecallablestatement = (OracleCallableStatement)oadbtransaction.createCallableStatement(s3, 1);
    boolean flag = true;
    try
    oraclecallablestatement.registerOutParameter(1, -5, 38, 38);
    oraclecallablestatement.setString(2, s);
    oraclecallablestatement.setString(3, s1);
    oraclecallablestatement.setString(4, s2);
    oraclecallablestatement.execute();
    Number number = new Number(oraclecallablestatement.getLong(1));
    if(number.equals(new Number("0")))
    flag = false;
    else
    flag = true;
    catch(Exception exception1)
    exception1.printStackTrace();
    throw OAException.wrapperException(exception1);
    finally
    try
    oraclecallablestatement.close();
    catch(Exception exception2)
    throw OAException.wrapperException(exception2);
    // Debug Message
    if(oadbtransaction.isLoggingEnabled(2))
    oadbtransaction.writeDiagnostics(this, "End validateDuplicateBankAccountNumber", 2);
    return flag;
    public boolean validateBankAccountNumber(String s)
    OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl)getApplicationModule();
    OADBTransaction oadbtransaction = (OADBTransaction)oaapplicationmoduleimpl.getDBTransaction();
    // Debug Message
    if(oadbtransaction.isLoggingEnabled(2))
    oadbtransaction.writeDiagnostics(this, "Start validateBankAccountNumber", 2);
    boolean flag = true;
    try
    // Check if the Account Number Length is less than 3 Digits
    if(s.length() < 3)
    flag = true;
    // Debug Message
    if(oadbtransaction.isLoggingEnabled(2))
    oadbtransaction.writeDiagnostics(this, "Account Number Less than 3 Digits!", 2);
    else
    // Debug Message
    if(oadbtransaction.isLoggingEnabled(2))
    oadbtransaction.writeDiagnostics(this, "Account Number greater than 3 Digits!", 2);
    flag = false;
    //return PaymentUtilities.checkDigits(s);
    catch (Exception exception4)
    //if(oadbtransaction.isLoggingEnabled(2))
    //oadbtransaction.writeDiagnostics(this, "Entered Catch", 2);
    throw OAException.wrapperException(exception4);
    if(oadbtransaction.isLoggingEnabled(2))
    // Debug Message
    oadbtransaction.writeDiagnostics(this, "End validateBankAccountNumber", 2);
    return flag;
    public static final String RCS_ID = "$Header: NewBankAccountVOImpl.java 115.8 2008/07/21 13:49:37 nkanchan noship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: NewBankAccountVOImpl.java 115.8 2008/07/21 13:49:37 nkanchan noship $", "oracle.apps.ar.irec.accountDetails.pay.server");
    I did compile the Java File and also the JPX import. It was all successful. I tested the code and it worked as expected. Now I see an exception on the page when I click the Pay button stating "No Method Signature No Method Signature - initQuery".
    The error do not come when I take out my substitution. Any one know what might be the reason for above issue. I have no idea why all of a sudden it stopped working and checked all standard filles but none got changed.
    Any pointers towards to resolve the same would be appreciable.
    Thanks in Advance,
    Veerendra

    Uma,
    try to delete all class files, recompile and run! Also, check if any CO is not extended other than from OAControllerImpl, although it would not be generally.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Error while extending ProfileFormHandler

    Hi please help me out this problem...while extending profileformhandler i am getting nullpointerexception...
    16:21:16,396 ERROR [DynamoServlet]
    java.lang.NullPointerException
            at atg.userprofiling.ProfileFormHandler.getRepositoryId(ProfileFormHandler.java:111)
            at atg.userprofiling.ProfileForm.getProfileItem(ProfileForm.java:278)
            at atg.userprofiling.ProfileFormHashtable.getItem(ProfileForm.java:3921)
            at atg.userprofiling.ProfileFormHashtablePropertyMapper.getPropertyValue(ProfileForm.java:3956)
            at atg.droplet.DropletDescriptor.getPropertyValue(DropletDescriptor.java:457)
            at atg.droplet.DropletDescriptor.getPropertyStringValue(DropletDescriptor.java:245)
            at atg.droplet.DropletDescriptor.getPropertyHtmlStringValue(DropletDescriptor.java:166)
            at atg.taglib.dspjsp.ValueStringTag.calculateValueString(ValueStringTag.java:358)
            at atg.taglib.dspjsp.InputTagBase.doEndTag(InputTagBase.java:476)
            at org.apache.jsp.createProfile_jsp._jspx_meth_dsp_005finput_005f0(createProfile_jsp.java:523)
            at org.apache.jsp.createProfile_jsp._jspx_meth_dsp_005fform_005f0(createProfile_jsp.java:293)
            at org.apache.jsp.createProfile_jsp._jspx_meth_dsp_005fpage_005f0(createProfile_jsp.java:216)
            at org.apache.jsp.createProfile_jsp._jspService(createProfile_jsp.java:122)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at atg.servlet.pipeline.TailPipelineServlet.service(TailPipelineServlet.java:161)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.pipeline.DispatcherPipelineServletImpl.service(DispatcherPipelineServletImpl.java:253)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.http.CookieBufferServlet.service(CookieBufferServlet.java:97)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.userprofiling.ExpiredPasswordServlet.service(ExpiredPasswordServlet.java:356)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.pipeline.MimeTyperPipelineServlet.service(MimeTyperPipelineServlet.java:206)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.droplet.DropletEventServlet.service(DropletEventServlet.java:565)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.commerce.order.CommerceCommandServlet.service(CommerceCommandServlet.java:128)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.commerce.promotion.PromotionServlet.service(PromotionServlet.java:191)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.userprofiling.AccessControlServlet.service(AccessControlServlet.java:655)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.sessionsaver.SessionSaverServlet.service(SessionSaverServlet.java:2425)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.userprofiling.PageEventTriggerPipelineServlet.service(PageEventTriggerPipelineServlet.java:169)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.multisite.SiteSessionEventTriggerPipelineServlet.service(SiteSessionEventTriggerPipelineServlet.java:139)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.userprofiling.SessionEventTrigger.service(SessionEventTrigger.java:477)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.userprofiling.ProfilePropertyServlet.service(ProfilePropertyServlet.java:208)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.userprofiling.ProfileRequestServlet.service(ProfileRequestServlet.java:437)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.pipeline.DynamoPipelineServlet.service(DynamoPipelineServlet.java:469)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.pipeline.URLArgumentPipelineServlet.service(URLArgumentPipelineServlet.java:280)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.pipeline.PathAuthenticationPipelineServlet.service(PathAuthenticationPipelineServlet.java:370)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.userprofiling.sso.PassportServlet.service(PassportServlet.java:554)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.security.ThreadUserBinderServlet.service(ThreadUserBinderServlet.java:91)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.dtm.TransactionPipelineServlet.service(TransactionPipelineServlet.java:212)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.multisite.SiteContextPipelineServlet.service(SiteContextPipelineServlet.java:348)
            at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
            at atg.servlet.pipeline.HeadPipelineServlet.passRequest(HeadPipelineServlet.java:1174)
            at atg.servlet.pipeline.HeadPipelineServlet.service(HeadPipelineServlet.java:857)
            at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:250)
            at atg.filter.dspjsp.PageFilter.doFilter(PageFilter.java:263)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126
            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:662)

    Thank you David_DE.....I gone through entire Profile doc....and i set those property file as : -
    $class=atg.userprofiling.ProfileFormHandler
    $scope=request
    profile=Profile
    profileTools=/atg/userprofiling/ProfileTools
    but
    now getting this exception...
    java.lang.NullPointerException
    atg.userprofiling.ProfileFormHandler.assumeSecurityIdentity(ProfileFormHandler.java:1072)
    atg.userprofiling.ProfileFormHandler.postCreateUser(ProfileFormHandler.java:480)
    atg.userprofiling.ProfileForm.handleCreate(ProfileForm.java:1115)
    atg.userprofiling.ProfileFormHandler.handleCreate(ProfileFormHandler.java:380)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    atg.droplet.EventSender.sendEvent(EventSender.java:582)
    atg.droplet.FormTag.doSendEvents(FormTag.java:800)
    atg.droplet.FormTag.sendEvents(FormTag.java:649)
    atg.droplet.DropletEventServlet.sendEvents(DropletEventServlet.java:523)
    atg.droplet.DropletEventServlet.service(DropletEventServlet.java:550)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.commerce.order.CommerceCommandServlet.service(CommerceCommandServlet.java:128)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.commerce.promotion.PromotionServlet.service(PromotionServlet.java:191)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.userprofiling.AccessControlServlet.service(AccessControlServlet.java:655)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.servlet.sessionsaver.SessionSaverServlet.service(SessionSaverServlet.java:2425)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.userprofiling.PageEventTriggerPipelineServlet.service(PageEventTriggerPipelineServlet.java:169)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.multisite.SiteSessionEventTriggerPipelineServlet.service(SiteSessionEventTriggerPipelineServlet.java:139)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.userprofiling.SessionEventTrigger.service(SessionEventTrigger.java:477)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.userprofiling.ProfilePropertyServlet.service(ProfilePropertyServlet.java:208)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.userprofiling.ProfileRequestServlet.service(ProfileRequestServlet.java:437)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.servlet.pipeline.DynamoPipelineServlet.service(DynamoPipelineServlet.java:469)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.servlet.pipeline.URLArgumentPipelineServlet.service(URLArgumentPipelineServlet.java:280)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.servlet.pipeline.PathAuthenticationPipelineServlet.service(PathAuthenticationPipelineServlet.java:370)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.userprofiling.sso.PassportServlet.service(PassportServlet.java:554)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.servlet.security.ThreadUserBinderServlet.service(ThreadUserBinderServlet.java:91)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.dtm.TransactionPipelineServlet.service(TransactionPipelineServlet.java:212)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.multisite.SiteContextPipelineServlet.service(SiteContextPipelineServlet.java:348)
    atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    atg.servlet.pipeline.HeadPipelineServlet.passRequest(HeadPipelineServlet.java:1174)
    atg.servlet.pipeline.HeadPipelineServlet.service(HeadPipelineServlet.java:857)
    atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:250)
    atg.filter.dspjsp.PageFilter.doFilter(PageFilter.java:263)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

  • Method signatures

    Hello again world.
    When the JVM compares method signatures, is there a difference between comparing overloaded methods and overridden methods?
    Thank you one and all.
    Ciao for now.

    No, overloaded and overridden mean the same thing.
    This terminology often confuses people.
    :)Overloading and overriding is totally different and by no means same thing.
    Overloaded methods supplement each other for example myMethod(int i) or myMethod(String s) .
    Orerridden method replaces the method it overrides. For example Class A extends Class B. If Class A contains the same method as class B it is called overridden method.
    Same as in above example, Overloading methods may have different argument lists of different types. i.e. int i as parameter or String s as parameter. While overridden method must be of same signature for example myMethod(int i) exist in Class B and Class A extends it then its overridden only if it has myMethod(int i) and not myMethod(String s).
    Hope this clears the doubt...

  • Which method signature is the best?

    Among the following method signatures in Java, which one can provide the best performance while the method is called? Why?
    (1) public void my_method( String a, int b, int c )
    (2) public void my_method( int b, String a, int c )
    (3) public void my_method( int b, int c, String a )

    1) All primitive types (except long and double) are pushed onto the stack as 32-bit entities and are 32-bit aligned. The reference types are pushed as a reference and occupy 32-bit also.
    2) If the method have had tens or hundreds of parameters, the opcodes for accessing some parameters will have short offsets and other parameters will have long offsets. When you have only 3 or 4 parameters there is no difference between the offsets needed to access each parameter. The difference of time used for the interpreter or JIT compiler for dealing with short or long offsets usually is negligible.
    3) So the better way to speed up your program is to forget micro-optimization and concentrate in better algorithms and caching data if possible.

  • Electronic signature while approving documents

    Dear experts,
    I have a client who is validating its SAP B1 implemented system in compliance with FDA 21 CFR part 11 (electronic records and electronic signatures).
    Can any one please describe how SAP business one treats electronic signature while approving documents? because in FDA 21 CFR part 11, it requires electronic signature on approval of certain documents which must contain 'the name of the signer, 'time and date stamp' and the 'meaning (such as approve, review, verify) associated with the signature' plus the traceable record of electronic signatures.
    Furthermore, it also require a 'password' or user id of the signer'  at the time of signing the document. In B1, it does not ask for user id / password at the time of approval and simply rely on login id / password. If user is already logged in, B1 simply allow the approver to approve a document and does not prompt for user id / password again.
    Can we fulfill the signing requirement in SAP Business one? and modify or customize B1 in such a way that it starts prompting for user id / password at the time of approving the document too?
    Any help is highly appreciated>
    Thanks in advance,
    Farhan

    Closing it

  • Deciding when to use "final" in method signatures

    Please consider this source code:
    public void foo(final Set<String> set) { ... }People who use this class don't need to know that the "set" reference is "final", right?
    Edited by: dpxqb on Apr 30, 2010 3:28 AM

    Kayaman wrote:
    They should be implicitly final so there would be no need for questions like this.I don't understand what that means.
    Or does someone here admit to having a habit of reassigning the parameters?I don't understand. I do it when it needs doing. Here is an example where I re-assigned the reference in the method signature:
    void foo(Writer w) {
      int i = 0;
      boolean hit = false;
      BufferedWriter bw = new BufferedWriter(w);
      Set<String> set = new HashSet<String>();
      bw.write(c);
      w.write(c); // no exception thrown. the object on the other end of the Writer will act weird
                  // which further masks the bug.
    }There are two working Writers going to the same location. There is no reason for this, it makes no sense, and it is a bug waiting to happen.
    This is how I got my BufferedWriter. Reassign the initial reference:
    void foo(Writer w) {
      if(! (w instanceof BufferedWriter)) {
        w = new BufferedWriter(w);
    }The only way to write is via a single object. It just prevents me from doing something stupid. I feel safer by eliminating unused references.

  • Question about changing method signature

    Hello. I've inherited some code which contains a method with the following signature:
    foo(int x, MyObject myObject)
    Okay, so that's not really the exact signature :) In any case, I need to modify the signature to:
    foo(int x, Object myObject)
    I believe that I can do this without affecting any existing client code because Obect is a superclass of MyObject. Is that right or must I deprecate the first version and add the second separately? Whatever, happens I can't break code which was compiled against the old version. Thanks in advance.
    -jason

    That's a good point. It's probably not an issue
    however as we don't provide (supported) access to our
    implementation classes. Thanks for the input.
    -JasonThen I don't see another issue with it, as long as no other internally-written class has already overridden it and doesn't get changed at the same time. In a sense you're saying it's a "private" (not necessarily in the same sense of the private keyword) method, so you can change the implementation, including method signatures, at your whim.

  • How to search OER for method signatures

    I would like to search OER for Service assets that have a specific input and/or output. I'm sure this is easy to do but am missing something.
    I was reading the description in the Sample Interface - Account Detail Interface shipped with OER and it says....
    "Users may search for particular method signatures, find this asset, and from here discover the services that implement this interface."
    That's what I want to do but am not sure how to do it. Can anyone explain how I would go about doing that?

    Try a simple search, put the method name in the search box, select the type as All Type. The search will list down the Interface and the Service that contains the api.

  • Dynamic method signatures

    This does not compile:
    public class Main {
      public static void main(String[] args) {
        Object sok = Socket.class.newInstance();
        foo(sok); // syntax error only as help to prevent runtime errors?
        Object x = ArrayList.class.newInstance();
        foo(x);  // syntax error because method linkage must happen and i don't know the class of "x" yet.
      public static void foo(Socket s) { println("i am a socket");  }
      public static void foo(List l) { println("i am a list"); }
    }Is the compiler complaining only to prevent a possible runtime (typecast) error? Or, is there actually some real problem (perhaps method linkage)?
    I read that methods live in their own special place in memory (and each has an address)? And is that address inserted into the bytecode when the Java source is compiled? So, while in the runtime every object knows its type, and this would enable selection of the correct method, you can't wait because of the need for compile-time method linking? Or, while waiting is technically possible, you can't because the developers of Java wanted to help developers to minimize run-time errors.
    If this question makes no sense, please help clear-up my misunderstanding about method linkage. thanks.

    dpxqb wrote:
    It only cares about the reference type of the expression you pass to foo(expression), which is Object for both cases.awesome. So, I hope this means that the "type" of the concrete object is not relevant for method signature. Rather, it is the "type" of the reference .Correct. I believe it's common to say class when talking about the concrete runtime object, and "type" when talking about the compile-time reference.
    And "reference typing" (aka "casting") happens at compile-time while "object typing" happens in the run-time.Yes and no. Your terminology is non-standard, so I'm not sure exactly what you mean, but approximately, yes, references types matter at compile time and object classes matter at runtime (for polymorphism in overridden methods, for example).
    Casting is both a compile-time and a runtime operation, however. At compile time, the reference type has to be one that could possibly be cast to whatever the target type is, and at runtime, the actual object has to be of an appropriate class for the cast to succeed.
    String s1 = (String)new Date(); // compile time error can't cast "across" the hierarchy
    String s2 = (String)new Object(); // compiles fine, but ClassCastException at runtime
    Object o1 = "abc";
    String s3 = (String)o1; // success

  • Generic method signature help

    Hello All,
    I'm confused about the following generic method signature . Compilation fails
    public class Animal{}
    public class Dog extends Animal{}
    public <E super Dog> List<E> methodABC(List<E> list){
    The compiler gives the following error
    E cannot be resolved to a type
    E cannot be resolved to a type
    Syntax error on token "super", , expected
    if i change the declaration of E to <E extends Dog>, no compiler error.
    An early response will be highly appreciated. Thanks in advance.
    Kind Regards.
    Hasnain Javed Khan.

    you cannot use "super" on a type variable, only on wildcards

  • [b]Two Interfaces with same method signature[/b]

    Hi,
    I am having 2 interfaces which does have same method signature and
    return type. In such case a class that implements these intefaces and overide
    the method . In such case which method will execute . The method of class A or
    class B otherwise one will be ignored by the JVM and other will be executed or
    not???
    For eg,
    interface A
    public void getData();
    interface B
    public void getData();
    class InterfaceTest implements A,B
    public void getData()
    System.out.println("Inside the getData()");
    public static void main(String args[])
    InterfaceTest interTest=new InterfaceTest();
    interTest.getData(); // Which method will execute Class A or B.
    Please do provide an answer for this. I will be waiting for ur reply...
    Thanks,
    M.Ananthu

    there is but one implementation, so why bother ?
    what's more, you're talking about "class A" and "class B" when you defined A and B as interfaces
    seems blurry in your mind...

  • Detecting webservice methods signatures

    Hi,
    I'm searching for an elegant solution for the following problem:
    My application is a webservice client that will consume a webservice with some methods.
    let's suppose service interface has methods :
    public void methodA(String A, String B, String C);
    public void methodB(String D, String B, String E);my application will parse a String stream and figure out what method to call .if for example the string pattern is : methodA:A,valueA:B,valueB:C,valueC;then i'll need to call method :public void methodA(String A, String B, String C);I need to know what is an elegant and clean why to implement this feature. Note that i don't know the webservice methods signatures in advance!
    I guess i'll have to use java Reflection. I'm not sure what is a good solution for this problem .
    thanks for your help.
    NB: I posted this same topic at [coderanche.com|http://www.coderanch.com/t/441073/Web-Services/java/detecting-webservice-methods-signatures] but couldn't get responses.

    slowfly wrote:
    That is imo a very bad idea. That's no java problem, it's a communication problem. If the service providers can't provide you the interface or the wsdl, you can't code towards it. They also should provide you a test-environment, where you can test your client implementations. Everything else is just... not right...
    I'm just curious: Where comes the string stream from? And why don't you know the endpoint interface? There must be another approach.
    regards
    slowflythe webservice client i'm coding is part of a complex system with many components communicating through JMS and using Spring Managed beans.
    my plug-in will receive a command from an external provisioning system. i'll have to parse this command string then figure out what webservice method i'll need to call on remote webservice.
    i know this is weired. but my boss is not helpful. he can't yet get the WSDL from the customer and I have now to manage testing with dummy webservice methods without actually talking to real webservice.
    I want to know what is a good solution to Map the above String command Pattern into a java method . it seems like to be a Mapping from String Pattern to java method with arguments. the only problem is that i can't know the names of method parameters.and the command string pattern might contains method args in un-ordered state. so after collecting the method args (from command) i will need to figure out which one fits in the args list of webservice method.
    probably using method parameters annotations? does this means the WSDL should also contain the parameter annotaions?
    anyway i hope someone here can suggest me some good solution.
    thanks

Maybe you are looking for