OC4J 1.0.2.2.1 Creating 2 JNDI Contexts

Hello,
I have a problem when creating two JNDI contexts.
I've got a very simple class that creates 2 contexts serially with 2 separate property objects.
But the 2nd context seems to be being created with the first properties object. And yes I am closing the first.
Here is it
public class TestLookup
private static void lookup(String name, String password)
InitialContext ctx = null;
try
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
p.setProperty(Context.PROVIDER_URL, "ormi://localhost:23791");
p.setProperty(Context.SECURITY_PRINCIPAL, name);
p.setProperty(Context.SECURITY_CREDENTIALS, password);
ctx = new InitialContext(p);
ctx.lookup("Security");
System.out.println("finish");
catch (Exception e)
try
if (ctx != null)
ctx.close();
System.out.println("ctx closed");
catch (Exception e2)
e2.printStackTrace();
e.printStackTrace();
public static void main(String[] args)
lookup("123", "admin");
lookup("admin", "admin");
Here is the output
ctx closed
java.lang.SecurityException: Invalid username/password for default (123)
etc....
ctx closed
java.lang.SecurityException: Invalid username/password for default (123)
etc....
Any ideas anyone

This may be problem with your userid/password. Please look the $OC4J_HOME/j2ee/home/config/principals.xml whether you have a right userid password.
I did a quick test at looking up at "jdbc/OracleDS" for two users admin and SCOTT and this works fine both in 1.0.2.2.x an 9.0.2
I got your errors when I had wrong passwords for these users
regards
Debu

