Using service Locator pattern to dynamically access remote EJBs

Hi All,
Please help to guide me how I can use a service locator to retrieve a remote object (residing on another application but on same domain) .
I do not want to use Dependency Injection since I want to dynamically discover them ( there are many implementations of same interface (POJO)). Each EJB implementation implements its own remote/local interface that extends this global POJO interface.
I have two J2ee-Applications on same domain. J2EE-Application 1 has an EJB module (EJB Module 1) that intends to access an EJB Module (EJB Module 2) in J2EE-Application 2. Following observations:
1. Dependency Injection fails if (include the EJB Module 2 jar in J2EE-Application 1). Reason App Server complains the EJB has been deployed (Deployment fails)
2. Dependency Injection works if (exclude the EJB Module 2 jar in J2EE-Application 1) and include the Remote Interface in EJB Module 1(J2EE-Application 1).Positive Observation (Deployment success and DI also success)
3.Using Service Locator to retrieve the remote object if (exclude the EJB Module 2 jar in J2EE-Application 1) and include the Remote Interface in EJB Module 1(J2EE-Application 1). Negative and Positive Observation.
Positive Observation: Using dependency injection I can still retrieve the Remote Object
Another Positive: The Service Locator remote lookup to another Bean in same Application but different EJB Module is successful.
Negative Observation:
The Service Locator lookup to this same remote object with Successful Dependency Injection fails (An Ejb in a different application).
Can't retrieve the Remote Object with Service Locator. Message from Server:.
NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial.
Thanks in advance

"I do not want to use Dependency Injection since I want to dynamically discover them ( there are many implementations of same interface (POJO))"
If you're calling ejbs from other ejbs or servlets, the same could probably be acomplished by using dependency injection (@EJB) in a number of instance variables typed with different remote/local interfaces or even with different beanName attributes (for when more than one bean implements the same managed interface in the same app - not sure how it works outside the same jee app...) , and dinamically selecting one of them; or encapsulating those injected variables into a stateless ejb as your service locator to make them accessible from POJOs too (which, due to concurrent acess, wouldn't work for statefull ejbs references...).
Anyway, using the jndi lookup service locator pattern seems ok in this case.
What doesn't seem ok, given the nature of the error for the negative observation - jndi context initialization - is that
Another Positive: The Service Locator remote lookup to another Bean in same Application but different EJB Module is successful.
Can you check your code and reconfirm that you're using the same context initialization code for both the positive and negative observations ?

