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

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 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]

  • 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

  • Search criteria using EJB-QL

    I need help. I am on WSAD 5.0 and EJB 2.0. I am developing search engine with 4-5 different fields (employee ID, first name, last name, dept, salary range etc) can be specified as criteria. I can do a search with 'LIKE' inside EJB-QL (provided user has specified all criteria). But user can keep it blank and if it is blank i want to omit it from 'SELECT' statement.
    Now I am bit confused how it is possible using EJB-QL ? Whether dynamic EJB-QL is supported in 2.0 ? Or is it that I write direct SQL and use DAO to get the list ?
    regards,
    Manisha

    You have to take a call i guess...but as far as making EJB QL dynamic..i dont think it works that way...but now that i think you can try something...else..
    Why dont you try substituting a wildcard in all those places when you dont get a parameter
    but you will have to do it in java
    for example if your Query was supposed to be
    Select Object(cust) from Customer cust where cust.firstName = ?1
    Now if you have a parameter its good..otherwise pass the wildcard "%"...it should work..but even then it will be a bit of testing for empty parameters...and not sure about performance either...but worth a try i think

  • Can not start WebLogic in Eclipse. Error: "Could not find the main class."

    I have installed Eclipse 2.0 and WebLogic Server 6.1. and the WebLogc plug in from GENUITEC (and jdk1.3.1_04, on Win2K Server). After I have done the configuration, the WebLogic start/stop buttons are integried into the Eclipse Toolbar, but when I click on the start button to start Weblogic, it pops up a dialog box "Java Virtual Machine Launcher" with message: "Could not find the main class. Program will exit!"
    Starting WebLogc Server from the Start panel works fine.
    Does any one have seen this before or have a suggestion what I should do?
    Many many thanks in advance.
    Huan

    Weblogic must be started with a full JDK; otherwise
    JSPs and dynamic EJB stubs could not be deployed. The
    error message
    indicates you are attempting to use a JRE. Configure
    Eclipse JRE to point to a JDK. The product
    documentation will help you with this process. It does not work for me. :-(
    I have tried JDK 1.3.1 and 1.4.1: same result: I get a "Could not find the main class: Program will exit"
    For free expert support please consider contacting
    Genuitec at [email protected] If just want any
    answer ask a newsgroup.
    WayneI'll try the support at '[email protected]' :)
    Michel
    Michel Szybist
    [email protected]
    Fax: +33 (0)173729897
    SMS: http://www.szybist.net/

  • Using service Locator pattern to dynamically access remote EJBs

    Hi All,
    Please help to guide me how I can use a service locator to retrieve a remote object (residing on another application but on same domain) .
    I do not want to use Dependency Injection since I want to dynamically discover them ( there are many implementations of same interface (POJO)). Each EJB implementation implements its own remote/local interface that extends this global POJO interface.
    I have two J2ee-Applications on same domain. J2EE-Application 1 has an EJB module (EJB Module 1) that intends to access an EJB Module (EJB Module 2) in J2EE-Application 2. Following observations:
    1. Dependency Injection fails if (include the EJB Module 2 jar in J2EE-Application 1). Reason App Server complains the EJB has been deployed (Deployment fails)
    2. Dependency Injection works if (exclude the EJB Module 2 jar in J2EE-Application 1) and include the Remote Interface in EJB Module 1(J2EE-Application 1).Positive Observation (Deployment success and DI also success)
    3.Using Service Locator to retrieve the remote object if (exclude the EJB Module 2 jar in J2EE-Application 1) and include the Remote Interface in EJB Module 1(J2EE-Application 1). Negative and Positive Observation.
    Positive Observation: Using dependency injection I can still retrieve the Remote Object
    Another Positive: The Service Locator remote lookup to another Bean in same Application but different EJB Module is successful.
    Negative Observation:
    The Service Locator lookup to this same remote object with Successful Dependency Injection fails (An Ejb in a different application).
    Can't retrieve the Remote Object with Service Locator. Message from Server:.
    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.
    Thanks in advance

    "I do not want to use Dependency Injection since I want to dynamically discover them ( there are many implementations of same interface (POJO))"
    If you're calling ejbs from other ejbs or servlets, the same could probably be acomplished by using dependency injection (@EJB) in a number of instance variables typed with different remote/local interfaces or even with different beanName attributes (for when more than one bean implements the same managed interface in the same app - not sure how it works outside the same jee app...) , and dinamically selecting one of them; or encapsulating those injected variables into a stateless ejb as your service locator to make them accessible from POJOs too (which, due to concurrent acess, wouldn't work for statefull ejbs references...).
    Anyway, using the jndi lookup service locator pattern seems ok in this case.
    What doesn't seem ok, given the nature of the error for the negative observation - jndi context initialization - is that
    Another Positive: The Service Locator remote lookup to another Bean in same Application but different EJB Module is successful.
    Can you check your code and reconfirm that you're using the same context initialization code for both the positive and negative observations ?

  • Dynamic filename configuration via custom EJB

    Hi Experts,
                        We are doing a poc on whether we can do the dynamic filename configuration,i.e. set the file name dynamically in a custom EJB deployed on the server and called in the sender comm. channel of any J2EE based adapter.
    The requirement is for some interfaces, there is no mapping requirement other then setting the filename dynamically, which maybe based on a certain value of the input file or a specific portion of string in the payload.
    The custom EJB takes the namespace and attribute as input parameters along with other string manupulation parameters to determine the receiver file name. That is if we are using sender JMS adapter, we can have namespace = http://sap.com/xi/XI/System/JMS and attribute as DCJMSMessageProperty1. The bean would read the value and perform the manipulation based on certain other input parameters and set the file.
    There is one particular bean : AF_Modules/DynamicConfigurationBean but it does not allow us to manipulate the filename.
    Any help would be much appreciated.
    Regards,
    Shiladitya

    Hi,
    please refer to the following links for your reference
    Re: Reading Dynamic Configuration information in side adapter module.
    Re: Dynamic Filename in File adapter
    Regards,
    Bhanu

  • A prefix can be included in the EJB JNDI name dynamically?

    In the Stateless annotation, we can specify the mappedName attribute to the EJB JNDI name bind.
    Can we specify a prefix to the mappedName separately?
    For example: We have this:
    @Stateless(mappedName="myEJB")And don't want to do this:
    @Stateless(mappedName="prefix/myEJB")We want to include the prefix in another place in the code dynamically.
    Can we do that??

    jtahlborn wrote:
    eudesf wrote:
    Hello! Thanks for reply!
    As I can't configure programatically, there is any way to configure in an application descriptor, or in another place of the application server?
    The idea is to publish two applications that use the same EJB classes, but in different JNDI namespaces, because we don't want to share the resources. Otherwise, it will result in JNDI name conflicts. The applications works in different contexts and we want to reuse the existing EJB definitions.
    Any suggestion?yes you can do this. ejb 3.0 keeps the features from 2.1, namely all the xml based configuration (although it is now optional). and, the annotations are always overriden by the xml configuration. thus, you can create different deployments with different the same compiled class files. you just need to override the annotation configuration with xml configuration (via ejb-jar.xml or whatever).Yes, we can do that. I've tested here, and it works. But, can we do better?
    The configuration via XML implies maintenance, and it's not good, because we have so many EJBs to maintain.
    And there is another problem... The EJB classes are in JARs, and these JARs are shared across the applications.
    Pretend that you have to maintain two versions of each EJB JAR. One with XML configured and other without. If we change one, the another must be changed too. How can it be productive?
    I have seen some EJB implementations that are more flexible with JNDI naming.
    See:
    - [http://openejb.apache.org/jndi-names.html|http://openejb.apache.org/jndi-names.html]
    - [http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html|http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html]
    Does it have a better solution in Glassfish?

  • Ejb dynamic 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

  • Dynamic jndi-name in weblogic-ejb-jar.xml

    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBs instead of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file? What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the same .ear
    file twice but have each environment (application - .ear) reference a different
    database schema (jdbc connection pool). I have everything working just fine for
    this scenario except when I define jndi-names for our ejbs. The problem is that
    I am really deploying the same ejbs (jndi-names and actually code base) in each
    applicatoin instance and I get an exception when the WebLogic is trying to deploy
    the second application (.ear) because the jndi-names in it have already been deployed
    by the first application instance. I recieve a jndi error stating that the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have one WebLogic
    instance support our beta and training environments? Usually (but not always)
    our code base is the for same for both of these environments, I simply need to
    have each environment use a different database schema.
    Thanks

    A little birdie tells me that BEA does this very thing. Looking at the
    descriptors for WebLogic Portal I see:
    <weblogic-enterprise-bean>
    <ejb-name>LoaderEJB</ejb-name>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>${APPNAME}.BEA_content.LoaderHome</jndi-name>
    </weblogic-enterprise-bean>
    Yes, the ${APPNAME} token really is expanded into the J2EE application
    name at deployment time!
    Sincerely,
    Daniel Selman
    Bryan Dixon wrote:
    Rewriting our build process isn't really much of an option for me. Our current
    build process is too complex and time consuming right now to convert to Ant (we
    eventually will do this but not for a while). So are there any other ideas that
    aren't build related?
    Thanks
    "Eric Ma" <[email protected]> wrote:
    You don't need run-time dynamism in JDNI names and it can't be done anyways.
    You
    need token substitution in XML configuration files when building the
    app. If
    you are using Ant for building, then it is a breeze. If not, first convert
    your
    build process to use Ant.
    Also, a single WLS instance hosting multiple environments sounds really
    INTRIGUING
    to me.
    Eric Ma
    "Bryan Dixon" <[email protected]> wrote:
    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBsinstead
    of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file?
    What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the
    same .ear
    file twice but have each environment (application - .ear) referencea
    different
    database schema (jdbc connection pool). I have everything working just
    fine for
    this scenario except when I define jndi-names for our ejbs. The problem
    is that
    I am really deploying the same ejbs (jndi-names and actually code base)
    in each
    applicatoin instance and I get an exception when the WebLogic is trying
    to deploy
    the second application (.ear) because the jndi-names in it have already
    been deployed
    by the first application instance. I recieve a jndi error stating that
    the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have
    one WebLogic
    instance support our beta and training environments? Usually (but not
    always)
    our code base is the for same for both of these environments, I simply
    need to
    have each environment use a different database schema.
    Thanks

  • Dynamic Class Downloading and EJBs

    Hi all,
    I have one session EJB with business method getObject returning a serializable object which class implements MyObject interface.
    This object's class, named MyObjectImpl, is in only deployed on server within my EAR file.
    I would like my client classpath not containing MyObjectImpl class but only MyObject class (the implemented interface).
    Could you suggest a way to do this, by dynamically downloading implementation class at runtime so I can correcly get casting?
    Thanks in advance
    Fil

    Hi Fil,
    There's no portable way to accomplish this in the Java EE plaform. Java EE requires that all dependent classes needed by a component be packaged with that component at deployment time. Applications are not permitted to dynamically load classes, as this would be both a security issue and a correctness issue. This is true even for clent components, which is why the Java EE platform has a first-class client component called an Application Client. You can find out more about the difference between an Application Client and a stand-alone client in our EJB FAQ.
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Dynamic Class Loading in an EJB Container

    Hello,
    We have a need to load classes from a nonstandard place with in an ejb container, ie a database or secure store. In order to do so we have created a custom class loader. Two issues have come up we have not been able to solve, and perhaps some one knows the answer to.
    Issue 1.
    Given the following code:
    public static void main(String args[])
    MyClassLoader loader = new MyClassLoader("lic.dat");
    System.out.println("Loading class ..." + "TestObject");
    Object o = Class.forName("TestObject",true,loader).newInstance();
    System.out.println("Object:" + o.toString());
    TestObject tstObj = (TestObject) o;
    tstObj.doIt();
    What happens when executed is as follows. Class.forName calls our loader and does load the class as we hoped, it returns it as well, and the o.toString() properly executes just fine. The cast of the object to the actual TestObject fails with a class not found exception. We know why this happens but don't know what to do about it. It happens because the class that contains main was loaded by the system class loader (the primordial class loader as its sometimes called), That class loader does not know about TestObject, so when we cast even though the class is "loaded" in memory the class we are in has no knowledge of it, and uses its class loader to attempt to find it, which fails.
    > So the question is how do you let the main class know to use our class loader instead of
    the system class loader dispite the fact is was loaded by the system class loader.
    Issue 2:
    To make matters worse we want to do this with in an EJB container. So it now begs the question how do you inform an EJB container to use a specific class loader for some classes?
    Mike...

    Holy crap! We are in a similar situation. In creating a plugin engine that dynamically loads classes we use a new class loader for each plugin. The purpose is so that we can easily unload and/or reload a class at runtime. This is a feature supposedly done by J2EE app servers for hot-deploy.
    So our plugins are packaged as JAR files. If you put any class in the CLASSPATH, the JVM class loader (or the class loader of the class that is loading the plugin(s)), will load the class. The JavaDoc API states that the parent classloader is first used to see if it can find the class. Even if you create a new URLClassLoader with NULL for parent, it will always use the JVM class loader as its parent. So, ideally, in our couse, plugins will be at web sites, network drives, or outside of the classpath of the application and JVM.
    This feature has two benefits. First, at runtime, new updates of plugins can be loaded without having to restart the app. We are even handling versions and dependencies. Second, during development, especially of large apps that have a long startup time, being able to reload only one plugin as opposed to the annoying startup time of Java apps is great! Speeds up development greatly.
    So, our problem sounds just like yours. Apparently, the Client, which creates an instance of the plugin engine, tries to access a plugin (after the engine loades it via a new classloader instance for each plugin). Apparently, it says NoDefClassFound, because as you say, the client classloader has no idea about the plugin class loaded by another classloader.
    My co-developer came up with one solution, which I really dont like, but seems to be the only way. The client MUST have the class (java .class file) in its classpath in order to work with the class loaded by another class loader. Much like how in an EJB container, the web server calling to EJB MUST contain the Home and Remote interface .class files in its classpath, the same thing needs to be done here. For us, this means if a plugin depends on 5 others, it must contain ALL of the .class files of those plugins it depends on, so that the classloader instance that loads the plugin, can also see those classes and work with them.
    Have you got any other ideas? I really dislike that this has to be done in this manner. It seems to me that the JVM should be able to allow various class loaders to work with one another in such a way that if a client loaded by one classloader has an import statement in it to use a class, the JVM should be able to fetch the .class out of the other classloader and share it, or something!
    This seems to me that there really is no way to actually properly unload and then reload a class so that the JVM will discard and free up the previous class completely, while using the new class.
    I would be interested in discussing this topic further. Maybe some others will join in and help out on this topic. I am surprised there isn't a top-level forum topic about things like class loaders, JVM, etc. I wish there was a way to add one!

  • Dynamic implementation download for return values from EJB

    I try the following exemplary scenario regarding dynamic implementation download. Let's say there is a statless EJB deployed (e.g. OrderHandler) with a method getSomeOrder() returning Order object; where Order is actually an interface extending java.io.Serializable. For Order there is implementation class OrderImpl. Within the getSomeOrder() the EJB creates a new OrderImpl, populates it and returns as interface. The client looks up OrderHandler and calls getSomeOrder() method. Then, on Order a dummy: String getName() method is called.
    Now, the problem is various behavior with implementation dynamic download. I receive different behavior from 2 clients (1st being launched from within LAN with the server, 2nd from outside server's LAN). When I put OrderImpl in clients' classpaths, obviously they both work the same. When I leave only Order interface (!!the very goal of the test - dynamic impl. download!!), only the 1st client still works. I measured times in milis, and it looks that the OrderImpl is really downloaded, as the first getSomeOrder() call lasts around 10 times as long as further calls.
    The 2nd client hangs a while on the getSomeOrder() call and then throws UnmarshallException, stating that it has failed to unmarshal the returned object, which basically means no implementation got downloaded.
    Can anyone help?

    You can try putting the Impl classes on a webserver.
    while starting the server set the property
    -Djava.rmi.server.codebase=http://mywebserver:8080
    While running the client if the impl classes are not available in the classpath, it would download it from the webserver

Maybe you are looking for

  • Date to rotate objects?

    I created a script that will rotate a different ad every day, based on a comparison of the current date & the ads assigned day. The bug in the script is that the number of ads vs the number of days may be odd, so the last one or two ads will miss a (

  • HP Slate 6 - Really disappointing

    I have purchased HP Slate 6 voice tab 4 months back and got a series of issues within 2 months of purchase..Network problem, Hanging issues, Battery issues, Automatic restart, later no voice for incoming and outgoing calls and was not able to make ca

  • "Select Users..." Button is greyed out in Remote Settings on windows 8.1 pro-pack upgrade

    I recently purchased the pro-pack upgrade from the Microsoft website to take my windows 8.1 base version to pro so I could use the remote desktop connection.  I can use this under my account which has sysadmin priviliges.  I don't want to have to hav

  • Cant call localejbbean from jsp

    hi all, i try to call my LocalEjbBean from Jsp file , but i got this exception this is my jsp file <% com.dcons.iss.HelloLocalHome home =null; com.dcons.iss.HelloLocal hello=null; Context ctx = new InitialContext(); Object obj=ctx.lookup("HelloLocalB

  • Slow TCP performance for traffic routed by ACE module

    Hi, the customer uses two ACE20 modules in active-standby mode. The ACE load-balances servers correctly. But there is a problem with communication between servers in the different ACE contexts. When the customer uses FTP from one server in one contex