INITIAL_CONTEXT_FACTORY, PROVIDER_URL and URL_PKG_PREFIXES

Hello!!
I hope that you can help me. What are the values of these three environment varibles? I have a problem when I create a new InitialContext .. what is wrong? This is my code :
Hashtable env = new Hashtable();
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
env.put(javax.naming.Context.PROVIDER_URL, "localhost:50004");
env.put(javax.naming.Context.URL_PKG_PREFIXES, "com.sap.tm.jndi.providers");
Context ctx = new InitialContext(env);
In this moment appears the following error :
com.sap.engine.services.jndi.persistent.exceptions.NamingException: Intermediate context : ejb was not found
     at com.sap.engine.services.jndi.implserver.ServerContextImpl.getLastContainer(ServerContextImpl.java:261)
     at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:562)
     at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:326)
     at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:222)
     at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:236)
     at javax.naming.InitialContext.lookup(InitialContext.java:347)
     at javax.naming.InitialContext.lookup(InitialContext.java:347)
Thanks.
Carlos

Hi Carlos,
your parameters are right. It seems like a wrong JNDI name into the call of the lookup method for finding an EJB. Check this and make you sure this element is existing into your JNDI.
Regards André

Similar Messages

  • What are PROVIDER_URL and INITIAL_CONTEXT_FACTORY for Sun iMQ

    Hi
    Thank you for reading my post
    I am trying to use sun MQ from outside the application server from an standalone client .
    i want to access to some queue and process its message from the standalone client , but where ever i searched i can not find those two parameters , can some one give them to me ?
    I need them to initiate the Context object

    Initial context factory is generally:
    com.sun.jndi.ldap.LdapCtxFactory
    URL depends on how you set up your object hierarchy. e.g. It might look something like:
    "LDAP://myhost.mycompany.com:15200/ou=AdministeredObjects,ou=MessageQueue,dc=sfbay,dc=sun,dc=com";

  • Help required in understanding the flow of control in working with EJB 3.0

    *1. Can anyone help me in understanding the flow after getting an object of InitialContext in using Stateless/Stateful in EJB 3.0 from client i.e. what we are getting in the step Object ref=jndiContext.lookup("CalculateBean/Remote) .*
    *2. What is the use of INITIAL_CONTEXT_FACTORY*
    *3. PROVIDER_URL*
    *4. Java.naimg.factory.url.pkgs*
    *5. why org.jboss.naming and org.jnp.interfaces separated by semi colon.*
    *6. Why we dont require INITIAL_CONTEXT_FACTORY, PROVIDER_URL and Java.naming.factory.url.pkgs if the client is a web client.*
    Properties p=new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              p.put(Context.PROVIDER_URL,"jnp://localhost:1099");
              p.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
              Context jndiContext = new InitialContext(p);
         Object ref = jndiContext.lookup("CalculateBean/Remote");
    Calculate c = (Calculate)ref;
    int sum=c.add(3,4);
    System.out.println(sum);
    Thanx in advance........

    Annotations can also be processed at run time using the core reflection API (java.lang.Class & java.lang.reflect.*), so you might want to explore down that path. I have no idea how JBoss actually does it, but annotation processing at build time and core reflection at runtime are the two most obvious possibilities.
    Bruce

  • InitialContext and PROVIDER_URL

    I'm creating an InitialContext in a server-side object, relying on the WebLogic Server
    to use the local naming service. This works as expected. However, once created,
    I would like to determine the URL and initial context factory for the local naming
    service. When the following code is executed:
    InitialContext myCtx = new InitialContext();
    ht = myCtx.getEnvironment();
    myContext = (String)ht.get(Context.INITIAL_CONTEXT_FACTORY);
    myServer = (String)ht.get(Context.PROVIDER_URL);
    if(myServer == null)
    myServer = (String)ht.get(weblogic.jndi.WLContext.PROVIDER_RJVM);
    ..the initial context factory is returned as expected from the environment hashtable,
    but both PROVIDER_URL and PROVIDER_RJVM are null. Is there any way to determine
    what the correct URL for the local naming service is? (Assuming that there is no
    guarantee that it is at localhost:7001)
    Thanks in advance,
    Mike

    I figured this out myself . A bug (6089084) was reported and closed as Not-A-Bug. Sun App server has a workaround on it. Instead of using InitialContext() with programmatically specified properties, specify the ejb-name/jndi-name binding in ejb descriptor file (with jndiname format : 'corbaname:iiop:<host>:<iiop port>#<Bean's JNDI name>'), create an InitialContext without any added properties, and use 'java:comp/env/<ejb-name>' for lookup.

  • Call EJB via ORMI+OID

    Hi All,
    I need to achieve this
    1. Swing client needs to be authendicated when he calls any EJB of the deployed application. ( My application is secured by OID)
    When i am doing a remote lookup my EJB using ORMI from swing client, i am getting invalid user name and password.
    I am supplying the user name configured in OID. Help me in achieving this.
    Enclosing the java program:
    package com.test.ormi;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import javax.naming.InitialContext;
    import java.util.Hashtable;
    public class ORMITest {
    static public Context getInitialContext(String url, String user, String passwd) throws NamingException {
    Hashtable h = new Hashtable();
    h.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    h.put(Context.PROVIDER_URL, url);
    h.put(Context.SECURITY_PRINCIPAL, user); // OID user name
    h.put(Context.SECURITY_CREDENTIALS, passwd);
    try {
    Context context = new InitialContext(h);
    return context;
    } catch (Throwable th) {
    throw new NamingException(th.getMessage());
    public static void main(String[] args) {
    Context initalCtx = null;
    try {
    initalCtx = ORMITest.getInitialContext("ormi://developmentservername:12345/CQS", "user", "password");
    Object o = initalCtx.lookup("jndiname");
    System.out.println("Class:" + o.getClass());
    } catch (NamingException e) {
    e.printStackTrace();
    } finally {
    Regards.

    Hi,
    Could you make a simple client Java program (instead of Swing), and call to the EJB.
    Could you test with hardcoded URL (for Context.PROVIDER_URL) and let me know if that works.
    I attached a sample code
    Thanks,
    Olaf
    ====
    package sampleClient;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import employeedetailssoln.Employee;
    import employeedetailssoln.EmployeeHome;
    import javax.naming.NamingException;
    public class SamClient
    public static void main(String [] args)
    SamClient sClient = new SamClient();
    try
    Context context = getInitialContext();
    SamHome samHome = (SamHome)PortableRemoteObject.narrow(context.lookup("SampleEJB"), SamHome.class);
    Sam samJ;
    // Use one of the create() methods below to create a new instance
    samJ = samHome.create();
    // invoke samJ
    catch(Throwable ex)
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome1");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23891/current-workspace-app");
    return new InitialContext(env);

  • WL5.1 SP* javax.naming.NameNotFoundException

    I am looking for advice ... I started getting a NameNotFoundException when I
    moved from SP6 to SP8 running on a Solaris machine (NO code changes).
    Anyone have any ideas as to the problem? As the deployment names seem
    correct, it is not obvious to me where the problem lies.
    ejb-jar.xml snippet
    =============
    <session>
    <description>ProductHierarchy EJB</description>
    <display-name>ProductHierarchy</display-name>
    <ejb-name>ProductHierarchy</ejb-name>
    <home>com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome</home>
    <remote>com.redcelsius.ecommerce.product.ejb.ProductHierarchy</remote>
    <ejb-class>com.redcelsius.ecommerce.product.ejb.ProductHierarchyBean</ejb-cl
    ass>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    weblogic-ejb-jar.xml snippet
    ===================
    <weblogic-enterprise-bean>
    <ejb-name>ProductHierarchy</ejb-name>
    <caching-descriptor>
    </caching-descriptor>
    <jndi-name>ecommerce.ProductHierarchyHome</jndi-name>
    </weblogic-enterprise-bean>
    client home lookup snippet
    ==================
    InitialContext ctx =
    AbstractResourceFactory.getResourceFactory().getInitialContext();
    Object ref = ctx.lookup("ecommerce.ProductHierarchyHome");
    Weblogic deployment
    ===============
    Thu Mar 01 12:18:31 GMT-05:00 2001:<I> <EJB JAR deployment
    ./myserver/redcelsius/ecommerce-server.jar> EJB home interface:
    'com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome' deployed bound
    to the JNDI name: 'ecommerce.ProductHierarchyHome'
    Exception
    =======
    javax.naming.NameNotFoundException: 'ecommerce.ProductHierarchyHome';
    remaining name 'ecommerce.ProductHierarchyHome'
    at
    weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:745)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at
    com.redcelsius.ecommerce.product.web.ProductBean.getEJB(ProductBean.java:68)

    I solved the problem. We read vendor specific values (such as
    Context.PROVIDER_URL and Context.INITIAL_CONTEXT_FACTORY) from a property
    file in a startup class in a static initializer.
    It seems that the timing of when the startup class is loaded changed between
    sp6 and sp8; as a result the static initializer could not find our property
    file to set the values required when InitialContext(Properties) is called.
    Everything now works.
    Alan Koop
    "Rob Woollen" <[email protected]> wrote in message
    news:[email protected]...
    Are you sure that you are looking up the EJB on the WLS server that
    deployed it? (I have to ask.)
    Otherwise, there shouldn't be any required code changes between SP6 and
    SP8. We certainly test 1000s of EJBs against the service pack so JNDI
    lookups should work fine.
    Have you made any environmental changes?
    If you go back to SP6, does it still work?
    -- Rob
    Alan Koop wrote:
    I am looking for advice ... I started getting a NameNotFoundException
    when I
    moved from SP6 to SP8 running on a Solaris machine (NO code changes).
    Anyone have any ideas as to the problem? As the deployment names seem
    correct, it is not obvious to me where the problem lies.
    ejb-jar.xml snippet
    =============
    <session>
    <description>ProductHierarchy EJB</description>
    <display-name>ProductHierarchy</display-name>
    <ejb-name>ProductHierarchy</ejb-name>
    <home>com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome</home>
    <remote>com.redcelsius.ecommerce.product.ejb.ProductHierarchy</remote>
    <ejb-class>com.redcelsius.ecommerce.product.ejb.ProductHierarchyBean</ejb-cl
    ass>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    weblogic-ejb-jar.xml snippet
    ===================
    <weblogic-enterprise-bean>
    <ejb-name>ProductHierarchy</ejb-name>
    <caching-descriptor>
    </caching-descriptor>
    <jndi-name>ecommerce.ProductHierarchyHome</jndi-name>
    </weblogic-enterprise-bean>
    client home lookup snippet
    ==================
    InitialContext ctx =
    AbstractResourceFactory.getResourceFactory().getInitialContext();
    Object ref = ctx.lookup("ecommerce.ProductHierarchyHome");
    Weblogic deployment
    ===============
    Thu Mar 01 12:18:31 GMT-05:00 2001:<I> <EJB JAR deployment
    ./myserver/redcelsius/ecommerce-server.jar> EJB home interface:
    'com.redcelsius.ecommerce.product.ejb.ProductHierarchyHome' deployedbound
    to the JNDI name: 'ecommerce.ProductHierarchyHome'
    Exception
    =======
    javax.naming.NameNotFoundException: 'ecommerce.ProductHierarchyHome';
    remaining name 'ecommerce.ProductHierarchyHome'
    at
    weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:745)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at
    com.redcelsius.ecommerce.product.web.ProductBean.getEJB(ProductBean.java:68)
    >
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • JNDI properties for JCAPS

    Hi I have installed the Logical Host of JCAPS .Also I can explore the different
    MBeans of it using JConsole.
    If I want to access those MBeans programmatically what would be the
    JNDI properties ?
    For examplke if I want to access JBoss 3.2.5 MBeans My sample code would be something like ....
    InitialContext ctx = null;
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
    ctx = new InitialContext(env);
    So what would be my INITIAL_CONTEXT_FACTORY,PROVIDER_URL,URL_PKG_PREFIXES etc
    in this case ?
    If somebody has any idea please reply . When I was working with JBoss 3.2.5, I got all the related information from JBoss Administration Guide .
    Does JCAPS has any specific doc which can help me in this regard ?
    Regards,
    Ayan

    I use the following properties to connect to the jndi tree.
            env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
            env.put("java.naming.provider.url", "iiop://localhost:18002");But!
    I don't see any of my jcd's when I walk this tree.
    Can anyone tell me why? I'm expecting to see a list of jcds.
    When I look into the sun-ejb-jar.xml file, I see that I should be able to lookup the deployed service with the following name;
    ic.lookup("java:comp/env/ejb/local/stc/testHarness3Deployment1/deployedServices/CMap1_Collaboration_11")Are my assumptions correct, or is my jndi knowledge faulty?

  • In sun's j2sdkee:abou JNDI,I don't know the two paramters' value

    In sun's j2sdkee, I deploy my first EJB, and I run a client code to test it.
    but I don't know the two paramters' value:
    java.naming.provider.url
    (Context.PROVIDER_URL)
    and
    java.naming.factory.initial
    (Context.INITIAL_CONTEXT_FACTORY)
    Do I need to install another a naming and directory server?????
    when I start j2ee, is there a naming and directory server already running?
    thanks a lot!

    The PROVIDER_URL gives the JNDI api knowledge about where to begin a tree. The tutorial on it can be found here: http://java.sun.com/products/jndi/tutorial/beyond/url/config.html
    For example, when using JNDI to explore a filesystem, the PROVIDER_URL tells JNDI which directory to start with:
    env.put(Context.PROVIDER_URL, "file:/");For a JNDI call to a J2EE server, it tells the JNDI api which machine and port it needs to connect to in order to retrieve JNDI objects.
    Using JNDI to access an LDAP server, you may need a PROVIDER_URL like this: ldap://somehost:389.
    The INITIAL_CONTEXT_FACTORY specifies the java classes that will translate and map your JNDI requests to the physical media you're accessing. This could be classes that know how to traverse a filesystem, or an LDAP instance, or a J2EE server. In the Sun tutorial, they use the following class to examine the filesystem of a local computer:
    env.put(Context.INITIAL_CONTEXT_FACTORY,
        "com.sun.jndi.fscontext.FSContextFactory");So, to answer your question, NO, you do not need another naming and directory server. The J2EE server will have all the infrastructure in place to handle your request for the EJB. How are you requesting your EJB? If it's from a webapp within the J2EE server or another EJB, you may not need to specify any of the above mentioned information, and you may be able to get by with just InitialContext context = new InitialContext();.
    If you're trying to reference the EJB from a standalone application, you'll need to specify both the PROVIDER_URL and INITIAL_CONTEXT_FACTORY. You may also need to provide the SECURITY_PRINCIPAL (username) and SECURITY_CREDENTIALS (password) as well.
    Let me know exactly how you're trying to access your EJB and I may be able to help your further.
    Thanks,
    Perry Tew

  • SASL Authentication...again...

    Last time i posted this question:
    While using iDS 5.1 and a test user "uid=jdoe,ou=xxx,o=xxx" we've been getting same results over and over again: Authentication failed. Passwords are being set to CLEARTEXT, user being created using default user template so it contains the userpassword-attribute, and in the Java-code we've been using MD5 Digest authentication 'cause that's the method it supports. This is what is being done in the code:
    1. Client connects server using ldapHost and ldapPort.
    2. Hashtable "env" is being constructed.
    3. Environment properties INITIAL_CONTEXT_FACTORY, PROVIDER_URL, SECURITY_PRINCIPAL and SECURITY_CREDENTIALS of context are being specified.
    4. if ldapconnection.isauthenticated() is TRUE, print "success", else print "failed".
    All environment properties are of course used via env.put(context.property_name, "value");
    Is this it? What else should it do? All values match the ones being set in DS. Still authentication fails. "
    We still have this problem but the thing that has come up is the supportedSASLMechanisms gives "no attributes" if asked with database name, but gives correct values when asked just with IP-address of server. To make long story short, this works:
    Attributes attrs = ctx.getAttributes("ldap://<ip-address>"new String[]{"supportedSASLMechanisms"});
    System.out.println(attrs);
    This doesn't work:
    Attributes attrs = ctx.getAttributes("ldap://<ip-address>/o=<organization>"new String[]{"supportedSASLMechanisms"});
    System.out.println(attrs);
    Is there a access control in NetscapeRoot that differs from our database controls that makes this happen?

    I think I have get little bit closer to get SASL authentication work, but now my program throws this kind of exception:
    javax.naming.AuthenticationException: SASL authentication failed. Root exception is java.lang.NoSuchMethodError
    at com.sun.jndi.ldap.sasl.LdapSasl.saslBind(LdapSasl.java:116)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.sun.jndi.ldap.LdapClient.saslBind(LdapClient.java:369)
    at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:185)
    at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2386)
    at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:239)
    at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:74)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:660)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
    at javax.naming.InitialContext.init(InitialContext.java:217)
    at javax.naming.InitialContext.<init>(InitialContext.java:193)
    at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:78)
    My code (I'm using jdk1.3.1):
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.Hashtable;
    class DigestTesti {
    public static void main(String[] args) {
         Hashtable env = new Hashtable();
         env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, "ldap://000.000.000.000:000");
         env.put(Context.SECURITY_AUTHENTICATION, "DIGEST-MD5");
         env.put(Context.SECURITY_PRINCIPAL, "dn:uid=JDoe,ou=...,o=...,dc=..., dc=...");
         env.put(Context.SECURITY_CREDENTIALS, "...");
         env.put("java.naming.security.sasl.realm", "...");
         try {
         DirContext ctx = new InitialDirContext(env);
         System.out.println(ctx);
         } catch (NamingException e) {
         e.printStackTrace();
    What could been wrong with my code?
    Regards,
    Janne

  • SASL-authentication

    While using iDS 5.1 and a test user "uid=jdoe,ou=xxx,o=xxx" we've been getting same results over and over again: Authentication failed. Passwords are being set to CLEARTEXT, user being created using default user template so it contains the userpassword-attribute, and in the Java-code we've been using MD5 Digest authentication 'cause that's the method it supports. This is what is being done in the code:
    1. Client connects server using ldapHost and ldapPort.
    2. Hashtable "env" is being constructed.
    3. Environment properties INITIAL_CONTEXT_FACTORY, PROVIDER_URL, SECURITY_PRINCIPAL and SECURITY_CREDENTIALS of context are being specified.
    4. if ldapconnection.isauthenticated() is TRUE, print "success", else print "failed".
    All environment properties are of course used via env.put(context.property_name, "value");
    Is this it? What else should it do? All values match the ones being set in DS. Still authentication fails.

    Some update, i got it working with SSL disabled.

  • What are context properties to use with sun imq ?

    Hi
    Thank you for reading my post.
    what are Context properties that we should use to connect an application to sun IMQ ?
    I mean :
    INITIAL_CONTEXT_FACTORY
    PROVIDER_URL
    Thanks

    You can purchase music using multiple accounts within the same Windows profile & using the same iTunes library. I think when you log into the store it remembers the last account name used, but provided you don't let it remember your password then you have the opportunity to enter the correct details for each purchase.
    If you're going to place these purchases on your respective iPod's the following may help.
    *How to use multiple iPods with one computer*
    The Apple support document How to use multiple iPods with one computer suggests a number of ways. I use method two (Sync with selected playlists) with a slight twist. Rather than regular playlists I set the grouping field to indicate which users should receive which tracks and create smart playlists based on the content of this field.
    e.g.
    "Alice's Tracks" is "Grouping contains Alice" + "Kind contains audio"
    "Bob's Videos" is "Grouping contains Bob" + "Kind does not contain audio"
    Tracks that both Alice & Bob want on their iPods have the grouping set to "Alice/Bob"
    etc.
    I currently manage our family's five iPods using this system, each getting a different selection to suit their tastes and the capacity of their iPod. An advantage of using the grouping field is that it is stored in file tags (for non-wav audio files anyway) so that it is relatively easy to recreate the playlists should the iTunes library get trashed. Also useful if you move files about manually as playlist membership is preserved when you delete & re-import the tracks.
    tt2

  • Remote client accessing ejb - question

    This may be a very simplistic question, but here goes -
    scenario: I have a J2EE application running on a server Y with session beans/entity beans.
    I need a remote client on machine X to access EJB objects on Y.
    I have set the initial conext with INITIAL_CONTEXT_FACTORY, PROVIDER_URL etc...
    But, in order to narrow the reference of the object returned by lookup() method, I need to instantiate the Home object of my session (or entity) bean ...
    here's my problem: How do I instantiate EJBHomeInterface or EJBRemoteInterface, when they do not exist on the remote client machine?? (does this have something to do with the stub??)
    THANKS!

    This answer assumes you're using Weblogic, although most any other EJB container has a facility for this. Basically you need to distribute a client jar file with the client. This client jar is created during the EJB compile/deployment process and creates a jar separate from the normal jar file associated with your deployment. This jar file contains the class stubs you need to call for and use EJB's on a remote client.
    I hope this makes some sense.
    SeanB

  • Stand-Alone JMS SAF Client

    Im interested in using a WL Stand-Alone JMS SAF Client to send messages to a server-side JMS destination,
              regardless of the servers availability.
              This is for a J2SE Swing Application. There currently is no app server interaction.
              I found the doc http://e-docs.bea.com/wls/docs92/client/saf_client.html
              It describes almost everything except for what the actual client will look like.
              Im stuck after "Modify Your JMS Client Applications.." section.
              Questions:
              A) Suggestions for other docs?
              B) Is anyone using a Stand-Alone JMS SAF Client?
              C) Does anyone know of any code examples?
              The odd thing is that a search on the net for "JMS SAF Client" or variants of yields nothing other than the WL docs...
              Thanks!

    I could not make stand-alone jms saf client work. Followed the doc, created ClientSAF.xml, made the change for intial-context factory. Tried using with provider_url and without it.
              I am not using default queue and connection factory. The client code is working fine when I don't use saf, i.e. "weblogic.jndi.WLInitialContextFactory" and provider_url.
              Getting following error:
              javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassCastException: weblogic.security.service.SubjectManagerImpl]
                   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 weblogic.jms.safclient.agent.internal.ClientEnvironmentImpl.getContext(ClientEnvironmentImpl.java:76)
                   at weblogic.jms.forwarder.Forwarder.getInitialContext(Forwarder.java:334)
                   at weblogic.jms.forwarder.Forwarder.reconnect(Forwarder.java:210)
                   at weblogic.jms.forwarder.Forwarder.timerExpired(Forwarder.java:265)
                   at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:259)
                   at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
              Caused by: java.lang.ClassCastException: weblogic.security.service.SubjectManagerImpl
                   at weblogic.corba.client.ClientORBInitializer.initialize(ClientORBInitializer.java:106)
                   at weblogic.jndi.WLInitialContextFactory.<init>(WLInitialContextFactory.java:29)
                   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)
                   ... 12 more
              java.lang.ClassCastException: weblogic.security.service.SubjectManagerImpl
                   at weblogic.corba.client.ClientORBInitializer.initialize(ClientORBInitializer.java:106)
                   at weblogic.jndi.WLInitialContextFactory.<init>(WLInitialContextFactory.java:29)
                   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)Stack level 1
                   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)
                   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 weblogic.jms.safclient.agent.internal.ClientEnvironmentImpl.getContext(ClientEnvironmentImpl.java:76)
                   at weblogic.jms.forwarder.Forwarder.getInitialContext(Forwarder.java:334)
                   at weblogic.jms.forwarder.Forwarder.reconnect(Forwarder.java:210)
                   at weblogic.jms.forwarder.Forwarder.timerExpired(Forwarder.java:265)
                   at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:259)
                   at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
              disconnect stack trace finished
              QUEUE NAME: jmssysmodule-ois!oisQueue

  • Test client pinned to single node in production

    WL 6.1 sp2, Solaris 2.8
              Currently we have a bunch of SLSBs deployed in cluster out in production and
              a web tier that usually gets and invokes a single SLSB, and they're running
              happily. But everyone once in a while, we get an asymmetrical exception,
              where one node in the cluster is giving us bad results. What I like to do
              is write some simple test clients that can pin to a particular node and
              diagnose just that node while the regular client (web tier) still
              round-robins in production.
              Our SLSBs do not have <stateless-clustering> elemements at all in
              weblogic-ejb-jar.xml, so <stateless-bean-is-clusterable> defaults to true.
              My understanding is this means WL will round robin at 3 different levels:
              jndi Context, EJBHome and EJBObject, unless server-client is co-located in
              which WL will always pick the local object.
              What I have tried to do is to write the test client with a single url in
              PROVIDER_URL
              and PIN_TO_PRIMARY_SERVER set to true in InitialContext construction. This
              does not seem to work; by the time I get the EJBHome, create the EJBObject
              and invoke a test method, I see round-robin occuring. I can understand a
              reason FOR this behavior, and a counter-argument AGAINST this behavior. The
              reason why WL is still round-robining is because only the Context is pinned
              to the primary server; subsequent EJBHome and EJBObject are cluster-aware,
              and hence will round-robin, which in fact it is doing. But then the reason
              against this observation is that once I retrieve InitialContext, the
              subsequent EJBHome and EJBObject are all available locally. So shouldn't WL
              do co-location optimization and hence never round-robin???
              Here are some alternative framework I've thought up so I can write a test
              client that pins to a specific ejb server:
              1) Create a second set of DD's in weblogic-ejb-jar.xml, this time setting
              stateless-bean-is-clusterable to false, and have the test client us this for
              pinning.
              2) Expose a co-located servlet that will accept ejb invocation (via SOAP or
              customized RPC). Servlet invocation will always be ip-specific, and
              hopefully co-location of web and ejb tier will
              Problem with #1 is 2 sets of DD's, hence 2 sets of EJBHomes/Objects that
              behave slightly differently.
              Problem with #2 is the complexity of a new web tier just for pinning, which
              then also means the test client doesn't exactly replicate my actual web
              client calls.
              Is there a simple solution to isolate and diagnose a single node in a
              production cluster? Am I missing something? Much appreciated!
              Gene
              

    WL 6.1 sp2, Solaris 2.8
              Currently we have a bunch of SLSBs deployed in cluster out in production and
              a web tier that usually gets and invokes a single SLSB, and they're running
              happily. But everyone once in a while, we get an asymmetrical exception,
              where one node in the cluster is giving us bad results. What I like to do
              is write some simple test clients that can pin to a particular node and
              diagnose just that node while the regular client (web tier) still
              round-robins in production.
              Our SLSBs do not have <stateless-clustering> elemements at all in
              weblogic-ejb-jar.xml, so <stateless-bean-is-clusterable> defaults to true.
              My understanding is this means WL will round robin at 3 different levels:
              jndi Context, EJBHome and EJBObject, unless server-client is co-located in
              which WL will always pick the local object.
              What I have tried to do is to write the test client with a single url in
              PROVIDER_URL
              and PIN_TO_PRIMARY_SERVER set to true in InitialContext construction. This
              does not seem to work; by the time I get the EJBHome, create the EJBObject
              and invoke a test method, I see round-robin occuring. I can understand a
              reason FOR this behavior, and a counter-argument AGAINST this behavior. The
              reason why WL is still round-robining is because only the Context is pinned
              to the primary server; subsequent EJBHome and EJBObject are cluster-aware,
              and hence will round-robin, which in fact it is doing. But then the reason
              against this observation is that once I retrieve InitialContext, the
              subsequent EJBHome and EJBObject are all available locally. So shouldn't WL
              do co-location optimization and hence never round-robin???
              Here are some alternative framework I've thought up so I can write a test
              client that pins to a specific ejb server:
              1) Create a second set of DD's in weblogic-ejb-jar.xml, this time setting
              stateless-bean-is-clusterable to false, and have the test client us this for
              pinning.
              2) Expose a co-located servlet that will accept ejb invocation (via SOAP or
              customized RPC). Servlet invocation will always be ip-specific, and
              hopefully co-location of web and ejb tier will
              Problem with #1 is 2 sets of DD's, hence 2 sets of EJBHomes/Objects that
              behave slightly differently.
              Problem with #2 is the complexity of a new web tier just for pinning, which
              then also means the test client doesn't exactly replicate my actual web
              client calls.
              Is there a simple solution to isolate and diagnose a single node in a
              production cluster? Am I missing something? Much appreciated!
              Gene
              

  • Connecting to the cluster

    Hi,
              I have a cluster running on a multihomed Solaris Server. It is made of two
              servers running on IP1 and IP2 (both using port 7001). It says in the
              documentation that I can put in the IPs of the two servers separated by a
              comma for the cluster address. So the address that I put in was
              "IP1:7001,IP2:7001" instead of a DNS name.
              How do I connect to the cluster. If I connect to IP1:7001 then I am
              connecting to the server and not the cluster, correct?
              I would appreciate any help,
              Mohammad
              

    Sorry for the delay, I have been extremely busy...
              There are several alternatives -- DNS round-robin, hardware load balancers
              (e.g., Cisco LocalDirector), etc.
              Mica Cooper wrote:
              > Robert,
              >
              > WLBS is Windows Load Balancing Service. It was designed to only use 1 IP per
              > box. It comes on the server editions. Do you know of something else? Linux
              > or Solaris maybe?
              >
              > Mica
              >
              > "Robert Patrick" <[email protected]> wrote in message
              > news:[email protected]...
              > > Hi,
              > >
              > > I'm not sure what WLBS is but I guess my question is does it really need
              > to know
              > > that the IP addresses happen to point to the same machine? What happens
              > if you
              > > just tell it that there are twice as many machines as there really are?
              > >
              > > Robert
              > >
              > > Mica Cooper wrote:
              > >
              > > > Currently,
              > > > I am using WLBS to do the load balancing and it will only handle one IP
              > per
              > > > box. Do you know of any other software to do this?
              > > > Mica
              > > >
              > > > "Robert Patrick" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > The real answer here is that the "cluster" is virtual -- it only
              > exists
              > > > because
              > > > > there are one or more server instances running. Regardless of how you
              > > > attain
              > > > > it, you are going to connect to one or more of the server instances.
              > > > There are
              > > > > several ways to do this as has been previously discussed (e.g., DNS
              > alias
              > > > that
              > > > > does DNS round-robin-style load-balancing, a comma-separated list of
              > IP
              > > > > addresses, etc.).
              > > > >
              > > > > Mica, as for your question, you need to teach your "load-balancing IP"
              > > > about all
              > > > > of the IP addresses for the servers in the cluster and not just "one
              > IP
              > > > per
              > > > > physical machine".
              > > > >
              > > > > Hope this helps,
              > > > > Robert
              > > > >
              > > > > Mica Cooper wrote:
              > > > >
              > > > > > Tao,
              > > > > >
              > > > > > Thats not what he is asking.
              > > > > >
              > > > > > He's asking how to call MyServerClusterName instead of trying to
              > call
              > > > > > different instances by IP. I would like to know how to do this also.
              > > > > > Currently we are calling a load balancing IP and it proxies to each
              > > > instance
              > > > > > but it only works for 1 instance per box and I need 2 instances per
              > box.
              > > > > >
              > > > > > Mica Cooper
              > > > > >
              > > > > > "Tao Zhang" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > > > If you don't use DNS, you can write the IP1:7001,IP2:7001 in your
              > > > > > > PROVIDER_URL, and then transfer it to InitialContext.
              > > > > > >
              > > > > > >
              > > > > > > Mohammad Khan <[email protected]> wrote in message
              > > > > > > news:[email protected]...
              > > > > > > > Hi,
              > > > > > > >
              > > > > > > > I have a cluster running on a multihomed Solaris Server. It is
              > made
              > > > of
              > > > > > two
              > > > > > > > servers running on IP1 and IP2 (both using port 7001). It says
              > in
              > > > the
              > > > > > > > documentation that I can put in the IPs of the two servers
              > separated
              > > > by
              > > > > > a
              > > > > > > > comma for the cluster address. So the address that I put in was
              > > > > > > > "IP1:7001,IP2:7001" instead of a DNS name.
              > > > > > > >
              > > > > > > > How do I connect to the cluster. If I connect to IP1:7001 then I
              > am
              > > > > > > > connecting to the server and not the cluster, correct?
              > > > > > > >
              > > > > > > > I would appreciate any help,
              > > > > > > > Mohammad
              > > > > > > >
              > > > > > > >
              > > > > > > >
              > > > > > >
              > > > > > >
              > > > >
              > >
              

