EJB 3.0 local lookup from POJO in WLS Cluster

Hello,
I'm developing on JDeveloper Studio Edition Version 11.1.2.3.0 and deploying to a WebLogic 10.3.5 Cluster.
I have developed an EJB 3.0 stateless session bean and I need to invoke it from a POJO within the same EAR, specifically an ADF EntityImpl Class.
Up to this point, I've only invoked EJBs using injection via an @EJB annotation, and have never done a full lookup.
Could somebody please provide a verbose instruction on how to obtain invoke an EJB 3.0 SLSB via local interface from a POJO when running on a WLS cluster?
As I see it I have two problems to solve.
1) Obtaining a reference to the initial context in a cluster.
2) Using that to get a reference to the local interface of the bean, which I don't think is on the global JNDI tree.
Many thanks.
Edited by: user576183 on Dec 5, 2012 4:16 PM

Re: Unable to lookup in InitialContext a Local EJB in Weblogic 10.3.5 (EJB 3.0)

Similar Messages

  • Lookup Local Interface from client app

    I have had an entity bean running using the remote interface.
    When I convert over to using a local interface I have problems
    with the jndi lookup. My environment is JDK 1.4, J2EE 1.3.1, Win 2k.
    The deployment using the J2EE RI works fine.
    I need to know what changes to the client code I need to make
    to locate the bean using lookup().
    I have tried two versions of the lookup:
    // same as the version which workds for the remote interface
    Properties p = new java.util.Properties();
    Context ctx = null;
    p.put (javax.naming.Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.cosnaming.CNCtxFactory");
    p.put(javax.naming.Context.PROVIDER_URL,
    "iiop://localhost:1050");
    ctx = new InitialContext(p);
    Object objref = ctx.lookup("LocalSPIConnector");
    cat.debug ("GOT THE OBJ REF");
    spiHome = (ServiceProviderBeanLocalHome)
    javax.rmi.PortableRemoteObject.narrow (objref,
    ServiceProviderBeanLocalHome.class);
    cat.debug ("AFTER NARROW");
    I get the following exception;
    javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosN
    aming/NamingContext/NotFound:1.0
    In the J2EE RI I can see that this JNDI is associated with the bean.
    Is there a different context factory to be used?
    I have tried to use the initialContext and then lookup
    various forms of the JNDi name:
    a. LocalSPIConnector
    b. java:comp/env/ejb/LocalSPIConnector
    c. java:comp/env/LocalSPIConnector
    d. the classpath to the home interface
    All these fail as the name has not been bound

    Thanks for the reply.
    I have simpliefied the lookup to the following:
    Context ctx = new InitialContext();
    spiHome = (ServiceProviderBeanLocalHome) ctx.lookup ("ServiceProviderBeanEJB");
    I still get the following exception:
    javax.naming.NameNotFoundException: ServiceProviderBeanEJB not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:174)
    I looked up the deployment descriptor from J2EE RI and took the name
    to lookup from the ejb-name:
    <ejb-jar>
    <display-name>localSPIJAR</display-name>
    <enterprise-beans>
         <entity>
              <display-name>ServiceProviderBeanEJB</display-name>
              <ejb-name>ServiceProviderBeanEJB</ejb-name>
    I presume that this is the correct name to use.

  • EventService lookup from ejb project

    hi
    We want to use the EventService from with in a class which resides in an ejb project of our portal application.
    We used the EventService from within the portal webapp project without problems. With
    Object o = p_context.lookup( "java:comp/env/ejb/EventService" );
    we could lookup the object and narrow it to the EventServiceHome interface. However this does not work within the ejb project.
    We get the error message:
    "javax.naming.NameNotFoundException: While trying to look up comp/env/ejb/EventService in /app/ejb/scp_helpers.jar#EJBTTHelper.; remaining name 'comp/env/ejb/EventService'"
    We tried another name which we found in different depoyment descriptors: p13n_ejb.jar#EventService . No success.
    What name do we have to use or shortly: what are we doing wrong? How could we get the EventService SessionBean from within an ejb project?

    look up the resource-ref in web.xml (and weblogic.xml). Add the same in ejb-jar.xml (and weblogic-ejb-jar.xml). The entries are not exactly the same, but the concept is the same.
    Best regards...
    hi
    We want to use the EventService from with in a class
    which resides in an ejb project of our portal
    application.
    We used the EventService from within the portal
    webapp project without problems. With
    Object o = p_context.lookup(
    "java:comp/env/ejb/EventService" );
    we could lookup the object and narrow it to the
    EventServiceHome interface. However this does not
    work within the ejb project.
    We get the error message:
    "javax.naming.NameNotFoundException: While trying to
    look up comp/env/ejb/EventService in
    /app/ejb/scp_helpers.jar#EJBTTHelper.; remaining name
    'comp/env/ejb/EventService'"
    We tried another name which we found in different
    depoyment descriptors: p13n_ejb.jar#EventService . No
    success.
    What name do we have to use or shortly: what are we
    doing wrong? How could we get the EventService
    SessionBean from within an ejb project?

  • EJB LOcal Lookup Error

    Hi All,
    I'm getting so much errors when I try to do a Local-Lookup for a Session bean, using local interfaces. I'm using Oracle 9iAS. I wish to get some sample code which demonstrates the above.
    Thanks in advance
    Rgds
    Arun

    Arun,
    can you post a stack trace here?
    Thanks,
    -- markus.

  • Weblogic 10.3.2 EJB3 Local Interface in POJO/Helper classes

    Hi,
    I have a jar file containing all EJB's in application & some Helper classes. I want to access Local interfaces of EJBs in those helper classes. Is there any way I can do it? I've gone through Maxence Button & Jay SenSharma 's blogs about accessing Local interface. but it doesn't help. May be these two guys can help me more here.. My requirement is very simple. Just to access local interface in POJO/Helper classes that are in same JAR file as EJB's. I can't get reference with @EJB class level annotation as Helper classes are called independently from MBean services.. not from any EJB or Servlert.
    Please if anyone can tell me how do I get reference of local interfaces, that would be really good.
    my environment is
    Weblogic 10.3.2
    EJB3
    Regards,
    Prasad

    Hi,
    Just check ...If you want something like mentioned in the below Link with a complete Example:
    [http://jaysensharma.wordpress.com/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/|http://jaysensharma.wordpress.com/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/]
    Regards
    Jay SenSharma

  • Recommended way of getting entity manager from pojo class

    Hi,
    In our application we have the need or retrieving entity manager from 'pojo' classes.
    More specifically we have singleton classes which act as 'data' repositories and are accessed from both servlets and ejb.
    I'm aware that the repositories classes might be problematic, but in the current stage we can't perform significant change in application structure so I am looking for a 'fast' solution as possible.
    The best way will be to lookup entityt manager in JNDI, but as I undestand this feature is not avaialabe in weblogic.
    I understand that the preffered way for getting entity manager in such situation is by using @PersistenceUnit annotion on the calling location and lookup entityManager by that name in the pojo. This is however problematic for us since since we access the repositories from variouse locations (many different classes).
    Possible additional solutions we thought of:
    - creating an 'entity manager factory' locator ejb. This is an ejb with no transaction attribute, which has one method getEntityManagerFactory. It injects entityManagerFactory and returns it. This is the fastest soltion to implement. Is this a valid one?
    - using application managed entity manager in such situations. We have a problem doing so now because the creation seems to fail for variouse reasons.
    What is the recommended way?
    Thanks.

    To obtain an EntityManager instance, first must obtain an EntityManagerFactory instance by injecting it into the application component by means of the javax.persistence.PersistenceUnit annotation:
    @PersistenceUnit
    EntityManagerFactory emf;
    Then, obtain an EntityManager from the EntityManagerFactory instance:
    EntityManager em = emf.createEntityManager();
    http://download.oracle.com/javaee/5/tutorial/doc/bnbqw.html
    Edited by: dvohra16 on Apr 14, 2011 5:06 PM

  • EJB 3.0 Local References

    I have an EJB module that contains a session bean, MasterBean, with a local interface MasterLocal, packaged in an EAR file. I am trying to look up a reference to MasterLocal in a regular Java class in the same EAR file. I am able to look up the MasterLocal in my WAR file using the following code
    web.xml:
        <ejb-local-ref>
            <ejb-ref-name>ejb/MasterLocal</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            <local>facade.MasterLocal</local>
            <ejb-link>MasterBean</ejb-link>
        </ejb-local-ref> Lookup:
    MasterLocal masterLocal = null;
            try {
                InitialContext ic = new InitialContext();
                masterLocal = (MasterLocal) ic.lookup("java:comp/env/ejb/MasterLocal");
            } catch (NamingException ex) {
                logger.severe("Error getting MasterLocal: " + ex.getMessage());
            }How can I use similar code to look up a reference to MasterLocal in the EAR module?
    Luke Mauldin

    [#|2007-02-01T12:09:04.263-0600|INFO|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=15;_ThreadName=httpWorkerThread-8080-0;|
    javax.ejb.EJBException
         at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
         at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
         at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
         at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:71)
         at $Proxy93.searchVisitorBadge(Unknown Source)
         at securitylog.login.SelectVisitors.search_action(SelectVisitors.java:752)
         at securitylog.login.SelectVisitors.init(SelectVisitors.java:712)
         at com.sun.rave.web.ui.appbase.servlet.LifecycleListener.fireInit(LifecycleListener.java:555)
         at com.sun.rave.web.ui.appbase.servlet.LifecycleListener.attributeAdded(LifecycleListener.java:405)
         at org.apache.coyote.tomcat5.CoyoteRequest.setAttribute(CoyoteRequest.java:1634)
         at org.apache.coyote.tomcat5.CoyoteRequestFacade.setAttribute(CoyoteRequestFacade.java:522)
         at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:295)
         at com.sun.faces.context.RequestMap.put(ExternalContextImpl.java:1055)
         at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:525)
         at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
         at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
         at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:62)
         at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
         at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
         at com.sun.faces.application.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:102)
         at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.pageBean(ViewHandlerImpl.java:666)
         at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.pageBean(ViewHandlerImpl.java:641)
         at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:249)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:133)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
         at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:203)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/MasterLocal
         at model.listeners.VisitorBadgeListener.lookupMasterBean(VisitorBadgeListener.java:67)
         at model.listeners.VisitorBadgeListener.PostLoad(VisitorBadgeListener.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.invokeMethod(PrivilegedAccessHelper.java:307)
         at oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener.invokeMethod(MetadataEntityListener.java:302)
         at oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener.invokeMethod(MetadataEntityListener.java:324)
         at oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener.postClone(MetadataEntityListener.java:404)
         at oracle.toplink.essentials.descriptors.DescriptorEventManager.notifyListener(DescriptorEventManager.java:640)
         at oracle.toplink.essentials.descriptors.DescriptorEventManager.notifyEJB30Listeners(DescriptorEventManager.java:591)
         at oracle.toplink.essentials.descriptors.DescriptorEventManager.executeEvent(DescriptorEventManager.java:199)
         at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.populateAttributesForClone(ObjectBuilder.java:2088)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.populateAndRegisterObject(UnitOfWorkImpl.java:2816)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:673)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent(UnitOfWorkIdentityMapAccessor.java:152)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkIdentityMapAccessor.getFromIdentityMap(UnitOfWorkIdentityMapAccessor.java:90)
         at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.getFromIdentityMap(IdentityMapAccessor.java:295)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3055)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3004)
         at oracle.toplink.essentials.queryframework.ObjectBuildingQuery.registerIndividualResult(ObjectBuildingQuery.java:319)
         at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:441)
         at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:406)
         at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:372)
         at oracle.toplink.essentials.queryframework.ReportQueryResult.processItem(ReportQueryResult.java:205)
         at oracle.toplink.essentials.queryframework.ReportQueryResult.buildResult(ReportQueryResult.java:167)
         at oracle.toplink.essentials.queryframework.ReportQueryResult.<init>(ReportQueryResult.java:83)
         at oracle.toplink.essentials.queryframework.ReportQuery.buildObject(ReportQuery.java:579)
         at oracle.toplink.essentials.queryframework.ReportQuery.buildObjects(ReportQuery.java:628)
         at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:776)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
         at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
         at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:937)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
         at facade.DataLookupBean.searchVisitorBadge(DataLookupBean.java:416)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
         at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
         at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
         at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
         ... 53 more
    Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/MasterLocal
         at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:751)
         at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:156)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at model.listeners.VisitorBadgeListener.lookupMasterBean(VisitorBadgeListener.java:63)
         ... 101 more
    |#]

  • How can i look up a EJB residing in different machine from client side?

    hai ,
    How can i look up a EJB residing in different machine from client side?
    this is my code...........i don't know what should i use as Initial Context Factory...................i am using a sun appserver 8............
    package com.parx.lms.lmsdelegate;
    import com.parx.lms.exception.LMSException;
    import javax.naming.Context;
    import javax .ejb.CreateException;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import java.rmi.RemoteException;
    import com.parx.lms.controller.*;
    import com.parx.lms.vo.UserVo;
    import com.parx.lms.exception.BusinessException;
    import java.util.Hashtable;
    import java.lang.*;
    public class LmsDelegate{
    private final static String JNDI_NAME="LmsBean";
    private static String url="http://localhost:4848";
    public static Lms lms = null;
    public void getController() throws CreateException,
    NamingException,RemoteException{
    if(lms == null){
    Hashtable h=new Hashtable();
    h.put(Context.INITIAL_CONTEXT_FACTORY," ********what should i use here???????*************************");
    h.put(Context.PROVIDER_URL,url);
    System.out.println("Before Loading Context in Delegate");
    Context ctx=new InitialContext(h);
    System.out.println("Loaded Context in Delegate");
    Object obj=ctx.lookup(JNDI_NAME);
    System.out.println("Loaded Object in Delegate");
    System.out.println("Before Loading Home in Delegate");
    LmsHome home = (LmsHome )PortableRemoteObject.narrow(obj,com.parx.lms.controller.LmsHome.class);
    System.out.println("Loaded Home in Delegate");
    lms = home.create();
    System.out.println("Loaded remote in Delegate");
    public void addUserDelegate(UserVo vo) throws BusinessException{
    try{
    getController();
    System.out.println("Before calling the addUser of Session");
    lms.addUser(vo);
    }catch(CreateException e){
    System.out.println("Create Exception in Delegate due to--->"+e);
    e.printStackTrace();
    throw new BusinessException(e);
    }catch(NamingException e){
    System.out.println("Naming Exception in Delegate due to--->"+e);
    e.printStackTrace();
    throw new BusinessException(e);
    catch(RemoteException e){
    System.out.println("Remote Exception in Delegate due to--->"+e);
    e.printStackTrace();
    throw new BusinessException(e);
    }catch(LMSException e){
    System.out.println("duplicate user name--->"+e);
    e.printStackTrace();
    throw new BusinessException(e);
    pls help me..........

    h.put(Context.INITIAL_CONTEXT_FACTORY," ********what should i use here???????*************************")
    Each app server provides their own jndi factory class. For ex for weblogic it is weblogic.jndi.WLInitialContextFactory. SInce you are using sun app server, check if there are any examples to find out or the docs.
    private static String url="http://localhost:4848
    Since the client is in a different machine the localhost is not going to work here. provide the url or the machine name of the system in which ur sunapp server is running. In addition u will need to have the stubs of the remote interfaces in ur client machine.

  • Local lookup not working : what to do ?

    Hello,
    I set up an account at dyndns.org so I can ssh to my desktop computer using "ssh mydomain.dyndns.org" on the command line when away from home.
    It works except when I'm at home and I try to access the desktop computer from my netbook via the wifi. In this case I just get "connection refused".
    It seems local lookup (is it what it's called ?) doesn't work with my router, so when I'm at home I have to use the local IP address : "ssh 192.168.1.128".
    But to avoid confusions I would like to be able to use the dyndns domain from home too.
    What's the correct way to do this ?
    I thought of configuring my wireless network manager so it would execute a script when connecting to my home network and modify the /etc/hosts file so mydomain.dyndns.org points to my local ip address. And then undo the change when disconnecting from the network. But it seems a bit cumbersome to me for such a simple task.
    Any advice ?
    Thanks.

    /dev/zero wrote:
    It seems weird that the laptop can't just keep using the same domain name. That is, assuming your netbook does have access to the external internet via the wifi and is correctly resolving external domain names.
    Can you confirm that the netbook can ping mydomain.dyndns.org?
    Yes the netbook can resolve the domain name. But I tried using the WAN IP from the netbook when at home and it doesn't work either. Only the LAN IP seems to work at home. Ping to mydomain.dyndns.org works, but I can't access any of the servers on my desktop computer using this DNS.
    I thought of using ssh profiles but I also have other servers (web, transmission web client) on the desktop computer that I would like to access using mydomain.dyndns.org.

  • Calling pojo from pojo in diffrent application

    Can i call a pojo in one application from pojo in diffrent application?
    For example:
    Ear 1 had pojo 1
    Ear 2 has pojo 2
    Can i call pojo 2 from pojo 1?
    One option isthat i can make pojo 2 an ejb or servelet can call it from pojo 1.
    Can i call pojos?

    Cross-posted here, where delicious dukes are available.

  • Calling EJB with bpelx:exec lookup-methode

    I created a EJB3.0 that I try to lookup in a BPEL Java Embedding activity with following code:
    try {          
      Object homeObj = lookup("ejb/stateless/LoginDataBean#com.unisoa.logindata.LoginDataBeanRemote");
    } catch (Exception ex) {              
       addAuditTrailEntry(ex);   
    }I get Logged exception "NameNotFoundException" as result. Unfortunately I do not have a clue why this happens.
    To prove the lookup-name I checked jndi-tree and it shows Binding-Name: ejb.stateless.LoginDataBean#com.unisoa.logindata.LoginDataBeanRemote. So jndi-name seems to be ok.
    Also I generated a java client with JDeveloper that works well too.
    Code Java Client:
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"; );
    env.put(Context.PROVIDER_URL, "t3://server:port");
    InitialContext context = new InitialContext( env );     
    LoginDataBeanRemote loginDataBeanRemote = (LoginDataBeanRemote)context.lookup("ejb/stateless/LoginDataBean#com.unisoa.logindata.LoginDataBeanRemote";);The bean I try to call is following:
    @Stateless(name = "LoginData", mappedName = "ejb/stateless/LoginDataBean")
    @Local(LoginDataBeanLocal.class)
    @Remote(LoginDataBeanRemote.class)
    public class LoginDataBean implements LoginDataBeanLocal, LoginDataBeanRemote{
      public LoginDataBean() {}
    }I did online research but could not find any usefull information. Also I do not know if remote or local jndi-name is necessary for lookup-methode. I am using SOA Suite 11.1.1.3.0.
    I would really appreciate some help.
    Thx
    Pascal

    Have you resolved this? I'm struggling with the exact same problem; a standalone EJB Java client works and I can see the mapped name in the soa server JNDI tree etc

  • I need helping!!! configuring RDP access to my local server from a remote location on my Cisco ASA 5505 Firewall.

    I need helping configuring RDP access to my local server from a remote location on my Cisco ASA 5505 Firewall.
    I have attempted to configure rdp access but it does not seem to be working for me Could I please ask someone to help me modify my current configuration to allow this? Please do step by step as I could use all the help I could get.
    I need to allow the following IP addresses to have RDP access to my server:
    66.237.238.193-66.237.238.222
    69.195.249.177-69.195.249.190
    69.65.80.240-69.65.80.249
    My external WAN server info is - 99.89.69.333
    The internal IP address of my server is - 192.168.6.2
    The other server shows up as 99.89.69.334 but is working fine.
    I already added one server for Static route and RDP but when I try to put in same commands it doesnt allow me to for this new one. Please take a look at my configuration file and give me the commands i need in order to put this through. Also please tell me if there are any bad/conflicting entries.
    THE FOLLOWING IS MY CONFIGURATION FILE
    Also I have modified IP information so that its not the ACTUAL ip info for my server/network etc... lol for security reasons of course
    Also the bolded lines are the modifications I made but that arent working.
    ASA Version 7.2(4)
    hostname ciscoasa
    domain-name default.domain.invalid
    enable password DowJbZ7jrm5Nkm5B encrypted
    passwd 2KFQnbNIdI.2KYOU encrypted
    names
    interface Vlan1
    nameif inside
    security-level 100
    ip address 192.168.6.254 255.255.255.0
    interface Vlan2
    nameif outside
    security-level 0
    ip address 99.89.69.233 255.255.255.248
    interface Ethernet0/0
    switchport access vlan 2
    interface Ethernet0/1
    interface Ethernet0/2
    interface Ethernet0/3
    interface Ethernet0/4
    interface Ethernet0/5
    interface Ethernet0/6
    interface Ethernet0/7
    ftp mode passive
    dns server-group DefaultDNS
    domain-name default.domain.invalid
    object-group network EMRMC
    network-object 10.1.2.0 255.255.255.0
    network-object 192.168.10.0 255.255.255.0
    network-object 192.168.11.0 255.255.255.0
    network-object 172.16.0.0 255.255.0.0
    network-object 192.168.9.0 255.255.255.0
    object-group service RDP tcp
    description RDP
    port-object eq 3389
    object-group service GMED tcp
    description GMED
    port-object eq 3390
    object-group service MarsAccess tcp
    description MarsAccess
    port-object range pcanywhere-data 5632
    object-group service MarsFTP tcp
    description MarsFTP
    port-object range ftp-data ftp
    object-group service MarsSupportAppls tcp
    description MarsSupportAppls
    port-object eq 1972
    object-group service MarsUpdatePort tcp
    description MarsUpdatePort
    port-object eq 7835
    object-group service NM1503 tcp
    description NM1503
    port-object eq 1503
    object-group service NM1720 tcp
    description NM1720
    port-object eq h323
    object-group service NM1731 tcp
    description NM1731
    port-object eq 1731
    object-group service NM389 tcp
    description NM389
    port-object eq ldap
    object-group service NM522 tcp
    description NM522
    port-object eq 522
    object-group service SSL tcp
    description SSL
    port-object eq https
    object-group service rdp tcp
    port-object eq 3389
    access-list outside_1_cryptomap extended permit ip 192.168.6.0 255.255.255.0 object-group EMRMC
    access-list inside_nat0_outbound extended permit ip 192.168.6.0 255.255.255.0 192.168.0.0 255.255.0.0
    access-list inside_nat0_outbound extended permit ip 192.168.6.0 255.255.255.0 object-group EMRMC
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 host 99.89.69.334 eq pcanywhere-data
    access-list outside_access_in extended permit udp 69.16.158.128 255.255.255.128 host 99.89.69.334 eq pcanywhere-status
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 host 99.89.69.334 object-group RDP
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 192.168.6.0 255.255.255.0 eq ftp
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 192.168.6.0 255.255.255.0 eq ldap
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 192.168.6.0 255.255.255.0 eq h323
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 192.168.6.0 255.255.255.0 eq telnet
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 192.168.6.0 255.255.255.0 eq www
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 host 99.89.69.334 object-group SSL
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 192.168.6.0 255.255.255.0 object-group NM522
    access-list outside_access_in extended permit tcp 69.16.158.128 255.255.255.128 192.168.6.0 255.255.255.0 object-group NM1731
    access-list outside_access_in extended permit tcp 173.197.144.48 255.255.255.248 host 99.89.69.334 object-group RDP
    access-list outside_access_in extended permit tcp any interface outside eq 3389
    access-list outside_access_in extended permit tcp host 66.237.238.194 host 99.89.69.333
    access-list outside_access_in extended permit tcp host 66.237.238.194 host 99.89.69.333 object-group rdp
    access-list outside_access_in extended permit tcp any host 99.89.69.333 object-group rdp
    access-list out_in extended permit tcp any host 192.168.6.2 eq 3389
    pager lines 24
    logging enable
    logging asdm informational
    mtu inside 1500
    mtu outside 1500
    icmp unreachable rate-limit 1 burst-size 1
    asdm image disk0:/asdm-524.bin
    no asdm history enable
    arp timeout 14400
    global (outside) 1 interface
    nat (inside) 0 access-list inside_nat0_outbound
    nat (inside) 1 0.0.0.0 0.0.0.0
    static (inside,outside) tcp 99.89.69.334 3389 192.168.6.1 3389 netmask 255.255.255.255
    static (inside,outside) tcp interface 3389 192.168.6.2 3389 netmask 255.255.255.255
    access-group outside_access_in in interface outside
    route outside 0.0.0.0 0.0.0.0 99.89.69.338 1
    timeout xlate 3:00:00
    timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
    timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
    timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
    http server enable
    http 192.168.6.0 255.255.255.0 inside
    http 0.0.0.0 0.0.0.0 outside
    no snmp-server location
    no snmp-server contact
    snmp-server enable traps snmp authentication linkup linkdown coldstart
    crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
    crypto map outside_map 1 match address outside_1_cryptomap
    crypto map outside_map 1 set peer 68.156.148.5
    crypto map outside_map 1 set transform-set ESP-3DES-MD5
    crypto map outside_map interface outside
    crypto isakmp enable outside
    crypto isakmp policy 10
    authentication pre-share
    encryption 3des
    hash md5
    group 1
    lifetime 86400
    crypto isakmp policy 30
    authentication pre-share
    encryption 3des
    hash md5
    group 2
    lifetime 86400
    telnet timeout 5
    ssh timeout 5
    console timeout 0
    dhcpd auto_config outside
    tunnel-group 68.156.148.5 type ipsec-l2l
    tunnel-group 68.156.148.5 ipsec-attributes
    pre-shared-key *
    class-map inspection_default
    match default-inspection-traffic
    policy-map type inspect dns preset_dns_map
    parameters
      message-length maximum 512
    policy-map global_policy
    class inspection_default
      inspect dns preset_dns_map
      inspect ftp
      inspect h323 h225
      inspect h323 ras
      inspect rsh
      inspect rtsp
      inspect esmtp
      inspect sqlnet
      inspect skinny
      inspect sunrpc
      inspect sunrpc
      inspect xdmcp
      inspect sip
      inspect netbios
      inspect tftp
    service-policy global_policy global
    prompt hostname context
    Cryptochecksum:f47dfb2cf91833f0366ff572eafefb1d
    : end
    ciscoasa(config-network)#

    Unclear what did not work.  In your original post you include said some commands were added but don't work:
    static (inside,outside) tcp interface 3389 192.168.6.2 3389 netmask 255.255.255.255
    and later you state you add another command that gets an error:
    static (inside,outside) tcp 99.89.69.333 3389 192.168.6.2 3389 netmask 255.255.255.255
    You also stated that 99.89.69.333 (actually 99.89.69.233, guessing from the rest of your config and other posts) is your WAN IP address.
    The first static statement matches Cisco's documentation, which states that a static statement must use the 'interface' directive when you are trying to do static PAT utilizing the IP address of the interface.  Since 99.89.69.333 is the assigned IP address of your WAN interface, that may explain why the second statement fails.
    Any reason why you are using static PAT (including the port number 3389) instead of just skipping that directive?  Static PAT usually makes sense when you need to change the TCP port number.  In your example, you are not changing the TCP port 3389.

  • Open a Local file from JSP

    Hi All,
    I want to access a local file from a JSP. On click of the link the local file should open. The location of the local file is
    O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    and the hyper link on the JSP shows
    file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    somehow the file does not open from the JSP page but it opens from the browser if I type
    'file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc' in the address bar.
    Can anybody please help.
    regards,
    Shardul.

    if you'd like to show the real path to the user, use simply an ftp server !
    however, if you prefer a secure solution, so use a servlet:
    example:
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SendWord extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        //get the 'file' parameter
        String fileName = (String) request.getParameter("file");
        if (fileName == null || fileName.equals(""))
          throw new ServletException(
              "Invalid or non-existent file parameter in SendWord servlet.");
        // add the .doc suffix if it doesn't already exist
        if (fileName.indexOf(".doc") == -1)
          fileName = fileName + ".doc";
        String wordDir = getServletContext().getInitParameter("word-dir");
        if (wordDir == null || wordDir.equals(""))
          throw new ServletException(
              "Invalid or non-existent wordDir context-param.");
        ServletOutputStream stream = null;
        BufferedInputStream buf = null;
        try {
          stream = response.getOutputStream();
          File doc = new File(wordDir + "/" + fileName);
          response.setContentType("application/msword");
          response.addHeader("Content-Disposition", "attachment; filename="
              + fileName);
          response.setContentLength((int) doc.length());
          FileInputStream input = new FileInputStream(doc);
          buf = new BufferedInputStream(input);
          int readBytes = 0;
          while ((readBytes = buf.read()) != -1)
            stream.write(readBytes);
        } catch (IOException ioe) {
          throw new ServletException(ioe.getMessage());
        } finally {
          if (stream != null)
            stream.close();
          if (buf != null)
            buf.close();
      public void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        doGet(request, response);
    }hope that helps

  • EJB 3.0 local interface JNDI

    Hello
    I found some information that will probably help a lot of people having trouble with local interface not referenced in JNDI.
    You need to delacre each local interface in the web.xml.
         <ejb-local-ref>
              <ejb-ref-name>MappedNameInYourEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
    <local> yourLocalInterface
              </local>
         </ejb-local-ref>
    The weird thing about this is you don't need to do it when you use remote interface!! I would have thought Weblogic was smart enough to put your EJB in the JNDI when you declare @local on your interface!!
    Am I wrong with something here?
    When I read the EJB spec, it says you don't need to declare your EJB anywhere when you use annotation....
    If someone have an explanation I would be very happy to read about it!!!!
    Tanx

    Hi,
    In our current impl, we don't bind local business interface impl onto global jndi, this is because adding global JNDI binding for local EJB means every local business interface object must be bound into global JNDI, which will give rise to strange errors when accessing remotely or in different application context.
    On the other hand, you needn't add each local interface in the web.xml, you can use annotation through EJB link, which is the suggested way to use EJB local reference, for example:
    @Stateful(name="AccountManagementBean")
    public class AccountManagementBean
    @EJB(
    name="PersonBeanRef",
    beanName="PersonBean"
    Person person;
    @Stateless(name="PersonBean")
    public class PersonBean implements Person {
    In this example, AccountManagementBean has a local reference of PersonBean, the key is you should use beanName in @EJB, whose value is the ejb name of referenced EJB.

  • Unexpected database connector error, when data sent from POJO.. Plz Help Me

    Hi, Please Help me about this, I have started learning to develop a crystal report with java swing in crystal report integrated eclipse IDE 3.5 but when i am trying to send data from pojo to report file its giving error like "Unexpected database connector error" and Error code:-2147215349 Error code name:docNotReady.... please hlep me... i uploaded my program and the link to download my file is :
    http://www.4shared.com/file/mz8O4iQi/SimplePojoReport.html
    and i am not using any database just setting the data in the pojo...
    i wrote my problem here before, but nobody replied me... so this time i uploaded my project.. please help me...
    thanks...

    Hell Ted Ueda,
          Thanks for your reply, and did you downloaded my project files ? if not then please download it first.. because i retrieving data from the POJO not from any database.. from database its working fine but in case of POJO its not, because i wanna retrieve data dynamically from directly fields to report, means that user will fill all the information in the text box (Swing) and when he click on the button then the data from the text box should be pushed to report file and also should have to saved in the database.. so please download my project file... and help me...
    link : http://www.4shared.com/file/mz8O4iQi/SimplePojoReport.html
    thanking you..
    Arun...

Maybe you are looking for

  • Address Book and Mail

    When I choose an email address from an entry in Address Book, clicking on "Send email", it opens Google Mail instead of Apple Mail. I cannot find any preferences somewhere to correct this-

  • Multiple tables in GUI_DOWNLOAD in same text file

    Hi, Can anybody tell me how to pass multiple internal tables for download in same text file. And also each table output should start with NEW LINE. Please help me in executing this functionality. Thanks, Amol

  • Can't get apple tv to connect to wireless

    I've tried restarting, disconnecting and reconnecting. I've tried lowering the resolution, I've tried everything. My macbook connects fine. HELP!!!!

  • Data rate conversion for f4fpackager

    Hello, I am woundering what Adobe suggest in the following matter. So, when I use f4f packager command line tool,i supply --bitrate value, but I know it in bps (say 500,000 bps). And f4fpackager wants it in kbps. So, should I divide by 1024 or 1000?

  • Solution sought: fax from apps in OX 10.7, via fax modem and Comcast cable svc.

    recently relocated from the rural mountains into the city...  previous fax communications achieved via dedicated phone line and hp 3330mfp... now confronted with Comcast cable and the bundled services... previous fax services are now antiquated and h