JNDI-lookup without weblogic.jar?

Is it possible to do a JNDI lookup to the remove weblogic server (using the WLInitialcontextfactory)
without using the whole weblogic.jar in the classpath? It's about 30 megs which
is far too much. I tried using only few classes from the weblogic.jar, but there
were so many dependencies that I gave up. Any workarounds?

Hi,
Weblogic provides you a way to create client jar files so that the complete weblogic.jar
doesn't need to be downloaded to the client. See
http://e-docs.bea.com/wls/docs70/adminguide/utils.html#1117405
hope this helps,
pat
"Janne" <[email protected]> wrote:
>
Is it possible to do a JNDI lookup to the remove weblogic server (using
the WLInitialcontextfactory)
without using the whole weblogic.jar in the classpath? It's about 30
megs which
is far too much. I tried using only few classes from the weblogic.jar,
but there
were so many dependencies that I gave up. Any workarounds?

Similar Messages

  • JNDI lookup for weblogic.management.MBeanHome

    Tried to do JNDI lookup for MBeanHome. It could resolve
    weblogic.management, but not MBeanHome.
    Any idea? Thank you
    T. Pei
    PS
    The statement and the error message:
    MBeanHome mBeanHome = (MBeanHome) initialContext.lookup
    ("weblogic.management.MBeanHome.JNDI_NAME.MyServer");
    javax.naming.NameNotFoundException:
    Unable to resolve weblogic.management.MBeanHome.JNDI_NAME.MyServer
    Resolved: 'weblogic.management'
    Unresolved:'MBeanHome' ; remaining name 'JNDI_NAME.MyServer'

    I answered this in my last post, but to clarify your attempt below.
    you can access MBeanHome through JNDI in any of three ways that I
    currently know...
    MBeanHome mBeanHome =
    (MBeanHome)ctx.lookup("weblogic.management.adminhome");
    MBeanHome mBeanHome =
    (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    MBeanHome mBeanHome =
    (MBeanHome)ctx.lookup(MBeanHome.JNDI_NAME+"."+yourservername);
    typically yourservername = "myserver"
    when I print MBeanHome.ADMIN_JNDI_NAME I get
    "weblogic.management.adminhome"
    when I print MBeanHome.JNDI_NAME I get
    "weblogic.management.home"
    so using MBeanHome.JNDI_NAME+"."+yourservername is the same as
    "weblogic.management.home.myserver", if the server you are trying to access
    is called myserver.
    may be more information than you want.
    "T. Pei" <[email protected]> wrote in message
    news:3a7a1562$[email protected]..
    >
    Tried to do JNDI lookup for MBeanHome. It could resolve
    weblogic.management, but not MBeanHome.
    Any idea? Thank you
    T. Pei
    PS
    The statement and the error message:
    MBeanHome mBeanHome = (MBeanHome) initialContext.lookup
    ("weblogic.management.MBeanHome.JNDI_NAME.MyServer");
    javax.naming.NameNotFoundException:
    Unable to resolve weblogic.management.MBeanHome.JNDI_NAME.MyServer
    Resolved: 'weblogic.management'
    Unresolved:'MBeanHome' ; remaining name 'JNDI_NAME.MyServer'

  • Exception while a session been lookup on weblogic 10.3.3 using wlclient.jar

    Hi,
    I am upgrading to weblogic 10.3.3.
    I have a client that downloads the required to the client machines using Java web start 6.
    I am using wlclient.jar at the client side.
    When I am trying to lookup for a session bean it is throwing the below exception at the client side.
    java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:
    org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: No
    at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
    at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
    at com.mbt.expert.server.util._ServerDBQueryObjectRemote_Stub.getExchangeList(Unknown Source)
    at com.mbt.expert.util.DBQueryObject.getExchangeList(DBQueryObject.java:419)
    at com.mbt.expert.view.dialogs.OpenExchangeDialog.actionPerformed(OpenExchangeDialog.java:425)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.Dialog$1.run(Unknown Source)
    at java.awt.Dialog$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Unknown Source)
    at com.mbt.expert.view.dialogs.OpenExchangeDialog.displayDialog(OpenExchangeDialog.java:606)
    at com.mbt.expert.mdi.actions.OpenExchangeAction.execute(OpenExchangeAction.java:204)
    at com.mbt.mdi.MDICommand.actionPerformed(MDICommand.java:47)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: No
    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)
    at com.sun.corba.se.impl.protocol.gio pmsgheaders.MessageBase.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
    at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    ... 80 more
    I have checked the server logs and the server is able to receive the request from the client and fetching the required details.
    I am sending these details to the client by adding to a Vector.
    I have observed one more thing, the same is working in other machine which is in another network.
    I have also tried with the other wl*.jar s but giving different exceptions.
    My server classpath consists of weblogic.jar.
    Do I have to include the client jars in my server classpath?
    Please suggest me how to resolve this.
    Please help me here :)

    Thanks for your time, :)
    I have tried all the three wl*client jars, but no use. :(
    Got the same error for wlclient.jar and wlfullclient.jar.
    And for wlt3client.jar I got some different error which is very strange...
    java.lang.AssertionError: Failed to generate class for com.mbt.expert.server.session.LoginSessionBean_tqw6yu_HomeImpl_1033_WLStub
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:797)
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:786)
    at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:74)
    at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:213)
    at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:207)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:598)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
    at weblogic.jndi.internal.ServerNamingNode_1033_WLStub.lookup(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:405)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at com.mbt.expert.mdi.ExpertVariable.getLoginSession(ExpertVariable.java:455)
    at com.mbt.expert.view.dialogs.Login.okPressed(Login.java:187)
    at com.mbt.expert.view.dialogs.Login.keyPressed(Login.java:141)
    at java.awt.Component.processKeyEvent(Unknown Source)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.Dialog$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.reflect.InvocationTargetException
    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 weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:795)
    ... 55 more
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
    at weblogic.utils.classloaders.AugmentableClassLoaderManager.getAugmentableClassLoader(AugmentableClassLoaderManager.java:48)
    at weblogic.rmi.internal.ClientRuntimeDescriptor.findLoader(ClientRuntimeDescriptor.java:254)
    at weblogic.rmi.internal.ClientRuntimeDescriptor.getInterfaces(ClientRuntimeDescriptor.java:132)
    at weblogic.rmi.internal.StubInfo.getInterfaces(StubInfo.java:77)
    at com.mbt.expert.server.session.LoginSessionBean_tqw6yu_HomeImpl_1033_WLStub.ensureInitialized(Unknown Source)
    at com.mbt.expert.server.session.LoginSessionBean_tqw6yu_HomeImpl_1033_WLStub.<init>(Unknown Source)
    ... 60 more
    Please tell me how can I get rid of this??

  • JNDI lookup issue in weblogic 10 server

    Hi all,
    I have a serious problem in getting the datasource lookup. My application uses EJB3 and JPA and it is deployed in weblogic10. I configured datasource in the domain (ex:mydomain) using weblogic 10 admin console. Now when i try to call from a client program, it is giving me javax.naming.NameNotFoundException. I use eclipse IDE to deploy the application. From the IDE, i can start the oracle 10.3 server and it automatically deploys the application into the server in mydomain. The admin console shows that the application deployed fine. And i can see the webcontent WAR file and EJB jar deployed. Coming back to the issue.... I verified user_projects\domains\mydomain\config\jdbc\datasource-jdbc.xml and user_projects\domains\mydomain\config\config.xml file enteries. My entries are present in those files.
    When i start the server i am getting below error...
    << Stacktrace >>
    javax.naming.NameNotFoundException: While trying to look up jdbc in /app.; remaining name 'jdbc'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
         at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
         at weblogic.deployment.PersistenceUnitInfoImpl.lookUpAppScopedDataSource(PersistenceUnitInfoImpl.java:529)
         at weblogic.deployment.PersistenceUnitInfoImpl.reconfig(PersistenceUnitInfoImpl.java:549)
         at weblogic.ejb.container.deployer.EJBModule.reconfigPersistenceUnits(EJBModule.java:529)
         at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:515)
         at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    << Client program snippet >>
    Hashtable ht = new Hashtable();
                   ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                   ht.put(Context.PROVIDER_URL, "t3://10.237.76.132:7001");
                   InitialContext ctx = null;
                   ctx = new InitialContext(ht);
                   Object obj = (Object)ctx.lookup(EmployeeBean.RemoteJNDIName);
                   EmployeeRemote empRemote = (EmployeeRemote)PortableRemoteObject.narrow(obj,com.acs.test.emp.EmployeeRemote.class);
                   List empList = empRemote.getEmployeeDetails(1);
                   System.out.println("SUCCESS"+empList.size());
    << Persistence.xml >>
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Persistence deployment descriptor for dev profile -->
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="cmsepool">
    <jta-data-source>java:/mydatasource</jta-data-source>
              <class>com.acs.test.emp.EmployeeVO</class>
              <properties>
    <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
              <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
    </properties>
    </persistence-unit>
    </persistence>

    Make sure that this Datasource you created is Targetted to Admin Server and full Cluster (incase of cluster domain). From Admin Console, select your datasource and check for the Targets tab. Since its JNDI lookup error, most probably it may not be deployed properly.
    HTH
    Ravi Jegga

  • Weblogic JNDI lookup in Applet

    Hi
    We are facing problem in JNDI lookup inside the applet
    here is the scenario
    We have two weblogic servers(port 7001)
    one server is main server where the Applet1 , weblogic.jar and app.htm
    are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
    and another is proxy server where HTTPProxyServlet is running and one
    web.xml file ( wall these files are provided by weblogic and the port
    of proxy server is 448)
    Both the servers are running on different machines
    and when we run the client browser and put the folloing url
    http://proxyServer IP Address:448/app.htm
    we get the following exception
    Java(TM) Plug-in: Version 1.3.0-C
    Using JRE version 1.3.0 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\kkumar
    Proxy Configuration: no proxy
    JAR cache enabled.
    In Init.1..:
    In Init.after ..doClassLoaderWorkaround
    In Init.after setText:
    In Init.before initjms:
    In initjms begin
    In initjms hostName...:10.1.10.211
    In initjms before initialcontext...:
    In initjms after initialcontext...:
    javax.naming.ConfigurationException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract
    java.lang.Object
    weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.io.NotSerializableException: javax.naming.InitialContext
    java.io.NotSerializableException: javax.naming.InitialContext
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
    at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
    at
    weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
    at
    weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at Applet1.initJMS(Applet1.java:128)
    at Applet1.init(Applet1.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Initialization failed
    In Init.end of initjms:
    the files are here
    app.htm
                   <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                        width="650" height="300" align="baseline"
                        codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
    >
                   <PARAM NAME="code" VALUE="Applet1">
                   <PARAM NAME="codebase" VALUE=".">
                   <PARAM NAME="AppletName" VALUE="Applet1">
                   <PARAM NAME="archive" VALUE="weblogic.jar">
                   <PARAM NAME="MAYSCRIPT" VALUE="true">
                   <PARAM NAME="type"
    VALUE="application/x-java-applet;version=1.2.2">
                   <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
                   <PARAM NAME="scriptable" VALUE="true">
                   <!--
                   <COMMENT>
                        <EMBED type="application/x-java-applet;version=1.2.2" width="650"
    height="300" align="baseline"
                                  code="ANZPopupApplet.class" codebase="../"
    model="models/HyaluronicAcid.xyz"
                             pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
    MAYSCRIPT="true">
                        <NOEMBED>
                   </COMMENT>
                   -->
                                  No JDK 1.2 support for APPLET!!
                        </NOEMBED>
                        </EMBED>
                   </OBJECT>
    </html>
    Applet1.java
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import javax.naming.*;
    import javax.jms.*;
    import java.lang.reflect.*;
    public class Applet1 extends Applet implements MessageListener {
    private boolean started = false;
    // JMS Stuff
    private InitialContext jmsContext = null;
    private QueueConnectionFactory jmsConnFactory = null;
    private QueueConnection jmsConnection = null;
    private Queue jmsQueue = null;
    private QueueSession jmsSession = null;
    private QueueSender jmsSender = null;
    private QueueReceiver jmsReceiver = null;
    // init - called to inform this applet that it has been
    // loaded into the system
    public void init() {
    //{{INIT_CONTROLS
    System.out.println("In Init.1..:");
         //doClassLoaderWorkaround();
    System.out.println("In Init.after ..doClassLoaderWorkaround");
    setLayout(null);
    setSize(426,266);
    jmslabel.setText("JMS Applet");
    System.out.println("In Init.after setText:");
    add(jmslabel);
    jmslabel.setBounds(144,12,148,24);
    textArea1.setEnabled(false);
    add(textArea1);
    textArea1.setBounds(24,36,375,100);
    jmsleaveButton.setLabel("Leave");
    add(jmsleaveButton);
    jmsleaveButton.setBackground(java.awt.Color.lightGray);
    jmsleaveButton.setBounds(312,240,78,20);
    add(jmsMessageField);
    jmsMessageField.setBounds(24,168,367,38);
    System.out.println("In Init.before initjms:");
    initJMS();
    System.out.println("In Init.end of initjms:");
    //{{DECLARE_CONTROLS
         java.awt.Label jmslabel = new java.awt.Label();
         java.awt.TextArea textArea1 = new java.awt.TextArea();
         java.awt.Button jmsleaveButton = new java.awt.Button();
         java.awt.TextField jmsMessageField = new java.awt.TextField();
    // getAppletInfo - Returns information about this applet.
    public String getAppletInfo() {
    return "JMS Applet\r\n";
    // destroy - called to inform this applet that it is being
    // reclaimed and that it should destroy any resources that
    // it has allocated.
    public void destroy() {
    try {
    if(started) {
    if (jmsConnection != null) {
    jmsConnection.stop();
    jmsConnection = null;
    started = false;
    stop();
    catch(Exception e) {
    // start - called to inform this applet that it should start its
    execution
    public void start() {
    if(!started) {
    started = true;
    // stop - Called to inform this applet that it should stop its
    execution
    public void stop() {
    textArea1.setEnabled(false);
    jmsMessageField.setEnabled(false);
    // action - handles entering message, Leave button clicked
    public boolean action(Event evt, Object obj) {
    System.out.println("In action begin:");
    if(evt.id == Event.ACTION_EVENT) {
    if(obj.equals(jmsMessageField.getText())) {
    System.out.println("In action before sendData:");
    sendData(jmsMessageField.getText());
    System.out.println("In action after sendData:");
    jmsMessageField.setText("");
    return true;
    if(obj.equals(jmsleaveButton.getLabel())) {
    destroy();
    return true;
    // initJMS - initialize all of the JMS stuff
    private void initJMS() {
    try {
    System.out.println("In initjms begin");
    String hostName = this.getCodeBase().getHost();
    System.out.println("In initjms hostName...:"+hostName);
    Hashtable env = new Hashtable();
    env.put(Context.APPLET,this);
    env.put(Context.PROVIDER_URL,
    "t3://" + hostName + ":448");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    System.out.println("In initjms before initialcontext...:");
    jmsContext = new InitialContext(env);
    System.out.println("In initjms after initialcontext...:");
    jmsConnFactory
    =(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
    System.out.println("In initjms after initialcontext..lookup.:");
    jmsConnection = jmsConnFactory.createQueueConnection();
    System.out.println("In initjms after initialcontext..lookup1.:");
    jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("In initjms before lookup...:");
    jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
    jmsConnection.start();
    jmsSender = jmsSession.createSender(jmsQueue);
    jmsReceiver = jmsSession.createReceiver(jmsQueue);
    jmsReceiver.setMessageListener(this);
    System.out.println("In initjms before setMessageListener...end of the
    const:");
    catch(Exception e) {
    e.printStackTrace();
    System.out.println("Initialization failed");
    // sendData - sends a message
    void sendData(String data) {
    try {
    System.out.println("In sendData before createTextMessage:");
    TextMessage message = jmsSession.createTextMessage();
    message.setText(data);
    jmsSender.send(message);
    System.out.println("In sendData end data:"+data);
    catch(Exception e) {
    System.out.println("Failed to send message");
    // onMessage - asynchronously receives a message
    public void onMessage(Message message) {
    String data;
    try {
    System.out.println("In onMessage:");
    data = ((TextMessage)message).getText();
    System.out.println("In onMessage data:"+data);
    textArea1.append(data + "\n");
    repaint();
    System.out.println("In onMessage end:");
    catch(Exception e) {
    System.out.println("Failed to receive message");
    private void doClassLoaderWorkaround(){
    boolean didit = false;
    // Get the ClassLoader of this applet:
    ClassLoader cloader = this.getClass().getClassLoader();
    if (cloader == null){
    System.out.println("### getClassLoader() returned null");
    else
    // We might call this handy utility routine:
    // boolean didit =
    Thread.currentThread().setContextClassLoader(cloader);
         Method setContextClassLoaderMeth = null;
         try {
              Method [] allMethods = Thread.class.getMethods();
              for ( int i = 0; i < allMethods.length; i++ ) {
                   if (allMethods.getName().equals("setContextClassLoader")) {
                        setContextClassLoaderMeth = allMethods[i];
                        break;
         catch(Exception e) {
              System.out.println("---Exception " + e);
    // but we don't because we need more visibility about what goes
    wrong.
    // Rather, reproduce that logic here, with extra error messages:
    //Method setContextClassLoaderMeth = null;
    try{
    // Class params = ClassLoader.class ;
    // setContextClassLoaderMeth =
    //Thread.class.getMethod("setContextClassLoader", params);
    catch (NoSuchMethodException ne) {
    setContextClassLoaderMeth = null;
    System.out.println("--- This java version does not have the
    method 'setContextClassLoader'. Not a problem.");
    return;
    catch (Exception ae){
    setContextClassLoaderMeth = null;
    System.out.println("### Thread.class.getMethod() threw
    unexpected exception: " + ae.getMessage());
    if (setContextClassLoaderMeth != null){
    Object[] args = { cloader };
    try{
    setContextClassLoaderMeth.invoke(Thread.currentThread(),
    args);
    didit = true;
    catch (InvocationTargetException ite){
    Throwable be = ite.getTargetException();
    System.out.println("### Thread.setContextClassLoader() failed:
    InvocationTargetException: " + be.getMessage());
    catch (Exception ie){
    System.out.println("### Thread.setContextClassLoader() threw
    unexpected exception: " + ie.getMessage());
    if (didit){
    System.out.println("--- Succeeded in setting the
    ContextClassLoader of this thread to be this applet's own
    ClassLoader");
    else{
    System.out.println("### Could not set ContextClassLoader,
    additional threads may not be able");
    System.out.println("### to get a JNDI Context in java 122 or
    greater.");
    any clue or thought. please help
    regards
    mohan

    It looks like the object that you have placed into the JNDO tree is not serializable or doesnt implement exernalizable!
    java.io.NotSerializableException
    0rrc
    On 26 Jul 2001 16:10:35 -0700, [email protected] (Mohan Raj) wrote:
    Hi
    We are facing problem in JNDI lookup inside the applet
    here is the scenario
    We have two weblogic servers(port 7001)
    one server is main server where the Applet1 , weblogic.jar and app.htm
    are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
    and another is proxy server where HTTPProxyServlet is running and one
    web.xml file ( wall these files are provided by weblogic and the port
    of proxy server is 448)
    Both the servers are running on different machines
    and when we run the client browser and put the folloing url
    http://proxyServer IP Address:448/app.htm
    we get the following exception
    Java(TM) Plug-in: Version 1.3.0-C
    Using JRE version 1.3.0 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\kkumar
    Proxy Configuration: no proxy
    JAR cache enabled.
    In Init.1..:
    In Init.after ..doClassLoaderWorkaround
    In Init.after setText:
    In Init.before initjms:
    In initjms begin
    In initjms hostName...:10.1.10.211
    In initjms before initialcontext...:
    In initjms after initialcontext...:
    javax.naming.ConfigurationException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract
    java.lang.Object
    weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.io.NotSerializableException: javax.naming.InitialContext
    java.io.NotSerializableException: javax.naming.InitialContext
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
    at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
    at
    weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
    at
    weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at Applet1.initJMS(Applet1.java:128)
    at Applet1.init(Applet1.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Initialization failed
    In Init.end of initjms:
    the files are here
    app.htm
                   <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                        width="650" height="300" align="baseline"
                        codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
    >
                   <PARAM NAME="code" VALUE="Applet1">
                   <PARAM NAME="codebase" VALUE=".">
                   <PARAM NAME="AppletName" VALUE="Applet1">
                   <PARAM NAME="archive" VALUE="weblogic.jar">
                   <PARAM NAME="MAYSCRIPT" VALUE="true">
                   <PARAM NAME="type"
    VALUE="application/x-java-applet;version=1.2.2">
                   <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
                   <PARAM NAME="scriptable" VALUE="true">
                   <!--
                   <COMMENT>
                        <EMBED type="application/x-java-applet;version=1.2.2" width="650"
    height="300" align="baseline"
                                  code="ANZPopupApplet.class" codebase="../"
    model="models/HyaluronicAcid.xyz"
                             pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
    MAYSCRIPT="true">
                        <NOEMBED>
                   </COMMENT>
                   -->
                                  No JDK 1.2 support for APPLET!!
                        </NOEMBED>
                        </EMBED>
                   </OBJECT>
    </html>
    Applet1.java
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import javax.naming.*;
    import javax.jms.*;
    import java.lang.reflect.*;
    public class Applet1 extends Applet implements MessageListener {
    private boolean started = false;
    // JMS Stuff
    private InitialContext jmsContext = null;
    private QueueConnectionFactory jmsConnFactory = null;
    private QueueConnection jmsConnection = null;
    private Queue jmsQueue = null;
    private QueueSession jmsSession = null;
    private QueueSender jmsSender = null;
    private QueueReceiver jmsReceiver = null;
    // init - called to inform this applet that it has been
    // loaded into the system
    public void init() {
    //{{INIT_CONTROLS
    System.out.println("In Init.1..:");
         //doClassLoaderWorkaround();
    System.out.println("In Init.after ..doClassLoaderWorkaround");
    setLayout(null);
    setSize(426,266);
    jmslabel.setText("JMS Applet");
    System.out.println("In Init.after setText:");
    add(jmslabel);
    jmslabel.setBounds(144,12,148,24);
    textArea1.setEnabled(false);
    add(textArea1);
    textArea1.setBounds(24,36,375,100);
    jmsleaveButton.setLabel("Leave");
    add(jmsleaveButton);
    jmsleaveButton.setBackground(java.awt.Color.lightGray);
    jmsleaveButton.setBounds(312,240,78,20);
    add(jmsMessageField);
    jmsMessageField.setBounds(24,168,367,38);
    System.out.println("In Init.before initjms:");
    initJMS();
    System.out.println("In Init.end of initjms:");
    //{{DECLARE_CONTROLS
         java.awt.Label jmslabel = new java.awt.Label();
         java.awt.TextArea textArea1 = new java.awt.TextArea();
         java.awt.Button jmsleaveButton = new java.awt.Button();
         java.awt.TextField jmsMessageField = new java.awt.TextField();
    // getAppletInfo - Returns information about this applet.
    public String getAppletInfo() {
    return "JMS Applet\r\n";
    // destroy - called to inform this applet that it is being
    // reclaimed and that it should destroy any resources that
    // it has allocated.
    public void destroy() {
    try {
    if(started) {
    if (jmsConnection != null) {
    jmsConnection.stop();
    jmsConnection = null;
    started = false;
    stop();
    catch(Exception e) {
    // start - called to inform this applet that it should start its
    execution
    public void start() {
    if(!started) {
    started = true;
    // stop - Called to inform this applet that it should stop its
    execution
    public void stop() {
    textArea1.setEnabled(false);
    jmsMessageField.setEnabled(false);
    // action - handles entering message, Leave button clicked
    public boolean action(Event evt, Object obj) {
    System.out.println("In action begin:");
    if(evt.id == Event.ACTION_EVENT) {
    if(obj.equals(jmsMessageField.getText())) {
    System.out.println("In action before sendData:");
    sendData(jmsMessageField.getText());
    System.out.println("In action after sendData:");
    jmsMessageField.setText("");
    return true;
    if(obj.equals(jmsleaveButton.getLabel())) {
    destroy();
    return true;
    // initJMS - initialize all of the JMS stuff
    private void initJMS() {
    try {
    System.out.println("In initjms begin");
    String hostName = this.getCodeBase().getHost();
    System.out.println("In initjms hostName...:"+hostName);
    Hashtable env = new Hashtable();
    env.put(Context.APPLET,this);
    env.put(Context.PROVIDER_URL,
    "t3://" + hostName + ":448");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    System.out.println("In initjms before initialcontext...:");
    jmsContext = new InitialContext(env);
    System.out.println("In initjms after initialcontext...:");
    jmsConnFactory
    =(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
    System.out.println("In initjms after initialcontext..lookup.:");
    jmsConnection = jmsConnFactory.createQueueConnection();
    System.out.println("In initjms after initialcontext..lookup1.:");
    jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("In initjms before lookup...:");
    jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
    jmsConnection.start();
    jmsSender = jmsSession.createSender(jmsQueue);
    jmsReceiver = jmsSession.createReceiver(jmsQueue);
    jmsReceiver.setMessageListener(this);
    System.out.println("In initjms before setMessageListener...end of the
    const:");
    catch(Exception e) {
    e.printStackTrace();
    System.out.println("Initialization failed");
    // sendData - sends a message
    void sendData(String data) {
    try {
    System.out.println("In sendData before createTextMessage:");
    TextMessage message = jmsSession.createTextMessage();
    message.setText(data);
    jmsSender.send(message);
    System.out.println("In sendData end data:"+data);
    catch(Exception e) {
    System.out.println("Failed to send message");
    // onMessage - asynchronously receives a message
    public void onMessage(Message message) {
    String data;
    try {
    System.out.println("In onMessage:");
    data = ((TextMessage)message).getText();
    System.out.println("In onMessage data:"+data);
    textArea1.append(data + "\n");
    repaint();
    System.out.println("In onMessage end:");
    catch(Exception e) {
    System.out.println("Failed to receive message");
    private void doClassLoaderWorkaround(){
    boolean didit = false;
    // Get the ClassLoader of this applet:
    ClassLoader cloader = this.getClass().getClassLoader();
    if (cloader == null){
    System.out.println("### getClassLoader() returned null");
    else
    // We might call this handy utility routine:
    // boolean didit =
    Thread.currentThread().setContextClassLoader(cloader);
         Method setContextClassLoaderMeth = null;
         try {
              Method [] allMethods = Thread.class.getMethods();
              for ( int i = 0; i < allMethods.length; i++ ) {
                   if (allMethods.getName().equals("setContextClassLoader")) {
                        setContextClassLoaderMeth = allMethods[i];
                        break;
         catch(Exception e) {
              System.out.println("---Exception " + e);
    // but we don't because we need more visibility about what goes
    wrong.
    // Rather, reproduce that logic here, with extra error messages:
    //Method setContextClassLoaderMeth = null;
    try{
    // Class params = ClassLoader.class ;
    // setContextClassLoaderMeth =
    //Thread.class.getMethod("setContextClassLoader", params);
    catch (NoSuchMethodException ne) {
    setContextClassLoaderMeth = null;
    System.out.println("--- This java version does not have the
    method 'setContextClassLoader'. Not a problem.");
    return;
    catch (Exception ae){
    setContextClassLoaderMeth = null;
    System.out.println("### Thread.class.getMethod() threw
    unexpected exception: " + ae.getMessage());
    if (setContextClassLoaderMeth != null){
    Object[] args = { cloader };
    try{
    setContextClassLoaderMeth.invoke(Thread.currentThread(),
    args);
    didit = true;
    catch (InvocationTargetException ite){
    Throwable be = ite.getTargetException();
    System.out.println("### Thread.setContextClassLoader() failed:
    InvocationTargetException: " + be.getMessage());
    catch (Exception ie){
    System.out.println("### Thread.setContextClassLoader() threw
    unexpected exception: " + ie.getMessage());
    if (didit){
    System.out.println("--- Succeeded in setting the
    ContextClassLoader of this thread to be this applet's own
    ClassLoader");
    else{
    System.out.println("### Could not set ContextClassLoader,
    additional threads may not be able");
    System.out.println("### to get a JNDI Context in java 122 or
    greater.");
    any clue or thought. please help
    regards
    mohan

  • Get server instance name without deploying weblogic.jar to client

    I use wlclient.jar with my client. Using weblogic.jar instead causes the
    size of the deployment package of my client to go from 4 meg to 34 meg
    (roughly). I don't want full MBean functionality, all I want to do is find
    out what the server instance name is. Surely there's a way to do this.

    Hi,
    Weblogic provides you a way to create client jar files so that the complete weblogic.jar
    doesn't need to be downloaded to the client. The tool is called verboseToZip.
    See
    http://e-docs.bea.com/wls/docs70/adminguide/utils.html#1117405
    hope this helps, pat
    "BEA" <[email protected]> wrote:
    I am trying to deploy my client application on a standalone windows machine
    and do not wish to deploy weblogic.jar with the client deployment. Is
    there
    any way of allowing my clients to use Weblogic JNDI without having to
    deploy
    weblogic.jndi.WLInitialContextFactory.class (and its associated classes.
    I find it hard to believe that everyone who is developing on weblogic
    distributes this JAR file to their customers with their client
    applications....?
    Can you use something other than weblogic.jndi.WLInitialContextFactory
    such
    as the sun jndi provider instead....?
    If anyone can shed some light on this deployment problem it would be
    much
    appreciated.....even if its simply 'thats just the way you have to do
    it
    !......will save me time trying to get other solutions to work...!
    TIA

  • 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

  • Deploying client apps without deploying Weblogic.jar ?

    I am trying to deploy my client application on a standalone windows machine
    and do not wish to deploy weblogic.jar with the client deployment. Is there
    any way of allowing my clients to use Weblogic JNDI without having to deploy
    weblogic.jndi.WLInitialContextFactory.class (and its associated classes.
    I find it hard to believe that everyone who is developing on weblogic
    distributes this JAR file to their customers with their client
    applications....?
    Can you use something other than weblogic.jndi.WLInitialContextFactory such
    as the sun jndi provider instead....?
    If anyone can shed some light on this deployment problem it would be much
    appreciated.....even if its simply 'thats just the way you have to do it
    !......will save me time trying to get other solutions to work...!
    TIA

    Hi,
    Weblogic provides you a way to create client jar files so that the complete weblogic.jar
    doesn't need to be downloaded to the client. The tool is called verboseToZip.
    See
    http://e-docs.bea.com/wls/docs70/adminguide/utils.html#1117405
    hope this helps, pat
    "BEA" <[email protected]> wrote:
    I am trying to deploy my client application on a standalone windows machine
    and do not wish to deploy weblogic.jar with the client deployment. Is
    there
    any way of allowing my clients to use Weblogic JNDI without having to
    deploy
    weblogic.jndi.WLInitialContextFactory.class (and its associated classes.
    I find it hard to believe that everyone who is developing on weblogic
    distributes this JAR file to their customers with their client
    applications....?
    Can you use something other than weblogic.jndi.WLInitialContextFactory
    such
    as the sun jndi provider instead....?
    If anyone can shed some light on this deployment problem it would be
    much
    appreciated.....even if its simply 'thats just the way you have to do
    it
    !......will save me time trying to get other solutions to work...!
    TIA

  • WLPI: business operations JNDI lookup & service pack

    Hello,
    I ran into a problem attempting to define a business operation in the Studio application
    using WLPI 1.2.1 (without service pack 1). Everything works up to the point where
    I press the Done button and Studio attempts to create a new business operation
    object. I am getting a JNDI lookup exception. It appearsejb-name of method in
    isolation-level must be the same name as that of the weblogic-enterprise-bean
    Studio is looking up the name 'com.bea.wlpi.businessoperation' while the business
    operation bean is bound under 'com.bea.wlpi.BusinessOperation'.
    In an attempt to fix this problem I upgraded to service pack 1, but am now unable
    to deploy wlpi-ejb.jar because of the following error: "ejb-name of method in
    isolation-level must be the same name as that of the weblogic-enterprise-bean".
    Can anyone help me create a business operation?
    Thanks,
    Martin

    Make sure that this Datasource you created is Targetted to Admin Server and full Cluster (incase of cluster domain). From Admin Console, select your datasource and check for the Targets tab. Since its JNDI lookup error, most probably it may not be deployed properly.
    HTH
    Ravi Jegga

  • RMI-IIOP JNDI lookup returns com.sun.corba.se.internal.iiop.CDRInputStream

    I have two different RMI-IIOP java clients, one is working fine and the other is not. Both are using weblogic.jndi.WLInitialContextFactory from wlclient.jar in WLS 8.1sp5 and JDK 1.4.2_6.
    One java client is a straight-forward java main. JNDI lookup is returning EJBHome_Stub correctly loaded by sun.rmi.server.LoaderHandler$Loader
    The other java client is a complex java program with multiple threads and many jars. A thread does the same JNDI lookup as the simple java client, but the object returned is of type com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1 which has NULL classloader (bootstrap classloader).
    What condition triggered the WebLogic InitialContext to default to com.sun.corba.se.internal.iiop.CDRInputStream?

    Kevin Fung <> writes:
    This is usally symptomatic of an IOR without the corresponding stub
    being loaded, usually because the correct security manager is not
    set. However the client jar bypasses the security manager to try and
    avoid this problem, so I am confused as to why you are seeing this. Do
    you know which object it is accessing? Can you try putting IIOP stubs
    for it in the client?
    andy
    I have two different RMI-IIOP java clients, one is working fine and the other is not. Both are using weblogic.jndi.WLInitialContextFactory from wlclient.jar in WLS 8.1sp5 and JDK 1.4.2_6.
    One java client is a straight-forward java main. JNDI lookup is returning EJBHome_Stub correctly loaded by sun.rmi.server.LoaderHandler$Loader
    The other java client is a complex java program with multiple threads and many jars. A thread does the same JNDI lookup as the simple java client, but the object returned is of type com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1 which has NULL classloader (bootstrap classloader).
    What condition triggered the WebLogic InitialContext to default to com.sun.corba.se.internal.iiop.CDRInputStream?

  • Manual JNDI lookup for EJB3 between different Application Server Instances

    Hi all,
    i have spent quite some time looking into this problem and searching the net but i just can't figure out for the life of me what i am doing wrong so i hope someone here can give me a clue or a good resource where i can look it up myself.
    I am currently doing some interoperability tests concerning EJB calls between Glassfish and Weblogic 10. In my test setup i have an EJB deployed in a jar file on one server and a servlet in a war file deployed on the other. The objective is to try to look up and call the EJB from the servlet. As there seem to be some issues with injection in Weblogic 10 i set that one aside for now (i have opened a case at BEA support for this) but i would like to do a plain old JNDI lookup to obtain the EJB.
    The online tutorials and FAQs i have read so far all state that this can be done the same way as it works for EJB2.x, at least if i understood them correctly. The interessting thing is, when i deploy an EJB2.x bean i can look it up without problems, but when i try to do the same with the EJB3 bean the name cannot be found. On the other hand when listing all contents of the JNDI tree in Glassfish from a stand alone application i can see entries for both EJBs of the type java.naming.Reference (in Weblogic i can also see entries for both, but the ones for EJB3 are of some weird internal weblogic types, which i put down as a weblogic problem for now).
    The lookup code for the servlet running in weblogic looks like this:
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, "corbaname:iiop:1.2@localhost:3700");
    Object myEjb = new InitialContext(env).lookup("JNDINameDisplayedByContextListing");
    I know that the preferred way would be to have the corbaname put into weblogic.xml/sun-web.xml and just use an InitialContext without an environment to perform the lookup but i wanted to get rid of any additional indirections to pinpoint the source my problem and it should work this way, too. As i said, it works when i target an EJB2.x bean but not with the EJB3 one, so i guess i am doing something wrong there. The jar file contains the interface of the bean annotated with @Remote and the implementation of the interface annotated with @Stateless, i also tried setting the mappedName attribute for the bean and use that name as JNDI name, but that also fails. In addition i added an ejb-jar.xml to the jars META-INF containing the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
         version="3.0">
         <enterprise-beans>
              <session>
                   <ejb-name>SecurityTest3EJB</ejb-name>
                   <ejb-class>
                        testcase.ejb.SecurityTestBean
                   </ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    But the ejb-name specified there does not show up in a context listing, so i would guess that means the file is ignored or only accessible from within the same application server (note, there is no indication of any problems in the Glassfish log when deploying the jar file).
    This might be just a stupid mistake by me, but i just can't figure it out at the moment, so any advice will be greatly appriciated.
    Thanks, Chris

    I think i stumbled across something now. From some posts it seems to me that the EJB3 spec does not require EJBs to be accessible from a remote location, since this can be achieved by using the @RemoteHome annotation and performing a EJB2.x compliant look up. Is that correct?

  • EJB 3.0 lookup in Weblogic 10.3.0

    Hello everyone,
    1: Our application runs on Weblogic Application Server,version 10.3.0
    2: In our system,we need to deploy an EJB conforming to the EJB 3.0 specification.
    Please find the sample code for our UAT environment as below :
    /*The remote interface*/
    package com.serverside.ejb.session;
    import javax.ejb.Remote;
    @Remote
    public interface ASimpleSessionBeanRemote {
         public void printThis(String print);
    /*The bean class*/
    package com.serverside.ejb.session;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    * Session Bean implementation class ASimpleSessionBean
    @Stateless(name="ASimpleSessionBean", mappedName = "ASimpleSessionEJB")
    @Remote(ASimpleSessionBeanRemote.class)
    public class ASimpleSessionBean implements ASimpleSessionBeanRemote {
    * Default constructor.
    public ASimpleSessionBean() {
    // TODO Auto-generated constructor stub
         @Override
         public void printThis(String print) {
              // TODO Auto-generated method stub
              System.out.println("ASimpleSessionBean : "+print);
    3: The above files when packaged in jar get deployed on the server successfully.
    4: As per EJB 3.0 specification,the deployement descriptors are not mandatory.Hence,the jar doesn't include ejb-jar.xml and weblogic-ejb-jar.xml
    5: Please find below,the EJB3.0 annotations reference as per the Weblogic Application Server Documentation :
    Annotation : @Stateless
    Package: javax.ejb.Stateless
    Attribute : mappedName
    Description :
    Specifies the product-specific name to which the stateless session bean should be mapped.
    You can also use this attribute to specify the JNDI name of this stateless session bean. WebLogic Server uses the value of the mappedName attribute when creating the bean’s global JNDI name. In particular, the JNDI name will be:
    mappedName#name_of_businessInterface
    where name_of_businessInterface is the fully qualified name of the business interface of this session bean.
    For example, if you specify mappedName="bank" and the fully qualified name of the business interface is com.CheckingAccount, then the JNDI of the business interface is bank#com.CheckingAccount.
    6: Conforming to the above specification, the sample EJB deployed on our application server has the binding name(as reflected in the jndi tree) as follows :
    ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSessionBeanRemote
    A jndi lookup using this name succeeds :
    InitialContext.doLookup("ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSesionBeanRemote");
    7: Now,we want the binding name to be a simple string i.e the lookup must be something like :
    InitialContext.doLookup("ASimpleSessionEJB");
    8: To implement point-7,we tried using the ejb-jar.xml and weblogic-ejb-jar.xml as follows :
    ->ejb-jar.xml
    <?xml version="1.0" encoding="ASCII"?>
    <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
    <display-name>ejb</display-name>
    <enterprise-beans>
         <session>
              <ejb-name>ASimpleSessionBean</ejb-name>
              <ejb-ref>
                   <ejb-ref-name>ASimpleSessionEJB</ejb-ref-name>
                   <remote>com.serverside.ejb.session.ASimpleSessionBeanRemote</remote>
                   <mapped-name>ASimpleSessionEJB</mapped-name>
              </ejb-ref>
         </session>
    </enterprise-beans>
    </ejb-jar>
    ->weblogic-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-ejb-jar xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
    <!-- server-version: 10.3.0 --><wls:weblogic-enterprise-bean>
         <wls:ejb-name>ASimpleSessionBean</wls:ejb-name>
         <wls:stateless-session-descriptor>
              <wls:business-interface-jndi-name-map>
                   <wls:business-remote>ASimpleSessionBeanRemote</wls:business-remote>
                   <wls:jndi-name>ASimpleSessionEJB</wls:jndi-name>
              </wls:business-interface-jndi-name-map></wls:stateless-session-descriptor>
         <wls:jndi-name>ASimpleSessionEJB</wls:jndi-name>
    </wls:weblogic-enterprise-bean>
    </wls:weblogic-ejb-jar>
    9: Inspite of the point-8,the binding name remains as follows :
    ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSessionBeanRemote
    10: Please guide us about the solution and implementation to attend point-7.
    Thanks !

    Hi,
    I find distributed applications very interesting (even though this application of mine could just use sockets - it is nicer than EJB 2.1). You don't need the @Local DI and local interface if you only do remote - so here is some minimal hello world code that currently works on a test network of mine.
    In this example I have provided only a remote stateless session bean and an SE client (could be a pojo or servlet).
    The *@Stateful* SB has been converted to a *@Stateless* SB (now the state field doesn't really hold state as the container pools the SSB - but this is an unrelated issue as I an not using transactions yet anyway). The key is naming the SSB with the mappedName attribute so you can easily reference it - or just check your logs after you deploy the EAR containing the EJB in your EE server.
    Note: WebLogic also registers a legacy EJB 2.1 compliant jndi name alias for you as well appsdirorg_eclipse_persistence_example_distributed_ClientEAR_earorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home*
    For your specific question about dependency injection (which is implemented by Spring AOP inside the server).
    Use @Remote on your Remote inteface class
    Use @Stateless on your session bean implementation class
    Use @EJB to inject your stateless session bean into a servlet for example (I have not tried using @EJB on a POJO - it would need to be running on the WebLogic container in the WAR or EJB.jar - don't think that is supported - I have not tried @Resource or spring annotations for this yet)
    This example (reduced to show a single remote server) uses a JNDI lookup to get a reference to the remote bean (full try/catch exception handlers in full code near end of post).
          Hashtable<String, String> aTable =  new Hashtable<String, String>();
          aTable.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");
          aTable.put("java.naming.provider.url", "beowulf5");
          Context aContext = new InitialContext(aTable);
          Object aRemoteReference = aContext.lookup("ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote");       
          NodeRemote aNode = (NodeRemote) PortableRemoteObject.narrow(aRemoteReference, NodeRemote.class);
          aNode.setState(0)); // remote method invocationI deploy an EAR containing the SSB on distributed servers on any EE container - I chose WebLogic 10.3.4.
    I run an SE app that connects to a list of servers that that are running the remote stateless session bean. The code is very naive at this point, it does retry bad connections and it is not yet multithreaded - just a proof of concept for EJB 3 remote session beans.
    The InitialContext RMI handshaking will take around 10 sec per server to setup - then you can do up to 200k remote EJB RMI invokacations per second/thread on my machine.
    The @Local code is only required if you wish to optimize using your SSB on the same JVM.
    The JPA peristence code can be ignored (no EJB 3.0 Entities)
    I just discovered the forum code tag in square brackets after 2 years
    package org.eclipse.persistence.example.distributed;
    import javax.ejb.Remote;
    @Remote
    public interface NodeRemote {
        public void setState(int state);
        public int getState();
    package org.eclipse.persistence.example.distributed;
    import javax.ejb.Stateful;
    @Stateful(mappedName="ejb/Node")
    public class Node implements NodeRemote {
        private int state;
        public void setState(int aState) {        state = aState;    }
        public int getState() {        return state;    }
    }weblogic-ejb-jar.xml ejb deployment descriptor - empty (we are using dependency injection annotations)
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-ejb-jar xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.2/weblogic-ejb-jar.xsd">
        <!--weblogic-version:10.3.4-->
    </wls:weblogic-ejb-jar>weblogic-application.xml deployment descriptor - essentially empty
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-application xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.2/weblogic-application.xsd">
        <!--weblogic-version:10.3.4-->
        <wls:application-param>
            <wls:param-name>webapp.encoding.default</wls:param-name>
            <wls:param-value>UTF-8</wls:param-value>
        </wls:application-param>
    </wls:weblogic-application>application.xml JEE5 deployment descriptor - you can ignore the model.jar and war
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
      <display-name>
    org.eclipse.persistence.example.distributed.ClientEAR</display-name>
      <module>
        <java>org.eclipse.persistence.example.distributed.Model.jar</java>
      </module>
      <module>
        <web>
          <web-uri>org.eclipse.persistence.example.distributed.ClientWeb.war</web-uri>
          <context-root>distributed</context-root>
        </web>
      </module>
      <module>
        <ejb>org.eclipse.persistence.example.distributed.ClientEJB.jar</ejb>
      </module>
    </application>SE java client code (run from Eclipse 3.6 EE edition)
    package org.eclipse.persistence.example.distributed;
    import java.rmi.ConnectException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Map;
    import javax.ejb.EJBException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import org.eclipse.persistence.example.distributed.NodeRemote;
    import org.eclipse.persistence.example.distributed.network.Cell;
    import org.eclipse.persistence.example.distributed.network.Quad;
    import org.eclipse.persistence.example.distributed.network.Wire;
    * This class tests RMI connections to multiple WebLogic servers running on
    * remote JVM's.  It is intended for experimental concurrency investigations only.
    * Note: for non-EE/ejb/web contexts (SE) use wlfullclient.jar generated from
    * $WLS_INSTALL\wlserver_10.3\server\lib>java -jar wljarbuilder.jar
    * 20110106: refactor for generic remote connections
    * @author http://wiki.eclipse.org/User:Michael.obrien.oracle.com 20100916
    public class Host {
        /** RMI server key name - does not need to resolve under DNS */
        public static String serverDNS[] = {"beowulf5","local"};//,"beowulf6"};
        /** RMI t3 URL */
        public static String serverT3[] = {"t3://1n.n.n.n:7001","t3://1n.n.n.n:7001"};
        private int numberServers = serverDNS.length;
        /** list of server names from above arrays */
        private List<String> serverNames = new ArrayList<String>();
        /** Input context map hashtable entries - For JNDI we are forced to use Hashtable instead of HashMap*/
        private Map<String, Hashtable<String, String>> contextHashtableMap
            = new HashMap<String, Hashtable<String, String>>();
        /** output cached context maps for each remote server */
        private Map<String, Context> rmiCachedContextMap
            = new HashMap<String, Context>();
        /** $Proxy remote objects */
        private Map<String, NodeRemote> remoteObjects                                  
            = new HashMap<String, NodeRemote>();
        /** remote propagation value */
        private Map<String, Integer> stateToSet                                                  
            = new HashMap<String, Integer>();
        /** How many processors are available (real + hyperthreaded) */
        private Map<String, Integer> availableProcessors                                  
            = new HashMap<String, Integer>();
        /** whether the node is accepting requests or not */
        private Map<String, Boolean> nodeUnavailable                                     
            = new HashMap<String, Boolean>();
        /** map of t3 protocol URLs */
        private Map<String, String>  serverIPMap                                               
            = new HashMap<String, String>();
        // verify that all EE libraries available via http://download.oracle.com/docs/cd/E12840_01/wls/docs103/client/jarbuilder.html
        private static final String CONTEXT_FACTORY_NAME = "weblogic.jndi.WLInitialContextFactory";
        private static final String SESSION_BEAN_REMOTE_NAME = "ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote";
        //private String sessionBeanRemoteName = "java:comp/env/ejb/Node"; // EE only
        //private String sessionBeanRemoteName = "org_eclipse_persistence_example_distributed_ClientEARorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home" ;
        public Host() {
            // initialize state
            for(int i=0;i<numberServers;i++) {
                // For each server add the name key and corresponding RMI URL
                serverNames.add(serverDNS);
    serverIPMap.put(serverDNS[i], serverT3[i]);
    nodeUnavailable.put(serverDNS[i], false);
    availableProcessors.put(serverDNS[i], 0);
    Hashtable<String, String> aTable = new Hashtable<String, String>();
    contextHashtableMap.put(serverDNS[i],aTable);
    aTable.put(Context.INITIAL_CONTEXT_FACTORY,CONTEXT_FACTORY_NAME);
    aTable.put(Context.PROVIDER_URL, serverT3[i]);
    public void process() {
    // process RMI Objects
    try {           
    NodeRemote aNode;
    StringBuffer aBuffer = new StringBuffer();
    // Endlessly generate RMI requests
    for(;;) {
    // Send messages to entire grid in parallel
    for(String remoteServer : remoteObjects.keySet()) {
    aNode = remoteObjects.get(remoteServer);
    // increment server's pending state
    stateToSet.put(remoteServer, stateToSet.get(remoteServer).intValue() + 1);
    if(!nodeUnavailable.get(remoteServer)) {
    try {
    // Issue: One JVM halt will affect the entire distributed app.
    // don't let a node failure halt the host
    aNode.setState(stateToSet.get(remoteServer)); // this remote call can throw an EJBException wrapping a java.rmi.ConnectException
    aBuffer = new StringBuffer("State from: ");
    aBuffer.append(remoteServer);
    aBuffer.append(" = ");
    aBuffer.append(aNode.getState());
    System.out.println(aBuffer.toString());
    } catch (EJBException e) {
    // weblogic.transaction.internal.TimedOutException: Transaction timed out after 29 seconds
    // or
    // EJBException wrapping a java.rmi.ConnectException if the server is not running
    e.printStackTrace();
    // mark the current node as down, clear the flag in 5 min
    nodeUnavailable.put(remoteServer, true);
    } catch (Exception e) {
    e.printStackTrace();
    public void connect() {
    // Setup RMI Objects
    try {           
    // Establish RMI connections to the session beans
    for(String aServer : serverNames) {
    Context aContext = null;
    try {
    aContext = new InitialContext(contextHashtableMap.get(aServer));
    rmiCachedContextMap.put(aServer, aContext);
    System.out.println("Context for " + aServer + " : " + aContext);
    // For qualified name look for weblogic log "EJB Deployed EJB with JNDI name"
    Object aRemoteReference = aContext.lookup(SESSION_BEAN_REMOTE_NAME);
    System.out.println("Remote Object: " + aRemoteReference);
    // narrow the $proxy remote bean
    NodeRemote aNode = (NodeRemote) PortableRemoteObject.narrow(aRemoteReference, NodeRemote.class);
    remoteObjects.put(aServer, aNode);
    System.out.println("Narrowed Session Bean: " + aNode);
    // initialize state list
    stateToSet.put(aServer, new Integer(0));
    } catch (Exception ce) {
    // server down throws a javax.naming.CommunicationException inside a java.net.ConnectException
    ce.printStackTrace();
    // mark the current node as down, clear the flag in 5 min
    nodeUnavailable.put(aServer, true);
    } catch (Exception e) {
    e.printStackTrace();
    public Map<String, Hashtable<String, String>> getContextMap() {        return contextHashtableMap;    }
    public void setContextMap(Map<String, Hashtable<String, String>> contextMap) {        this.contextHashtableMap = contextMap;    }
    public Map<String, Context> getRmiContextMap() {        return rmiCachedContextMap;    }
    public void setRmiContextMap(Map<String, Context> rmiContextMap) {        this.rmiCachedContextMap = rmiContextMap;    }
    public Map<String, NodeRemote> getRemoteObjects() {        return remoteObjects;    }
    public void setRemoteObjects(Map<String, NodeRemote> remoteObjects) {        this.remoteObjects = remoteObjects;    }
    public Map<String, Integer> getStateToSet() {        return stateToSet;    }
    public void setStateToSet(Map<String, Integer> stateToSet) {        this.stateToSet = stateToSet;    }
    public Map<String, Boolean> getNodeUnavailable() {        return nodeUnavailable;    }
    public void setNodeUnavailable(Map<String, Boolean> nodeUnavailable) {        this.nodeUnavailable = nodeUnavailable;    }
    public Map<String, String> getServerIPMap() {        return serverIPMap;    }
    public void setServerIPMap(Map<String, String> aServerIPMap) {        serverIPMap = aServerIPMap;    }
    public List<String> getServernames() {        return serverNames;    }
    public void setServerNames(List<String> serverNames) {        this.serverNames = serverNames;    }
    public int getNumberServers() {        return numberServers;    }
    public void setNumberServers(int numberServers) {        this.numberServers = numberServers;    }
    public Map<String, Integer> getAvailableProcessors() {        return availableProcessors;    }
    public void setAvailableProcessors(Map<String, Integer> availableProcessors) {        this.availableProcessors = availableProcessors;    }
    public static void main(String[] args) {
    Host host = new Host();
    host.connect();
    host.process();
    Path to run SE client from command line
    java -cp .;wls/wlfullclient.jar org.eclipse.persistence.example.distributed.HostRemote Server Deploy logs
    Local JVM
    ####<18-Jan-2011 11:13:45 o'clock AM VET> <Info> <EJB> <mfobrien-pc2> <AdminServer> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295365425233> <BEA-014021> <The EJB 'Node(Application: _appsdir_org.eclipse.persistence.example.distributed.ClientEAR_ear, EJBComponent: org.eclipse.persistence.example.distributed.ClientEJB.jar)' has been successfully deployed.
    The following remote interfaces have been bound into JNDI with the specified JNDI names:>
    ####<18-Jan-2011 11:13:45 o'clock AM VET> <Info> <EJB> <mfobrien-pc2> <AdminServer> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295365425233> <BEA-014022> <********
    org.eclipse.persistence.example.distributed.NodeRemote is bound with JNDI name:ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote ********>
    ####<18-Jan-2011 11:13:45 o'clock AM VET> <Info> <EJB> <mfobrien-pc2> <AdminServer> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295365425233> <BEA-010009> <EJB Deployed EJB with
    JNDI name _appsdir_org_eclipse_persistence_example_distributed_ClientEAR_earorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home.>
    beowulf5 JVM
    ####<Jan 18, 2011 11:27:46 AM EST> <Info> <EJB> <beowulf5> <AdminServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295368066578> <BEA-014021> <The EJB 'Node(Application: _appsdir_org.eclipse.persistence.example.distributed.ClientEAR_ear, EJBComponent: org.eclipse.persistence.example.distributed.ClientEJB.jar)' has been successfully deployed. The following remote interfaces have been bound into JNDI with the specified JNDI names:>
    ####<Jan 18, 2011 11:27:46 AM EST> <Info> <EJB> <beowulf5> <AdminServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295368066578> <BEA-014022> <******** org.eclipse.persistence.example.distributed.NodeRemote is bound with
    JNDI name:ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote ********>
    ####<Jan 18, 2011 11:27:46 AM EST> <Info> <EJB> <beowulf5> <AdminServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295368066578> <BEA-010009> <EJB Deployed EJB with JNDI name _appsdir_org_eclipse_persistence_example_distributed_ClientEAR_earorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home.>
    local SE client logs
    Context for beowulf5 : javax.naming.InitialContext@9980d5
    Narrowed Session Bean: ClusterableRemoteRef(7753348759447467175S:10.156.53.10:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer [7753348759447467175S:10.156.53.10:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer/292])/292
    Context for local : javax.naming.InitialContext@1a897a9
    Narrowed Session Bean: ClusterableRemoteRef(-5707697697594367270S:10.156.52.246:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer [-5707697697594367270S:10.156.52.246:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer/300])/300
    State from: local = 1
    State from: beowulf5 = 1
    State from: local = 2
    State from: beowulf5 = 2thank you
    Glad to help out.
    /Michael

  • Problem in JNDI lookup.

    Hi,
    I have a JSP running on tomcat. And it accesses an EJB running on weblogic thru a local bean. When the following JNDI lookup code is executed, I get errors. Errors follow the code. Please Help.
    Thanks!
    public InitialContext getInitialContext() throws NamingException
    // Utils.Trace("****** in getInitialContext ******");
    // web logic server and jsp engine NOT weblogic
    if (url != null && url.length() > 0)
    //Hashtable env = new Hashtable();
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    // assumes that JSP and EJB container are on the same box,
    // otherwise EJB hostname should be specified
    //env.put(Context.PROVIDER_URL, "t3://localhost:7001");
    env.put(Context.PROVIDER_URL, url);
    System.out.println("Using t3 services");
    return new InitialContext(env);
    // weblogic server and weblogic jsp, or inprise server (JBuilder's default JSP)
    else
    System.out.println("Not Using t3 services");
    return new InitialContext();
    The ERRORS are
    =====================================================================
    org.apache.jasper.JasperException: weblogic/common/T3Services
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:479)
    root cause
    javax.servlet.ServletException: weblogic/common/T3Services
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)
         at org.apache.jsp.login_jsp._jspService(login_jsp.java:276)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:479)

    Your JSP trying to load the weblogic context factory to perform the lookup, but can't find it. Your servlet engine must have access to the weblogic.jndi.WLInitialContextFactory class (in weblogic.jar).

  • Jndi lookup in resin

    Hi,
              I'm facing problems while lookingup Home, from Resin to
              wlserver6.1.
              I'm new to Resin and unable to find any clean documentation either.
              I'm able to lookup the server from Tomcat, but not from resin.
              The Resin.conf file is like this, jndi props....
              jndiname is: ReteAdminBean
                   <jndi-link>
                   <jndi-name>java:comp/env/ReteAdminBean</jndi-name>
                   <jndi-factory>weblogic.jndi.WLInitialContextFactory</jndi-factory>
                   <init-param java.naming.provider.url="t3://localhost:7001"/>
                   <init-param java.naming.security.principal="system"/>
                   <init-param java.naming.security.credentials="calvin2k"/>
                   <jndi-lookup>ReteAdminHome</jndi-lookup>
                   </jndi-link>
              I'm not very sure of the syntax. Any help?????
              Thanks in advance..
              regards
              tapas
              

    tapas <[email protected]> wrote:
              > Hi,
              > I'm facing problems while lookingup Home, from Resin to
              > wlserver6.1.
              > I'm new to Resin and unable to find any clean documentation either.
              > I'm able to lookup the server from Tomcat, but not from resin.
              > The Resin.conf file is like this, jndi props....
              > jndiname is: ReteAdminBean
              Then why <jndi-lookup> says ReteAdminHome ?
              Also, make sure that you have WebLogic classes in the classpath
              (<classpath id='c:/bea/wlserver6.1/lib/weblogic.jar'/>)
              >      <jndi-link>
              >      <jndi-name>java:comp/env/ReteAdminBean</jndi-name>
              >      <jndi-factory>weblogic.jndi.WLInitialContextFactory</jndi-factory>
              >      <init-param java.naming.provider.url="t3://localhost:7001"/>
              >      <init-param java.naming.security.principal="system"/>
              >      <init-param java.naming.security.credentials="calvin2k"/>
              >      <jndi-lookup>ReteAdminHome</jndi-lookup>
              >      </jndi-link>
              >
              > I'm not very sure of the syntax. Any help?????
              > Thanks in advance..
              > regards
              > tapas
              Dimitri
              

  • JNDI lookup problem in WAS 5.1

    Hello all,
    I have generated an EAR using XDoclet and MyEclipse. When I deploy this EAR on WAS 5.1, I get the following exception:
    javax.naming.NameNotFoundException: Context: WarHog/nodes/WarHog/servers/server1, name: ejb/TEDIObjectManagerLocal: First component in name TEDIObjectManagerLocal not found.  Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at com.ibm.rmi.iiop.CDRInputStream.readBoxedIDLEntity(CDRInputStream.java:2112)
         at com.ibm.rmi.iiop.CDRInputStream.readIDLValue(CDRInputStream.java:2177)
         at com.ibm.rmi.iiop.CDRInputStream.fast_read_value(CDRInputStream.java:1734)
         at com.ibm.rmi.io.IIOPInputStream.readValueType(IIOPInputStream.java:2085)
         at com.ibm.rmi.io.IIOPInputStream.readObjectField(IIOPInputStream.java:2057)
         at com.ibm.rmi.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1765)
         at com.ibm.rmi.io.IIOPInputStream.inputObjectUsingClassDesc(IIOPInputStream.java:1348)
         at com.ibm.rmi.io.IIOPInputStream.continueSimpleReadObject(IIOPInputStream.java:420)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObjectLoop(IIOPInputStream.java:404)
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:347)
         at com.ibm.rmi.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:200)
         at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:1367)
         at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:450)
         at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
         at javax.rmi.CORBA.Util.copyObject(Util.java:333)
         at com.wdc.tedi.interfaces._TransformationEngine_Stub.transform(_TransformationEngine_Stub.java:268)
         at com.wdc.tedi.web.TestHarnessBean.translate(TestHarnessBean.java:42)
         at com.wdc.tedi.web.TestHarnessBean.setDataBlob(TestHarnessBean.java:80)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)First of all, I don't really understand what the error means. Is it that the JNDI lookup failed when one of my beans tried to do a lookup on 'ejb/TEDIObjectManagerLocal'? I believe there's some configuration that went wrong (EJB reference binding or something) when I deployed the EAR. The reason I don't think it's a faulty code is because the EAR runs like a charm when I deploy it on Oracle 10g and Weblogic.
    I am really stuck on this problem and shall appreciate any help that I can get. I can send the code, xdoclet tags and configuration if that might assist someone.
    Thanks
    -ybh6336

    Hello all,
    I'm still stuck on this issue. Following are the entries related to my
    application when I do a 'dumpNameSpace':
       28 (top)/nodes/WarHog/servers/server1/ejb/tedi/TEDIObjectManager
       28
    com.wdc.tedi.interfaces._TEDIObjectManagerHome_Stub
       29 (top)/nodes/WarHog/servers/server1/ejb/tedi/DSValueLookup
       29
    com.wdc.tedi.interfaces._DSValueLookupHome_Stub
       30 (top)/nodes/WarHog/servers/server1/ejb/tedi/TransformationEngine
       30
    com.wdc.tedi.interfaces._TransformationEngineHome_StubObservations:
    - I only see the namespace entries for my Session beans. There's one
    entity bean also which does not show up.
    - I don't see anything for the Local Home interfaces, it shows only the
    Home interfaces.
    As additional information, I'm looking up 'TEDIObjectManagerLocal'
    using 'ejb/TEDIObjectManagerLocal'. I also tried using 'local:ejb/ejb/TEDIObjectManagerLocal' (as Karthyk suggested) and
    'java:comp/env/ejb/TEDIObjectManagerLocal', but that does not work
    either.
    Also, the XDoclet tags that I use to generate the interfaces for
    TEDIObjectManager bean are as follows:
    /* @ejb.bean name="TEDIObjectManager"
    *           display-name="TEDIObjectManager"
    *           description="TEDIObjectManager"
    *           jndi-name="ejb/tedi/TEDIObjectManager"
    *           local-jndi-name="ejb/TEDIObjectManagerLocal"
    *           type="Stateless"
    *           view-type="both"
    * @ejb.util generate="physical"
    * @ejb.ejb-ref ejb-name="TEDIObject"
    * view-type = "local"
    * ref-name = "ejb/TEDIObjectLocal"
    * @oc4j.bean jndi-name="ejb/tedi/TEDIObjectManager"
    */My ejb-jar.xml looks like following for that bean:
    <session >
             <description><![CDATA[TEDIObjectManager]]></description>
             <display-name>TEDIObjectManager</display-name>
             <ejb-name>TEDIObjectManager</ejb-name>
             <home>com.wdc.tedi.interfaces.TEDIObjectManagerHome</home>
             <remote>com.wdc.tedi.interfaces.TEDIObjectManager</remote>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
             <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TEDIObjectManagerSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectLocal</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectLocalHome</local-home>
                <local>com.wdc.tedi.interfaces.TEDIObjectLocal</local>
                <ejb-link>TEDIObject</ejb-link>
             </ejb-local-ref>
          </session>AND following for the bean that is referencing it:
    <session >
             <description><![CDATA[TransformationEngine]]></description>
             <display-name>TransformationEngine</display-name>
             <ejb-name>TransformationEngine</ejb-name>
             <home>com.wdc.tedi.interfaces.TransformationEngineHome</home>
             <remote>com.wdc.tedi.interfaces.TransformationEngine</remote>
    <local-home>com.wdc.tedi.interfaces.TransformationEngineLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TransformationEngineLocal</local>
    <ejb-class>com.wdc.tedi.ejb.TransformationEngineSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             <ejb-local-ref >
                <ejb-ref-name>ejb/TEDIObjectManagerLocal</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.wdc.tedi.interfaces.TEDIObjectManagerLocalHome</local-home>
    <local>com.wdc.tedi.interfaces.TEDIObjectManagerLocal</local>
                <ejb-link>TEDIObjectManager</ejb-link>
             </ejb-local-ref>
          </session>The entries in ibm-ejb-jar-bnd.xmi (generated using MyEclipse) are as
    follows for the two beans:
    <ejbBindings
             xmi:id="Session_bnd_1"
             jndiName="ejb/tedi/TransformationEngine">
             <ejbRefBindings xmi:id="EJBRefBnd_1"
    jndiName="ejb/TEDIObjectManagerLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_1"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TransformationEngine" />
          </ejbBindings>
    <ejbBindings
             xmi:id="Session_bnd_3"
             jndiName="ejb/tedi/TEDIObjectManager">
             <ejbRefBindings xmi:id="EJBRefBnd_2"
    jndiName="ejb/TEDIObjectLocal">
        <bindingEjbRef href="META-INF/ejb-jar.xml#EJBLocalRef_2"/>
             </ejbRefBindings>
             <enterpriseBean
                xmi:type="ejb:Session"
    href="META-INF/ejb-jar.xml#Session_TEDIObjectManager" />
          </ejbBindings>I know I'm swamping the post with code, but please let me know if anyone finds something unusual.
    NOTE: When deploying on WAS, in the 'Map EJB references to beans' step, I'm giving the following values for 'TransformationEngine' bean:
    Reference binding: ejb/TEDIObjectManagerLocal
    JNDI Name: ejb/tedi/TEDIObjectManager
    There's one other similar binding that works for 'TEDIObjectManager'
    bean:
    Reference binding: ejb/TEDIObjectLocal
    JNDI Name: ejb/TEDIObject
    Everything in ejb-jar and ibm-ejb-jar-bnd.xmi look similar for this working bean, there is one difference though, I do the lookup on this one using 'java:comp/env/ejb/TEDIObjectLocal', but I've already tried that for the other one.
    Really appreciate your time.
    Thanks
    -yogesh

Maybe you are looking for