Dynamic EJB reloading

Hello
I read about ejb dynamic reloading in a few places in ias documentation and
i have the following quastions:
- what will happen if i change deployment descriptors of ejb?
- what will happen if i change some other classes like value object classes
or other helper classes?
- what will happen if i change remote or home interface of ejb?
Does dynamic reloading work in that sytuation?
I also found that I have to call create method for stateless session bean
and entity bean to reflect the changes of dynamic reloading. Is it true?
Artur

Hi Artur,
Please find answer inline.
Artur Kaszczyszyn wrote:
Hello
I read about ejb dynamic reloading in a few places in ias documentation and
i have the following quastions:
- what will happen if i change deployment descriptors of ejb?
- what will happen if i change some other classes like value object classes
or other helper classes?
- what will happen if i change remote or home interface of ejb?
Does dynamic reloading work in that sytuation?
Dynamic reloading works fine if you change only in Bean Implementation
class. It does not support change in Home, Remote Interface or any other
helper class.
I also found that I have to call create method for stateless session bean
and entity bean to reflect the changes of dynamic reloading. Is it true?
Yes it's absolutely correct.
Thanks
Deepak

Similar Messages

  • Is there a way to do that? To use dynamic EJB connections?

    Hello Developers,
    I have developed a security web application using EJB,
    Jaas with customer provider
    I used DBSystemLogin module
    I want to fined a way that the EJB connection change each time when the user login.
    I used the HR as the main schema.
    I created three schemas that I want to use them as users:
    -Lina
    -Salem
    -Ahmad
    I granted Roles to users on hr tables.
    additional, created my own roles in data base and granted to my users:
    ADMINISTRATOR  Lina - can see all records
    EMPLOYEE Ahmad -can see the records added by this employee
    CUSTOMER  Salem - can see the records belongs to this customer
    In developer 10.1.3.3
    I created Order Entity been using HR database connection, created session been,
    Modified web.xml:
    -security roles["ADMINISTRATOR","EMPLOYEE","CUSTOMER"])
    -Loginconfig (Form-based authentication: login page, error page)
    -Security constraints: ord on /faces/Orders.jsp to ADMINISTRATOR,EMPLOYEE,CUSTOMER.
    I created Orders.jsp page contains order table.
    Now, I want that when the user login as Lina to switch the EJB database connection to Lina, so the displayed order table achieves ADMINISTRATOR roles that created in database,means opening database session for user Lina and use it.
    and so on for user salem and ahmad.
    Is there a way to do that? To use dynamic EJB connections? To achieve authentication based connection? to implement the user database roles on the client side? To specify the database connection at run time?
    That is possible using forms but I don’t want to use forms.
    I want to reed the roles from database according to the user.
    I hope to get answers soon,
    thanks.

    Does JNDI do this job?

  • Dynamic class reloading in modular web application

    Hi.
    My web application has these requirements:
    A. Functional modularization (like plug-ins). Modules will be simple jars containing application logic classes: dto beans, business logic services, dao (jpa), framework stuff (Struts2), etc...
    B. At runtime and without restarting the application "class loading" must be aware of classes inside new, changed and removed modules.
    C. Some of these jars will be outside the web application folder (WEB-INF/lib), possibly outside the container itself too.
    My question:
    1. Can I achieve all or some of my requirements with a Java web application?
    2. How should I manage the modules?
    3. Do I need some special web container feature (maybe osgi)?
    4. Can I use a custom class loader in my application?
    The architecture objectives are:
    I. Provide scalability.
    II. Efficient development process (independent deployment and no application restart required).
    III. Better production support (no application restart required for changes).
    More on the architecture:
    a). Functional scalability, meaning this that my application may functionally grow up to an indeterminate number of small functional modules.
    b). Modules will be developed, deployed and maintained independently so the application discovers and loads classes on demand.
    c). Avoid a big .war file containing all the small modules because a small change in one module would involves deploying all the other modules (possibly hundreds o even thousands of them) and restarting the application.
    d). Above point involves dynamic class reloading.
    I guess this is addressed by OSGI (looks like heavy to deal with), Jigsaw (still under development) and maybe others. I think the key point is the class loader. I will develop a custom class loader but maybe you have some advice for me before starting to develop.
    Thanks and regards.

    Classes maintained by the container should not be loaded by an application. You want the container to read those classes and react accordingly. Most of those classes are read when the container starts up a container restart will be required. Trying to leverage another container within a container does not sound like it will be worth (if you can get it to work).
    Perhaps you should state the problem that you are trying to solve with these modules so that others may suggest more feasible solutions to achieve your target goals.

  • Dynamic Servlet reload activation in Weblogic 6.0 using web applications

    Dynamic Servlet reload activation in Weblogic 6.0 using web applications
              Add the next lines to your web.xml file
              <context-param>
              <param-name>weblogic.httpd.servlet.reloadCheckSecs</param-name>
              <param-value>0</param-value>
              </context-param>
              <context-param>
              <param-name>weblogic.httpd.servlet.classpath</param-name>
              <param-value>C:/bea/wlserver6.0/config/myServer/applications/MyApp/WEB-INF/serverclasses</param-value>
              </context-param>
              Register your servlet on web.xml file.
              <servlet>
              <servlet-name>Test</servlet-name>
              <servlet-class>Test</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>Test</servlet-name>
              <url-pattern>/Test/*</url-pattern>
              </servlet-mapping>
              <servlet>
              Create a directory under WEB-INF called "serverclasses"
              copy your servlet(also directories under serverclasses if your class has a package).
              Don't forget to remove from \classes the same servlet class file.
              I hope it could be helpfull for the community.
              Regards
              

    Dynamic Servlet reload activation in Weblogic 6.0 using web applications
              Add the next lines to your web.xml file
              <context-param>
              <param-name>weblogic.httpd.servlet.reloadCheckSecs</param-name>
              <param-value>0</param-value>
              </context-param>
              <context-param>
              <param-name>weblogic.httpd.servlet.classpath</param-name>
              <param-value>C:/bea/wlserver6.0/config/myServer/applications/MyApp/WEB-INF/serverclasses</param-value>
              </context-param>
              Register your servlet on web.xml file.
              <servlet>
              <servlet-name>Test</servlet-name>
              <servlet-class>Test</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>Test</servlet-name>
              <url-pattern>/Test/*</url-pattern>
              </servlet-mapping>
              <servlet>
              Create a directory under WEB-INF called "serverclasses"
              copy your servlet(also directories under serverclasses if your class has a package).
              Don't forget to remove from \classes the same servlet class file.
              I hope it could be helpfull for the community.
              Regards
              

  • Dynamic EJB-QL

    Hi,
    Do you know if there is a way to define Dynamic EJB-QL?
    I know it is not part of the current spec, will it be for the next versions?
    T

    EJB 2.1 does not provide that support. However you can do that in OC4J 10.1.3 with EJB 3.0 where you can create a dynamic query:
    em.createQuery("UPDATE Address address SET address.city = 'Ottawa' WHERE address.city = 'Nepean'");
    int rowCount = queryRenameCity.executeUpdate();
    You can find more about this from http://www.oracle.com/technology/tech/java/ejb30.html
    OC4J 10.1.3Developer Preview has support features of EJB 3.0 draft specifications
    -Debu

  • EJB Reloading with 9.1

    I'd swear I had EJB reloading working on WLS8.1. Even changes to the signature of a bean method were picked up by the server without restart (i.e. in cases where the debugger had no change to apply hotswap to the code).
    Is there a way to enable EJB reloading for WLS 9.1?
    Thanks
    Stefan

    You should just need to redeploy the application not restart the WLS instance.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • NON-SERVLET, NON-EJB DYNAMIC CLASS RELOAD

    hi,
              In weblogic 5.1, is there a way to reload a class from the clientclasses directory without restarting the server? it's just a class in the clientclasses used by the JSPs. a kind of hotdeploy for NON-EJB, NON-SERVLET CLASS. SPECIFIC guidance will be immensely appreciated..
              Thanks in advance
              Vijay
              

    please show us the full error message.
    it sounds like a classpath problem...

  • Dynamic ejb lookup

    Hello Community,
    Question for u :)
    I have a necessity to dynamically lookup for ejbs' and call methods on them. I am using EJB 1.0 on VAJ. I have the string values of the home, remote and the JNDI names. I need to read those values and lookup for the bean, and call methods. I have this.
    String h = "MyEjbHome";
    String r = "MyEjbRemote";
    String jndi = "MyEjb";
    I need to do something like this..
    //parenthesis on LHS is just to explain the pbm
    (MyEjbHome) home = jndicontextfactory.lookup(jndi, Class.forName(h));
    (MyEjbRemote) remote = home.create();
    remote.myMethod();
    Now if u visualize the problem here, on the left hand side how can i dynamically give the type as (MyEjbHome) or (MyEjbRemote) when all I know is their names which are strings?
    Please share ur knowledge. Thanks

    Hi I tried this and it worked. But the thing is even though I tried PortableRemoteObject.narrow() I was still gettting ClassCastException. So I had to use reflection. Now the code looks something like this, and it works.
    // child home
    Object obj = newContext.lookup(childJNDI);
    // get the create method
    Method m = obj.getClass().getMethod("create", null);
    // create the remote inteface for child
    Object objRemote = m.invoke(obj, null);
    // cast the child remote to the parent remote
    ParentRemote re = (ParentRemote) PortableRemoteObject.narrow(objRemote, ParentRemote.class);
    re.soSomething();
    Thanks much for your help. I appreciate it.
    look at this:
    http://forums.java.sun.com/thread.jsp?forum=13&thread=2
    8593

  • Dynamic EJB Client

    Hi there,
    I've a runtime problem. I don't know until runtime which ejb my client program wishes to lookup. Is there anyway of creating/retrieving the instance of a bean at runtime and ivoking business methods on the remote interface dynamically.
    All information I have got is this.
    String MyEjbBindName = args[0];
    String MyEjbHomeName = args[1];
    String MyEjbRemoteName = args[2];
    String MyEJbMethodName = args[3];
    Any ideas would be greatly appreciated. Thanks,
    Raj.

    Hy,
    It is posible
    This is the code:
    ========================
    package com.somepackage;
    import java.util.Properties;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.ejb.EJBHome;
    import javax.ejb.EJBException;
    import javax.rmi.PortableRemoteObject;
    public class EjbProxy
    private Properties _prop = null;
    public EjbProxy()
    public EjbProxy (String initContextFactory, String providerUrl)
    setContextProperties (initContextFactory, providerUrl, null, null);
    public EjbProxy (Properties prop)
    setContextProperties (prop);
    public void setContextProperties (Properties prop)
    _prop = prop;
    public void setContextProperties (String initContextFactory, String providerUrl,
    String user, String password)
    _prop = new Properties ();
    prop.put (Context.INITIALCONTEXT_FACTORY, initContextFactory);
    prop.put (Context.PROVIDERURL, providerUrl);
    if (user != null)
         prop.put(Context.SECURITYPRINCIPAL, user);
         if (password == null)
              password = "";
         prop.put(Context.SECURITYCREDENTIALS, password);
    public void setContextUserParam (String user, String password)
    if (_prop == null)
    _prop = new Properties ();
    prop.put(Context.SECURITYPRINCIPAL, user);
    prop.put(Context.SECURITYCREDENTIALS, password);
    public EJBHome getHome (String beanJndiLookupName) throws EJBException
    try
    InitialContext ctx = null;
         if (_prop != null)
              ctx = new InitialContext (_prop);
         else
              ctx = new InitialContext ();
    Object home = ctx.lookup(beanJndiLookupName);
    EJBHome obHome = (EJBHome)PortableRemoteObject.narrow (home, EJBHome.class);
    return obHome;
    catch (NamingException ne)
    throw new EJBException (ne);
    catch (Exception e)
                   e.printStackTrace();
    throw new EJBException (e);
    public Object getObj (String beanJndiLookupName) throws EJBException
    try
    EJBHome obHome = getHome (beanJndiLookupName);
    //get the method of create
    Method m = obHome.getClass().getDeclaredMethod("create", new Class[0]);
    //invoke the create method
    Object obj = m.invoke (obHome, new Object[0]);
    return obj;
    catch (NoSuchMethodException ne)
    throw new EJBException (ne);
    catch (InvocationTargetException ie)
    throw new EJBException (ie);
    catch (IllegalAccessException iae)
    throw new EJBException (iae);
    =====================================
    You can also get the code an further explanations from
    http://www.javaworld.com/javaworld/javatips/jw-javatip118.html
    Here you have something similar, but not that good:
    http://www.devx.com/premier/mgznarch/javapro/2001/02feb01/ru0102/ru0102.asp
    Now, the idea is that you can lookup a bean by only using it's jndi lookup name!
    This works fine..
    But, you must have your home and remote interface in your application classpath,
    otherwise you'll be unable to compile your code!
    And even if you would compile it, javax.InitialContext.lookup wouldn't create your
    object(it also checks in your classpath).
    You don't need this, do you?
    have a nice day,
    rudi vaum
    [email protected]

  • EJB Reloading without restarting server

    Does anyone know how to activate class reloading for EJBs in Weblogic
    6.1 (sp1)?
    It works for servlets, but there does not seem to be any options in
    the Admin console to set this.
    Compiling a new class file and overwriting the old one, doesn't work
    unless you restart the server.

    Production mode turns it off. Development mode turns it on.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Humphrey" <[email protected]> wrote in message
    news:[email protected]..
    Does anyone know how to activate class reloading for EJBs in Weblogic
    6.1 (sp1)?
    It works for servlets, but there does not seem to be any options in
    the Admin console to set this.
    Compiling a new class file and overwriting the old one, doesn't work
    unless you restart the server.

  • Dynamic Class Reloading

    As I know that setting has to be made to the application server to enable the class reloading features, so that the changes to the components (such as enterprise beans, servlets, and JSP files) to a running server can be deployed without having to stop the application server process and start it again.
    I'm just wondering, for those Web Hosting Company that offer JSP-compatible Web Servers services, are they forced to have the Class Reloading Feature enabled for their Web Server?? else how they can provided 7 x 24 service, as no downtime are allowed, please advise?

    "... else how they can provided 7 x 24 service, as no downtime are allowed, please advise?"
    Most large organisations wishing to redeploy an application but maintain service would not use class reloading (which would be a path to chaos!) but would use their load balancers or clustering software to disable connections to some (half?) of their servers. They'd then load the updated software onto the out-of-service servers, swich the live traffic onto them and then update the remaining servers before bringing them back into service.
    This kind of redeployment can also be achieved by running more than one instance of the app server on each box, with only one instance 'live' at any one time. Updates are made to the off-line instances and then connections redirected to them. This has the advantage that the old code is still in place so fall-back is easy if there's a problem with the redeployed code.

  • How to make servlets reloadable in iplanet web server in solaris??

    hi all,
    does anyone know how to make servlets reloadable in iplanet ??? Thanks for help

    Hi there,
    I think your question is about "Dynamic Class Reloading", also named as Hot deployment. and the following lines may be helpful.
    iAS 6.0 SP3 and later version supports new hot deployment features through dynamic class
    reloading of EJBs.By default, dynamic servlet, EJB and registered JSP reloading is disabled in iPlanet Application Server.
    To enable dynamic reloading of servlets, EJBs and registered JSPs, perform the following steps:
    1.Start iPlanet Registry Editor, kregedit, and modify the Disable value under the Versioning key:
    SOFTWARE/iPlanet/Application Server/6.0/CCS0/SYSTEM_JAVA/Versioning
    2.Set the Disable value to 0 (By default, the Disable value is set to 1)
    3.Restart iPlanet Application Server to enable the change
    To hot deploy your application, simply compile and replace the file in the appropriate directory or, use iasdeploy to redeploy
    applications.
    I recommand you to check out the iAS's release notes (http://docs.iplanet.com/docs/manuals/ias/60/sp3/rn_sp3.html#20766) for more infomation.
    Good luck
    Shen Jie
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • MBean calling ejb class loading issue

    Hi,
    I would like to have an mbean call an ejb. I have come against a (predictable!!)
    class loading problem. The EJB Home cant be bundled with the mbean because the
    mbean class loader would load the interface, preventing ejb reload( Thats what
    the error msg indicates) and the ejb doesnt get deployed.
    I have moved to an mlet based scheme (beacuse an mlet is a class loader) to
    load the mbeans, but now I have the problem that when the mbean looks up the
    home in jndi the cast fails ie the jndi object has an interface class loaded by
    the ejb class loader but the mlet has its own loaded home interface. These class
    loaders appear to be sibblings - but I havnt printed out the trees.
    This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around this?
    Have I invented a problem that doesnt exist? I cant go to WLS8.
    My current way forward is to have the mbean find the class loader that loaded
    the interface class (jndi object) and then have the mbean use that class loader
    to load its copy of the interface class. Seems a bit complex. Im sure I missed
    something obvious.
    Thanks
    Pete Marshall

    Pete,
    could you explain better your thoughts...
    I'm interested to hear them.
    regards,
    Pedro Salazar.
    Pete Marshall wrote:
    Must think before typing..
    If I have the ejb register a listener on the mbean and have the mbean emit an
    event the detyped notification from the mbean will break the link between the
    mbean class loader and the ejb loader. I think ;-) Ill try it.
    Pete
    "Pete Marshall" <[email protected]> wrote:
    Hi,
    I would like to have an mbean call an ejb. I have come against a (predictable!!)
    class loading problem. The EJB Home cant be bundled with the mbean because
    the
    mbean class loader would load the interface, preventing ejb reload( Thats
    what
    the error msg indicates) and the ejb doesnt get deployed.
    I have moved to an mlet based scheme (beacuse an mlet is a class loader)
    to
    load the mbeans, but now I have the problem that when the mbean looks
    up the
    home in jndi the cast fails ie the jndi object has an interface class
    loaded by
    the ejb class loader but the mlet has its own loaded home interface.
    These class
    loaders appear to be sibblings - but I havnt printed out the trees.
    This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around
    this?
    Have I invented a problem that doesnt exist? I cant go to WLS8.
    My current way forward is to have the mbean find the class loader that
    loaded
    the interface class (jndi object) and then have the mbean use that class
    loader
    to load its copy of the interface class. Seems a bit complex. Im sure
    I missed
    something obvious.
    Thanks
    Pete Marshall

  • Dynamically loading a class that is part of a larger loaded package

    I am dynamically loading a class that is part of a large package, much of which is loaded at startup. The code directly references protected variables in the parts of the package that is loaded by the default class loader. Attempting to access these protected variables gives an access error when the class is dynamically loaded that doesnt occur when the class is loaded at startup.
    Is there a way to make this work?

    To answer my own question -- no
    A reference from http://access1.sun.com/techarticles/DR-article.html says:
    The use of Dynamic Class Reloading can introduce problems when classes that are being dynamically reloaded make calls to non-public methods of helper classes that are in the same package. Such calls are likely to cause a java.lang.IllegalAccesserror to be thrown. This is because a class that is dynamically reloaded is loaded by a different classloader than the one used to load the helper classes. Classes that appear to be in the same package are effectively in different packages when loaded by different classloaders. If class com.myapp.MyServlet is loaded by one classloader and an instance of it tries to call a non-public method of an instance of class com.myapp.Helper loaded by a different classloader, the call will fail because the two classes are in different packages.
    So not being able to access non-private variables in this scenario is the way it works.

  • Re: MBean calling ejb class loading issue

    Must think before typing..
    If I have the ejb register a listener on the mbean and have the mbean emit an
    event the detyped notification from the mbean will break the link between the
    mbean class loader and the ejb loader. I think ;-) Ill try it.
    Pete
    "Pete Marshall" <[email protected]> wrote:
    >
    Hi,
    I would like to have an mbean call an ejb. I have come against a (predictable!!)
    class loading problem. The EJB Home cant be bundled with the mbean because
    the
    mbean class loader would load the interface, preventing ejb reload( Thats
    what
    the error msg indicates) and the ejb doesnt get deployed.
    I have moved to an mlet based scheme (beacuse an mlet is a class loader)
    to
    load the mbeans, but now I have the problem that when the mbean looks
    up the
    home in jndi the cast fails ie the jndi object has an interface class
    loaded by
    the ejb class loader but the mlet has its own loaded home interface.
    These class
    loaders appear to be sibblings - but I havnt printed out the trees.
    This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around
    this?
    Have I invented a problem that doesnt exist? I cant go to WLS8.
    My current way forward is to have the mbean find the class loader that
    loaded
    the interface class (jndi object) and then have the mbean use that class
    loader
    to load its copy of the interface class. Seems a bit complex. Im sure
    I missed
    something obvious.
    Thanks
    Pete Marshall

    Pete,
    could you explain better your thoughts...
    I'm interested to hear them.
    regards,
    Pedro Salazar.
    Pete Marshall wrote:
    Must think before typing..
    If I have the ejb register a listener on the mbean and have the mbean emit an
    event the detyped notification from the mbean will break the link between the
    mbean class loader and the ejb loader. I think ;-) Ill try it.
    Pete
    "Pete Marshall" <[email protected]> wrote:
    Hi,
    I would like to have an mbean call an ejb. I have come against a (predictable!!)
    class loading problem. The EJB Home cant be bundled with the mbean because
    the
    mbean class loader would load the interface, preventing ejb reload( Thats
    what
    the error msg indicates) and the ejb doesnt get deployed.
    I have moved to an mlet based scheme (beacuse an mlet is a class loader)
    to
    load the mbeans, but now I have the problem that when the mbean looks
    up the
    home in jndi the cast fails ie the jndi object has an interface class
    loaded by
    the ejb class loader but the mlet has its own loaded home interface.
    These class
    loaders appear to be sibblings - but I havnt printed out the trees.
    This is WLS 702 which seems to be JMX 1.1. Has anyone got a way around
    this?
    Have I invented a problem that doesnt exist? I cant go to WLS8.
    My current way forward is to have the mbean find the class loader that
    loaded
    the interface class (jndi object) and then have the mbean use that class
    loader
    to load its copy of the interface class. Seems a bit complex. Im sure
    I missed
    something obvious.
    Thanks
    Pete Marshall

Maybe you are looking for

  • My iPhone 5 won't stop scrolling through songs and I can't stop it please help !! :(

    My iPhone 5 won't stop scrolling through songs and I can't stop it please help !! :(

  • Here we go again...headphone jack prob

    Alright, so this isnt the first time i've had this problem. Last year in May 2005, i emailed creative about the notorious headhpone jack problem i've had in my zen micro, and they sent me a new one. But now, over a year later, this one they gave me i

  • How do i get avi's to play in quick look and the preview bar?

    I have a MBP and i was wondering if i can get finder/Quicklook to play AVI's im pretty sure my old MB did it find but my MBP wont? Any ideas? cheers, Sam

  • Setting Default Configuration in 1.4.2

    Previous versions of Java Web Start had a default configuration file javaws.cfg which contained the default preferences. When JWS was installed on PCs in our intranet, we could switch the cfg file to one which, amongst other things, set the proxy cor

  • Gedit plugins not available

    Installed Arch today, coming from Debian. I use gedit for creating/editing bash, html, css, php and python together with gedit-plugins. Before I installed Arch I made sure Arch had also this package gedit-plugins. So when I got up and running I did p