Home & remote interface

i deployed EJB with ORACLE deployejb tool,it succeed,from the sess_sh shell,i can see the bean itself.But where should i put the home & remote interface class,is that the web server defined class path just like using a javabean.i use tomcat as my webserver.i didn't do above,and when i import the Home & remote interface in my jsp file,it says can not compile the Home & remote interface class,is that the reason.
thanks

it did work!thans!
but i got another error in my jsp file:
"javax.naming.CommunicationException: Can't find SerialContextProvider "
it generate after the following code,can you tell me the reason:
try{
Hashtable env = new Hashtable();
env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
env.put(Context.SECURITY_PRINCIPAL, user);
env.put(Context.SECURITY_CREDENTIALS, password);
env.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
ic = new InitialContext(env);
thanks!
null

Similar Messages

  • Home/Remote Interface and BeanName EJB in different Packages

    Hi all,
    I have a simple stateless session bean. Its Home and Remote interfaces are in X package and the BeanEJB in another. The files compile without any error. While I try to deploy it into J2EE ref implementation server using its deployment IDE, it throws up an rmic compilation error.
    Error Details
    File e:\j2sdkee1.3\repository\tejix\gnrtrTMP\POC2\General\SeabedHome_RemoteHomeImpl.java does not contain type General.SeabedHome_RemoteHomeImpl as expected. Please adjust the class path so that the file does not appear in the package General.
    General is the package where the remote/home interfaces are located and Bean1 is where the BeanEJB.
    Please suggest a solution
    Thanks in advance
    - Tejasvi

    I think that there is no problem in having the remote and home interface in different packages. Are you sure there is no conflit between classes? I had the same problem because i had repeated classes in the same package. I know this looks stupid but it really happened.
    miguel

  • Using CallRouter with EJB Home/Remote interface

    Hi,
    How do i Use my CallRouter class for EJB's.
    How to use rmic . please help
    thanx in adv.
    pradeep bhat

    You can specify the call-routers in weblogic-ejb-jar.xml.
    FWIW, what are you trying to do?
    -- Rob
    pradeep bhat wrote:
    Hi,
    How do i Use my CallRouter class for EJB's.
    How to use rmic . please help
    thanx in adv.
    pradeep bhat

  • How to specify a base class for Remote Interface in Workshop 9.2? -- URGENT

    Hi,
    I am trying to create a UUP EJB in WebLogic 9.2 workshop. I am using @FileGeneration to create my home & remote interfaces. And the generated remote interface is extending javax.ejb.EJBObject;I want my remote interface to extend com.bea.p13n.property.EntityPropertyManager which in turn implements javax.ejb.EJBObject. Can someone tell how i can do it in Workshop?.
    I came across Predefined Variable: remote.baseClass and as per docume
    ntation..."If specified, the value of this variable will be used as the base class for all generated remote classes. Where i should specify it?. @FileGeneration does nt have any option for it. Any help is grtly appreciated.
    Following are my code snippets:
    IMPL Class
    @FileGeneration(remoteClass = Constants.Bool.TRUE,remoteHome = Constants.Bool.TRUE, localClass = Constants.Bool.FALSE, localHome = Constants.Bool.FALSE,remoteClassName = "MyEntityPropertyManager",remoteHomeName = "MyEntityPropertyManagerHome")
    public class MyEntityPropertyManagerImpl extends GenericSessionBean implements
              SessionBean {
    //code
    }

    This question was posted to both the bea.workshop.developer.general and weblogic.developer.interest.workshop (I had replied to the later on 10/19); after seeing an identical question today on this list want to include a reference to that reply here:
    http://forums.bea.com/bea/message.jspa?messageID=600044925&tstart=0
    -Rob

  • Enhancement request: Remote interface java file generation

    Problem:
    In release 9.0.3, If you want to write a method that is suppossed to be exposed in the remote interface, you have to first right click on the ejb-jar.xml's appropriate EJB name node and then add the method, specify the argument types (say about 25 in number in a small width textbox), return type, etc and check the check box 'Expose in remote interface'. Then only remote interface's java source gets updated and only after doing all this can you actually sit down to write the business logic in that method. If you first code the method and then try to add the same, it gives an error saying "duplicate method exists"
    Suggestion:
    The similiar feature in release 9.0.2 was much better and flexible as it allowed the generation of remote interface source after coding the actual method in the EJB source. You can first write the method and then expose it in the interface by just choosing it from a method browser and opting for exposing it in the remote interface. You donot have to write the name and number of arguments like we have to currently do in the 9.0.3 release.
    (1) Actually, all public methods in the EJB source should by default be exposed in the remote interface because EJB are supposed to be used by other EJBs and JSPs only and all methods that are public but not exposed in the remote interface should actually be private or protected.
    (2) Leave it up to the developer to edit the remote interface
    (3) When the EJB source file is changed (public methods changed) compiled the remote interface should also be updated automatically. Why? already you have provision to change the remote interface source, so just dump all the public methods in the remote interface source when the EJB source is compiled.
    (4) Ditto for EJB Homes
    (5) Actually whenever the developer changes and compiles the EJB source, the remote and home source should automatically be updated AND COMPILED. (Refer: Pramati Studio 3.0 SP3 :- URL: www.pramati.com )
    I was very happy with the earlier option. If anybody other then the JDeveloper Team finds this interesting, please respond. A suite like developer should be more User-friendly.
    And yes expect more like this from me in the future

    Hi Raghu,
    Thanks for the quick response. This flexiblity in Remote interface generation and choice of methods in it at any given point in the development cycle is very much desired feature.
    The other thing I would like to suggest is you look at another enhancement request in my name regarding batch updates of the "web.xml" file. You will find the thread updated today i.e. on 15th September with a reply
    I will shortly post one more for lack of modularity in EJB components descriptors.
    My Company Four Soft Pvt. Ltd. (www.four-soft.com) is Oracle's development partner and we use and support Oracle products. They are good but naturally we would like them to be better and more User-friendly.
    Thanks once again.
    Amit

  • Remote Interface problem using Sun ONE App & web server

    HI,
    1) I am using an S'less SB. I have local & remote interfaces. I am using the sun one appserver7 & the sun ones's htttp server. By default it doesnt pick up the remote interfaces is it ? How do i make my remote interfaces work ? what are the changes required in config/xml ?
    2) However i changed my client code (i.e my action class which is called by the struts action servlet ) to access the localhome rather than the remote home, but then i get java.lang.classcastexception.
    pls help !
    sanjay

    Hi parsuram,
    Thanks for the tip. After looking at the sample source code, I did finally figure out the solution - so I'll post it in case anyone else happens to be working with websphere studio has the same issue deploying on sun one.
    To access local interface ejb, you must have the following
    1. ejb-local-ref tag in the ejb-jar.xml like so underneath the <session> or <entity> tag of the bean which you plan to access the local ejb with.
    <ejb-local-ref>
    <ejb-ref-name>TestL</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>memory.simple.TestLLocalHome</local-home>
    <local>memory.tool.simple.TestLLocal</local>
    <ejb-link>TestL</ejb-link>
    </ejb-local-ref>
    2. similar ejb-ref tag in sun-ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>TestL</ejb-ref-name>
    <jndi-name>localejbs/module_memory.betaEJB/TestL68640023372300293</jndi-name>
    </ejb-ref>
    note: sun generates the <jndi-name> and overwrites whatever you put in that tag no matter what you put in there.
    3. here is the code to access
    Context initial = new InitialContext();
    TestLLocalHome tlHome=(TestLLocalHome) Initial.lookup
    ("TestL");
    //the string must match <ejb-ref-name> underneath <ejb-local-ref>
    4. note that the jndi name for the local interface bean becomes irrelevant. only the <ejb-ref-name> in the ejb-jar and sun-ejb-jar matter. furthermore, both <ejb-ref-name> must be the same or you won't be able to deploy.
    5. This is completely my fault for not checking the "proper" way to access local interfaces. in websphere, they let you get away without the ejb-ref tags and just use the string "local:/TestL"!
    -matt

  • Reflection of remote interface

    Hi. was wondering if you could use reflection to ennumerate the remote interface used by a java RMI server. I dont have anything specific in mind just a point at some documentation about this kind of reflection would be cool.......or any obsticles that would prevent me from doing so.
    Thanks!

    why do we have remote/home interface.What for? You'd just restrict the use of inheritance, without providing any additional implementation details or better design "semantics".

  • Obtain remote interface using PortableRemoteObject

    Hello,
    I have sample code from "Applying Enterprinse JavaBeans" book.
    Plan plan = (Plan)PortableRemoteObject.narrow(
    it.next(), Plan.class);
    ... plan.getPlanInfo() ...
    here:
    Plan is a remote interface of the entity bean (e.g.. MyPlanBean).
    getPlanInfo() is one of the business methods in Plan.
    In this case, the remote interface is obtained by using PortableRemoteObject.narrow(...). could anyone explane the creation using the concept of life cycle of an entity bean instance? That means if any ejbCreate() methods or any callback methods are involved in the creation or not?
    Thanks.

    I am not sure if you are doing the right thing.
    The home interface represents the life-cycle methods of the component (create, destroy, find) while the remote interface represents the business method of the bean.
    Clients use the bean's home interface to obtain references to the bean's remote interface. Following is the life-cycle of
    entity bean creation:
    1. Client invokes create() on home object
    2. Home object allocates a bean from the free pool
    3. Home object passes on the create args to the ejbCreate(..)
    in the bean
    4. the bean inserts a row into the database table
    5. the bean returns the primary key of the row to the home object
    6. The container creates an EJB object for the bean and populates
    it with the primary key
    7. The home object calls the ejbPostCreate() on the bean
    8. The home object returns the remote reference to the EJB
    object back to the client
    9. Client now makes business calls to the bean instance.
    No bean instance is associated with the EJB object
    10. EJB object communicates to the container that a bean
    instance is needed
    11. The container allocates a bean instance from the pool
    and associates it with the EJB object (ejbActivate() is called)
    12. home object invokes the ejbLoad method on the bean to
    tell it to load itself(BMP) or to tell it that it has just been
    loaded (CMP)
    13. the bean uses the primary key stored in the EJB object to load the approp row's data from the database
    14. EJB object dispatches the client's business method call to the
    bean
    Hope this helps.
    Regards,
    Sun-DTS

  • Calling Remote interface from client

    Hi there!
    I am working on a BMP (using weblogic 6.1)
    My problem is - How do I contact remote interface from client. In my jndi tree I have mentioned only Home interface. Right now I am calling my remote interface like this:
    //contact home interface
    Object obj = ctx.lookup("APIHome");
    APIHome home = (APIHome) javax.rmi.PortableRemoteObject.narrow(obj, APIHome.class);
    //creating remote somehow - I got this clue from a website
    rem = home.findByPrimaryKey(new EntityPK("test1","test2"));
    //calling getter & setter methods
    rem.setWidth()
    rem.getId();
    This works...but doesn't make any sense to me. Why should we initialize remote interface as above. Or is there any other option. Can somebody please explain me more clearly about this concept.
    Thanks very much
    regards
    -Manasvi

    The HomeInterface contains two types of methods - create and find. The create methods create an instance of the entity bean(i.e., a record in the database) and the finder methods finds an existing record in the database, constructs an entity bean representing this row and returns the remote interface of this bean to the client for further manipulations.

  • Role of Remote Interface in EJB 2.0

    Hi,
    Recently I was working upon a sample application for developing Entity Bean, the Home interface had a method which provided Business functionality. The implementation of the method was given in the Bean Class by preceeding the name of the method by ejbHome.
    This method was callable by just looking up the Entity Bean, thus not requiring the need for the Remote Interface.
    Now my question is why was this kind of work around required? This totally removes the need for the remote interface, if the Bean Writer decides so.
    The practices suggest that any functionality to the client should be provided via remote interface, and Home interface should contain only the methods related to life cycle of the EJB, then why to have business methods in the Home Interface.
    Please clarify.

    Bhushan!,
    I hope you getting the whole context wrong!.
    As I said earlier if you want to operate on your persistent data, then you must either find an entity bean through ejbFind() or create a new one using ejbCreate ().
    However ejbHome methods provide a functionality which is independent of the persistent data that the bean represents. For ex. Suppose you have an entity bean User that maps to a user database then in order to operate on user data you will always need a remote interface.
    However if you need some information from the bean which is independent of user data then, for ex. you want to say Hello to your clients, you need to implement this functionality using ejbHome () methods.
    I hope this helps.
    VJ

  • When do remote interface get invaliated? Can I cache them?

    Hello,
    I am designing an application, and considering using the "Service Locator" pattern, acting as a singleton that will cache jndi context, and bean home and remote interfaces. However I am unsure whether caching of remote interface is a problem or not:
    1) Under what circumstances will the cached remote interface for a stateless session bean be invalidated?
    2) Under what circumstances will the cached remote interface for an Entity Bean be invalidated?
    3) Assuming that I cache Stateful session bean remote interfaces in a Servlet HTTPSESSION, under what circumstances will the cached remote interface for Stateful session bean be invalidated?
    4) Finally, do I have to utilise home handles instead of remote interfaces for any of these situations? If so, why?
    Thanks

    I understand that caching the Home Interface or HomeHandle of this, is the solution for
    reconnection to EJB's problems.
    But I do not succeed in getting a working solution for handling the reconnection
    to a restarted EJB server after some downtime.
    First the HomeHandle of the Home Interface is successfully saved with:
    "myHomeHandle = myHome.getHomeHandle();"
    Later the HomeHandle is used to restore the Home Interface with:
    "MyHome myHome = (MyHome) myHomeHandle.getEJBHome();"
    But this gives an Exception like
    Caused by: javax.naming.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
    I have followed the recommandations in this postings, but in some way I lack a bit information.
    Has somebody a code example in Java of how to do this?
    Here is my code which throws the exception
    InitialContext context = new InitialContext( properties );
    Object obj = context.Lookup( "My" );
    MyHome myHome = (MyHome) PortableRemoteObject.narrow( obj, MyHome.class );
    myBean = myHome.create();
    myHomeHandle = myHome.getHomeHandle();
    // At this point everything fine, and a myBean is created.
    // Now I try to recreate the myHome Interface
    MyHome myHome = (MyHome) myHomeHandle.getEJBHome();
    // In order to (re)create the myBean EJB.
    myBean = myHome.create();
    // But the second create is never executed, as the method call "...myHomeHandle.getEJBHome();"
    throws the above Exception.
    So, any help I will Appreciate.

  • Handle vs remote interface

    Hi,
    I have some web-page which submits to a servlet which calls methods in a stateful sesiion ejb. The same web page is again displayed. Again on submission the same
    ejb gets called.
    Question is should I hold the ejb's handle or the remote interface in session(HttpSession)?
    Raster

    Hi,
    If it's necessary to keep the state of the bean for the next time, keep the ejb's handle. Otherwise, I think it's better to keep the home handle.(to avoid the bean time out issues.) If state is not needed then u can can make it a stateless, right?
    Also please ensure that not more than on client is using the same insatnce of stateful session bean
    concurrently. Synchronize the code appropriately
    [email protected]

  • Session Bean - Why the Remote Interface?

    Hi,
    I have a stateless session bean that takes a serializable object
    as a parameter and passes it to an entity bean to persist. My question
    is: why should I put the method (addxxx) in the remote interface of my
    session bean? Why can't I just put it in the home interface so that I
    don't have to instantiate the EJB object first, then call the method?
    Any pros/cons? Thanks.
    -Linus

    You could use the Home.create() method. Generally, the home interface is
    used to manage the lifecycle of a EJB. Theoretically, you are right in your
    thinking because a stateless session bean does not preserve any state and is
    alive for the duration of a method call.
    "Linus" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I have a stateless session bean that takes a serializable object
    as a parameter and passes it to an entity bean to persist. My question
    is: why should I put the method (addxxx) in the remote interface of my
    session bean? Why can't I just put it in the home interface so that I
    don't have to instantiate the EJB object first, then call the method?
    Any pros/cons? Thanks.
    -Linus

  • Slowness in Retrieval of Remote Interface

    We are running Weblogic 6.1 with service pack 2. Recently we saw that it was taking
    from 1 to 2 minutes to get a remote interface to a session bean. Normally this
    takes less than a second. My question is, what "gotchas" are out there when it
    comes to the timeliness of accessing a session bean?

    The two lines of code causing the delay are:
    home = (TRSSessionHome)javax.rmi.PortableRemoteObject.narrow(contextForBean.lookup(TRSSessionHome.beanHomeName),TRSSessionHome.class);
    remote = home.create();
    What makes you think it is DNS? We are thinking that we are blocking on a thread
    somewhere? But this still doesn't account for the 2 minute delay. We saw no errors
    in our logs either. Any help is greatly appreciated because we haven't gotten a
    solution and the tech support guy is out of ideas until the problem happens again
    and I get him a thread dump.
    thanks,
    lisa
    Rob Woollen <[email protected]> wrote:
    Are you talking about the JNDI look-up, or the call to home.create. Is
    this a
    stateless session bean or a stateful session bean? Is the caller within
    the WebLogic
    Server or in an outside process/machine?
    My first guess is that you're having problems with your DNS. Try using
    the IP address
    instead.
    -- Rob
    Michael Dunnigan wrote:
    We are running Weblogic 6.1 with service pack 2. Recently we saw thatit was taking
    from 1 to 2 minutes to get a remote interface to a session bean. Normallythis
    takes less than a second. My question is, what "gotchas" are out therewhen it
    comes to the timeliness of accessing a session bean?

  • EJB3 - More than one remote interface for Session Bean?

    Hi,
    Is it possible in EJB3 to have more than one remote interface for a SessionBean?
    I have seen it posetd on here that it is possible but never been able to find any other information.
    Using JBoss as my App Server, I have deployed an App, where a SessionBean is defined as implementing 2 interfaces, both of which are annotated using @remote.
    However when I examine the JBoss JMX Console, Global JNDI Namespace only one remote interface is listed, and indeed it is the first one defined in the SessionBean.
    Considering I use a String similar to (MyApp/MyBean/remote) to do the JNDI lookup, this would indicate that it is not possible to have more than one remote interface.
    1. Is this a JBoss specific limitation?
    2. Is there another way of performing the JNDI lookup?
    Thanks,
    Alan.

    Hi,
    Thanks for prompt response! I tried the suggestion in my application, and the output from JBoss JMX Console was
    +- XXXBean (class: org.jnp.interfaces.NamingContext)
      |   |   +- remote (proxy: $Proxy291 implements No ClassLoaders found for: xxx.xxx.xxx.xxx.xxx.Remote1 (no security manager: RMI class loader disabled))Again only displaying the remote interface that is first in the @remote ({ Remote1.class , Remote2.class}) list. This would lead me to believe that JBoss does not support this.
    Can anyone confirm this?
    Alan.

