How to use Hibernet in session bean

Hello all,
i want to develop a Web client and a dextop client using hibernet technology....
Is it possible to use session bean for connection to the database using hibernet.
regards
chetan

Hi,
Do you mean Hibernate ?
if so, sure, you can use it from SessionBean.
Regards,
Sebastien Degardin.

Similar Messages

  • How can I set a Session bean timeout

    Hello !
    How can I set a Session bean to time out eg. 48 hours ?
    Thanks
    Uiloq Slettemark

    For stateful session beans you can use the timeout attribute in the orion-ejb-jar e.g.
    <session-deployment timeout=1800 ..>
    this is specified in seconds and Default Value: 30 (minutes)
    regards
    Debu

  • How can i lookup a session bean from the client side

    how can i lookup a session bean from the client side...........i am using sun appserver..............
    this is my code.................[B]
    private final static String JNDI_NAME="ejb/LmsBean";
    private static String url="ldap://localhost:4848";
    Hashtable h=new Hashtable();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
    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");
    [B]and i got the exception........
    Inside Client before calling delegate
    Before Loading Context in Delegate
    javax.naming.CommunicationException: Request: 1 cancelled
    javax.naming.CommunicationException: Request: 1 cancelled
    at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:60)
    at com.sun.jndi.ldap.Connection.readReply(Connection.java:405)
    at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:340)
    at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:171)
    at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2640)
    at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:290)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193
    at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.ja
    va:136)
    at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.jav
    a:66)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    62)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    at com.parx.lms.lmsdelegate.LmsDelegate.getController(LmsDelegate.java:3
    0)
    at com.parx.lms.lmsdelegate.LmsDelegate.addUserDelegate(LmsDelegate.java
    :50)
    at com.parx.lms.client.consoleClient.Client.main(Unknown Source)
    pls go tru the exception and pls help.........

    That url string should be having the server name or ip instead of localhost.

  • Using EJB remote session beans llike webservice.

    My requirement is to fetch a big size ASCII stream file from a remote location. For this can I use Statless EJB Session beans?
    For this EJB application & Web application will be on my application server side & EJB client should reside on the remote end side from where I want to fetch the file. - Please confirm my this logic as I am new in Java & EJB, I am having a basic query like this. (I don't want to proceed with EJB web service like (@Stateless, @WebService), I want to purly use EJB Statless Remote session beans - Is this possible?
    If yes, can I have one sample example URL pls?
    Thanks in advance for your help.

    My requirement is to fetch a big size ASCII stream file from a remote location. For this can I use Statless EJB Session beans?
    For this EJB application & Web application will be on my application server side & EJB client should reside on the remote end side from where I want to fetch the file. - Please confirm my this logic as I am new in Java & EJB, I am having a basic query like this. (I don't want to proceed with EJB web service like (@Stateless, @WebService), I want to purly use EJB Statless Remote session beans - Is this possible?
    If yes, can I have one sample example URL pls?
    Thanks in advance for your help.

  • Urgent: how to use cookies or session in javafx

    Hi....
    i am new to javafx and need help to learn how to use cookies and session in javafx.i want to create a simple website using javafx.....
    Urgent reply is requested
    mufaddal

    Please correct me if I'm wrong: I think LiveConnect is not supported on IE, and Mozilla has plans to discontinue it.
    Didn't an earlier version of JavaFX allow access to the Applet instance, including the AppletContext? Seems to me, just generally, that JavaFX applets are hobbled unless they have that functionality available. Cookies are one example. Also applet parameters, hyperlinks, and the browser status display.
    Especially hyperlinks.

  • How to cast back and use a retrieved Session Bean reference in a servlet?

    Please help!
    1. I invoke a Session Bean from a servlet :
    travelagent = home.create();
    2. I store the travelagent reference in the HTTP Session :
    session.setAttribute( "travelagent" , travelagent );------------------------------------------------------------------------------------------------------------------
    Now, in another servlet, I have to retrieve the reference to the EJB from the HTTPSession.
    I then have to use this reference to call a business method in the EJB Session Bean.
    I have tried two ways to retrieve the reference and cast it before calling the business method. I get errors in both forms of casting.
    The Values you will see below in the code:
    EJB Remote Interface : TravelAgent (TravelAgent.java)
    Business Method : listItineraries( )
    Servlet which calls the above method : ListItinerary.java
    Line 46 of ListItinerary.java : ArrayList itineraries = traveler.listItineraries();------------------------------------------------------------------------------------------------------------------
    The two ways along with the error I get on the servlet page in the browser are :
    (A)
    TravelAgent traveler = (TravelAgent)session.getAttribute("travelagent");The error I get is :
    java.rmi.NoSuchObjectException: CORBA OBJECT_NOT_EXIST 9998 Maybe; nested exception is:
         org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: 0x2000 minor code: 1806 completed: Maybe
    com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:208)
         com.sun.corba.ee.impl.javax.rmi.CORBA.Util.wrapException(Util.java:591)
         javax.rmi.CORBA.Util.wrapException(Util.java:277)
         source.traveler.ejb._TravelAgent_Stub.listItineraries(Unknown Source)
         source.traveler.servlet.ListItinerary.processRequest(ListItinerary.java:46)
    (B)
    TravelAgent traveler  =
    (TravelAgent)PortableRemoteObject.narrow(session.getAttribute("travelagent"), TravelAgent.class);The error I get is :
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException
         com.sun.corba.ee.impl.javax.rmi.CORBA.Util.wrapException(Util.java:597)
         javax.rmi.CORBA.Util.wrapException(Util.java:277)
         source.traveler.ejb._TravelAgent_Stub.listItineraries(Unknown Source)
         source.traveler.servlet.ListItinerary.processRequest(ListItinerary.java:46)
    Could someone advice on how to retrieve and cast the EJBObject's reference from the servlet so that I may use it to call the business method?
    Thanks!

    Thanks guys! It worked.
    1.. I should have used the handle. Got to coding without going deep in the concepts.
    2.. I dont know if I could have used the EJB Reference directly (instead of the handle).
    3.. The error was due to me not mapping the servlets with the EJBs that they could use. I continued to get the same error even after using the handle. Once I put the mapping to the EJBs correctly, everything fell in place.
    Thanks a lot!
    Henry

  • Newbie: How do i use a stateless session bean in a backing bean?

    I have a stateless session bean with a function 'getVoterList()'; how do i instantiate the bean and use it in from my managed bean?
    I dont want to use seam; coz the stateless serrion bean/EJB is written by another developer and we cant updat eit now to use seam..
    any tutorials? walk thrus or sample code?
    thanks
    illi

    I used a different method...
    I used servicegen with only a.jar to create the ear.
    I touch-ed my own application.xml to make it newer than the one already in the
    newly created ear.
    I used the ant <ear> task to add b.jar, c.jar, and application.xml to the ear.
    Worked like a charm.
    Mike
    Bruce Stephens <[email protected]> wrote:
    Hello,
    See if Neal's answer here helps solve your problem using servicegen's
    service element "IncludeEJBs" attribute:
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.webservices&item=2932&utag=
    HTHs,
    Bruce
    kk wrote:
    This is my situation.
    I have an .ear file and in that i have several other .jar files whichare
    inter-dependant, lets say
    A.jar
    B.jar
    C.jar files
    and i want to expose only A.jar as
    webservice, how can i do that ?
    Does WLS8.1 provided any way how to do that?
    I Appreciate any suggestions and advices.
    Thanks
    kk

  • How to init the managed session bean?

    Hi, suppose we have a session bean like this:
    <managed-bean>
        <managed-bean-name>A</managed-bean-name>
                <managed-bean-class>
         a.A
                </managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>I want to clear the states of A, so i need to reinitialize it,how to do that?

    Y_Not, i find there is some problem with the line:
    createValueBinding( "#{yourSessionBeanName}").setValue(FacesContext.getCurrentInstance(),null);later,when i again what to use my session bean, i will got an java.lang.NullPointerException, so i guess when there is a ValueBinding trying to get the bean,if the bean is null, jsf impl will not initialize it automatically, is that true?
    But i think the class of the session bean has been specified, so jsf should be capable of initializing it whenever it is null and someone try to get it.I am using myfaces, i don't know if this not happens with sun implemenation.
    so maybe i have to use the following line instead of the one above:
    createValueBinding( "#{yourSessionBeanName}").setValue(FacesContext.getCurrentInstance(),new YourSesssionBeanName());Obviously,this is not convenient.
    Best Regards:)

  • Using a Statefull Session Bean with RMI on Multiple JSP pages

    Heya all,
    i have a JBoss server running with a statefull bean on it. I want to use it on my JSP pages. But every time I start my JSP-page a NEW INSTANTION of the bean is created! For each user using my page, I want ONE bean.
    Is there anyway to do this? ANything with the sessioncontext?
    I can do it with local beans, using the simple tags in the JSP-page, but they do not work for Remote Beans.
    (I use JNDI)

    hi,
    statefull session beans are client session specific. the instance will exists if client session exits.
    now since u are loading the jsp page again in the other browser, a new instance will be associated with the current session.
    hope it will work.
    sameer

  • How to track the stateful Session Bean?

    Hi all,
    Am in a serious trouble. I have a message driven bean which will get initiated when some message gets dumped into the queue. I have got session bean which i use to process message which my message driven bean takes from the queue.
    My problem is, lets say there are 3 msgs in the queue. lets say the messages be "aaaa", "aaaa" and "bbbb".
    In this case, when i read the first message, i will create an instance of the session bean to process the message "aaaa". When i receive the second message still i create an instance to process the message "aaaa". When i get the 3rd message, i create an instance to process the message "bbbb".
    My problem in this is, i want to create only one instance of session bean for the message "aaaa".
    So once i create the instance for session bean for particular message, i need to store the object or something of the instance which i created along with the message. Please help me with what i can store with which i can reffer to the session bean again.
    Please see the sample code too.
    Thanks in advance,
    Ashly
    if(msg.equals("aaaa"))
    First n;
    Object obj = ctx.lookup("ejb/First");
    FirstHome home = (FirstHome) PortableRemoteObject.narrow(obj, FirstHome.class);
    n = home.create(msg);
    }

    Hi,
    thanks for information. But i have one question. In a stateful session bean why do we have to store the Remote Interface on the client side.
    I expected in the second jsp page when i do a lookup or create, the container/server should find out whether there is a session bean already created for this session if yes, then return that particular instance of the session bean else create a new one.
    If this is not a possible case then a stateful session bean is nuthing but an instance of an object in the EJB container which does not get destroyed unless there is a time out or the remove method is called. It has nuthing to do with session because throughout the session I have to store the remote interface in the session context of the client( the client here means the jsp).
    thanks in advance
    Anurag

  • How to use the Dynamic Configuration Bean

    Hi experts,
    im currently doing a file to mail scenario.
    i want the name of the input file as the subject of the mail.
    i want to establish this using the Dynamic Configuration bean
    my first question is:
    key.1 <b>read</b> http://sap.com/xi/XI/System/Mail THeaderSUBJECT
    value.1 message.messageID
    this reads the value of the message ID into the attribute THeaderSUBJECT
    but what does this do?
    key.1 <b>write</b> http://sap.com/xi/XI/System/Mail THeaderSUBJECT
    value.1 message.messageID
    when i use this it has no effect atall.
    my second question.
    I have my input filename in the FileName attribute in Dynamic configuration how can i read it into THeaderSUBJECT attribute.
    Appreciate any suggestions.

    Hi Satish,
    Yep i know its possible via an udf in Message mapping but i dont have an MM in my scenario. Since im not parsing thru the input data since its an excel file, so im transferring the file using the following method
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    and in this method if i include an MM it will give me a mapping exception.
    So i have to use this bean somehow and try to accomplish what we do in the udf.

  • How to get the Stateful Session bean instance in the second call

    Hi,
    I am new to EJBs. I have made a Stateful session bean on the first jsp page. In this page i am setting certain member variables of the EJB. Now in the second page i want to get these stored values in the EJB.
    In the second page do I...
    1. Store the instance of Remote Interface in the Session Context of the first JSP page and then in the second page get the Remote interface stored in its session context and call the business functions to get the values. If this is the case then what do u mean by Stateful Session beans??
    P.S.- This works fine.
    2. Try to get the Remote interface of that particular instance of the EJB(in which the values were stored) and call its business functions. IF this is possible. How do i do it??
    thanks in advance
    Anurag

    Hi,
    thanks for information. But i have one question. In a stateful session bean why do we have to store the Remote Interface on the client side.
    I expected in the second jsp page when i do a lookup or create, the container/server should find out whether there is a session bean already created for this session if yes, then return that particular instance of the session bean else create a new one.
    If this is not a possible case then a stateful session bean is nuthing but an instance of an object in the EJB container which does not get destroyed unless there is a time out or the remove method is called. It has nuthing to do with session because throughout the session I have to store the remote interface in the session context of the client( the client here means the jsp).
    thanks in advance
    Anurag

  • How to use JavaScript in Web bean generated JSP

    I want to do some simple JavaScript validations (for example, checking if a particular field is empty) in the JSP page rendered by the data web bean. Because the HTML is rendered by the bean, I'm not able to refer to the HTML controls in the JSP page. I'm not even able to refer to the form with the following standard piece of JavaScript code - "document.forms[0].control_name".
    Is anybody aware of how to use JavaScript with these rendered JSP pages?

    You just have to add it like and applet , including this line in your JSP or JSF
    <script src="http://dl.javafx.com/dtfx.js"></script>Then add the applet
    <script>
        javafx(
                  archive: "./resources/jar/Draw.jar",
                  width: 400,
                  height: 200,
                  code: "Draw",
                  name: "Draw"
    </script>./resources/jar/Draw.jar - is the path and the name of the jar

  • When to use ApplicationBean  and Session Bean dataproviders

    hi i am developing a small application, in which i have cached rowset and if i want to access the database i have to call the bean component so which one to call either application Bean or Session Bean component in some examples they used application bean and in some applications they used session bean. Please suggest me the right one and i have to access the database correctly. I am confused ,please help me out in solving this problem.
    Thanking You in Advance.

    The following excerpt is from http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    Before you create a bean property to store a value, you must decide what scope to put the property in. Because several users can access a web application at the same time, you want to use the smallest scope possible so that you don't waste valuable space. The following figure illustrates the duration of each type of scope.
    * Application scope lasts until the server stops the application. Values that you store in an application bean are available to every session and every request that uses the same application map.
    * Session scope begins when a user first accesses a page in the web application and ends when the session times out due to inactivity, or when the web application invalidates the session, such as, for example, by calling session.invalidate().
    * Request scope begins when the user submits the page and ends when the response is fully rendered, whatever page that is.

  • How to use my logic sessions and ilok at two places

    Hi there,
    I am wondering if I can use my Logic sessions and even my ilok plugins at two places, two countries?
    - but still keeping my ilok at one place.
    Is there any way via internet? perhaps using some kind of network server for my sessions
    - iDisk perhaps?
    what is the best solution?
    Thanks
    Message was edited by: Olavur
    Message was edited by: Olavur

    Buy a second iLok, and licenses for your software

Maybe you are looking for

  • How to attach a document (resume) when replying to a job posting?

    I am on Craigslist trying to respond to a job posting by clicking the Reply button & my email (gmail) opens a new message window properly but I can't attach my resume to the email which is what I need to do in order to respond to the posting.  In the

  • IChat Network Error On Start Up

    Hello, I have recently purchased a new MacBook Pro to replace my old iBook and with it came Leopard. Now, one problem I seem to have is when the computer starts up, everything is fine, until one error comes up and I think its iChat related, here is t

  • Continuous Kernel crashes with  Lion 10.7.5

    The last week everytime I leave my system idle for an hour I come back and my system has crashed. It has been happening a lot. Almost 4-5 crashes a week. Not sure if it was anything I installed ( I don't remember anything ). Here is the kernel report

  • Itunes 8 won't play my videos/movies

    I recently re-formatted my hard drive and re-installed all software including ITunes and Quick Time. I installed ITunes 8.0.2.20 (before the reformat, I was using the previous version). I have several music videos/TV shows purchased from the ITunes S

  • Wierd SMB Multichannel performance VM to Storage

    Hi, I have some wierd speed issues with SMB multichannel. I have tried almost every combination but i won't get the speed stable from VM to my storage system. When i transfer a file from my workstation to the VM i get a constant speed but when i tran