Initial Context Conflict with EJB

Hi People.
I have been trying to debug this follow. I have got a EJB running on a server (in machine A) and I created an initialcontext for the remote EJB.
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
InitialContext contex = new InitialContext(properties);
And on Machine B, I have a JMS server running of which I created another initialContext
try {
InitialContext ic = TopicSend.getInitialContext(CONSTANTS.JMS_SERVER);
ts = new TopicSend();
ts.init(ic, CONSTANTS.CLIENT_ORDER_TOPIC);
System.out.println("Adding a topic Send");
but I have the following security(below), which indicate that the userid of the EJB initialContext has actually spilled over to the declaration of the initialcontext of the JMS. Do Advise......
ERROR MESSAGE
JMS init failed: java.lang.SecurityException: Invalid Subject: principals=[userID]
Start server side stack trace:
java.lang.SecurityException: Invalid Subject: principals=[userID]
at weblogic.security.service.SecurityServiceManager.seal(SecurityServiceManager.java:893)
at weblogic.rjvm.MsgAbbrevInputStream.getSubject(MsgAbbrevInputStream.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:309)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
End server side stack trace
java.lang.SecurityException: Invalid Subject: principals=userID]
Start server side stack trace:
java.lang.SecurityException: Invalid Subject: principals=[userID]
at weblogic.security.service.SecurityServiceManager.seal(SecurityServiceManager.java:893)
at weblogic.rjvm.MsgAbbrevInputStream.getSubject(MsgAbbrevInputStream.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:309)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
End server side stack trace
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy0.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:339)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at JMSApi.TopicSend.init(TopicSend.java:56)

I got the same problem, did u figure out what is the solution?
java.lang.SecurityException: Invalid Subject: principals=[UserID]....
my email address is [email protected]