Similar Messages

  • Error during JNDI lookup Accessing Remote EJB (access to web service restricted using declarative security model)

    Hello everyone,
    I developed a Web Service prototype accessing remote EJB using the EJB
    control with special syntax in the jndi-name attribute: @jws:ejb
    home-jndi-name="t3://10.10.245.70:7131/AccountDelegatorEJB"
    Everything works fine, but I get an error when I restrict access to my web
    service with a declarative security model by implementing steps provided in
    help doc:
    - Define the web resource you wish to protect
    - Define which security role is required to access the web resource
    - Define which users are granted the required security role
    - Configure WebLogic Server security for my web service(Compatibility
    Security/Users)
    I launch the service by entering the address in a web browser. When prompted
    to accept the digital certificate, click Yes, when prompted for network
    authentication information, enter username and password, navigate to the
    Test Form tab of Test View, invoke the method by clicking the button and I
    get the following exception:
    <error>
    <faultcode>JWSError</faultcode>
    <faultstring>Error during JNDI lookup from
    jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookup failed for
    name:t3://10.10.245.70:7131/AccountDelegatorEJB]</faultstring>
    <detail>
    <jwErrorDetail> weblogic.jws.control.ControlException: Error during JNDI
    lookup from jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookup failed
    for name:t3://10.10.245.70:7131/AccountDelegatorEJB] at
    weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
    8) at
    weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
    .java:220) at
    weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
    ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
    ibas.GetSecure.retrieveVisaHistoryTxn(GetSecure.jws:64) </jwErrorDetail>
    </detail>
    </error>
    I have a simple Hello method as well in my WebService (which is also
    restricted) and it works fine, but remote EJB access doesn't. I tested my
    prototype on Weblogic 7.2 and 8.1 platforms - same result.
    Is that a bug or I am missing some additional configuration in order to get
    that working. Has anyone seen similar behavior? Is there a known resolution?
    Or a suggested way to work around the problem?
    Thank you.
    Andre

    Andre,
    It would be best if this issue is handled as an Eval Support case. Please
    BEA Customer Support at http://support.beasys.com along with the required
    files, and request that an Eval support case be created for this issue.
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Andre Shergin" <[email protected]> wrote in message
    news:[email protected]...
    Anurag,
    I removed "t3", still get an error but a different one (Unable to create
    InitialContext:null):
    <error>
    <faultcode>JWSError</faultcode>
    <faultstring>Error during JNDI lookup from
    jndi://secuser1:[email protected]:7131/AccountDelegatorEJB[Unable to
    create InitialContext:null]</faultstring>
    <detail>
    <jwErrorDetail> weblogic.jws.control.ControlException: Error during JNDI
    lookup from
    jndi://secuser1:[email protected]:7131/AccountDelegatorEJB[Unable to
    create InitialContext:null] at
    weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
    8) at
    weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
    .java:220) at
    weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
    ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
    ibas.GetVisaHistoryTransactions.getVisaHistoryTxn(GetVisaHistoryTransactions
    .jws:67) </jwErrorDetail>
    </detail>
    </error>
    Note: inter-domain communication is configured properly. The Web Service to
    remote EJB works fine without a declarative security.
    Any other ideas?
    Thank you for your help.
    Andre
    "Anurag" <[email protected]> wrote in message
    news:[email protected]...
    Andre,
    It seems you are using the URL
    jndi:t3://secuser1:[email protected]:7131/AccountDelegatorEJB
    whereas you should not be specifying the "t3:" protocol.
    The URL should be like
    jndi://secuser1:[email protected]:7131/AccountDelegatorEJB
    Please do let me know if you see any issues with this.
    Note that this will only allow you to access remote EJBs in the same WLS
    domain. For accessing EJBs on another domain, you need to configure
    inter-domain communication by
    following a few simple steps as mentioned at
    http://e-docs.bea.com/wls/docs81/ConsoleHelp/jta.html#1106135. This link has
    been provided in the EJB Control Workshop documentation.
    Regards,
    Anurag
    "Andre Shergin" <[email protected]> wrote in message
    news:[email protected]...
    Raj,
    I tried that before, it didn't help. I got similar error message:
    <error>
    <faultcode>JWSError</faultcode>
    <faultstring>Error during JNDI lookup from
    jndi:t3://secuser1:[email protected]:7131/AccountDelegatorEJB[Lookup
    failed for
    name:t3://secuser1:[email protected]:7131/AccountDelegatorEJB]</faultstr
    ing>
    <detail>
    <jwErrorDetail> weblogic.jws.control.ControlException: Error during JNDI
    lookup from
    jndi:t3://secuser1:[email protected]:7131/AccountDelegatorEJB[Lookup
    failed for
    name:t3://secuser1:[email protected]:7131/AccountDelegatorEJB] at
    weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
    8) at
    weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
    .java:220) at
    weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260) at
    ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
    ibas.GetSecure.retrieveVisaHistoryTxn(GetSecure.jws:64) </jwErrorDetail>
    </detail>
    </error>
    Anything else should I try?
    P.S. AccountDelegatorEJB, the remote EJB my Web Service calls is NOTaccess
    restricted.
    I hope there is a solution.
    Thanks,
    Andre
    "Raj Alagumalai" <[email protected]> wrote in message
    news:[email protected]...
    Andre,
    Can you try using the following url with username and password
    jndi://username:password@host:7001/my.resource.jndi.object ?
    once you add webapp level security, the authenticated is the user who
    invokes the EJB.
    http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/ejb/con
    CreatingANewEJBControl.html?skipReload=true
    has more info on using remote EJB's.
    Hope this helps.
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Alla Resnik" <[email protected]> wrote in message
    news:[email protected]...
    Hello everyone,
    I developed a Web Service prototype accessing remote EJB using the EJB
    control with special syntax in the jndi-name attribute: @jws:ejb
    home-jndi-name="t3://10.10.245.70:7131/AccountDelegatorEJB"
    Everything works fine, but I get an error when I restrict access to my
    web
    service with a declarative security model by implementing steps
    provided
    in
    help doc:
    - Define the web resource you wish to protect
    - Define which security role is required to access the web resource
    - Define which users are granted the required security role
    - Configure WebLogic Server security for my web service(Compatibility
    Security/Users)
    I launch the service by entering the address in a web browser. Whenprompted
    to accept the digital certificate, click Yes, when prompted for
    network
    authentication information, enter username and password, navigate tothe
    Test Form tab of Test View, invoke the method by clicking the buttonand
    I
    get the following exception:
    <error>
    <faultcode>JWSError</faultcode>
    <faultstring>Error during JNDI lookup from
    jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookup failed for
    name:t3://10.10.245.70:7131/AccountDelegatorEJB]</faultstring>
    <detail>
    <jwErrorDetail> weblogic.jws.control.ControlException: Error during
    JNDI
    lookup from jndi:t3://10.10.245.70:7131/AccountDelegatorEJB[Lookupfailed
    for name:t3://10.10.245.70:7131/AccountDelegatorEJB] at
    weblogic.knex.control.EJBControlImpl.acquireResources(EJBControlImpl.java:27
    8) at
    weblogic.knex.context.JwsInternalContext.acquireResources(JwsInternalContext
    .java:220) at
    weblogic.knex.control.ControlHandler.invoke(ControlHandler.java:260)at
    ibas.AccountControl.getTransactionHistory(AccountControl.ctrl) at
    ibas.GetSecure.retrieveVisaHistoryTxn(GetSecure.jws:64)</jwErrorDetail>
    </detail>
    </error>
    I have a simple Hello method as well in my WebService (which is also
    restricted) and it works fine, but remote EJB access doesn't. I testedmy
    prototype on Weblogic 7.2 and 8.1 platforms - same result.
    Is that a bug or I am missing some additional configuration in order
    to
    get
    that working. Has anyone seen similar behavior? Is there a knownresolution?
    Or a suggested way to work around the problem?
    Thank you.
    Andre

  • Service Locator pattern question.

    Hi,
    We have this kind of service locator which provides the caller a reference to a remote interface instead of to the home interface of the session bean. We're working with weblogic 6.1. My question, is it ok to store a reference to a remote interface in the service locator or is it better to store a reference to the home interface or .... is it better to not store them but every time create one when a client wants one. What is the best way and the pros and cons.
    Cheers!

    Hi,
    typically it is more common to just cache Homes and Factories in the ServiceLocator pattern.
    We have a detailed example of the Service Locator pattern applied in an application at http://java.sun.com/blueprints/patterns/ServiceLocator.html
    We cache the EJB Homes and other Factories.
    http://java.sun.com/blueprints/code/jps131/src/com/sun/j2ee/blueprints/servicelocator/web/ServiceLocator.java.html
    This allows the Service Locator to be used as a utility class. We have a Service Locator used by the web tier, and also one used by the EJB tier to lookup other EJBs and resources.
    hope that helps,
    Sean

  • Service Locator Pattern

    I have a question about the Service Locator Pattern. If The service locator caches the EJBHome references in a Hashmap and retreives them though a method, does that method need to be synchronized for Thread Safety?
    If it has to be synchronized, doesnt it introduce performance bottle neck by letting only 1 thread access the method at any time?
    Please see code snippet below...
    Thanks,
    Krish
    public static synchronized EJBHome getHome(Class homeClass) throws NamingExeption {
    EJBHome home = (EJBHome) this.homes.get(homeClass);
    if(home == null) {
    ctx = getInitialContext();
    home = (EJBHome) PortableRemoteObject.narrow(ctx.lookup(homeClass.getName()),homeClass);
    this.homes.put(homeClass,home);
    return home;
    }

    Hi,
    Take a look at the below thread on server side which discusses this issue in details.
    http://www.theserverside.com/discussions/thread.tss?thread_id=14992
    Anil

  • Security issue to access remote ejbs, URGENT!!! please and thanks.

    Hi gurus:
    I have questions for you. I need to access remote ejbs. the ejb(beans) have been
    deployed on remote machine. I have helper class file to do JNDI lookup to point
    the machine and find it.
    I have local machine to have all of home interfaces, remote interfaces and stub
    classes and common classes. I have local jsp and config weblogic-web.xml to allow
    test user to access.
    Sometimes fine but got the following message and error from my local machine.
    I have no clue about that. Is any other issue that remote machine have security
    to limit clients to access beans. Because remote wl server startup as system/weblogic.
    If my local machine startup as system/weblogic too. It has no problem at all.
    This doesn't make sense for my local machine has to have same system's password
    as remote machine. Should have some issues to limit clients to access remote beans.
    Thank you for any helps and suggestions in advance.
    Steven.
    ####<Jun 7, 2001 10:34:25 AM CDT> <Error> <HTTP> <stevenzhu> <myserver> <ExecuteThread-14>
    <springbow> <> <101020> <[WebAppServletContext(8365803,public_html)] Servlet failed
    with Exception>
    java.lang.SecurityException: Authentication for user test denied in realm wl_realm
    at weblogic.rmi.internal.AbstractOutboundRequest.sendReceive(AbstractOutboundRequest.java:90)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:247)
    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 com.sprint.common.util.EJBHelper.getHomeInterface(EJBHelper.java:172)
    at com.sprint.common.util.EJBHelper.getOrganizationSLHome(EJBHelper.java:122)
    at com.sprint.common.organization.OrganizationBean.getOrganizationHome(OrganizationBean.java:290)
    at com.sprint.common.organization.OrganizationBean.getOrganizationRemote(OrganizationBean.java:315)
    at com.sprint.common.organization.OrganizationBean.findEmployee(OrganizationBean.java:107)
    at jsp_servlet._ehr._vieworganizationalhierarchy._jspService(_vieworganizationalhierarchy.java:173)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:208)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:1127)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1529)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    well, if we post in other threads, they tell me that it is ARD and server technology. If you try to post back to my mac in the normal threads about Leopard, they point us to this thread.
    It seems that a lot of people are frantically looking for someone who can explain in plain english how to do the remote desktop - is remote desktop the same technology as back to my mac?
    Extremely frustrating for people like me who don't have unix or programming language experience... We choose for mac because we wanted user friendlyness... What a joke!

  • Using Service Locator in Struts app without ant eejb components

    Hi
    We are developing a Struts application witjout any EJB components.
    But we may go for EJB in future.
    Keeping that in mind we want to introduce a service locator between the action class and the business logic. So it may be easier to acomodate in future.
    But how do i do that ? Can anyone help me in this?
    Since all the Service locator example which i have seen is implemented using ejb
    Please do help me in this
    Thanks
    Ottran

    Controller (Action class) gets reference to Business Delegate (BD) and calls a particular business method.
    The BD gets reference to Service Locator (from JNDI tree) to access a business service. The business sevice can be implemented using EJB, POJO, Web Service, legacy app, etc.
    A UML diagram is available at
    http://www.softwareleadership.org/docs/J2EEDesignPatterns.html
    Click on Business Delegate to view diagram with Service Locator.

  • Unable to access  Remote EJB with jndi.properties in classpath

    Hi
    I'm trying to use remote interfaces with my adf web layer.
    Created remote datacontrol for my model part and my model EAR is deployed in another Oracle App Server instance(S1).
    My web layer is deployed in another Oracle App Server(S2). My page def uses the remote interfaces.
    Following are the files which are needed to have ejb ref entry.
    ---- orion-web.xml ----
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <orion-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd"
    schema-major-version="10" schema-minor-version="0"
    servlet-webdir="/servlet/" >
    <ejb-ref-mapping name="MySessionEJB" location="MySessionEJB"
    remote-server-ref="true"
    jndi-properties-file="jndi.properties"></ejb-ref-mapping>
    </orion-web-app>
    --- web.xml ---
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app 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" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>oracle.adf.view.faces.USE_APPLICATION_VIEW_CACHE</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>CpxFileName</param-name>
    <param-value>com.home.view.DataBindings</param-value>
    </context-param>
    <filter>
    <filter-name>PCF</filter-name>
    <filter-class>oracle.webcache.adf.filter.FacesPageCachingFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>PCF</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>AFCStatsServlet</servlet-name>
    <servlet-class>oracle.webcache.adf.servlet.AFCStatsServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>1</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
    <jsp-config/>
    <ejb-ref>
    <ejb-ref-name>MySessionEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <remote>com.home.model.MySessionEJBRemote</remote>
    <ejb-link>MySessionEJB</ejb-link>
    </ejb-ref>
    </web-app>
    and this jndi.properties file in placed in the WEB-INF/classes folder.
    java.naming.factory.initial=oracle.j2ee.rmi.RMIInitialContextFactory
    java.naming.security.principal=oc4jadmin
    java.naming.security.credentials=welcome123
    java.naming.provider.url=opmn:ormi://S1:6003:Test_Instance/test-ejb
    The same web application if I run it in Jdeveloper its able to open the welcome.jspx which calls the remote EJB method on load. But when I deploy it Oracle Server 10.1.3.1.0 the error "500 Internal Server Error" shows up and in log file following exception can be found
    avax.faces.el.EvaluationException: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg
    =JBO-29000: Unexpected exception caught: javax.naming.NameNotFoundException, msg=MySessionEJB not found
    Seems like the jndi properties is ignored during the Context creation for lookup.
    Please advice where I'm missing the configuration.

    http://docs.sun.com/source/819-0079/dgjndi.html

  • Accessing Remote EJBs

    I am trying to access an EJB on a remote server using the following code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
            "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL,
            "iiop://190.30.123.34:1050");
    InitialContext initial = new InitialContext(env);
    Context environment (Context)initial.lookup("java:comp/env");
    Object ref = environment.lookup("ejb/lands.mc.bus.TopoMap");
    home = (TopoMapHome) PortableRemoteObject.narrow(ref, TopoMapHome.class);I have the following entry in my web.xml:
    <ejb-ref>
    <ejb-ref-name>ejb/lands.mc.bus.TopoMap</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>lands.mc.bus.TopoMapHome</home>
    <remote>lands.mc.bus.TopoMap</remote>
    </ejb-ref>But when ever i perform the environment lookup, i get the following error:
    javax.naming.NamingException: Cannot create resource instance
    When i print out the bindings, the TopoMap binding is present.
    Can anyone suggest what i might be doing wrong?
    Thanks
    toby

    Tried that, gives me this error:
    javax.naming.NameNotFoundException: Name lands.mc.bus.TopoMap is not bound in this ContextIf i change
    env.put(Context.PROVIDER_URL,"iiop://190.30.123.34:1050");To a non existent URL, tells me it cant connect to the ORB, so its definitly connecting properly. I also noticed that when i print out the bindings, it prints out only those that are in my web.xml file for the tomcat server, not the bindings that are on 190.30.123.34 (J2EE server).
    Any other suggestions?
    Thanks,
    Toby

  • Access remote ejb in oc4j

    I use oc4j in jdeveloper 10G in access a remote EJB using
    sample java client both of EJB and java client on MY COMPUTER
    AS SERVER I THINK I HAVE PROBLEM IN SETTING CLASS PATHS
    I HAVE DOWNLOAD J2EE SDK VER 1.3.1 AND I ASSIGN MY CLASSPATHS
    AS FOLLOWS:
    C:\java_course1\jdbc\lib\classes12.jar;C:\java_course1\jdbc\lib\nls_charset12.jar; c:\java_course1\j2ee\home\lib;c:\java_course1\lib\ ; C:\J2Sdkee1.3.1\lib\j2ee.jar
    java_course1 is folder of jdeveloper
    j2Sdkee.1.3.1 is J2EE SDK VER 1.3.1
    the code i have written in java client
    env.put(Context.INITIAL_CONTEXT_FACTORY,"RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23893/current-workspace-app");
    Context context = new javax.naming.InitialContext(env);
    EmpHome empHome = (EmpHome)PortableRemoteObject.narrow(context.lookup("EmpHome"), EmpHome.class);
    I get the following error message
    javax.naming.NoInitialContextException: Cannot instantiate class: RMIInitialContextFactory [Root exception is java.lang.ClassNotFoundException: RMIInitialContextFactory]
    Is Someting is missed in class pathes or should i copy j2ee.jar file from
    C:\J2Sdkee1.3.1\lib\j2ee.jar to oc4j folder

    Thank you for useful information i found in site
    But if you help me if defintions of class passes i have assigned and
    show in my message are correct or I have missed something weather
    in class paths or environment variables
    Again Thanks a lot

  • Accessing remote EJBs while debugging using the Embedded Application Server

    I'm trying to configure to debug a multi-tier application (servlets + EJBs) where a servlet accesses EJBs set up on a second OC4J application server. I've set up rmi.xml in the embedded application server to reference my second application server by adding the line.
    <server host="127.0.0.1" username="admin" port="23791" password="password"/>
    When I run the embedded application server it seems to hang, with the stack in
    the following state:
    OC4J main()
    OC4J launchOC4JCommandLine()
    ApplicationServer launchCommandLine()
    Thread join()
    Thread join(0)
    Object wait(0)
    The following exception is generated on the second application server
    C:\Program Files\Oracle\JDeveloper9i\j2ee\home>java -jar oc4j.jar
    Oracle9iAS (9.0.2.0.0) Containers for J2EE initialized
    java.lang.NullPointerException
    java.lang.ClassLoader com.evermind.server.rmi.RMIInputStream.getClassLoa
    der()
    java.lang.Class com.evermind.server.rmi.RMIInputStream.resolveClass(java
    .io.ObjectStreamClass)
    java.io.ObjectStreamClass java.io.ObjectInputStream.inputClassDescriptor
    java.lang.Object java.io.ObjectInputStream.readObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject()
    int java.io.ObjectInputStream.inputObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject(boolean)
    java.lang.Object java.io.ObjectInputStream.readObject()
    void com.evermind.server.rmi.RMIConnection.handleBindObject()
    void com.evermind.server.rmi.RMIConnection.run()
    void com.evermind.util.ThreadPoolThread.run()
    Has anyone got any ideas what is happening here and how I can fix it?
    Thanks,
    Mark.

    This is an OC4J question. Try posting your message to the Products > Application Server > J2EE forum. Someone there should be able to answer your question.

  • Unable to access remote EJB object on different server

    I have deployed an EJB module on one server. I have been able to access the entity beans on this server from a standalone java client (on a different machine) using the CORBA Interopable Naming Syntax. Using this syntax
    corbaname:iiop:<hostname>:port#<jndi-name>
    However, when I deploy another EJB module on a separate server I am unable to access the objects held on the original server. I am using the same syntax as the java client.
    We are using Sun Application Server to deploy the modules. The error held in the server log is below. Can someone help with this. Does the Sun Application Server prevent connection to remote objects by default?
    [#|2005-12-09T17:39:55.703+0000|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.resource.corba._DEFAULT_.rpc.transport|_ThreadID=11;|"IOP00410216: (COMM_FAILURE) Unable to create IIOP listener on the specified host/port: all interfaces/3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 216 completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2661)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2681)
         at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:167)
         at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.getAcceptors(CorbaTransportManagerImpl.java:207)
         at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.addToIORTemplate(CorbaTransportManagerImpl.java:224)
         at com.sun.corba.ee.spi.oa.ObjectAdapterBase.initializeTemplate(ObjectAdapterBase.java:104)
         at com.sun.corba.ee.impl.oa.toa.TOAImpl.<init>(TOAImpl.java:78)
         at com.sun.corba.ee.impl.oa.toa.TOAFactory.getTOA(TOAFactory.java:65)
         at com.sun.corba.ee.impl.orb.ORBImpl.connect(ORBImpl.java:1536)
         at com.sun.corba.ee.spi.presentation.rmi.StubAdapter.connect(StubAdapter.java:164)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.connectAndGetIOR(ORBUtility.java:825)
         at com.sun.corba.ee.impl.orb.ORBImpl.getFVDCodeBaseIOR(ORBImpl.java:901)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.addServiceContexts(CorbaClientRequestDispatcherImpl.java:737)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:227)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:127)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:244)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:345)
         at com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:321)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:247)
         at com.sun.jndi.cosnaming.CNCtx.createUsingURL(CNCtx.java:85)
         at com.sun.jndi.url.iiop.iiopURLContextFactory.getUsingURLIgnoreRest(iiopURLContextFactory.java:56)
         at com.sun.jndi.url.iiop.iiopURLContext.getRootURLContext(iiopURLContext.java:44)
         at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:182)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.ppl.services.ServiceLocator.lookup(ServiceLocator.java:47)
         at com.ppl.services.ServiceLocator.getRemoteHome(ServiceLocator.java:74)
         at com.ppl.services.ServiceLocator.getRemoteUSRRoutinesHome(ServiceLocator.java:134)
         at com.ppl.business.LoginBusiness.isUserServiceAvailable(LoginBusiness.java:50)
         at org.apache.jsp.testEJBComponents_jsp._jspService(testEJBComponents_jsp.java:72)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    Caused by: java.lang.Error: Untranslated exception
         at sun.nio.ch.Net.translateToSocketException(Net.java:63)
         at sun.nio.ch.Net.translateException(Net.java:79)
         at sun.nio.ch.Net.translateException(Net.java:85)
         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:61)
         at com.sun.enterprise.server.ss.ASServerSocket.bind(ASServerSocket.java:258)
         at com.sun.enterprise.server.ss.ASServerSocket.bind(ASServerSocket.java:231)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createServerSocket(IIOPSSLSocketFactory.java:289)
         at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:160)
         ... 62 more
    Caused by: java.net.SocketException: Already bound
         at sun.nio.ch.Net.translateToSocketException(Net.java:49)
         ... 69 more
    Caused by: sun.nio.ch.AlreadyBoundException
         at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:114)
         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
         ... 66 more
    |#]
    [#|2005-12-09T17:39:55.703+0000|WARNING|sun-appserver-pe8.1_02|javax.enterprise.resource.corba._INITIALIZING_.rpc.presentation|_ThreadID=11;|"IOP02310202: (OBJ_ADAPTER) Error in connecting servant to ORB"
    org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 202 completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.orbConnectError(ORBUtilSystemException.java:8276)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.orbConnectError(ORBUtilSystemException.java:8294)
         at com.sun.corba.ee.impl.orb.ORBImpl.connect(ORBImpl.java:1538)
         at com.sun.corba.ee.spi.presentation.rmi.StubAdapter.connect(StubAdapter.java:164)
         at com.sun.corba.ee.impl.orbutil.ORBUtility.connectAndGetIOR(ORBUtility.java:825)
         at com.sun.corba.ee.impl.orb.ORBImpl.getFVDCodeBaseIOR(ORBImpl.java:901)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.addServiceContexts(CorbaClientRequestDispatcherImpl.java:737)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:227)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:127)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:244)
         at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
         at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:345)
         at com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:321)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:247)
         at com.sun.jndi.cosnaming.CNCtx.createUsingURL(CNCtx.java:85)
         at com.sun.jndi.url.iiop.iiopURLContextFactory.getUsingURLIgnoreRest(iiopURLContextFactory.java:56)
         at com.sun.jndi.url.iiop.iiopURLContext.getRootURLContext(iiopURLContext.java:44)
         at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:182)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.ppl.services.ServiceLocator.lookup(ServiceLocator.java:47)
         at com.ppl.services.ServiceLocator.getRemoteHome(ServiceLocator.java:74)
         at com.ppl.services.ServiceLocator.getRemoteUSRRoutinesHome(ServiceLocator.java:134)
         at com.ppl.business.LoginBusiness.isUserServiceAvailable(LoginBusiness.java:50)
         at org.apache.jsp.testEJBComponents_jsp._jspService(testEJBComponents_jsp.java:72)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    Caused by: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 216 completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2661)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFailed(ORBUtilSystemException.java:2681)
         at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:167)
         at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.getAcceptors(CorbaTransportManagerImpl.java:207)
         at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.addToIORTemplate(CorbaTransportManagerImpl.java:224)
         at com.sun.corba.ee.spi.oa.ObjectAdapterBase.initializeTemplate(ObjectAdapterBase.java:104)
         at com.sun.corba.ee.impl.oa.toa.TOAImpl.<init>(TOAImpl.java:78)
         at com.sun.corba.ee.impl.oa.toa.TOAFactory.getTOA(TOAFactory.java:65)
         at com.sun.corba.ee.impl.orb.ORBImpl.connect(ORBImpl.java:1536)
         ... 56 more
    Caused by: java.lang.Error: Untranslated exception
         at sun.nio.ch.Net.translateToSocketException(Net.java:63)
         at sun.nio.ch.Net.translateException(Net.java:79)
         at sun.nio.ch.Net.translateException(Net.java:85)
         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:61)
         at com.sun.enterprise.server.ss.ASServerSocket.bind(ASServerSocket.java:258)
         at com.sun.enterprise.server.ss.ASServerSocket.bind(ASServerSocket.java:231)
         at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createServerSocket(IIOPSSLSocketFactory.java:289)
         at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:160)
         ... 62 more
    Caused by: java.net.SocketException: Already bound
         at sun.nio.ch.Net.translateToSocketException(Net.java:49)
         ... 69 more
    Caused by: sun.nio.ch.AlreadyBoundException
         at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:114)
         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
         ... 66 more
    |#]

    http://docs.sun.com/source/819-0079/dgjndi.html

  • EJB 3.x business delegate & service locater

    Hi all
    are business delegate & service locater patterns still relevant when considering EJB 3.x? Why or why not?
    Does dependency inversion replaces service locater? was there dependency inversion in EJB 2.x??
    Thx a lot

    Hello,
    Business Delegate is still relevant while using EJB 3.0
    Business Delegate reduces coupling between presentation-tier clients and business services, that does not change with EJB 3.0.
    However, Service Locator can be avoided by the Dependency injection provided by java EE5.
    But, remember, Dependency injection works only for object managed by the container, so, Service locator can yet be useful in ejb 3.0.
    Regards,
    Sebastien Degardin

  • SERVICE LOCATOR ?? Is it really an interesting Design pattern??

    Hi everybody,
    i've a problem with the J2EE Design Pattern "Services locator" (it's a singleton).
    It is said that by making use of a Service Locator we can :
    - hide to the client the complexities of initial context creation, EJB home object lookup,and EJB objectre-creation.
    - multiple clients can reuse the Service Locator object to reduce code complexity, provide a single point of control, and improve performance by providing a caching facility.
    But i would like to understand at which side should that service locator object reside??!!??
    If it is at server side then the clients need well an initial context in order to make a lookup on that object.
    Conclusion :
    the service locator doesn't hide the complexities of initial context!!
    Furthermore the client has to perform a look-up on that service locator object!! The only advantage left is caching facility.
    If it is at client side, each client needs his own services locator object
    Conclusion :
    multiple client don't reuse the same service locator. What's the advantage to be a singleton ???
    There is certainly something that i don't understand so help me please!! Thanks.

    Hi Yves,
    But i would like to understand at which side should
    that service locator object reside??!!??
    If it is at client side, each client needs his own
    services locator object
    Conclusion :
    multiple client don't reuse the same service locator.
    What's the advantage to be a singleton ???The service locator resides on the client side and is implemented as
    a singleton. Since it is possible that there could be multiple
    class loaders/JVMs on the client side, and therefore, multiple
    instances of the "singleton" service locator. This is typical
    in a distributed environment (e.g. servlets/JSPs in a web-tier
    cluster using service locator). Thus service locator is not
    a truly "distributed singleton" object. But, the empahsis
    is to design the service locator such that it does not hold
    any state that needs to be replicated across multiple
    instances across different JVMs as mentioned. Thus, there
    is no need for multiple clients to use the "same" service locator,
    but still the benefits of implementing this pattern is realized.
    By making it a singleton, and keeping it from holding state
    that needs to be replicated, we realize the benefits of this pattern.
    You may also want to visit the J2EE Pattern interest list
    and see these relevant discussions :
    Topic: Service Locator and passivation
    http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=j2eepatterns-interest&F=&S=&P=1026
    Topic: Caching EJBHome interfaces
    http://archives.java.sun.com/cgi-bin/wa?A2=ind0106&L=j2eepatterns-interest&F=&S=&P=9226
    Topic: Using Service Locator for Data Source caching
    http://archives.java.sun.com/cgi-bin/wa?A1=ind0106&L=j2eepatterns-interest#31
    hope this helps,
    thanks,
    -deepak

  • Can we implement "Service Locator" in Stateless Session Bean??

    Hi,
    My enterprise application is using Stateless Session Bean. To increase the performace , I think of implementing "service Locator" pattern so as to cache the EJBHome objects in order to avoid looking up Home object every time. I want to know whether this will work out in case of stateless session bean??
    Thanks for ur help.

    Hi,
    The purpose of service locator is to abstract the lookup of the server side services like ejb and DSNs. It should be a normal java class but as such there is no such restriction. You can have a look at the service locator patter at the j2ee blue prints.
    /Ashwani

  • Service Locator and Performance?

    We currently have an application with numerious EJBs. Obviously, this in turn involves
    numerous JNDI look ups for these EJBs. Both the client (a web application) and
    the EJBs run within the same JVM, however not as part of a singe EAR application
    (the EJBs are deployed as standalone application modules). We do not have any
    Service Locator (J2EE pattern) implemented. My question is, given this scenario,
    will there be a performance enhancement if a Service locator is implemented to
    cache JNDI look-ups? If so, Will this come into play if we deploy the app as an
    EAR?
    Thanks,
    Krish

    There are a lot of tools out there.
    Here's what I've used:
    On Windows/Linux, OptimizeIt and Jprobe are pretty common.
    If you're using jrockit, try JRA
    http://dev2dev.com/products/wljrockit81/analyzer.jsp
    On HP-UX, I like HP's JMeter:
    http://www.hpjmeter.com
    -- Rob
    Krish wrote:
    Is there a Profiling tool that I could use to identify where most of the time is
    being spent?
    Thx,
    Rob Woollen <[email protected]> wrote:
    If your end goal is to improve performance, then I'd strongly encourage
    you to spend some time tracking down where time is currently being spent.
    In my experience, creating InitialContext objects can be expensive.
    Lookups generally aren't that bad, but it's a reasonable approach to
    cache both.
    Basically, if you're spending a lot of time in JNDI lookups, then I'd
    suggest doing the Service Locator pattern. If your time is being mainly
    spent elsewhere, attack that first.
    -- Rob
    Krish wrote:
    We currently have an application with numerious EJBs. Obviously, thisin turn involves
    numerous JNDI look ups for these EJBs. Both the client (a web application)and
    the EJBs run within the same JVM, however not as part of a singe EARapplication
    (the EJBs are deployed as standalone application modules). We do nothave any
    Service Locator (J2EE pattern) implemented. My question is, given thisscenario,
    will there be a performance enhancement if a Service locator is implementedto
    cache JNDI look-ups? If so, Will this come into play if we deploy theapp as an
    EAR?
    Thanks,
    Krish

