This discussion is archived
1 2 Previous Next 19 Replies Latest reply: May 23, 2012 3:17 PM by EJP RSS

try in a method

adf009 Explorer
Currently Being Moderated
hi how can i catch a null in the method using try,my method is public void PerformSdmsLogon(String userid, String pwd) {
userid = this.getUsrId();
pwd = this.getL_pwd();
try{
callPerformSdmsLogon("SMS_FORM_TO_ADf.perform_sdms_logon(?,?)", new Object[] { userid, pwd, });
} catch (SQLException e) {
throw new JboException(e);
}
}
  • 1. Re: try in a method
    BIJ001 Explorer
    Currently Being Moderated
    can i catch a null
    You can not catch a "null", you can only catch an Exception.
    What is exactly the problem?
  • 2. Re: try in a method
    BIJ001 Explorer
    Currently Being Moderated
    Do you mean something like this (exception with "null" message)?

    null
    java.lang.NullPointerException
    public class a
    {
      public static void main( String a[] )
      {
        Object      o = null;
    
        try
        {
          System.out.println( o.toString() );
        }
        catch ( Throwable t )
        {
          System.out.println( t.getMessage() );
          System.out.println( t );
        }
      }
    
    }
  • 3. Re: try in a method
    gimbal2 Guru
    Currently Being Moderated
    BIJ001 wrote:
    Do you mean something like this (exception with "null" message)?

    null
    java.lang.NullPointerException
    public class a
    {
    public static void main( String a[] )
    {
    Object      o = null;
    
    try
    {
    System.out.println( o.toString() );
    }
    catch ( Throwable t )
    {
    System.out.println( t.getMessage() );
    System.out.println( t );
    }
    }
    
    }
    If you're going to post example code, at least encourage to print out the stacktrace.
         }
         catch ( Throwable t ) {
           t.printStackTrace();
         }
    Too many times people prematurely post questions because they refuse to embrace the most wonderful tool that Java gives you and just throw the information into oblivion. Perhaps the println of the throwable already does it, but it is far from clear from the code that this is the intent.
  • 4. Re: try in a method
    BIJ001 Explorer
    Currently Being Moderated
    I wanted to reproduce a possibly disturbing "null" output, but I should have included printStackTrace in the example, indeed.
  • 5. Re: try in a method
    adf009 Explorer
    Currently Being Moderated
    hi see my stacktrace
    Default
    <PropertyManager> <loadProperty> [133] BC4J Property jbo.load.components.lazily='false' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [134] BC4J Property MetaObjectContext='oracle.jbo.mom.xml.XMLContextImpl' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [135] BC4J Property java.naming.factory.initial='oracle.jbo.common.JboInitialContextFactory' -->(SessionImpl) from Client Environment
    <PropertyManager> <loadProperty> [136] BC4J Property IsLazyLoadingTrue='true' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    <PropertyManager> <loadProperty> [137] BC4J Property oracle.jbo.usemds='true' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [138] BC4J Property oracle.adfm.usemds='true' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [139] BC4J Property ActivateSharedDataHandle='false' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [140] Skipping empty Property HandleName from System Default
    <PropertyManager> <loadProperty> [141] Skipping empty Property Factory-Substitution-List from System Default
    <PropertyManager> <loadProperty> [142] WARNING: Property jbo.projectset to null
    <PropertyManager> <loadProperty> [143] Skipping empty Property jbo.project from null
    <PropertyManager> <loadProperty> [144] BC4J Property jbo.max.cursors='50' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [145] BC4J Property jbo.dofailover='false' -->(Configuration) from Client Environment
    <PropertyManager> <loadProperty> [146] WARNING: Property jbo.envinfoproviderset to null
    <PropertyManager> <loadProperty> [147] Skipping empty Property jbo.envinfoprovider from null
    <PropertyManager> <loadProperty> [148] Skipping empty Property jbo.rowid_am_conn_name from System Default
    <PropertyManager> <loadProperty> [149] Skipping empty Property jbo.rowid_am_datasource_name from System Default
    <PropertyManager> <loadProperty> [150] WARNING: Property jbo.ampool.writecookietoclientset to null
    <PropertyManager> <loadProperty> [151] Skipping empty Property jbo.ampool.writecookietoclient from null
    <PropertyManager> <loadProperty> [152] WARNING: Property jbo.doconnectionpoolingset to null
    <PropertyManager> <loadProperty> [153] Skipping empty Property jbo.doconnectionpooling from null
    <PropertyManager> <loadProperty> [154] WARNING: Property jbo.recyclethresholdset to null
    <PropertyManager> <loadProperty> [155] Skipping empty Property jbo.recyclethreshold from null
    <PropertyManager> <loadProperty> [156] WARNING: Property jbo.ampool.dynamicjdbccredentialsset to null
    <PropertyManager> <loadProperty> [157] Skipping empty Property jbo.ampool.dynamicjdbccredentials from null
    <PropertyManager> <loadProperty> [158] BC4J Property jbo.ampool.resetnontransactionalstate='true' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [159] BC4J Property jbo.ampool.sessioncookiefactoryclass='oracle.jbo.common.ampool.DefaultSessionCookieFactory' -->(Configuration) from Client Environment
    <PropertyManager> <loadProperty> [160] WARNING: Property jbo.ampool.connectionstrategyclassset to null
    <PropertyManager> <loadProperty> [161] Skipping empty Property jbo.ampool.connectionstrategyclass from null
    <PropertyManager> <loadProperty> [162] BC4J Property jbo.ampool.maxpoolsize='-1' -->(Configuration) from Client Environment
    <PropertyManager> <loadProperty> [163] BC4J Property jbo.ampool.initpoolsize='0' -->(Configuration) from Client Environment
    <PropertyManager> <loadProperty> [164] WARNING: Property jbo.ampool.monitorsleepintervalset to null
    <PropertyManager> <loadProperty> [165] Skipping empty Property jbo.ampool.monitorsleepinterval from null
    <PropertyManager> <loadProperty> [166] WARNING: Property jbo.ampool.minavailablesizeset to null
    <PropertyManager> <loadProperty> [167] Skipping empty Property jbo.ampool.minavailablesize from null
    <PropertyManager> <loadProperty> [168] WARNING: Property jbo.ampool.maxavailablesizeset to null
    <PropertyManager> <loadProperty> [169] Skipping empty Property jbo.ampool.maxavailablesize from null
    <PropertyManager> <loadProperty> [170] WARNING: Property jbo.ampool.maxinactiveageset to null
    <PropertyManager> <loadProperty> [171] Skipping empty Property jbo.ampool.maxinactiveage from null
    <PropertyManager> <loadProperty> [172] WARNING: Property jbo.ampool.timetoliveset to null
    <PropertyManager> <loadProperty> [173] Skipping empty Property jbo.ampool.timetolive from null
    <PropertyManager> <loadProperty> [174] WARNING: Property jbo.ampool.doampoolingset to null
    <PropertyManager> <loadProperty> [175] Skipping empty Property jbo.ampool.doampooling from null
    <PropertyManager> <loadProperty> [176] BC4J Property jbo.ampool.issupportspassivation='false' -->(Configuration) from Client Environment
    <PropertyManager> <loadProperty> [177] BC4J Property jbo.ampool.isuseexclusive='true' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [178] BC4J Property jbo.passivationstore='null' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [179] BC4J Property jbo.saveforlater='false' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [180] BC4J Property jbo.snapshotstore.undo='persistent' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [181] BC4J Property jbo.maxpassivationstacksize='10' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [182] BC4J Property jbo.txn.handleafterpostexc='false' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [183] BC4J Property jbo.connectfailover='true' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [184] BC4J Property jbo.datasource_naming_factory='oracle.jbo.server.DataSourceContextFactory' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [185] WARNING: Property jbo.maxpoolcookieageset to null
    <PropertyManager> <loadProperty> [186] Skipping empty Property jbo.maxpoolcookieage from null
    <PropertyManager> <loadProperty> [187] WARNING: Property PoolClassNameset to null
    <PropertyManager> <loadProperty> [188] Skipping empty Property PoolClassName from null
    <PropertyManager> <loadProperty> [189] BC4J Property jbo.maxpoolsize='4096' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [190] BC4J Property jbo.initpoolsize='0' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [191] BC4J Property jbo.poolrequesttimeout='30000' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [192] BC4J Property jbo.poolmonitorsleepinterval='600000' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [193] BC4J Property jbo.poolminavailablesize='5' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [194] BC4J Property jbo.poolmaxavailablesize='25' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [195] BC4J Property jbo.poolmaxinactiveage='600000' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [196] BC4J Property jbo.pooltimetolive='-1' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [197] BC4J Property jbo.qcpool.monitorsleepinterval='1800000' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [198] BC4J Property jbo.qcpool.maxinactiveage='900000' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [199] BC4J Property jbo.qcpool.maxweight='-1' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [200] BC4J Property RELEASE_MODE='Stateful' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [201] BC4J Property jbo.assoc.consistent='true' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [202] BC4J Property jbo.viewlink.consistent='DEFAULT' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [203] BC4J Property jbo.finder.range.size='DEFAULT' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [204] BC4J Property jbo.passivation.TrackInsert='true' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [205] Skipping empty Property jbo.ViewCriteriaAdapter from System Default
    <PropertyManager> <loadProperty> [206] BC4J Property jbo.SQLBuilder='Oracle' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    <PropertyManager> <loadProperty> [207] BC4J Property jbo.ConnectionPoolManager='oracle.jbo.server.ConnectionPoolManagerImpl' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [208] BC4J Property jbo.TypeMapEntries='Oracle' -->(MetaObjectManager) from /oracle/jbo/server/jboserver.properties resource
    <PropertyManager> <loadProperty> [209] Skipping empty Property jbo.sql92.JdbcDriverClass from System Default
    <PropertyManager> <loadProperty> [210] BC4J Property jbo.sql92.LockTrailer='FOR UPDATE' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [211] BC4J Property jbo.jdbc.trace='false' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [212] BC4J Property jbo.abstract.base.check='true' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [213] BC4J Property jbo.assoc.where.early.set='false' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [214] BC4J Property jbo.use.findbykey.for.assoc='true' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [215] BC4J Property jbo.sql92.DbTimeQuery='select sysdate from dual' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [216] BC4J Property oracle.jbo.defineColumnLength='skipDefines' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [217] BC4J Property jbo.jdbc_bytes_conversion='jdbc' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [218] Skipping empty Property jbo.tmpdir from System Default
    <PropertyManager> <loadProperty> [219] Skipping empty Property jbo.server.internal_connection from System Default
    <PropertyManager> <loadProperty> [220] BC4J Property SessionClass='oracle.jbo.server.SessionImpl' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [221] Skipping empty Property TransactionFactory from System Default
    <PropertyManager> <loadProperty> [222] Skipping empty Property jbo.def.mgr.listener from System Default
    <PropertyManager> <loadProperty> [223] Skipping empty Property jbo.use.global.sub.map from System Default
    <PropertyManager> <loadProperty> [224] BC4J Property jbo.debugoutput='adflogger' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    <PropertyManager> <loadProperty> [225] BC4J Property jbo.debug.prefix='DBG: ' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    <PropertyManager> <loadProperty> [226] BC4J Property jbo.logging.show.timing='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    <PropertyManager> <loadProperty> [227] BC4J Property jbo.logging.show.function='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    <PropertyManager> <loadProperty> [228] BC4J Property jbo.logging.show.level='false' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    <PropertyManager> <loadProperty> [229] BC4J Property jbo.logging.show.linecount='true' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    <PropertyManager> <loadProperty> [230] BC4J Property jbo.logging.trace.threshold='6' -->(Diagnostic) from /oracle/jbo/common/Diagnostic.properties resource
    <PropertyManager> <loadProperty> [231] BC4J Property jbo.jdbc.driver.verbose='false' -->(Diagnostic) from System Default
    <PropertyManager> <loadProperty> [232] Skipping empty Property oracle.home from System Default
    <PropertyManager> <loadProperty> [233] Skipping empty Property oc4j.name from System Default
    <PropertyManager> <loadProperty> [234] Skipping empty Property jbo.shared.txn from System Default
    <PropertyManager> <loadProperty> [235] BC4J Property oracle.adfm.useSharedTransactionForFrame='true' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [236] BC4J Property oracle.adfm.joinNewFrameTransaction='false' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [237] BC4J Property jbo.ejb.txntimeout='1830' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [238] BC4J Property jbo.ejb.txntype='global' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [239] BC4J Property jbo.ejb.txn.disconnect_on_completion='false' -->(SessionImpl) from System Default
    <PropertyManager> <loadProperty> [240] Skipping empty Property jbo.ejb.useampool from System Default
    <PropertyManager> <loadProperty> [241] Skipping empty Property oracle.jbo.schema from System Default
    <PropertyManager> <loadProperty> [242] BC4J Property jbo.xml.validation='false' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [243] BC4J Property ord.RetrievePath='ordDeliverMedia' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [244] BC4J Property ord.HttpMaxMemory='102400' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [245] Skipping empty Property ord.HttpTempDir from System Default
    <PropertyManager> <loadProperty> [246] BC4J Property ord.wmp.classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [247] BC4J Property ord.qp.classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [248] BC4J Property ord.rp.classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [249] BC4J Property ord.wmp.codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [250] BC4J Property ord.qp.codebase='http://www.apple.com/qtactivex/qtplugin.cab' -->(MetaObjectManager) from System Default
    <PropertyManager> <loadProperty> [251] Skipping empty Property ord.rp.codebase from System Default
    <PropertyManager> <loadPrope

    my whole class is

    import java.sql.PreparedStatement;
    import java.sql.SQLException;

    import oracle.jbo.JboException;
    import oracle.jbo.server.ApplicationModuleImpl;
    import oracle.jbo.server.ViewRowSetImpl;

    import sms0000.common.sms0000Module;
    // ---------------------------------------------------------------------
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Fri Apr 27 16:51:47 CAT 2012
    // --- Custom code may be added to this class.
    // --- Warning: Do not modify method signatures of generated methods.
    // ---------------------------------------------------------------------
    public class sms0000ModuleImpl extends ApplicationModuleImpl implements sms0000Module {
    /**
    * This is the default constructor (do not remove).
    */
    private String l_usrid;
    private String l_pwd;
    public sms0000ModuleImpl() {
    }
    public String getUsrId() {
    return l_usrid;
    }

    public void setl_usrid(String usrid) {
    this.l_usrid = usrid;
    }


    /**
    * Gets the attribute value for the calculated attribute L_pwd.
    * @return the L_pwd
    */

    public void setL_pwd(String lPwd) {
    this.l_pwd = lPwd;
    }

    public String getL_pwd() {
    return l_pwd;
    }


    /**
    * getQueryHitCount - overridden for custom java data source support.
    */


    protected void callPerformSdmsLogon(String stmt, Object[] bindVars) {
    PreparedStatement st;
    st = null;
    try {
    // 1. Create a JDBC PreparedStatement for
    st = getDBTransaction().createPreparedStatement("begin " + stmt + ";end;", 0);

    if (bindVars != null) {
    // 2. Loop over values for the bind variables passed in, if any
    for (int z = 0; z < bindVars.length; z++) {
    // 3. Set the value of each bind variable in the statement
    st.setObject(z + 1, bindVars[z]);
    }
    }
    // 4. Execute the statement
    st.executeUpdate();
    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {
    // 5. Close the statement
    st.close();
    } catch (SQLException e) {
    }
    }
    }
    }
    public void PerformSdmsLogon(String userid, String pwd) {

    userid = this.getUsrId();
    pwd = this.getL_pwd();
    //pwd = this.getPwd().getValue().toString();
    callPerformSdmsLogon("SMS_FORM_TO_ADf.perform_sdms_logon(?,?)", new Object[] { userid, pwd, });
    }



    }

    am geting Re: java.lang.NullPointerException when i call my method PerformSdmsLogon(
  • 6. Re: try in a method
    aksarben Journeyer
    Currently Being Moderated
    Unfortunately, this is not a stack trace, just a bunch of log entries. If this is the entire log, then your code is evidently not bothering to log the exception. In short, there's little or no information here that would help you debug the problem.

    Tip: In your highest level method, put a catch(Exception) block to intercept any exceptions you missed farther down in the bowels of the program.
  • 7. Re: try in a method
    796440 Guru
    Currently Being Moderated
    Tshifhiwa wrote:
    am geting Re: java.lang.NullPointerException when i call my method PerformSdmsLogon(
    Unless you're going out of your way to hide it, such as
    catch (Exception e) {
      // let's NOT call e.printStackTrace() here, because we want it to be DIFFICULT to debug our code
    }
    then there will be a lot more information than that. For example, it will tell you exactly which line is causing the problem.
  • 8. Re: try in a method
    796440 Guru
    Currently Being Moderated
    aksarben wrote:
    Unfortunately, this is not a stack trace, just a bunch of log entries. If this is the entire log, then your code is evidently not bothering to log the exception. In short, there's little or no information here that would help you debug the problem.

    Tip: In your highest level method, put a catch(Exception) block to intercept any exceptions you missed farther down in the bowels of the program.
    But only if you call the Exception's printStackTrace() method inside the catch block.
  • 9. Re: try in a method
    adf009 Explorer
    Currently Being Moderated
    ok my stack trace is
    or can i send you my project and check where the problem
    ADF: Adding the following JSF error message: java.lang.NullPointerException
    java.lang.NullPointerException
         at sms0000.client.LogOnClient.PerformSdmsLogon(LogOnClient.java:77)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
         at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
         at oracle.adf.model.bean.DCBeanDataControl.invokeMethod(DCBeanDataControl.java:453)
         at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
         at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:507)
         at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:307)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:185)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1545)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:965)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:346)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:204)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
  • 10. Re: try in a method
    796440 Guru
    Currently Being Moderated
    Tshifhiwa wrote:
    ok my stack trace is
    or can i send you my project and check where the problem
    ADF: Adding the following JSF error message: java.lang.NullPointerException
    java.lang.NullPointerException
         at sms0000.client.LogOnClient.PerformSdmsLogon(LogOnClient.java:77)
    All you need to know is right there. What's line 77 of LogOnClient.java?
  • 11. Re: try in a method
    adf009 Explorer
    Currently Being Moderated
    i have this method in line 77 i try to fix it by puting a try but no luck
    public void PerformSdmsLogon(String userid, String pwd) {
    try{
    Object _ret =
    getApplicationModuleProxy().riInvokeExportedMethod(this,"PerformSdmsLogon",new String [] {"java.lang.String","java.lang.String"},new Object[] {userid, pwd});

    }
    catch ( Throwable t ) {
    t.printStackTrace();
    }
    /*return (String)_ret;*/
    }
  • 12. Re: try in a method
    796440 Guru
    Currently Being Moderated
    Tshifhiwa wrote:
    i have this method in line 77 i try to fix it by puting a try
    No.

    First of all, just adding catching an exception doesn't magically fix the problem that caused the exception. It just gives you a chance to transfer control to code that only gets invoked when there's an error, so you can try to recover from that error. If you're not actually going to fix the problem that caused the exception, don't catch it in the first place.

    Second, you shouldn't be catching NullPointerException anyway. That is an unchecked exception, meaning it indicates either a bug in your code, or a serious problem in the JVM. Neither one of those conditions is something you should be trying to handle in a catch block.

    Since NullPointerException indicates a bug in your code, the proper way to deal with it is to fix your bug, so that the NPE doesn't happen in the first place.
    Object _ret =
    getApplicationModuleProxy().riInvokeExportedMethod(this,"PerformSdmsLogon",new String [] {"java.lang.String","java.lang.String"},new Object[] {userid, pwd});
    If that line is giving NPE, then getApplicationModuleProxy() is returning null.
  • 13. Re: try in a method
    adf009 Explorer
    Currently Being Moderated
    ok so wht must getApplicationModuleProxy() return am new in java i just what to call my procedure from database
  • 14. Re: try in a method
    796440 Guru
    Currently Being Moderated
    Tshifhiwa wrote:
    ok so wht must getApplicationModuleProxy() return
    I don't know anything about that method. You either wrote it, in which case you must know what it does and how it works, or it's in the core API or some third party lib, in which case you need to study its documentation so you can learn what it returns and when it might return null.

    If you're going to use the result of that call, it must return non-null.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points