Similar Messages

  • How OSB pass Initial Context parameters to EJB

    For security reasons I have to pass a ticket (through initial context) to legacy system from OSB for calling EJB, below is a code
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, connectionUrl);
    env.put(javax.naming.Context.SECURITY_PRINCIPAL, ticket);
    env.put(javax.naming.Context.SECURITY_CREDENTIALS, "");
    InitialContext ctx = new InitialContext(env);
    Object homeRef = ctx.lookup("com.cih.services.contact.interfaces.IContactServiceRemote");
    IContactServiceRemoteHome home = (IContactServiceRemoteHome) javax.rmi.PortableRemoteObject
    .narrow(homeRef, IContactServiceRemoteHome.class);
    IContactServiceRemote ejb = home.create();
    Please let me know how we can pass Initial context parameter from Business service or proxy service to legacy system.
    Thanks

    Hi Russ
    Yes, I've done this too. Basic SQL though will not allow the updating of a table inside a function, so we have to get clever. The trick is to use the PRAGMA AUTONOMOUS TRANSACTION command. Here's an example:
    FUNCTION UPDATE_MYTABLE(P_VALUE IN NUMBER)
    RETURN VARCHAR2 IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    UPDATE SCHEMA_OWNER.MY_TABLE SET MY_VALUE = P_VALUE;
    COMMIT;
    RETURN('Done');
    END UPDATE_TABLE;
    When the update has been completed the Discoverer worksheet will respond with 'Done'.
    Everyone: don't forget to grant EXECUTE on this function to all of the necessary users, including the EUL owner, and also don't forget to import the function using the Admin edition so that it is available for the users. You will also need to make sure that all necessary users have been granted the UPDATE privilege on the table.
    I hope this helps
    Regards
    Michael

  • Implicitly Passing a Custom Context with EJB Invocations

    Dimitri, this is most likely one for you.
    We have a need to implicitly pass contextual information with EJB
    invocations. I'd also like to be able to intercept/filter invocations.
    The current approach autogenerates subclasses for the bean
    implementations. In these subclasses, the methods take an additional
    context parameter. From the client perspective, the business delegates
    implicitly provide this parameter.
    I'd like to solve this without code generation.
    The current approach I'm considering is to have a generic command EJB.
    This stateless session bean will take a method signature, method
    parameters, and a context object. The command EJB will delegate these
    invocations to the actual EJBs.
    I will get the client to go through this command EJB by intercepting the
    home lookups. I will wrap the initial context. Using dynamic proxies,
    the new initial context will return a wrapped stub that will actually go
    through the command bean, implicitly passing the thread local context.
    So far as the command bean's configuration goes, I will set to the pool
    size very high (the sum of all of the other stateless session bean pool
    sizes perhaps). I will set the transaction type to Supports and pass on
    any exceptions.
    Can anyone think of a better way to go about this?
    Thanks,
    Bob

    Why do you need the custom context? I have worked with an application that held the SessionContext and wrapped all the methods of the EJB context. This was a maintenance problem because changes to the EJB spec caused the methods to change and therefore the calling code.
    Are you trying to insulate your POJO code from EJB specific classes?

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

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

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

  • Error creating initial context with environment

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

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

  • EJB initial Context

    Any one have set their initial context for EJB for J2eesdk kit similar to Weblogic initial context please mail me i will be grateful to you
    mail:[email protected]

    Have a look at the ServiceLocator pattern, this caches references found and has a method getInitialContext() which instantiates an InitialContext and sets it as a member value of the ServiceLocator which itself is a Singelton.

  • ClassNotFoundException for initial-context-factory using foreign JMS p.

    Hi,
    I am currently working on migrating an application from weblogic 9 to weblogic 10 and I bumped into this issue while MDB connecting to JMS.
    [Loaded cz.jaksky.riskscenario.beans.RiskScenarioServiceLocalHome from file:/C:/SVN/app-WLS10-FRESH/app-deploy/servers/myserver/tmp/_WL_user/performance/nyubkw/point-interfaces.jar]
    <17-Sep-2012 11:01:27 o'clock CEST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: PerformanceAsyncRequestBean is unable to connect to the JMS destination: wls.AsyncQueue. The Error was:
    javax.naming.NoInitialContextException: Cannot instantiate class: cz.jaksky.common.jms.JMSInitialContextFactory [Root exception is java.lang.ClassNotFoundException: cz.jaksky.common.jms.JMSInitialContextFactory]
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at weblogic.deployment.jms.ForeignOpaqueReference.getReferent(ForeignOpaqueReference.java:182)
    at weblogic.jndi.internal.WLNamingManager.getObjectInstance(WLNamingManager.java:96)
    at weblogic.jndi.internal.ServerNamingNode.resolveObject(ServerNamingNode.java:377)
    at weblogic.jndi.internal.BasicNamingNode.resolveObject(BasicNamingNode.java:856)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:209)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
    at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at weblogic.jms.common.CDS$2.run(CDS.java:486)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.jms.common.CrossDomainSecurityManager.runAs(CrossDomainSecurityManager.java:131)
    at weblogic.jms.common.CDS.lookupDestination(CDS.java:480)
    at weblogic.jms.common.CDS.lookupDDAndCalloutListener(CDS.java:345)
    at weblogic.jms.common.CDS.access$100(CDS.java:41)
    at weblogic.jms.common.CDS$DDListenerRegistrationTimerListener.timerExpired(CDS.java:193)
    at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: java.lang.ClassNotFoundException: cz.jaksky.common.jms.JMSInitialContextFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
    ... 23 more
    I am using foreign JMS provider with provided mapping. Config follows:
    ejb-jar.xml:
    <enterprise-beans>
              <message-driven>
                   <ejb-name>PortfolioRetrieverAsyncRequestBean</ejb-name>
                   <ejb-class>cz.jaksky.common.async.AsynchronousRequestMessageBean</ejb-class>
                   <transaction-type>Bean</transaction-type>
                   <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
                   <message-driven-destination>
                        <destination-type>javax.jms.Queue</destination-type>
                        <subscription-durability>Durable</subscription-durability>
                   </message-driven-destination>
                   <message-selector>
                        <![CDATA[ Service IN ('PortfolioRetriever')
                      AND MessageType = 'request'
                      AND BigBox = FALSE
                    ]]>
                   </message-selector>
              </message-driven>
         </enterprise-beans>
    weblogic-ejb-jar.xml:
    <weblogic-enterprise-bean>
              <ejb-name>PortfolioRetrieverAsyncRequestBean</ejb-name>
              <message-driven-descriptor>
                   <pool>
                        <max-beans-in-free-pool>64</max-beans-in-free-pool>
                        <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
                   </pool>
                   <destination-jndi-name>wls.AsyncQueue</destination-jndi-name>
                   <initial-context-factory>weblogic.jndi.WLInitialContextFactory</initial-context-factory>
                   <connection-factory-jndi-name>ServiceLocatorAsyncQueueFactory</connection-factory-jndi-name>
              </message-driven-descriptor>
              <dispatch-policy>PortfolioAsyncQueueWorkManager</dispatch-policy>
         </weblogic-enterprise-bean>
    jmsconfig-jms.xml
    <foreign-server name="TibjmsAsyncServer">
    <default-targeting-enabled>true</default-targeting-enabled>
    <foreign-destination name="AsyncQueue.LOCAL.prgdwm355410.7001">
    <local-jndi-name>wls.AsyncQueue</local-jndi-name>
    <remote-jndi-name>AsyncQueue.LOCAL.prgdwm355410.7001</remote-jndi-name>
    </foreign-destination>
    <foreign-connection-factory name="FTQueueConnectionFactory">
    <local-jndi-name>ServiceLocatorAsyncQueueFactory</local-jndi-name>
    <remote-jndi-name>FTQueueConnectionFactory</remote-jndi-name>
    </foreign-connection-factory>
    <initial-context-factory>cz.jaksky.common.jms.JMSInitialContextFactory</initial-context-factory>
    <connection-url>tcp://JUSD-FTPOIA.jaksky.com:22542,tcp://JUSD-FTPOB.jaksky.com:22543</connection-url>
    </foreign-server>
    Module containing this MDB is packed as an ear file with following structure:
    APP-INF/lib/modules.jar - contains AsynchronousRequestMessageBean class
    APP-INF/lib/interface.jar - contains JMSInitialContextFactory (class used for initial-context-factory)
    portfolio-async.jar
    META-INF/ejb-jar.xml content pasted above
    META-INF/webogic-ejb-jar.xml content pasted above
    Weblogic system classpath doesn't contain any application sepcific libraries.
    This set up was working for weblogic 9 without any problem. I am just wondering what the problem is whether I am faceing class loading issue or JMS configuration issue and how to resolve it.
    Edited by: user13047709 on 18-Sep-2012 07:15
    Edited by: user13047709 on 18-Sep-2012 07:16

    Hi,
    When working with a non-WebLogic JNDI provider (or a non-WebLogic JMS provider), the non-WebLogic client classes must be made available to the classloader of the calling application in WebLogic Server. This is usually accomplished by adding them to the system classpath.
    In your case, WebLogic is looking for a proprietary/foreign JNDI Context Factory class named "cz.jaksky.common.jms.JMSInitialContextFactory", which means you need to make sure that a jar/dir that contains the non-WebLogic class "JMSInitialContextFactory.class" is in the classpath.
    The configuration for this should be similar in WL9 and WL10. It could be that your classpath is already setup to reference the foreign class, but it refers to a directory/jar that you haven't setup yet on your WL10 host.
    HTH,
    Tom

  • Initial context lookup error??

    hi, i keep having a problem with the initial context lookup .
    my bean is RoomManagerBean and its JNDI is IRMS/hotel/RoomManagerBean.
    this is the code:
    Object obj = context.lookup("IRMS/hotel/RoomManagerBean");
    however, the result is always NULL. when i try to edit the path to:
    Object obj = context.lookup("java:comp/env/IRMS/hotel/RoomManagerBean");
    , i will get the error: object not bound to name: java:comp/env/IRMS/hotel/RoomManagerBean
    is it becasue my path name is wrong? or the JNDI name? pls help me with this, highly appreciated :)

    ok here's my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/RoomManager</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>IRMS.hotel.RoomManagerLocalHome</local-home>
    <local>IRMS.hotel.RoomManagerLocal</local>
    <ejb-link>IRMS-EJBModule.jar#RoomManager</ejb-link>
    </ejb-local-ref>
    </web-app>
    as u can see, the ejb ref is there. however, when i try to run the file, it gives me the error: Unresolved: <ejb-link>. what does it mean and how to solve it? because i checked the JNDI name for room manager, it's IRMS/hotel/RoomManager. and under the ejb-jar.xml, here is a portion of it in relation to the roommanager:
    <session>
    <display-name>RoomManagerSB</display-name>
    <ejb-name>RoomManager</ejb-name>
    <local-home>IRMS.hotel.RoomManagerLocalHome</local-home>
    <local>IRMS.hotel.RoomManagerLocal</local>
    <ejb-class>IRMS.hotel.RoomManagerEJB</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    <ejb-local-ref>
    <ejb-ref-name>ejb/Room</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>IRMS.hotel.RoomLocalHome</local-home>
    <local>IRMS.hotel.RoomLocal</local>
    <ejb-link>Room</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/Room</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>IRMS.hotel.RoomLocalHome</local-home>
    <local>IRMS.hotel.RoomLocal</local>
    <ejb-link>Room</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/Room</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>IRMS.hotel.RoomLocalHome</local-home>
    <local>IRMS.hotel.RoomLocal</local>
    <ejb-link>Room</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>IRMS/hotel/RoomManager</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>IRMS.hotel.RoomManagerLocalHome</local-home>
    <local>IRMS.hotel.RoomManagerLocal</local>
    <ejb-link>RoomManager</ejb-link>
    </ejb-local-ref>
    </session>
    can u solve this? thanks

  • Initial Context response times

    Hi,
    What is the generally accepted timings to obtain an intial context first
    time from a client app to a remote EJB Server. My timings have shown that
    even on my development machine with a local Weblogic server its can take
    easily take upto 5 or 6 seconds to obtain an initial context. Using an IP
    Address to avoid resolving a domain name makes little difference.
    Thanks,
    Pete.
    KB Group Ltd
    http://www.kbgroup.co.nz

    See:
    news://www4.weblogic.com/<[email protected]>
    Cheers
    Mark G.
    Toby Allsopp wrote:
    I was just looking at this last week. What we see is that the time taken to
    obtain an InitialContext is pretty much constant at about 5-6 seconds as the
    number of concurrent client connections increases, until you hit the number of
    socket reader threads that you have configured. At that point, the time taken
    increases by about 1 seconds for each additional client connection.
    This is using WL 4.0.3 under IRIX. We have seen similar results with the
    server running under NT, but the situation is much better when using the
    native performance pack (i.e. the times stay at about 5 or 6 seconds even for
    a lot of client connections).
    We have attributed the slow-down as the number of clients increases to the
    lack in the java.net API of anything resembling the select(2) function. We are
    assuming that this functionality is provided by the native performance packs.
    However, this doesn't explain why it takes 5 or 6 seconds to get one.
    Toby Allsopp.
    Jerry Taylor wrote:
    We experience waits of 20 -30 seconds quite regularly.....
    Pete Bent <[email protected]> wrote in message
    news:7um2en$3qf$[email protected]..
    Hi,
    What is the generally accepted timings to obtain an intial context first
    time from a client app to a remote EJB Server. My timings have shown that
    even on my development machine with a local Weblogic server its can take
    easily take upto 5 or 6 seconds to obtain an initial context. Using an IP
    Address to avoid resolving a domain name makes little difference.
    Thanks,
    Pete.
    KB Group Ltd
    http://www.kbgroup.co.nz
    Toby Allsopp
    Research & Development
    Peace Software International Ltd
    Ph +64-9-3730400--
    =====================================================
    Reply to the newsgroup. Don't reply to this mail
    alias. This is used only for answering posts on
    WebLogic Newsgroups.
    =====================================================

  • Weblogic 10 Initial context issue...?

    Hi All,
    Please provide a suggestion for the same.
    InitialContext not getting loaded properly and the weblogic jars are also there in the cp
    Re: Exception in Initial Context Weblogic 10
    thx in Adv.

    Hi RainaV,
    This problem looks like a Weblogic library conflict in your runtime environment.
    java.lang.NoSuchMethodError: weblogic.common.internal.VersionInfo.initialize(Z)V
    at weblogic.kernel.Kernel.initialize(Kernel.java:88)
    This means you have some possible mix of old and new Weblogic binaries loaded in your classpath. The Exception means that the compiled version of the Kernal class (loaded in your system classpath) is refering a different version of the class weblogic.common.internal.VersionInfo, with different initialize() method signature.
    Please have a look at your full classpath and look any for duplicate and conflicted version of the weblogic.jar library.
    Also, which version of weblogic client are you using? There is no such VersionInfo class in Weblogic 10.0.x. Please have a look at the MANIFEST file of the weblogic.jar you are using to confirm. You are likely trying to use an older client like Weblogic 9.x.
    Regards
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • Initial context

    Hi!
    I am using a jndi initial context object to lookup my ejbs in weblogic.
    There are places, where I initialize the initial context differently. I was
    wondering if it's ok to do that.
    For example,
    Scenario A:
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Scenario B:
    HashMap prop = new HashMap();
    prop.set(contextFactory, ...);
    prop.set(providerUrl, ...);
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Should I foresee any kind of problems with Scenario A. Does weblogic know
    what context factory and provider url to use if I don't mention it.
    Thanks in advance,
    Van

    If you are creating InitialContext inside the container, you
    do not need to specify any properties - it is container's responsibility
    to set them up.
    van saravanan <[email protected]> wrote:
    Hi!
    I am using a jndi initial context object to lookup my ejbs in weblogic.
    There are places, where I initialize the initial context differently. I was
    wondering if it's ok to do that.
    For example,
    Scenario A:
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Scenario B:
    HashMap prop = new HashMap();
    prop.set(contextFactory, ...);
    prop.set(providerUrl, ...);
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Should I foresee any kind of problems with Scenario A. Does weblogic know
    what context factory and provider url to use if I don't mention it.
    Thanks in advance,
    Van--
    Dimitri

  • Initial Context Factory

    Hi
    I am trying to develop a EJB Project and trying to call the EAR depployed on the server using JNDI.
    I am writing the code using Java Client
    Can i have the name of Initial Context Factory for WAS 6.40.
    Its Urgent
    With Wishes
    Krishna Kanth

    Hi,
    the Initial context factory on Web AS 6.40 is
    com.sap.engine.services.jndi.InitialContextFactoryImpl

  • Creating initial context from a java client

    I have tried to create intial context from a java client.....
    but that gives me the following exception:
    My code:TestClient.java
    import java.util.*;
    import javax.naming.*;
    public class TestClient
    public static void main(String nilesh[]) throws NamingException
    Hashtable hash = new Hashtable();
    hash.put("Context.INITIAL_CONEXT_FACTORY","com.evermind.server.rmi.RMIInitialContextFactory");
    hash.put("Context.PROVIDER_URL","ormi://localhost:23791/symularity");
    hash.put("Context.SECURITY_PRINCIPAL","admin");
    hash.put("Context.SECURITY_CREDENTIALS","admin");
    Context ctx = new InitialContext(hash);
    System.out.println("Context: "+ctx);
    The output is:
    ERROR! Shared library ioser12 could not be found.
    Exception in thread "main" javax.naming.NamingException: Error accessing repository: Cannot con
    nect to ORB
    at com.sun.enterprise.naming.EJBCtx.<init>(EJBCtx.java:51)
    at com.sun.enterprise.naming.EJBInitialContextFactory.getInitialContext(EJBInitialConte
    xtFactory.java:62)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at TestClient.main(TestClient.java:14)
    is anybody able to solve my problem....
    Thanks in advance..
    NileshG

    Nilesh,
    First of all make sure that the shared library error you are getting is fixed by including the library in your classpath. Secondly, where are you running the client from? The connection factory that you use varies depending on where you are connecting from:
    1. ApplicationClientContextFactory is used when looking up remote objects from standalone application clients. This uses refs and mappings in application-client.xml.
    2. RMInitialContextFactory is used when looking up remote objects between different containers.
    3. ApplicationInitalContextFactory is used when looking up remote objects in same application. This is the default initial context factory and this uses refs/mappings in web.xml and ejb-jar.xml.
    Rob Cole
    Oracle Hello Rob cole..
    thank u for ur reply...but actualy i dont know what is application-client.xml and where i can find that file in my j2ee folder...can u give me detail explanation about that...actually i have not created any application or not deployed also without deploying any application i have created that TestClient.java class so how it will relate with application-client.xml....so i have changed the lookup code with ApplicaitonClientContextFactory...but still the same error is coming......can u give me the full explanation or solution of my problem...
    Thanks & Regards
    NileshG...

  • Initial context and PROVIDER_URL default

    I´d like a short way to put into the initial context the correct provider.
    Default value of PROVIDER_URL is "t3://localhost:7001", but this is tied to a specific port (I run two instances of Weblogic in a development environment).
    How can I detect on wich port is running my instance of weblogic server in order to put the provider value in an independent way.
    Thanks,

    I am fairly new to JBoss as well, so I may be of limited help here. Although JBoss can use a jndi.properties file (as you are using) I have not experimented with this appraoch as of yet ...I supply a Hashtable filled with the appropriate properties.
    i.e.
        java.util.Hashtable props = new java.util.Hashtable();
         props.put(
          Context.INITIAL_CONTEXT_FACTORY,
        props.put(
          Context.PROVIDER_URL,
        props.put(
          Context.URL_PKG_PREFIXES,
        Context ctx = null;
        try {
           ctx = new InitialContext(props);
        } catch (NamingException ne) {
          System.out.println("Failed to create JNDI context from EJB server.");
          System.out.println(ne.toString(true));
        }However, I am starting to think this might not be the problem. I was reading the JBoss newsgroup yesterday and there are some jars from the JBoss "client" folder that need to be included in the classpath when running your client, but I sent the doc I created home (I could verify for you later if we can'y figure it out here from memory). You need two for sure, one being $JBOSS_HOME/client/log4j.jar and the other being (something like) $JBOSS_HOME/client/clientall-jboss.jar
    If you experiment with what you find in the client folder in the JBoss install dir, you will likely find the jars you need in the classpath by process of elimination.
    Hope this helps, sorry all my references are at home at the moment.
    GumB.

  • Help With EJB Client

    I have successfully gotten my client to run when I use the appclient with the reference implementation. When I try to run my simple client outside of appclient I get the following error.
    Exception: javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: I
    DL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    I have my client.jar which is returned from the deploy tool, I have the j2ee.jar in my classpath, and I have my jndi name set up as ejb/Hello in the server. My code to access this is such:
    public static void main(String[] args)
    try
    System.out.println("Adding properties");
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://MyHost:3700");
    Context initial = new InitialContext(env);
    System.out.println("Got initial context!");
    Object o = initial.lookup("java:comp/env/ejb/Hello");
    System.out.println("got object from lookup");
    HelloHome home = (HelloHome)PortableRemoteObject.narrow(o, com.tosht.ejb.HelloHome.class);
    System.out.println("got home object back and did remote narrow cast");
    Hello h = home.create();
    System.out.println("got component interface");
    System.out.println(h.sayHello());
    System.out.println("called business method on component interface");
    catch(Exception ex)
    System.out.println("Exception: " + ex.toString());
    I am sure this is a jndi issue, but in the deploy tool my applications jndi name for my component is ejb/Hello just as it is in code?
    Any help would be greatly appreciated!!!!!

    Hi Tim,
    Couple things I can think of. 1) Are you sure that the ejb application deployed correctly? ejb/Hello does look like the right global JNDI name given the sun-ejb-jar.xml, so one explanation is that the ejb is not found because it wasn't deployed at all or wasn't deployed successfully. 2) It's worth double-checking that you have the correct client code compiled and found at runtime. Is it possible there is still the old version of the client main class that is looking up java:comp/env/ejb/Hello?
    One final suggestion is to print the exception.printStackTrace() rather than exception.toString(). There is often very valuable information about the exception that is not printed out as part of toString().
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

Maybe you are looking for