Call weblogic EJB without using weblogic.jndi.T3InitialContextFactory

I am trying to call an ejb on a weblogic server without using weblogic.jndi.T3InitialContextFactory.
The context retrieval is as follows:
Properties table = new Properties();
table.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
table.put(Context.PROVIDER_URL, "iiop://localhost:7001");
Context context = new InitialContext(table);
return context;
but when I run the client I am getting the follwing error:
javax.naming.CommunicationException: Cannot connect to ORB [Root exception is org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No]
at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:362)
at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl(CNCtx.java:289)
at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:245)
at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:209)
at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.test.TestDirectDocumentLoad.getContext(TestDirectDocumentLoad.java:59)
at com.test.TestDirectDocumentLoad.loadDocs(TestDirectDocumentLoad.java:139)
at com.test.TestDirectDocumentLoad.main(TestDirectDocumentLoad.java:116)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:173)
at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
at com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:652)
at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:594)
at com.sun.corba.se.internal.corba.InitialNamingClient.resolve(InitialNamingClient.java:1105)
at com.sun.corba.se.internal.corba.InitialNamingClient.resolveUsingBootstrapProtocol(InitialNamingClient.java:788)
at com.sun.corba.se.internal.corba.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:1186)
at com.sun.corba.se.internal.corba.InitialNamingClient.resolve_initial_references(InitialNamingClient.java:1079)
at com.sun.corba.se.internal.corba.ORB.resolve_initial_references(ORB.java:2436)
at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:340)
... 12 more
I have the J2EE jar on the client path and all....but can't get through this error
need help guys!
Samir

Samir j <> writes:
Make sure IIOP is enabled on the server side. There was a bug in
earlier 8.1 config wizards that defaulted it to off.
andy
I am trying to call an ejb on a weblogic server without using weblogic.jndi.T3InitialContextFactory.
The context retrieval is as follows:
Properties table = new Properties();
table.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
table.put(Context.PROVIDER_URL, "iiop://localhost:7001");
Context context = new InitialContext(table);
return context;
but when I run the client I am getting the follwing error:
javax.naming.CommunicationException: Cannot connect to ORB [Root exception is org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No]
at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:362)
at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl(CNCtx.java:289)
at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:245)
at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:209)
at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.test.TestDirectDocumentLoad.getContext(TestDirectDocumentLoad.java:59)
at com.test.TestDirectDocumentLoad.loadDocs(TestDirectDocumentLoad.java:139)
at com.test.TestDirectDocumentLoad.main(TestDirectDocumentLoad.java:116)
Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:173)
at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
at com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:652)
at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:594)
at com.sun.corba.se.internal.corba.InitialNamingClient.resolve(InitialNamingClient.java:1105)
at com.sun.corba.se.internal.corba.InitialNamingClient.resolveUsingBootstrapProtocol(InitialNamingClient.java:788)
at com.sun.corba.se.internal.corba.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:1186)
at com.sun.corba.se.internal.corba.InitialNamingClient.resolve_initial_references(InitialNamingClient.java:1079)
at com.sun.corba.se.internal.corba.ORB.resolve_initial_references(ORB.java:2436)
at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:340)
... 12 more
I have the J2EE jar on the client path and all....but can't get through this error
need help guys!
Samir