Maybe you are looking for

  • Search a text in a multiple tables and one table has BLOB column

    Hi, I couldn't find a solution/examples for below scenario in oracle text documentation or related forums. I need to search a text in a multiple tables,in that one table has blob column which is used to store the documnents(pdf,doc,jpg..etc) and othe

  • Premiere Pro CC Crashes on startup

    Hi, I'm using a Mac OS X 10.9.2, and premiere pro keeps crashing every time I try to start up today. The other creative cloud programs all work, just premiere pro. There are no updates as far as I can tell. I've tried restarting. Any suggestions?

  • Generating RTF/PDF/HTML

    Hi all Is it somehow possible to generate an RTF, PDF or HTML easily direct out of Java so that i can display my text and all other stuff like this, without using of a printer/printpreview - i don't want to make it like this it is easier to simply sh

  • Database Authentication with CMP

    Hi all, I was curious if there was any way to have the login credentials for the underlying datasource that my CMP 2.0 entity bean uses be passed in somehow at "access" time (i.e. via some context object, properties, JAAS, etc). Basically I want to h

  • Why are my printers suddenly auto-pausing?

    Hello all - weirdest thing has just started happening.  I have two Canon large-format printers (iPF8100/iPF8300) I use, along with several smaller photo and office printers.  I haven't printed to the two big ones in about a week or so, but needed to