Maybe you are looking for

  • More than one Quant in a Storage bin section (Strategy P)

    Dear all, We have a Storage type with Putaway strategy P, the SUT check active but no SU Management active, Mixed storage = X and Addition to stock = X. For this Storage type, our Storage bin type and SUT we have set up in customizing a Bin sectionin

  • Aperture import automator workflow available

    I recently put together an Aperture import workflow in Automator which I thought other people might find useful, it can be downloaded with instructions here: http://tonyswash.info/ImportPlugin.zip What this does is act as a plug-in for Image Capture.

  • Connecting iPod video to Blaupunkt car stereo

    Blaupunkt sells an adapter to connect iPods to their car stereo. Part number: 7607540500. It is compatible with the factory (Blaupunkt sourced) car stereo of my Fiat Panda model year 2005. The car stereo 'sees' the iPod as a Blaupunkt CD changer. It

  • Require a Java API to read Business System defined in SLD

    Hi Experts, Is there any standard java API that provides any methods to retrieve information about the system mentioned in business landscapes. e.g.(name of a system ) In my Web DynPro Application I need to provide a drop down UI that contains names

  • Configure the Linux Kernel for Oracle 8i

    I wish to install Oracle 8i as explaned in its documenation. Hence, I need to recompile the Linux Kernel with increased values to shared memory or semaphore parameters. Therefore, can someone please post to this discussion list copies of their altere