Creating a simple java client for a session EJB local interface

Hi all
Is it possible to create a simple java client for a session ejb local interface with JDeveloper.
The problem is that it creates a test client for a remote interface only...
i.e.
MySessionEJB sessionEJB = context.lookup("MySessionEJB")
and once i try to adjust it manually for the local interface...
MySessionEJBLocal sessionEJB = (MySessionEJBLocal) context.lookup("MySessionEJBLocal") (MySessionEJBLocal - is the name of my local interface)
it generates the exception:
javax.naming.NotFoundException: SessionEJBLocal not found
at...........................(RMIClientContext.java:52)
There is still no problem with accessing the local interface object from the jsf project where i've added <ejb-local-ref> tag into the web.xml file.
but i need the possibility of testing the simple java client for the local interface to test business methods wich should return objects without indirect properties
Thanks in advance.
Alex.

Pedja thanks for reply.
I still dont understand what is wrong with my example.
The first peace of the code i wrote (getting the reference to the remote interface object) works pretty well, and even more it is produced automatically by JDeveloper, so why we cant get a reference to the local interface object the same way?
Certanly we should use the local interface for getting access to the resource functioning under the same local jvm and i think it doesnt metter wich app server we really use wls or oas or others
Thanks. Alex.

Similar Messages

  • Web Service-Client for stateful session EJB container

    Do you know, how to write a Web Service-Client to connect a stateful session EJB container?
    A stateful session EJB container ist created with Web Logic 8.1.
    Message was edited by n.t.c at Dec 14, 2004 6:09 AM

    Pedja thanks for reply.
    I still dont understand what is wrong with my example.
    The first peace of the code i wrote (getting the reference to the remote interface object) works pretty well, and even more it is produced automatically by JDeveloper, so why we cant get a reference to the local interface object the same way?
    Certanly we should use the local interface for getting access to the resource functioning under the same local jvm and i think it doesnt metter wich app server we really use wls or oas or others
    Thanks. Alex.

  • I have deployed a simple session bean with one business method.I created a simple java client to access.

     

    Hi,
    It depends upon your client program. You can use a java rmi based client or a web application. The good kick start to the problem would be to have a look into the java pet store example and converter example which is using RMI port for client access as well as web based access. Please review the examples shipped along with iAS and I'm sure that you will have a good idea on going about the coding.
    Regards
    Raj

  • Creating a SIMPLE Java APPLET for a HTML website

    Hello!
    I was wondering if anyone can help me.
    i have designed a very simple HTML website and wanted to make an applet.
    which program would be best (eclipse, blue j...etc)
    and how do i go about it!
    i am very new to this and would appriciate the help
    many thanks in advance

    sabre150 wrote:
    gimbal2 wrote:
    your brain to do all the hard work. It needs to be preloaded with knowledge of programming, the Java language, the Java platform and the Java plugin relating to applets before it will work.So that's where I have been going wrong!Lies, I know for a fact that you know a thing or two. What are you trying to do here? Hide from your responsibilities as a knowledgeable person?

  • Replicating simple Java objects for automatic failover

    Is there a way to replicate a simple java object that is bound from JNDI
              across all servers so that if the primary server fails, it will
              automatically failover?
              We have a java client that uses JNDI to access EJBs on WLS5.1 SP8. In order
              to determine client information, the client currently binds a simple java
              class in the JNDI tree. The Entity and Session beans use the caller
              principal to locate the object in order to access client-information for
              such things as record locking, logging, etc..
              We have to move this architecture to a cluster environment and we are
              wondering how we can replicate this object across cluster servers so that
              failover is handled automatically, and that it is still accessible through
              JNDI.
              An RMI replicated stub is not enough, since it only works as long as the
              server hosting the RMI object is alive.
              I'd like to add that the object is created and bound at client start-up and
              destroyed at client exit.
              Thank you for any advice or information,
              Dania Kodeih.
              

    A: Replicating simple Java objects for automatic failover

    That's what I figured. I guess the only solution in this case is to persist
              the object during client sessions. I was hoping for something simpler, but I
              guess I'll have to create an Entity Bean and everything else that comes with
              it.
              Thanks,
              Dania.
              Cameron Purdy wrote in message <[email protected]>...
              >Unfortunately, when the originating server goes down, the replicated object
              >disappears.
              >
              >Peace,
              >
              >--
              >Cameron Purdy
              >Tangosol, Inc.
              >http://www.tangosol.com
              >+1.617.623.5782
              >WebLogic Consulting Available
              >
              >
              >"Don Ferguson" <[email protected]> wrote in message
              >news:[email protected]..
              >> If I am not mistaken, any serializable object will automatically be
              >replicated
              >> across the tree.
              >>
              >> Dania Kodeih wrote:
              >>
              >> > Is there a way to replicate a simple java object that is bound from
              JNDI
              >> > across all servers so that if the primary server fails, it will
              >> > automatically failover?
              >> >
              >> > We have a java client that uses JNDI to access EJBs on WLS5.1 SP8. In
              >order
              >> > to determine client information, the client currently binds a simple
              >java
              >> > class in the JNDI tree. The Entity and Session beans use the caller
              >> > principal to locate the object in order to access client-information
        �... [Show more]

    Read other 4 answers

  • Unable to create a simple test client. Got ConfigException: JBO--33001

    I am trying to create a simple test client as per ADF training manual. Have just created an empty AM. The test client is giving this error at runtime.
    The test client looks like:
    public static void main(String args[])
    String amDef = "test.TestModule";
    String config = "TestModuleLocal";
    ApplicationModule am =
    Configuration.createRootApplicationModule(amDef, config);
    // Work with your appmodule and view object here
    Configuration.releaseRootApplicationModule(am, true);
    Getting the following error
    Exception in thread "main" oracle.jbo.ConfigException: JBO-33001: Cannot find the configuration file /test/common/bc4j.xcfg in the classpath
         at oracle.jbo.client.Configuration.loadFromClassPath(Configuration.java:432)
         at oracle.jbo.common.ampool.PoolMgr.createPool(PoolMgr.java:284)
         at oracle.jbo.common.ampool.PoolMgr.findPool(PoolMgr.java:539)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1252)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1230)
         at amit.bc4j.TestClient.main(TestClient.java:18)
    Process exited with exit code 1.
    I have added JAXB and Applications Core libraries to the default library list.
    (added JaxB because of http://myforums.oracle.com/jive3/thread.jspa?messageID=3425268&#3425268
    and Unable to create a simple test client. Error JAXBException
    I have checked that /home/aagupta/jdevhome/home/aagupta/jdevhome/FusionJdev/mywork/Test2/TestProj/classes/amit/bc4j/common/bc4j.xcfg file exists.
    I even tried to add this directory using Add lib/directory pane, but no help.
    Please suggest what to do...
    Thanks,
    Amit

    Got it....i paid the price of not understanding the error messages and expecting bc4jclient and ctrl+enter is a magic wand :)
    Thanks to Steinmeier,Oliver http://myforums.oracle.com/jive3/thread.jspa?messageID=3408700&#3408700
    The shortcut only generates sample code. We need to substitute the actual AM location.
    public static void main(String args[])
    String amDef = "amit.bc4j.model.TestAM";
    String config = "TestAMLocal";
    ApplicationModule am =
    Configuration.createRootApplicationModule(amDef, config);
    System.out.println("Read the messages!");
    // Work with your appmodule and view object here
    Configuration.releaseRootApplicationModule(am, true);
    }

  • Does anyone know of a product I can use to script over a Java Client for Or

    Does anyone know of a product I can use to script over a Java Client for Oracle Forms edition 9i??????????

    You should post your question in the Forms the Developer Suite forums. It is found at:
    Forms

  • Java client for MQSeries

    Hi ,
    I am new to MQSeries . We have a requirement to develop java wrapper_ to consume /produce message to MQSeries queueies .
    I googled out for document but no luck i couldnt get proper document . Please help me on this appreciate your help.
    Thanks & Regards ,
    Siva K Divi

    my 2 cents: http://www.javamonamour.org/2011/06/java-client-for-websphere-mq.html
    there used to be a great IBM Red Book with EVERYTHING about MQ v6.... sort of BIBLE of MQ....

  • Java client for microsoft passport

    hi,
    i wonder if it is possible to build a java client for microsoft passport services on mobile phones. do i need any kind of middleware to communicate between a java phone and a server?
    thanks in advance
    Dirk

    Hi,
    Yes, by using a servlet you can connect to passport services lets say hotmail by using the HTTP protocol as described in RFC 2518. Only thing you have to do is to communicate with the servlet afterwards..
    Cheers,

  • How to create command line java client

    I have a java servlet FileClient.java and am invoking it thru POST method from the html file. How can I create command line java client so that I can execute this class file from windows command prompt.
    e.g. java FileClient <argument>
    TIA

    > .. there's also a "won't work".
    I could post a sample...I know that you can instantiate and call aservlet,
    or even write your own servlet container - butit's
    still a local instance. He can't invoke his remote
    servlet by calling its class on the client like he
    suggested.HttpURLConnection in main.Only if his Servlet has a main method. Which wouldn't really make it a servlet anymore.
    OP said he wants to invoke it from command-line using
    java -cp . TheServletClass
    He said he has a servlet called FileClient. And he can't invoke a servlet directly that way, without building a wrapper that starts it, making it more than a servlet, and it definitely won't execute on the server. That's my whole point. I never wanted to say you can't write a command-line program that invokes a servlet on a remote server. I do it myself after all.
    I guess I should have expressed myself more clearly.

  • Starting out with Java client for Web Services

    Hi,
    I'm new to Web Services (but not Java in general). Just looking for some pointers to get me started in the right direction.
    My pressing need is to develop a Java client for a set of Web Services described through a WSDL.
    I've found the "Chapter 12: Building Web Services With JAX-RPC" section of the Web Services Tutorial. Could someone just confirm that this is the right tutorial for me to read for my puropse.
    Also I was wondering about available tools for this purpose.
    I was expecting that there would be a tool that could read a WSDL and generate client side stubs for it automatically. (Like how you can take a Remote interface and rmic it in RMI). Is there such a thing? Is it possible?
    Preferably an open source (free) tool. I use the Netbeans IDE so if anyone knows of anything that integrates with that, all the better. I had a look at their site but couldn't see anything.
    Thanks in advance for any tips anyone can provide.

    Hi,
    I'm new to Web Services (but not Java in general).
    Just looking for some pointers to get me started in
    the right direction.
    My pressing need is to develop a Java client for a set
    of Web Services described through a WSDL.
    I've found the "Chapter 12: Building Web Services
    With JAX-RPC" section of the Web Services Tutorial.
    Could someone just confirm that this is the right
    tutorial for me to read for my puropse.Yes, that's right. It manages to say very little in very many pages.
    Also I was wondering about available tools for this
    purpose.
    I was expecting that there would be a tool that could
    read a WSDL and generate client side stubs for it
    automatically. (Like how you can take a Remote
    interface and rmic it in RMI). Is there such a thing?
    Is it possible?This is exactly what the wscompile tool (distributed with the JWS SDK 1.3) does as one of its options. See http://java.sun.com/webservices/docs/1.1/tutorial/doc/JAXRPC6.html for more info.

  • Weblogic-ejb-jar.xml for a Session EJB

    The weblogic-ejb-jar.xml generated for a Session EJB with local interfaces has a jndi-name element instead of local-jndi-name.
    1. Create a Session EJB.
    Select Include Local Interfaces.
    2. In the META-INF directory select New>General>Deployment Descriptors>weblogic-ejb-jar.xml
    The deployment descriptor generated has a jndi-name element.
    For a Session EJB with local interfaces the element should be local-jndi-name.
    thanks,
    Deepak

    weblogic-ejb-jar.xml jndi-name (instead of local-jndi-name) is with JDeveloper version 10.1.2 & 10.1.3

  • Do I need to Create Primary Key Class for Entity beans with Local interface

    Do I need to Create Primary Key Class for Entity beans with Local interface?
    I have created my entity bean with the wizard in Sun One Studio and it does not create a primary key class for you.
    I thought that the primary key class was required. My key is made up of only one field.
    Anyone know the answer.
    Jim

    u dont need to create a primary key class for a entity bean.if ur table's primary key feild(int ,float) is a built in or primitive data type,then u dont need one.But if ur table has a primary key field which is non primitive (for example StudentID,ItemID etc)then u have to create a primary key class.
    hope this helps :-)

  • EJB 3.0 Session bean local interface NullPointerException

    I am trying a very simple test of a Stateless EJB 3.0 bean called from a servlet.
    The bean has a local interface, annotated with @Local. The bean implements that interface and is annotated with @Stateless.
    I have a servlet with a variable of the local interface type, annotated with @EJB. The servlet's doGet method invokes the bean's one method using that interface and it works fine.
    BUT if I put the same variable, annotated with @EJB into another class in the web container, it is not injected correctly and I get a NullPointerException on the variable. This class is in WEB-INF/classes with the servlet class, so I assume it is loaded by the same classloader.
    I don't understand why the servlet can instantiate the EJB local interface successfully but another class in the web container can't. I get the same result in OC4J standalone 10.1.3.1 and 10.1.3.3.

    Only managed classes like servlets, filters etc. will have context and EJB references injected into them, and only with servlet version 2.5. A work colleague found the answer in Debu Panda's blog:
    http://debupanda.blogspot.com/2006_10_01_archive.html#116184543992078773
    This behaviour appears to be part of the EJB 3.0 standard.
    The solution is to use JNDI lookup in the client class (POJO) and declare an ejb-local-ref in web.xml.

  • Java client for calling a XI web service

    Hello,
    does anyone have created a Java client
    with Apache Axis? I tried it and it works
    for web service which aren't provided by
    SAP XI, but if I use to call a XI web service
    something went wrong.
    The XI web service works. I tested it with
    XML Spy.
    I think there must be something special with
    XI web service.
    So anyone got a tutorial/guide for this???
    thanks
    chris

    Hola mi  nombre es Luis,
    Creyendo que eres español te escribo en tal idioma.
    He visto que a ti también te devolvía un error de autentificación 401, y que lo subsanaste, pero a mi con la solución que te dieron no me vale, ya que implemento el código que te ofrecieron para arreglarlo y ahora me da un fallo de "Server Error" poniendo en usuario y password, los correspondientes a XI.
    +Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay req=new Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay();
    wdContext.nodeRequest_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay().bind(req);
    req._setUser("username");
    req._setPassword("password");+
    No sé si es que ese usuario y contraseña son otros distintos.
    Si pudieras ayudarme, te lo agradecería.
    Un saludo, Luis

Maybe you are looking for

  • Music scrollbar doesn't show the correct time

    I have this really annoying problem on my Ihone 4. It doesn't happen all the time though. I always listen to audiobooks en aometimes when I have to take a call or whatever it will restart from 00:00 this is not the problem but when I then want to use

  • Crm_dataexch_after_bapi_fill - CRM to R3

    Hi Experts, We have a requirement to replicate the sales order from CRM to a new sales ordem in R3 system. The issue is that, some times, in R3 the sales order must have some different informations that the sales order in CRM. When I create a sales o

  • How do i change account names and password on an existing device

    i need to change from a existing 4s to a 5s. the 5s was my son's and need to change the icloud info to mine.

  • Default Table Interface Class - 0TPL_BAP_MASTER

    Hi there We are trying to determine which table interface class is used on the default 0TPL_BAP_MASTER web template. We have created our own web template, but one of the pieces of functionality delivered with the standard template is the sort (ascend

  • Looking for a monitor

    I am looking for a monitor to use with Aperture and Final Cut. Maybe 22 or 24 inch.  I am not ready to spring for an Apple Cinema Display, so what is out there? Any good websites with reviews or recommendations for the forum ?