Similar Messages

  • Issues while trying to create JNDI Context in Glassfish

    I believe I have searched this all across google but I didn't find a satisfactory answer so posting here to ask the question.
    * Create a JNDI API InitialContext object if none exists
    * yet.
    try {
    jndiContext = new InitialContext();
    } catch (NamingException e) {
    System.out.println("Could1 not create JNDI API " +
    "context: " + e.toString());
    e.printStackTrace();
    System.exit(1);
    } catch (Exception e) {
    System.out.println("Exception. Could not create JNDI API " +
    "context: " + e.toString());
    e.printStackTrace();
    System.exit(1);
    System.out.println("JNDI Created");
    Above is the code that is throwing exceptions
    Could1 not create JNDI API context: javax.naming.NoInitialContextException: Cann
    ot instantiate class: com.sun.enterprise.naming.impl.SerialInitContextFactory [R
    oot exception is java.lang.NullPointerException]
    javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterp
    rise.naming.impl.SerialInitContextFactory [Root exception is java.lang.NullPointerException]
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at examples.simple.SimpleQueueSender.main(SimpleQueueSender.java:93)
    Caused by: java.lang.NullPointerException
         at com.sun.enterprise.module.single.ManifestProxy.<init>(ManifestProxy.java:75)
         at com.sun.enterprise.module.single.ProxyModuleDefinition.<init>(ProxyModuleDef
    inition.java:78)
         at com.sun.enterprise.module.single.ProxyModuleDefinition.<init>(ProxyModuleDef
    inition.java:73)
         at com.sun.enterprise.module.single.SingleModulesRegistry.<init>(SingleModulesR
    egistry.java:79)
         at com.sun.enterprise.module.single.SingleModulesRegistry.<init>(SingleModulesR
    egistry.java:67)
         at com.sun.enterprise.module.single.StaticModulesRegistry.<init>(StaticModulesR
    egistry.java:66)
         at org.glassfish.internal.api.Globals.getStaticHabitat(Globals.java:84)
         at com.sun.enterprise.naming.impl.SerialInitContextFactory.<init>(SerialInitCon
    textFactory.java:236)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         ... 5 more
    Earlier while researching a previous issue, ManifestProxy was earlier not able to find "findResouces" method so with older versions of jar it was giving a different issue. I checked the latest version, not sure how the change in code could have resolved the issue. Seems earlier the error was NoMethodFoundException and now that has been caught and now it is throwing NullPointerException.
    Did any of you face this issue and can help? I have all the classes from GLASSFISH_HOME/lib and GLASSFISH_HOME/module in my classpath.

    If you are running that code outside the container then you need to provide properties for the context factory with
      Properties props = new Properties();
      props.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
      props.setProperty("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
      props.setProperty("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
      // optional   
    props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
    props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
    jndiContext  = new InitialContext(props);and make sure the appserv-rt.jar is on the classpath (by including it's path and name rather than by copying it to somewhere).

  • Using JNDI Context with HTTP Tunneling (Detecting Connection Problems)

    Hi there,
    We are using connection to WL 5.1.0,SP6 cluster to create JNDI Context. Everything works fine until tcp/ip timeouts occur.
    After that ...
    Is there a way to subscribe for connection events?
    I don't want to use T3CLient for this, since WL advises not
    to do that. The recommended method is to create a Context and
    work with it.
    Help.
    For the curious here is one exception which we can not even
    trap. Is this fixed in SP8?:
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ MBuf used after writeTo() called ]
         at weblogic.socket.MBuf.checkNotWritten(MBuf.java:68)
         at weblogic.socket.MBuf.writeTo(MBuf.java:140)
         at weblogic.socket.JVMSocketHTTPClient.sendMsg(JVMSocketHTTPClient.java:253)
         at weblogic.socket.JVMAbbrevSocket.sendOutMsg(JVMAbbrevSocket.java:348)
         at weblogic.socket.JVMAbbrevSocket.sendMsg(JVMAbbrevSocket.java:237)
         at weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:420)
         at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:494)
         at weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.java:155)
         at weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:163)
         at weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:186)
         at weblogic.rmi.internal.BasicOutgoingRequest.sendRecv(BasicOutgoingRequest.java:23)
         at weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.java:73)
         at

    Download Firmware 2.77 MB...
    TFTP Download , download both the files on the desktop only...
    Double click the TFTP.exe file and click run :
    For Server- Enter the IP Address of the router that you assigned.  By default, the router is 192.168.1.1...
    For Password- Enter the password you assigned the router. By default, the router’s password is “admin”.
    For File- Click the triple “…” button and browse for the .bin firmware file...
    Click Upgrade button to start upgrading.  A progress bar should show up to show the progress.
    Once the Upgrade is done press and hold the reset button for 30 seconds...Release the reset button...Unplug the power cable from your router, wait for 30 seconds and re-connect the power cable...Now re-configure your router...

  • How to create JNDI data source name in Tomcat 6.0.18 server?

    Hai,
    How to create JNDI data source name in Tomcat 6.0.18 server?
    Regards,
    MariMuthu.A

    [http://google.com/search?q=jndi+site:tomcat.apache.org+6.0]

  • Creating JNDI datsource for Sybase 11.2 in Sun One Web Server 6.1

    Hi,
    I would like to get detailed explanation on how to create JNDI datasource in Sun One Web Server 6.1 for Sybase 11.2. Can anybody help?

    Did you read and follow the WebServer manual? Since you did not even provide a version number, I'll point you at the latest:
    http://docs.sun.com/app/docs/coll/WebServer_05q1
    Thanks,
    -- Marco

  • Problem: empty JNDI Context, weird name space

    Hello,
    I am unable to deploy our EAR file and one of the suspicious things is that if I print out the 'InitialContext' (the JNDI Context), I get nothing!.
    Here is the code:
    InitialContext jndiContext = new InitialContext();
    System.out.println("CONTEXT: " + jndiContext);
    System.out.println("ENV: " + jndiContext.getEnvironment());
    System.out.println("NAME: " + jndiContext.getNameInNamespace());
    And this is the output I get:
    05/01/18 15:45:50 CONTEXT: javax.naming.InitialContext@18c4a7f
    05/01/18 15:45:50 CONTEXT ENV: {} <=== empty!?
    05/01/18 15:45:50 CONTEXT NAME: wgen <=== where is this 'wgen' coming from!?
    I see 2 issues here:
    1. Why is the Context environment empty? It shouldn't be empty!
    2. Where does the Context name of 'wgen' come from? I do not have 'wgen' mentioned anywhere in ejb-jar.xml
    So then I tried fixing issue 1 by creating the Context environment programmatically:
    java.util.Hashtable env = new java.util.Hashtable();
    env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationInitialContextFactory");
    env.put(javax.naming.Context.SECURITY_PRINCIPAL, "jazn.com/admin");
    env.put(javax.naming.Context.SECURITY_CREDENTIALS, "admin2");
    env.put(javax.naming.Context.PROVIDER_URL, "opmn:ormi://localhost:3201:OAS1.bray/wgen")
    InitialContext jndiContext = new InitialContext(env);
    This still produced an empty environment.
    Has anyone got aaaany ideas about this?
    Where is OAs/OC4J getting that 'wgen' context from? How do you populate the JNDI environment? It's as if the JNDI is completely brain-dead.... and it's possible that it's just misconfigured. All I have in my j2ee/config/ dir is a jndi.properties file that looks like this:
    java.naming.factory.initial=com.evermind.server.ApplicationInitialContextFactory
    java.naming.provider.url=opmn:ormi://localhost:6003:OAS1.bray/wgen
    java.naming.security.principal=admin
    java.naming.security.credentials=admin2
    Thanks,
    Otis

    I would say there is nothing wrong with JNDI in your oc4j. The very fact that the CONTEXT NAME is wgen, which is obtained from the
    java.naming.provider.url=opmn:ormi://localhost:6003:OAS1.bray/wgen
    shows jndi is functioning.
    To see more of you jndiContext, run
    listContext (jndiContext,"")
    after you have added the following method that iterates through the subContexts. Please note that getEnviroment returns the enviroment for the context, not the context itself. It might be empty indeed.
    private static void listContext (Context ctx, String indent) {
    try {
    NamingEnumeration list = ctx.listBindings("");
    while (list.hasMore()) {
    Binding item = (Binding)list.next();
    String className = item.getClassName();
    String name = item.getName();
    System.out.println(indent+className+" "+name);
    Object o = item.getObject();
    if (o instanceof javax.naming.Context)
    listContext ((Context)o,indent+" ");
    catch (NamingException ex) {
    ex.printStackTrace();
    System.err.println ("List error: "+ex);

  • "No JNDI context" error

    Hello.
    I'm currently using SQLDeveloper version 1.5.0.5.3 and since maybe three versions ago, I started getting frequently the following error when opening the application:
    {color:#ff0000}SEVERE 60 0 oracle.jdevimpl.db.adapter.DefaultContextWrapper failed to create naming Context for db connections at url: file:/C:/Documents and Settings/jvargem/Application Data/SQL Developer/system1.5.0.53.38/o.jdeveloper.db.connection.11.1.1.0.22.49.35/connections.xml
    SEVERE 61 16 oracle.jdevimpl.db.adapter.DefaultContextWrapper failed to create naming Context for db connections at url: file:/C:/Documents and Settings/jvargem/Application Data/SQL Developer/system1.5.0.53.38/o.jdeveloper.db.connection.11.1.1.0.22.49.35/connections.xml
    SEVERE 62 15 oracle.jdeveloper.db.DatabaseConnections DatabaseConnections has no JNDI context so cannot list connections.
    SEVERE 63 0 oracle.jdevimpl.db.adapter.DefaultContextWrapper failed to create naming Context for db connections at url: file:/C:/Documents and Settings/jvargem/Application Data/SQL Developer/system1.5.0.53.38/o.jdeveloper.db.connection.11.1.1.0.22.49.35/connections.xml
    SEVERE 64 0 oracle.jdevimpl.db.adapter.DefaultContextWrapper failed to create naming Context for db connections at url: file:/C:/Documents and Settings/jvargem/Application Data/SQL Developer/system1.5.0.53.38/o.jdeveloper.db.connection.11.1.1.0.22.49.35/connections.xml
    SEVERE 65 0 oracle.jdeveloper.db.DatabaseConnections DatabaseConnections has no JNDI context so cannot list connections.{color}
    When this error happens, no connections are displayed, which prevents me from using the application unless I create the connection all over again!
    As I said this happens frequently and afterwards I have to close and restart the application several times until the error goes away. The problem is that sometimes it doesn't go away and I have to restart the computer and restart all over again, hoping it will work.
    As anyone experienced this? Any idea of what may be happening and how to solve it?
    Thanks a lot
    Jo&atilde;o Vargem

    Please read the whole thread before posting.
    You did search the forum, which is great, but then read what people respond! There was only 1 reply here, so that shouldn't be too much work...
    If the latest version still gives you problems, do get back though.
    Regards,
    K.

  • Error in JMS receiver adapter: "Error creating initial context with environment"

    Hello,
    I have some trouble with a JMS receiver adapter (access to JMS-provider with JNDI).
    The message in adapter monitoring is:
    A channel error occurred. Detailed error (if any) :
    com.sap.aii.adapter.jms.api.connector.ConnectorException: Fatal Error looking up connection factoryJMSQueueConnectionFactory, for profile: ConnectionProfile of channel: CC_JMS_RCV_XLIMI00001on node: 503473150 having object id: 5b424f2f79b6350ca636ab35d528cfdd:
    ConnectorException: Error creating initial context with environment: java.naming.provider.url=wcsefdev.example.com:9064; java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory; for profile: ConnectionProfile of channel:
    CC_JMS_RCV_XLIMI00001on node: 503473150 having object id: 5b424f2f79b6350ca636ab35d528cfdd: javax.naming.NoInitialContextException:
    Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory<br> at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.createConnectionFactory
    (JndiConnectorImpl.java:152)<br> ....
    Message processing failed. Cause:
    com.sap.aii.adapter.jms.core.fsm.DFA$InvalidTransitionException: No transition found from state: ERROR, on event: process_commence for DFA: CC_JMS_RCV_XLIMI00001:5b424f2f79b6350ca636ab35d528cfdd
    The third party assured me that the specified JNDI parameters are right and everything is configured on their site, so it should work...
    Might there be a problem with the JMS drivers?
    Regards,
    Marcus

    Hi Marcus,
    Have a look at below thread
    Connecting to PI 7.11 JMS Queue from other PI 7.11 Server

  • Error creating initial context with environment

    Hi,
    Currently we are working on a scenarios, where we need to integrate XI and webmethods using JMS.
    It was working fine. But recently they have restarted the webmethods server. After that we re getting an error message like,
    In Adapter Monitoring:
    Channel error occurred; detailed error description: com.sap.aii.adapter.jms.api.connector.ConnectorException: Error creating initial context with environment: {java.naming.provider.url=server:port, java.naming.factory.initial=com.sap.engine.services.jndi.InitialContextFactoryImpl, java.naming.security.principal=XYZ, java.naming.security.credentials=ABC}for profile: ConnectionProfile of channel: CC_RCV_JMS_INon node: 3010950 having object id: ABCXYZ: NamingException: Error getting the server-side naming service functionality during getInitialContext operation.
    at com.sap.aii.adapter.jms.core.connector.JndiConnectorImpl.createInitialContext(JndiConnectorImpl.java:66)
    In RWB
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: No transition found from state: STARTING, on event: process_commence for DFA: C_RCV_JMS_IN:e4413a5265a436459e271d5e0dd4859b
    Can one please tell me what the problem is?
    Thanks in advance.
    Regards,
    Prasad Babu.

    Hi,
    Check this link looks like same problem
    Re: file to JMS(for MQ series)
    Thanks
    Vikranth

  • Error in SQL Developer: Database Connections has no JNDI context so cannot

    Hello,
    I have installed SQL Developer 3.1.07 version on Linux. Previously I was able to create a connection and browse the existing tables, add tables, etc.
    Now when I launch SQL Developer, I see that no connections are displayed. Instead there are these three messages indicating an error. Can you please advice on how to resolve this?
    Thanks,
    Errors:
    SEVERE     44     0     oracle.jdeveloper.db.DatabaseConnections     DatabaseConnections has no JNDI context so cannot list connections.
    SEVERE     43     36     oracle.jdevimpl.db.adapter.DefaultContextWrapper     Failed to create naming Context for db connections at url: file:/home/user/.sqldeveloper/system3.1.07.42/o.jdeveloper.db.connection.11.1.1.4.37.59.48/connections.xml
    SEVERE     42     0     oracle.jdevimpl.db.adapter.DefaultContextWrapper     Failed to create naming Context for db connections at url: file:/home/user/.sqldeveloper/system3.1.07.42/o.jdeveloper.db.connection.11.1.1.4.37.59.48/connections.xml

    Hi uparthas,
    Here is a similar thread (Windows 7) marked as answered, and may be applicable to a Linux environment if you are using jdk1.7 rather than jdk1.6:
    Lost my connections.
    If that does not solve the issue, you might also wish to ...
    1. Exit SQL Developer
    2. Delete or rename the /home/user/.sqldeveloper/system3.1.07.42 directory
    3. Launch SQL Developer, perhaps without choosing to migrate settings from a prior install.
    Hope this helps,
    Gary
    SQL Developer Team

  • DatabaseConnections has no JNDI context so cannot list connections

    All my connections are missing and I cannot create or save new ones.
    The messagse from the logging page are:
    oracle.jdevimpl.db.adapter.DefaultContextWrapper -
    failed to create naming Context for db connections at url: file:/C:/Documents and Settings/PhilDeFrancesco/Application Data/SQL Developer/system1.5.1.54.40/o.jdeveloper.db.connection.11.1.1.0.22.49.42/connections.xml
    oracle.jdeveloper.db.DatabaseConnection
    DatabaseConnections has no JNDI context so cannot list connections

    The thread suggesting changes to .jar files did not work:
    http://forums.oracle.com/forums/ann.jspa?annID=737
    However,
    I found this on another thread and it worked for me.
    Connection problems with SQL Developer -- ANSWERED
    "Try removing the SQL Developer SYSTEM folder that is created on Startup.
    \Documents and Settings\<user>\Application Data\SQL Developer\system1.5.0.53.38.
    Note that this will remove any connections and settings created, but as you are not able to import or create connections, that should not be a concern. This system folder is created when you first invoke SQL Developer and is updated while you work, storing and preserving connections and various settings as you work. "

  • Start-up error "DatabaseConnections has no JNDI context so cannot list ..."

    Hi,
    Since this morning, every time I startup SQLDeveloper I nolonger see my database connections. All I see is a logging page with entries like the one given below.
    I have re-downloaded and installed sqldeveloper using sqldeveloper-2.1.1.64.45.zip, and I have also trashed the "system" folder(s) under:
    C:\Documents and Settings\anipatel\Datos de programa\SQL Developer
    ...but the error continues.
    I have not applied any Sqldeveloper updates nor have I updated any other software on the PC (OS XP Pro SP3).
    Any pointers as to how to resolve this issue?
    Thanks - Anit
    SEVERE     56     1329     oracle.ide.IdeCore     Exception firing mainWindowOpened to oracle.dbtools.raptor.RaptorDBAddin$1@10eb2f0
    SEVERE     52     1532     oracle.ide.IdeCore     Exception firing mainWindowOpened to oracle.ideimpl.jsr198.OracleIDE$1@871dcc
    SEVERE     49     0     oracle.jdeveloper.db.DatabaseConnections     DatabaseConnections has no JNDI context so cannot list connections.
    SEVERE     48     0     oracle.jdevimpl.db.adapter.DefaultContextWrapper     Failed to create naming Context for db connections at url: file:/C:/Documents and Settings/anipatel/Datos de programa/SQL Developer/system2.1.1.64.45/o.jdeveloper.db.connection.11.1.1.2.36.55.30/connections.xml
    SEVERE     47     390     oracle.jdevimpl.db.adapter.DefaultContextWrapper     Failed to create naming Context for db connections at url: file:/C:/Documents and Settings/anipatel/Datos de programa/SQL Developer/system2.1.1.64.45/o.jdeveloper.db.connection.11.1.1.2.36.55.30/connections.xml
    SEVERE     46     0     oracle.ide.IdeCore     Exception firing addinsLoaded to oracle.jdevimpl.vcs.VCSManagerImpl$6@7ac6c
    SEVERE     62     0     oracle.jdeveloper.db.DatabaseConnections     DatabaseConnections has no JNDI context so cannot list connections.
    SEVERE     61     0     oracle.jdevimpl.db.adapter.DefaultContextWrapper     Failed to create naming Context for db connections at url: file:/C:/Documents and Settings/anipatel/Datos de programa/SQL Developer/system2.1.1.64.45/o.jdeveloper.db.connection.11.1.1.2.36.55.30/connections.xml
    SEVERE     60     375     oracle.jdevimpl.db.adapter.DefaultContextWrapper     Failed to create naming Context for db connections at url: file:/C:/Documents and Settings/anipatel/Datos de programa/SQL Developer/system2.1.1.64.45/o.jdeveloper.db.connection.11.1.1.2.36.55.30/connections.xml
    SEVERE     57     281     oracle.ide.IdeCore     Exception firing mainWindowOpened to oracle.dbtools.raptor.RaptorDBAddin$1@154fc43
    SEVERE     55     2017     oracle.ide.IdeCore     Exception firing mainWindowOpened to oracle.ideimpl.jsr198.OracleIDE$1@1f4ff23
    SEVERE     50     0     oracle.ide.IdeCore     Exception firing addinsLoaded to oracle.jdevimpl.vcs.VCSManagerImpl$6@12801c5

    Bringing this old post back to add some information.
    Since our company upgraded versions (from "v-GO" with the circles in the system tray to "ESSO" with a big oracle O in the system tray), I no longer have to kill the SSO processes in order to run SQL Developer.
    Instead, I simply have to launch SQL Developer 3 times.
    First time: SQL Developer crashes. Just click OK.
    Second time: SQL Developer loads but no connections appear. However, it does load much faster than the first time.
    Third time: SQL Developer loads properly.
    I'd rather launch SQL developer 3 times than have it crash (1st time), remember that I have to kill all ESSO processes, then re-launch SQL Developer (2nd time), then re-launch ESSO. So, this is how I've been doing it for the last few months and it "works" every time.

  • How do I create a context menu in the new CL_SALV

    I like a function xx in context menu. How do I create a context menu in the  CL_SALV ?
    thank you!
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        TYPES: t_proc TYPE zmp_c00_pr_d,
               tt_proc TYPE STANDARD TABLE OF t_proc,
               tt_proces_subpr TYPE TABLE OF ltyp_proces_subpr.
        CLASS-DATA: lr_context TYPE REF TO cl_gui_alv_grid,
        r_selections TYPE REF TO cl_salv_selections,
        lr_menu type ref to cl_ctmenu.
        CLASS-METHODS: main CHANGING ct_zmp_c00_pr_d TYPE tt_proc
                                     ct_proces_subpr TYPE tt_proces_subpr
                                     cv_screen TYPE i.
      PRIVATE SECTION.
        CLASS-DATA lt_zmp_c00_pr_d TYPE TABLE OF zmp_c00_pr_d.
        CLASS-DATA ls_process TYPE zmp_c00_pr_d.
        CLASS-METHODS: handle_double_click
                   FOR EVENT double_click  OF cl_salv_events_table
                   IMPORTING row column,
                   detail
                   IMPORTING l_objkey TYPE zmp_c00_pr_d-objkey.
    ENDCLASS.                    "lcl_events DEFINITION
    * CLASS lcl_event_handler IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD main.
        DATA: lr_alv TYPE REF TO cl_salv_table,
              lr_events TYPE REF TO cl_salv_events_table,
              lr_columns TYPE REF TO cl_salv_columns,
              lt_col_tab TYPE salv_t_column_ref.
        FIELD-SYMBOLS <column> LIKE LINE OF lt_col_tab.
        IF r_container IS INITIAL.
          CREATE OBJECT r_container
            EXPORTING
              container_name              = 'CONTAINER'
            EXCEPTIONS
              cntl_error                  = 1
              cntl_system_error           = 2
              create_error                = 3
              lifetime_error              = 4
              lifetime_dynpro_dynpro_link = 5
              OTHERS                      = 6.
          IF sy-subrc <> 0.
            MESSAGE i004(z_pm_tool).
          ENDIF.
    *Für Dynpro 1400
          IF cv_screen = '1400'.
            TRY.
                CALL METHOD cl_salv_table=>factory
                  EXPORTING
    *    list_display   = IF_SALV_C_BOOL_SAP=>FALSE
                    r_container    = r_container
                  IMPORTING
                    r_salv_table   = r_alv
                  CHANGING
                    t_table        = ct_proces_subpr.
              CATCH cx_salv_msg .
            ENDTRY.
            TRY.
    * zeige die Daten
                r_alv->display( ).
                IF sy-subrc NE 0.
                  MESSAGE i001(z_pm_tool).
                ENDIF.
              CATCH cx_salv_msg.
            ENDTRY.
          ENDIF.
    * Für Dynpro 1100
          TRY.
              CALL METHOD cl_salv_table=>factory
                EXPORTING
    *    list_display   = IF_SALV_C_BOOL_SAP=>FALSE
                  r_container    = r_container
                IMPORTING
                  r_salv_table   = r_alv
                CHANGING
                  t_table        = ct_zmp_c00_pr_d  .
            CATCH cx_salv_msg .
          ENDTRY.
          TRY.
    * zeige die Daten
              r_alv->display( ).
              IF sy-subrc NE 0.
                MESSAGE i001(z_pm_tool).
              ENDIF.
            CATCH cx_salv_msg.
          ENDTRY.
    *Ereignisobjekt holen
          lr_events = r_alv->get_event( ).
    ** get the SELECTIONS object
    *r_selections = r_alv->get_selections( ).
    * Interne-Tabelle füllen und an die Methode handle_double_click übergeben
          LOOP AT ct_zmp_c00_pr_d INTO ls_process.
            APPEND ls_process TO lt_zmp_c00_pr_d.
          ENDLOOP.
    * Zeiger auf Container für Kontexmenu
          CREATE OBJECT lr_context
            EXPORTING
              i_parent = r_container.
          DATA: lt_events TYPE cntl_simple_events.
          CALL METHOD lr_context->set_registered_events
            EXPORTING
              events                    = lt_events
            EXCEPTIONS
              cntl_error                = 1
              cntl_system_error         = 2
              illegal_event_combination = 3
              OTHERS                    = 4.
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    * Interne-Tabelle füllen und an die Methode handle_double_click übergeben
          LOOP AT ct_zmp_c00_pr_d INTO ls_process.
            APPEND ls_process TO lt_zmp_c00_pr_d.
          ENDLOOP.
    * Event: Add Function
          SET HANDLER: on_added_function FOR lr_events.
    * Event: Kontexmenu
    *      SET HANDLER: on_context_menu_request FOR lr_context.
    * Event: Doppelklick
          SET HANDLER handle_double_click FOR lr_events.
    * get the SELECTIONS object
          r_selections = r_alv->get_selections( ).
    * Einzelne Spalte holen
          lr_columns = r_alv->get_columns( ).
    * Doppelklick funktioniert nur auf das Feld OBJKEY
          LOOP AT lt_col_tab ASSIGNING <column>.
            <column>-r_column->set_output_length( 20 ).
            IF <column>-columnname = 'OBJKEY'.
              <column>-r_column->set_visible( 'X' ).
            ELSE.
              <column>-r_column->set_visible( ' ' ).
            ENDIF.
          ENDLOOP.
          IF lt_col_tab IS NOT INITIAL AND sy-subrc <> 0.
            MESSAGE i002(z_pm_tool).
          ENDIF.
        ENDIF.
      ENDMETHOD.                    "main
      METHOD handle_double_click.
        FIELD-SYMBOLS <fs_zmp_c00_pr_d> TYPE zmp_c00_pr_d.
        READ TABLE lt_zmp_c00_pr_d INDEX row ASSIGNING <fs_zmp_c00_pr_d>. " vor dem Changing Parameter der Klasse
    *    READ TABLE ct_zmp_c00_pr_d INDEX row ASSIGNING <fs_zmp_c00_pr_d>.
        IF sy-subrc <> 0.
          RETURN.
        ENDIF.
        IF column = 'OBJKEY'.
          lcl_event_handler=>detail( <fs_zmp_c00_pr_d>-zz_slotid_a ).
        ENDIF.
      ENDMETHOD.                    "handle_double_click
      METHOD detail.
        DATA: lr_alv TYPE REF TO cl_salv_table,
              lt_alv_tab TYPE TABLE OF zmp_p00_sp_d.
    * Subprozess holen
        SELECT * FROM zmp_p00_sp_d INTO TABLE lt_alv_tab
          WHERE objkey = l_objkey.
        IF sy-subrc <> 0.
          MESSAGE i003(z_pm_tool).
        ENDIF.
        TRY.
    * Neu erzeugte Instanz für ALV-Tabellenobjekt holen
            cl_salv_table=>factory( IMPORTING r_salv_table = lr_alv
                                     CHANGING t_table = lt_alv_tab ).
    * Ausgabe Fenster für SubScreens
            lr_alv->set_screen_popup( start_column = 1
                                   end_column = 130
                                   start_line = 1
                                   end_line = 10 ).
    * Anzeige der Daten
            lr_alv->display( ).
            IF sy-subrc <> 0.
              MESSAGE i001(z_pm_tool).
            ENDIF.
          CATCH cx_salv_msg.
        ENDTRY.
      ENDMETHOD.                    "detail
    ENDCLASS."lcl_event_handler IMPLEMENTATION
    Edited by: polaris1 on Dec 15, 2010 12:18 PM

    Can't read that jumble, but suggest you look at the excellent SALV tutorials by Rich Heilman by searching for SALV tutorial on SCN.  You'll find working code and how-to for adding your own functions to SALV.

  • How to create a context menu in ALV table cell editor(Webdynpro abap )

    Hello Experts,
    I am having a problem in creating a context menu in a table cell editor in the ALV table output.I have assigned a 'lta' as the cell editor.But befor assigning the lta as cell editor I have assigned the menu to the lta.But when the view is rendered I can see the lta with the actioned assigned to it.But I cannot see the context menu.
    The code snippet below:
      "Create menu for each coloumn
      create OBJECT lo_menu_actions type CL_SALV_WD_VE_MENU EXPORTING
          id = 'MITM_ACTIONS'.
      lo_menu_actions->set_visible( value = abap_true ). 
      lo_menu_actions->set_visible_fieldname( value = 'ACTIONS' ).
      "ADd menu items
      CREATE OBJECT lo_menu_item_create type CL_SALV_WD_VE_MENU
      exporting
        id = 'MITM_CREATE_EXPRESSION'.
      lo_menu_item_create->set_visible( value = abap_true ).
      lo_menu_item_create->set_visible_fieldname( value = 'Create' ).
      "Add item 1
      lo_menu_actions->ADD_ITEM( VALUE = lo_menu_item_create ). 
      "  Set the cell editor for each column cell(link to an action)
      LOOP AT lt_node_dec_tab_cols INTO ls_node_dec_tab_cols .
        lv_column_name = ls_node_dec_tab_cols-object_name.
        lr_column = lr_column_settings->get_column( lv_column_name ).
       "Create 'lta' Ui item
        CREATE OBJECT lo_lta TYPE cl_salv_wd_uie_link_to_action.
        lo_lta->set_menu( value = lo_menu_actions ).
        lo_lta->set_text_fieldname( lv_column_name ).
        lr_column->set_cell_editor( lo_lta ).
        IF ls_node_dec_tab_cols-is_result EQ abap_true.
          lr_column->set_cell_design( value =
                      cl_wd_table_column=>e_cell_design-key_medium ).
        ENDIF.
      ENDLOOP.

    Hi Prakash,
    I have not come across this requirement till now to have context menu in a cell editor of alv.
    Unfortunately  the implementation of method SET_MENU of alv ui elements ( ex: cl_salv_wd_uie_text_view ) is not updating alv configurable table, instead it just stores in a global attribute as string. Hence has no effect on context menu.
    If your user is very particular about this requirement of having context menu in cell editor, you can go for a normal table. Because, normal table's cell editor has the property to set the menuID as we do it for other ui elements.
    Regards,
    Rama

  • JNDI Context Retrieval in EJB 3.0

    I have a doubt about JNDI context retrieval in EJB 3.0. I know that when I call a bean from another bean I can use this line:
    InitialContext ctx=new InitialContext();
    But I'd like to know whether in a Client I am obliged to pass this parameter:
    InitialContext ctx=new InitialContext(System.getProperties());
    This method was the one I called when I used EJB 2.1..Now in many examples I find both these approaches...I'd like to know what differentiates one from another and which is the standard in EJB 3.0?
    I read that when calling a bean from another bean I can use the first constructor with no parameters...but in clients I am obliged to give the param..why?
    Thanks!

    Correct me if I am wrong: the application client
    container is a "static" container: you need to know
    which EJB to call at develop time and you can not
    change it later without recompiling.That's not quite right. First, there's nothing special about the application client
    container with respect to retrieving Java EE dependencies that is not also true
    of Java EE web containers and EJB containers. The programming model for
    defining and accessing EE dependencies is exactly the same, independent of
    whether the code is running in an Application Client, EJB container, etc.
    It's true that dependencies are defined at development time, but one of the
    whole reasons for the level of indirection provided by Java EE dependencies
    is to allow the target of those dependencies to change without changing code.
    E.g, with EJB dependencies this is done using the ejb-link attribute in ejb-ref
    or ejb-local-ref. That specifies which EJB is the target of the ejb dependency
    without changing the code used to retrieve the dependency.
    >
    JNDI was designed to be more flexible: you can
    dynamically lookup EJB homes, then call a remote
    method you like at runtime. Is that flexibility lost
    with application client container. Is there any way
    to dynamically inquiry-invoke?In the Java EE programming model, components always define what their
    dependencies are so that the deployer can configure them. The idea of
    doing a direct global lookup without using a Java EE dependency is
    outside the scope of Java EE. It works in many implementations but the
    specifics are not portable.
    We have a presentation that covers some of these topics you might find
    interesting. See here :
    https://glassfish.dev.java.net/javaee5/ejb/compdependencies_xmlforum_nov15.pdf

Maybe you are looking for

  • I did the recommended re-install to resolve the missing MSVCR80.dll file. This worked, but I am now stymied by two error messages: "Apple Mobile Device failed to start" and "Apple application support not found". How to overcome?

    That worked, however I now get two error messages when I install I Tunes: o  Apple Mobile Device failed to start. o  Apple Application Support not found. This were of course deleted in the recommended re-install procedure to resolve the dll file, but

  • Cant download skype for windows

    trying to download skype for windows and when i run the instill file it comes up with a error (installing  skype failed code 163 and do everything it asks but cant find skype on the uninstall list can anybody help

  • Different Ways of Code

    Can I build a query in a different way without using alias tables of position,physical Quantity in the WEBI report level. (SELECT   DISTINCT pp2.trade subtrade,                                          pq2.shipment subshipment,                       

  • 64-bit OS

    I'm quite sure that this topic has been up before but today I saw on AMDzone.com that Mandrake have some sort of 64-bit version. So I'm wondering, is there any new 64-bit OS' out there in full version? For x86-64 ofcourse and not SunOS or something..

  • The odd Audio CD problem

    I'm having problems with a few Audio CD's I'm trying to upload to i-Tunes, When I play the CD through either i-Tunes or Windows Media Player there seems to be a loud crackling sound in the background Its happened with a number of audio CD's I have, I