Similar Messages

  • Can I create a "UPSERT" Service which calls 2 services without using BPM ??

    Hi all,
    I'm on PI 7.10 and have the following problem.
    I want to Upsert (Update or Insert) an Account into a 3rd Party System.
    The third party system does not have one web service that does this, instead it has
    Update -> Will update an existing account (but will not create it if it's not there)
    Create -> Will create a new account (but will not update it if it is there).
    I have created a generic Service Interface (abstract, synchronous).
    I have created two operation mappings (create, update).
    I want to
    Call the update service
    If it succeeds
      respond with success
    Else (if it fails)
       Call create service
       If it succeeds
          respond with success
       else
        respond with failure.
    I ideally want to do this without using a BPM and was thinking there may be a way to call multiple operations sequentially.
    Can you do this by
    Mutliple operation in the Service Interface?
    Multiple operations in the Operation Mapping?
    Is there another way without using a BPM?
    Ideally I'm looking for a link to an article or help documentation describing how to do this.
    Thanks in advance for your help.
    Regards,
    John

    I think BPM will be required in this case.
    Your requirement is to perform Insert OR Update.....insert and update actions depending on result of each other.
    first send a Insert request to the target system and get back the response...depending on the response decide if the record was inserted or if there is a record already present and if present then send a Update request from the BPM.
    Check how your webservice responds back....you mentioned that SUccess or Failure is to be communicated....from where should this be send...is the WS sending it or should PI send it?
    Other way would be to make use SOAP lookup and perform valiudation in Mapping based on response of the lookup.
    I am doubtful if Multiple Operations will help you in getting this requirement done.
    Regards,
    Abhishek.

  • Deploy ejbs without using deployment tool in J2EE server

    Hi,
    IS there any way to deploy ejbs in J2EE without using the deployment tool? I am using the j2ee 1.2.1.
    Thanks,
    Nipa

    When I was in my companies Java Boot Camp (6 week fulltime training in Java technologies) the class was split about 75/25 with 75% of the class using a deployment tool (I think it was WebGain). The other 25% did not use a deployment tool. I was one of the 25%.
    What we did was write a Perl script that took care of all the necessary deployment steps. It has been awhile, and I no longer work for that company, but I'll try and dig up some of those scripts. (Can't promise I'll find them!)
    BTW, the 25% group deployed more EJBs with less problems than those using the deployment tool...

  • ViewController to call deployed EJB JAR on WLS

    Hi,
    I have Model project containing EJB deployed into WLS as EJB JAR file.
    I need to create another application for the View and reference the deployed EJB JAR.
    The idea is to call remote EJB without having and any project dependencies.
    Can you please advice on how it can be done.
    Thank you in advance
    Emile

    Hi Frank,
    The Model is only EJB.
    The View only contains ADF Faces (no bindings , no page def , no datacontrol).
    Please consider it as urgent
    Thank you for your reply
    Edited by: ebitar on Oct 12, 2011 9:46 AM

  • Error in Calling Weblogic EJB's from JRun servlet engine

    I am using servlets in Jrun engines to callEJB's running on a WebLogic Server. I have included "c:\weblogic\classes" in Jrun classpath. But i am getting the following error. Does any body have any idea what this may be??javax.servlet.ServletException: com/sun/java/util/collections/ArrayListjava.lang.NoClassDefFoundError: com/sun/java/util/collections/ArrayListat weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:193)at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:148)at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:123)at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)at javax.naming.InitialContext.init(InitialContext.java:222)at javax.naming.InitialContext.(InitialContext.java:198)

    First off, wrong forum section.
    Check if your JNDI name is correctly placed for the bean you're calling -- check j2ee-engine.xml for that. Check the EJB container if the ear file you deployed is there and updated.
    Try placing  "localejbs/JNDI name" on your lookup parameter.
    Regards,
    Jan

  • Calling an ejb from glassfish to weblogic server

    I'd like to be able to call a stateless session bean from a glassfishV3 server that is residing on weblogic 9.2.3. (Ejb spec 2.1 NOT 3.0 please)
    I've done this successfully from Tomcat to weblogic, but there are a few hiccups when trying this on glassfish.
    Basically what I've attempted is this:
    1.) I add these jvm properties to the glassfish startup:
    -Dorg.omg.CORBA.ORBClass=weblogic.corba.orb.ORB
    -Dorg.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB
    -Djavax.rmi.CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl
    -Djavax.rmi.CORBA.UtilClass=weblogic.iiop.UtilDelegateImpl
    2.) Copy weblogic.jar, tools.jar, and webservices.jar from the weblogic/server/lib directory to the glassfish lib/ext directory
    ...glassfish won't start then because of the weblogic.jar...
    3.) Move the weblogic.jar to the WEB-INF/lib directory of my war in glassfish.
    Now I try it and get:
    (I'm skipping some of the stacktrace at the start)
    .....java.lang.IllegalAccessError: tried to access method weblogic.kernel.KernelStatus.initialized()V from class weblogic.kernel.Kernel at weblogic.kernel.Kernel.ensureInitialized......
    I'm guessing that this has to do with the "weblogic kernel" not being initialized. So now I'm stuck.
    Am I going down the wrong path?
    I've also tried these other proposed solutions:
    1.) Changing the connection properties of the InitialContext to use these properties:
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, "t3://localhost:7001");
    env.put(Context.SECURITY_PRINCIPAL, "weblogic");
    env.put(Context.SECURITY_CREDENTIALS, "weblogic");
    2.) Using RMI over IIOP instead of T3.
    None of these with any luck.
    If anyone has done this successfully I'd appreciate some insight.
    Regards,
    Eric

    I'd like to be able to call a stateless session bean from a glassfishV3 server that is residing on weblogic 9.2.3. (Ejb spec 2.1 NOT 3.0 please)
    I've done this successfully from Tomcat to weblogic, but there are a few hiccups when trying this on glassfish.
    Basically what I've attempted is this:
    1.) I add these jvm properties to the glassfish startup:
    -Dorg.omg.CORBA.ORBClass=weblogic.corba.orb.ORB
    -Dorg.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB
    -Djavax.rmi.CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl
    -Djavax.rmi.CORBA.UtilClass=weblogic.iiop.UtilDelegateImpl
    2.) Copy weblogic.jar, tools.jar, and webservices.jar from the weblogic/server/lib directory to the glassfish lib/ext directory
    ...glassfish won't start then because of the weblogic.jar...
    3.) Move the weblogic.jar to the WEB-INF/lib directory of my war in glassfish.
    Now I try it and get:
    (I'm skipping some of the stacktrace at the start)
    .....java.lang.IllegalAccessError: tried to access method weblogic.kernel.KernelStatus.initialized()V from class weblogic.kernel.Kernel at weblogic.kernel.Kernel.ensureInitialized......
    I'm guessing that this has to do with the "weblogic kernel" not being initialized. So now I'm stuck.
    Am I going down the wrong path?
    I've also tried these other proposed solutions:
    1.) Changing the connection properties of the InitialContext to use these properties:
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, "t3://localhost:7001");
    env.put(Context.SECURITY_PRINCIPAL, "weblogic");
    env.put(Context.SECURITY_CREDENTIALS, "weblogic");
    2.) Using RMI over IIOP instead of T3.
    None of these with any luck.
    If anyone has done this successfully I'd appreciate some insight.
    Regards,
    Eric

  • Help: I'm sure it is a Bug in JNI calling WebLogic EJB

    Help me! I'm using jni to call weblogic EJB from a Com+ component,here is the code:
    // This is the main project file for VC++ application project
    // generated using an Application Wizard.
    #include "stdafx.h"
    #pragma unmanaged
    #include <windows.h>
    #include <jni.h>
    #include <process.h>
    #include <stdio.h>
    #define USER_CLASSPATH "C:\\myClasses;C:\\j2sdk1.4.0\\lib\\tools.jar;Z:\\wlserver6.1\\lib\\weblogic.jar;"
    /* where Prog.class is */
    JavaVM *jvm;
    * Function GetJNIEnv(void) returns the java environment pointer
    * in case we are executing on a thread other than the one the
    * jvm was created on.
    JNIEnv* GetJNIEnv(void){
         JNIEnv *env = NULL;
         jint nRet = jvm->GetEnv((void **)&env, JNI_VERSION_1_2);
         if(nRet == JNI_EDETACHED){
              jvm->AttachCurrentThread((void **)&env, NULL);
         return env;
    * Function DoJNDI(void *arg) uses the Java Invocation API to
    * execute the following Java code:
    * Hashtable prop = new Hashtable();
    * prop.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"
    * prop.put( Context.PROVIDER_URL, "t3://192.168.40.137:7001" );
    * ctxInitial = new InitialDirContext( prop );
    void DoJNDI(void *arg){
         jclass clsHash, clsInitDirCx;
         jmethodID mHashInit, mHashPut, mInitDirCxInit;
         jobject objHash, objInitDirCx;
         JNIEnv *env = GetJNIEnv(); // Get the environment if on a different thread
         clsHash = env->FindClass("java/util/Hashtable");
         mHashInit = env->GetMethodID(clsHash, "<init>", "()V");
         objHash = env->NewObject(clsHash, mHashInit);
         mHashPut = env->GetMethodID(clsHash, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
         jstring jstrICxFactoryPut = env->NewStringUTF("java.naming.factory.initial");
         jstring jstrICxFactoryVal = env->NewStringUTF("weblogic.jndi.WLInitialContextFactory");
         env->CallObjectMethod(objHash, mHashPut, jstrICxFactoryPut,jstrICxFactoryVal);
         jstring jstrProviderUrlPut = env->NewStringUTF("java.naming.provider.url");
         jstring jstrProviderUrlVal = env->NewStringUTF("t3://192.168.40.137:7001");
         env->CallObjectMethod(objHash, mHashPut, jstrProviderUrlPut,jstrProviderUrlVal);
         clsInitDirCx = env->FindClass("javax/naming/InitialContext");
         mInitDirCxInit = env->GetMethodID(clsInitDirCx, "<init>", "(Ljava/util/Hashtable;)V");
         objInitDirCx = env->NewObject(clsInitDirCx, mInitDirCxInit, objHash);
         if(objInitDirCx == NULL){
              printf("%s test FAILED:\n\n", (char*)arg);
         else{
              printf("%s test PASSED\n\n", (char*)arg);
         jvm->DetachCurrentThread();
    * Function main(void) creates a JVM, and calls DoJNDI twice:
    * Once as a regular function call, and once as a spun off thread.
    void main() {
    JavaVMInitArgs vm_args;
    JavaVMOption options[5];
         options[0].optionString = "-client";
    options[1].optionString =
    "-cp " USER_CLASSPATH;
    options[2].optionString =
    "-Djava.class.path=" USER_CLASSPATH;
         //options[3].optionString =
         //     "-Xbootclasspath:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;z:\\wlserver6.1\\lib\\weblogic.jar;";
         options[3].optionString =
              "-Xbootclasspath/a:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
         options[4].optionString =
              "-Xbootclasspath/p:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 5;
    vm_args.ignoreUnrecognized = JNI_TRUE;
         JNIEnv *env;
         jint res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
         // *** Make the magic calls! (Both lines should do the same thing) ***
         DoJNDI((void*)"Function call");
         _beginthread(DoJNDI,0,(void *)"Thread call");
         /* wait for thread(s) to finish */
         Sleep(5000);
         jvm->DestroyJavaVM();
    But it always send me a Exception like below:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory.
    Root exception is java.lang.ClassNotFoundException: weblogic/jndi/WLInitialContextFactory
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:207)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    when I search this problem in java.sun.com,an article announce that it is a bug that
    JNDI not support multi-threads call,and it is fixed is JDK1.4 beta. The link is:
    http://developer.java.sun.com/developer/bugParade/bugs/4307751.html
    It seems that weblogic's JNDI is not support multi-thread call. what can i do?

    Try adding the following code before instantiating your initial context:
    Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader()
    This fixed the problem for me.
    -Brian
    "Edward Lu" <[email protected]> wrote:
    >
    Help me! I'm using jni to call weblogic EJB from a Com+ component,here is
    the code:
    // This is the main project file for VC++ application project
    // generated using an Application Wizard.
    #include "stdafx.h"
    #pragma unmanaged
    #include <windows.h>
    #include <jni.h>
    #include <process.h>
    #include <stdio.h>
    #define USER_CLASSPATH "C:\\myClasses;C:\\j2sdk1.4.0\\lib\\tools.jar;Z:\\wlserver6.1\\lib\\weblogic.jar;"
    /* where Prog.class is */
    JavaVM *jvm;
    * Function GetJNIEnv(void) returns the java environment pointer
    * in case we are executing on a thread other than the one the
    * jvm was created on.
    JNIEnv* GetJNIEnv(void){
         JNIEnv *env = NULL;
         jint nRet = jvm->GetEnv((void **)&env, JNI_VERSION_1_2);
         if(nRet == JNI_EDETACHED){
              jvm->AttachCurrentThread((void **)&env, NULL);
         return env;
    * Function DoJNDI(void *arg) uses the Java Invocation API to
    * execute the following Java code:
    * Hashtable prop = new Hashtable();
    * prop.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"
    * prop.put( Context.PROVIDER_URL, "t3://192.168.40.137:7001" );
    * ctxInitial = new InitialDirContext( prop );
    void DoJNDI(void *arg){
         jclass clsHash, clsInitDirCx;
         jmethodID mHashInit, mHashPut, mInitDirCxInit;
         jobject objHash, objInitDirCx;
         JNIEnv *env = GetJNIEnv(); // Get the environment if on a different thread
         clsHash = env->FindClass("java/util/Hashtable");
         mHashInit = env->GetMethodID(clsHash, "<init>", "()V");
         objHash = env->NewObject(clsHash, mHashInit);
         mHashPut = env->GetMethodID(clsHash, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
         jstring jstrICxFactoryPut = env->NewStringUTF("java.naming.factory.initial");
         jstring jstrICxFactoryVal = env->NewStringUTF("weblogic.jndi.WLInitialContextFactory");
         env->CallObjectMethod(objHash, mHashPut, jstrICxFactoryPut,jstrICxFactoryVal);
         jstring jstrProviderUrlPut = env->NewStringUTF("java.naming.provider.url");
         jstring jstrProviderUrlVal = env->NewStringUTF("t3://192.168.40.137:7001");
         env->CallObjectMethod(objHash, mHashPut, jstrProviderUrlPut,jstrProviderUrlVal);
         clsInitDirCx = env->FindClass("javax/naming/InitialContext");
         mInitDirCxInit = env->GetMethodID(clsInitDirCx, "<init>", "(Ljava/util/Hashtable;)V");
         objInitDirCx = env->NewObject(clsInitDirCx, mInitDirCxInit, objHash);
         if(objInitDirCx == NULL){
              printf("%s test FAILED:\n\n", (char*)arg);
         else{
              printf("%s test PASSED\n\n", (char*)arg);
         jvm->DetachCurrentThread();
    * Function main(void) creates a JVM, and calls DoJNDI twice:
    * Once as a regular function call, and once as a spun off thread.
    void main() {
    JavaVMInitArgs vm_args;
    JavaVMOption options[5];
         options[0].optionString = "-client";
    options[1].optionString =
    "-cp " USER_CLASSPATH;
    options[2].optionString =
    "-Djava.class.path=" USER_CLASSPATH;
         //options[3].optionString =
         //     "-Xbootclasspath:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;z:\\wlserver6.1\\lib\\weblogic.jar;";
         options[3].optionString =
              "-Xbootclasspath/a:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
         options[4].optionString =
              "-Xbootclasspath/p:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 5;
    vm_args.ignoreUnrecognized = JNI_TRUE;
         JNIEnv *env;
         jint res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
         // *** Make the magic calls! (Both lines should do the same thing) ***
         DoJNDI((void*)"Function call");
         _beginthread(DoJNDI,0,(void *)"Thread call");
         /* wait for thread(s) to finish */
         Sleep(5000);
         jvm->DestroyJavaVM();
    But it always send me a Exception like below:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory.
    Root exception is java.lang.ClassNotFoundException: weblogic/jndi/WLInitialContextFactory
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:207)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    when I search this problem in java.sun.com,an article announce that it is
    a bug that
    JNDI not support multi-threads call,and it is fixed is JDK1.4 beta. The
    link is:
    http://developer.java.sun.com/developer/bugParade/bugs/4307751.html
    It seems that weblogic's JNDI is not support multi-thread call. what can
    i do?

  • Calling foreign EJB server from Weblogic

    Hi,
    I'm trying to invoke an EJB hosted in an old PowerTier EJB Container from an 8.1 SP5 hosted EJB, and I'm running in to problems. (PowerTier is based on the JBroker ORB)
    So far the only way I can get it to work is by replacing Weblogic's ORB implementation with the JBroker one:
    -Djavax.rmi.CORBA.StubClass=com.sssw.jbroker.rmi.StubDelegate
    -Djavax.rmi.CORBA.UtilClass=com.sssw.jbroker.rmi.UtilDelegate
    -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sssw.jbroker.rmi.PortableRemoteObjectDelegate
    But I'd like to avoid doing this if possible.
    So I'd like to get this to work using the WL RMI-IIOP implementation to integrate with the PowerTier/JBroker server.
    After looking at : http://forums.bea.com/bea/message.jspa?messageID=202437541&tstart=0
    I tried the following:
    Properties config = new Properties();
    config.setProperty(
    Context.PROVIDER_URL, "<b>iiop</b>://xxx.xxx.xxxxx.xxx:389/cn=Instance1,ou=Development,cn=Xxxx%20Xxxxxxx%20Xxxxx,ou=Components,cn=Xxxxxx%20Xxxx,ou=Applications,o=xxxxxxxx,c=uk");
    InitialContext context = new InitialContext(config);
    URL changed to protect the innocent - but format maintained.
    When the server executes this I get the following exception:
    javax.naming.InvalidNameException: url does not contain a port
    at weblogic.corba.j2ee.naming.NameParser.parseURL(NameParser.java:419)
    at weblogic.corba.j2ee.naming.ORBHelper.parseURL(ORBHelper.java:533)
    at weblogic.corba.j2ee.naming.ORBHelper.getORBReference(ORBHelper.java:440)
    at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:97)
    at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:42)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:135)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    Any idea what is causing this exception? If I replace the '%20' with a normal spaces it makes no difference.
    Am I going about this the right way?
    Thanks!

    Getting a bit closer now.
    The Object retreived from LDAP was a javax.naming.Reference - which contains the IOR for the Home interface.
    // Get IOR from LDAP
    InitialContext context;
    Hashtable config = new Hashtable();
    config.put(Context.PROVIDER_URL,"ldap://<host>:389/");
    config.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    context = new InitialContext(config);
    Reference reference = (Reference)context.lookup("<path to home>");
    // Get IOR from reference
    String ior = "" + reference.get(0).getContent();
    // Get WLS ORB
    ORB orb = (ORB)new InitialContext().lookup("java:comp/ORB");
    Object object = orb.string_to_object(ior);
    FooHome home = (FooHome)PortableRemoteObject.narrow(object, FooHome.class);
    Foo foo = home.create();
    // Everything works fine up to here.
    foo.invokeMethod(); // <-- This fails with the following exception :
    java.rmi.RemoteException: ; nested exception is:
    org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
    at weblogic.iiop.OutboundRequestImpl.sendReceive(OutboundRequestImpl.java:197)
    at weblogic.iiop.IIOPRemoteRef.invokeInternal(IIOPRemoteRef.java:205)
    at weblogic.iiop.IIOPRemoteRef.invoke(IIOPRemoteRef.java:153)
    at ztkt.pl.Foo_IIOP_WLStub.invokeMethod(Unknown Source)
    at com.xyz.ezs.wl.ejb.PLProxyBean.invoke(PLProxyBean.java:56)
    at com.xyz.ezs.wl.ejb.PLProxy_o3b3ao_EOImpl.invoke(PLProxy_o3b3ao_EOImpl.java:45)
    at com.xyz.ezs.wl.ejb.PLProxy_o3b3ao_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:492)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:435)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:430)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:306)
    at java.lang.Class.newInstance(Class.java:259)
    at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:337)
    at weblogic.iiop.InboundResponseImpl.getThrowable(InboundResponseImpl.java:62)
    at weblogic.iiop.OutboundRequestImpl.sendReceive(OutboundRequestImpl.java:179)
    ... 15 more
    (Method, class and package names changed.)
    Has anyone seen this before? Any idea what might be causing it?

  • How to get InitialContextFactory using RMI/IIOP without using weblogic.jar

    Hi Robert
    I know this is an old post. but I am interested in knowing how to get the
    initial context using RMI/IIOP without the use weblogic specific classes
    like weblogic.jndi.WLInitialContextFactory . If you have a code snippet that
    you can provide as an example, it would be just great.
    thanx in advance
    Daya Sharma
    See comments inline...
    Stewart Wachs wrote:
    I would like to get an initial context to Weblogic JNDI from a client.
    code snippet:
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFacorty");
    ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
    try {
    Context ctx = new InitialContext(ht);
    catch(...) {
    This works fine when I include weblogic.jar (and other dependend weblogic
    jar's) in the classpath.
    Is there a way to access WL JNDI from a client without the weblogicclasses
    in the classpath?If you are using WLS 6.1, you could use RMI/IIOP to do this but in general,
    the
    answer is no, you will need at least some of the weblogic classes on the
    client.
    If not, is there a lightweight jar available for distribution for client
    JNDI connectivity?This is something in the works. In addition, a colleague and I are working
    on
    a white paper that describes the "Thin Client Options with WebLogic Server"
    that we hope to make available in the not too distant future...
    Are there any licencing issues with distributing the weblogic classes to
    clients that need to access WL JNDI?No. WLS is licensed by the server so you are free to distribute
    weblogic.jar
    to your clients.
    Hope this helps,
    Robert

    Take a look at the RMI/IIOP section of our whitepaper "Small Footprint
    Client options for BEA WebLogic Server" at:
    http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
    Daya Sharma wrote:
    Hi Robert
    I know this is an old post. but I am interested in knowing how to get the
    initial context using RMI/IIOP without the use weblogic specific classes
    like weblogic.jndi.WLInitialContextFactory . If you have a code snippet that
    you can provide as an example, it would be just great.
    thanx in advance
    Daya Sharma
    See comments inline...
    Stewart Wachs wrote:
    I would like to get an initial context to Weblogic JNDI from a client.
    code snippet:
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFacorty");
    ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
    try {
    Context ctx = new InitialContext(ht);
    catch(...) {
    This works fine when I include weblogic.jar (and other dependend weblogic
    jar's) in the classpath.
    Is there a way to access WL JNDI from a client without the weblogic
    classes
    in the classpath?
    If you are using WLS 6.1, you could use RMI/IIOP to do this but in general,
    the
    answer is no, you will need at least some of the weblogic classes on the
    client.
    If not, is there a lightweight jar available for distribution for client
    JNDI connectivity?
    This is something in the works. In addition, a colleague and I are working
    on
    a white paper that describes the "Thin Client Options with WebLogic Server"
    that we hope to make available in the not too distant future...
    Are there any licencing issues with distributing the weblogic classes to
    clients that need to access WL JNDI?
    No. WLS is licensed by the server so you are free to distribute
    weblogic.jar
    to your clients.
    Hope this helps,
    Robert

  • Using a vendor specific datasource (oracel data source) to weblogic JNDI

    Hi !
    Is there can I use vendor specific datasource implementation such as oracle
    DataSource object and bind it to Weblogic JNDI so that I can create
    connection pools. Oracle Datasource let's you pass the user, password at
    run time like Datasource.getConnection(user,password).
    The reason is I need to access various oracle accounts within the same
    oracle instance and I need to add to connect with a new user account (when
    ever there is a new oracle user) without stopping the application server.
    If anybody knows any workrounds doing this in weblogic I would really
    appreciate it.
    Thanks,
    Srinivas

    Hi,
      You can create a JDBC DataSource using the Visual Administrator GUI as given in the link http://help.sap.com/saphelp_nw04/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/content.htm
      In your J2EE Application you can obtain the connection using InitialContext lookup for 'jdbc/<Alias Name>'.
      Also please select the correct SQL Engine option
    http://help.sap.com/saphelp_nw04/helpdata/en/45/ef362dc57b1e46aa6f445ec6247103/content.htm
    Regards,
    S.Divakar

  • Programming Weblogic with jmx without using weblogic api?

    Hi,
    I want to know if it is possible to program weblogic management service without
    using weblogic api but just rely on standard JMX interface and methods.
    Currently, I am relying on weblogic api weblogic.jndi.Environment and weblogic.management.MBeanHome
    interface to get the context and access the MBean Server subsystem. Can I find
    the equivalent using jmx?
    My code is as follows:
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(username);
    env.setSecurityCredentials(password);
    Context ctx = env.getInitialContext();
    MBeanHome home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    String domain = home.getDomainName();
    homeServer = home.getMBeanServer();
    Thank you.

    Hi Ryan,
    I have looked through the documentation.
    It told me that I need to use weblogic.management.MBeanHome interface to get MBeanHome
    and from there then I can only use jmx interface.
    I presume it is not possible not to use weblogic.jar if I want to establish the
    initial connection with Weblogic server?
    Thanks.
    ryan upton <[email protected]> wrote:
    YongLeong wrote:
    Hi,
    I want to know if it is possible to program weblogic management servicewithout
    using weblogic api but just rely on standard JMX interface and methods.
    Currently, I am relying on weblogic api weblogic.jndi.Environment andweblogic.management.MBeanHome
    interface to get the context and access the MBean Server subsystem.Can I find
    the equivalent using jmx?
    My code is as follows:
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(username);
    env.setSecurityCredentials(password);
    Context ctx = env.getInitialContext();
    MBeanHome home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    String domain = home.getDomainName();
    homeServer = home.getMBeanServer();
    Thank you.I think you'll find your answer here:
    http://edocs.bea.com/wls/docs81/jmx/index.html
    HTH
    ~Ryan

  • Clustered application without using EAR in WebLogic 6.0

              Hi,
              Is it possible to set-up a clustered application without using EAR files in WebLogic
              6.0.
              Please point me to instructions for the same.
              Thanks
              B.Srini
              

    Yep. Possible.
              refer bea docs
              "Srinivasan Bhoopathy" <[email protected]> wrote in message
              news:3c5e5815$[email protected]..
              >
              > Hi,
              >
              > Is it possible to set-up a clustered application without using EAR files
              in WebLogic
              > 6.0.
              >
              > Please point me to instructions for the same.
              >
              > Thanks
              > B.Srini
              

  • How to create Users/Roles for ldap in weblogic without using admin console

    Is it possible to create Users/Roles for ldap in weblogic without using admin console? if possible what are the files i need to modify in DefaultDomain?
    or is there any ant script for creating USers/Roles?
    Regards,
    Raghu.
    Edited by: user9942600 on Jul 2, 2009 1:00 AM
    Edited by: user9942600 on Jul 2, 2009 1:58 AM

    Hi..
    You can use wlst or jmx to perform all security config etc.. same as if it were perfomred from the admin console..
    .e.g. wlst create user
    ..after connecting to admin server
    serverConfig()
    cd("/SecurityConfiguration/your_domain_name/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator")
    cmo.createUser("userName","Password","UserDesc")
    ..for adding/configuring a role
    cd("/SecurityConfiguration/your_domain_name/Realms/myrealm/RoleMappers/XACMLRoleMapper")
    cmo.createRole('','roleName', 'userName')
    ...see the mbean docs for all the different attributes, operations etc..
    ..Mark.

  • Calling non ejb from ejb using jndi lookup

    Is it possible to call a non ejb java object from an ejb using a jndi lookup?
    For example, we have a java class where main registers itself with our application server (JBoss 3.0.1). We have a test client that can use jndi to look up the object, but we can't get an ejb inside the application server to use the object.
    Are we trying to do the impossible? If my question is not clear, please let me know so I can try to clarify.
    Thanks

    JNDI uses factories to create objects.
    It's possible that JBoss has a Bean Factory which you can use to create your instance.
    Tomcat has a Bean factory in its JNDI implementation. I use it just as you have indicated.
    The JBoss documenation may help?
    Dave

  • Calling BRM from UDF using JNDI lookup with @EJB annotation

    Hi Experts
    I am trying to implement a UDF to invoke my BRM Rules set via JNDI Lookup instead of a SOAP Channel lookup.
    I have had a look at the following links/docs:
    Calling BRM from UDF using Public API
    http://www.gleanster.com/system/resources/W1siZiIsIjIwMTIvMDgvMDcvMjAvNDcvNTAvNDMvVGhpbmdzX1lvdV9TaG91bGRfS25vd19hYm91dF9TQVBfTmV0V2VhdmVyX0JSTS5wZGYiXV0/Things%20You%20Should%20Know%20about%20SAP%20NetWeaver%20BRM.pdf
    For item 1 above, the example looks really good, but it doesnt explain how I get access to the following required imports from my UDF:
    import com.sap.brms.qrules.ejb.*;
    import com.sap.brms.qrules.engine.AbstractProject;
    import com.sap.brms.qrules.engine.RuleEngine;
    import com.sap.brms.qrules.engine.RulesetContext;
    import javax.ejb.EJB;
    The second document is really good as well, but I could not figure out how to get it to work from my UDF.
    So, can anyone help me to understand specifically what is required to get this to work?
    Is is possible to invoke the rule set from my UDF?
    How do I give my UDF access to all the required jars/imports?
    I have manage to create a new DC (Development Component) with a public part and this enables me to get my code to compile on my local PC but I am not able to activate it due to the server not having access to the same java packages as my local copy.
    Any help would be greatly appreciated.

    You resolve the dependency by importing the required jars with using the dependency tab for the mapping program.
    As stipulated before, I have managed to resolve the dependency issue but I have now getting the same error as in the forum: Calling BRM from UDF using Public API
    The specific error is:
    com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:238)
    Has anyome manage to get invoke a BRM Ruleset using JNDI?

Maybe you are looking for

  • 'Adjustment Brush' in CS5 Bridge

    The adjustment brush in my CS5 Bridge is no longer working. Can some offer me a solution?

  • Manually create WT in "Waiting" Status.

    Dear Experts, Is there a way we can create some kind of "Planned" warehouse tasks like we have WTs created in "Waiting"? We cannot use POSC for this. But we would like the Warehouse Tasks to be created in "Waiting" Status. These are required for TUs.

  • 'Resampling' images

    I'm using Photoshop Starter Edition 3.0 on Windows XP and I want to resize images (or 'resample') so that the image takes up less bandwidth when I upload it to a website. But I can't find any drop-down menus or links in the programme to resize. How d

  • How can scan coins for web use?

    How can scan coins for web use?

  • Restricting of Materials in a Sales order

    Hello, We want to keep a track of certain materials to make sure they are properly handled in the customer's warehouse. The requirement is as follows: - We will send an instruction letter whenever the customer first buys the material. - On receiving