Maybe you are looking for

  • Challenging:How can I COMBINE two CWIMAQPoints Collection in one - URGENT

    I have two CWIMAQPoints collections and I want to combine them in one CWIMAQPoints in order to pass it as an argument to another function. In order to do this I would like to avoid using a loop in where I would add each item one-by-one. I would appre

  • The transferring of mp3 to Creative Zen Style 100 stops

    Hello, several weeks ago i bought Creative Zen Style 00. Everything worked perfectly for the first 2 times (I mean the transferring from PC to the player) but then something went wrong - it transfers or a few songs from the album and then it stops (s

  • Putting my Seconf JFrame on Top of First ...

    hi my application has a main JFrame and once a button on that JFrame is clicked ... another JFRame is opened ... My problem is that i want my second JFrame on top of the first JFrame .. but what is happeining is that the seconf JFrame goes on the bac

  • APEX 4 Bug: Wrong quickpicks in Item Page's Read Only section

    This bug is an easy one In Edit Page Item page, Read Only section, the predefined option list (now quickpicks) is as follows: [PL/SQL] [item=value] [item not null] [request=e1] [page in] [page not in] [exists] [none] [never] But if you look carefully

  • Oracle SES - URL issue in PeopleSoft

    Hi, I have installed PeopleSoft search framework in PT8.52 version. Howevere, When I try to click the search result from the OSES, I can able to get the result but with wrong URL. http://10.287.xx.xxx:8080/psc/EMPLOYEE/PSFT_EP/q/?ICAction=ICQryNameUR