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

Similar Messages

  • 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 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.

  • Previous unanswered Hot deploy of non EJB, non JSP classes

              Subject to my last post I've since seen my questions has appeared twice on this
              newsgroup, March 2001, and Nov 2000 and no responses to it those times. Aren't
              there BEA engineers reading this newsgroup who would know the answer to that question?
              http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=3776&utag=
              http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=5171&utag=
              

              Firstly I already did call BEA support before coming here, this is my last resort.
              I can't get a definitive answer from support. They were the ones that actually
              suggested to me that I post here in the first place. I did search the BEA edocs
              and couldn't find anything on it.
              Secondly, I am using WL 6.1 SP1, and in the thread just beneath this one, which
              I referred to directly in my opening post on this thread, I do mention this in
              the opening paragraph, in fact I give considerable detail.
              Thirdly, I never implied there was an onus on any BEA engineer to answer anything
              here. What I did mean was that given that they do read these posts and they do
              answer posts, I was merely a bit concerned that as I'm third person to ask, it
              would be strange to still get no response given that they answer other questions.
              I mean if they don't know, then who does? It's a real simple yes/no answer, it
              would take 5 seconds.
              Paul
              Robert Patrick <[email protected]> wrote:
              >
              >
              >The answer is simple -- move to WLS 6.x and use enterprise applications
              >(or web applications or an EJB jar file)
              >to package everything up into a single deployment unit and hot deploy
              >the whole deployment unit. WLS 5.1 and
              >earlier do not support hot deployment of non-servlet/non-JSP/non-EJB
              >classes.
              >
              >Mike Reiche wrote:
              >
              >> You can always call BEA Support - 1.888.232.7878 to get the help you
              >need. This
              >> newsgroup is not official BEA Support. It is out of the goodness of
              >their hearts
              >> that BEA engineers help people out here.
              >>
              >> I don't really think you wanted everyone that read your email and didn't
              >know
              >> if such a feature was available, to send you an email saying 'No, I
              >don't know
              >> if such a feature is available'. That's why there were zero responses.
              >>
              >> None of the posts you listed mention what version of WL. That makes
              >a difference.
              >> Also read the online documentation at edocs.bea.com, search for 'hot
              >deploy'.
              >>
              >> Mike Reiche
              >>
              >> "Paul H" <[email protected]> wrote:
              >> >
              >> >Subject to my last post I've since seen my questions has appeared
              >twice
              >> >on this
              >> >newsgroup, March 2001, and Nov 2000 and no responses to it those times.
              >> >Aren't
              >> >there BEA engineers reading this newsgroup who would know the answer
              >> >to that question?
              >> >
              >> >http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=3776&utag=
              >> >
              >> >http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=5171&utag=
              >
              >
              ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              ><html>
              >The answer is simple -- move to WLS 6.x and use enterprise applications
              >(or web applications or an EJB jar file) to package everything up into
              >a single deployment unit and hot deploy the whole deployment unit. 
              >WLS 5.1 and earlier do not support hot deployment of non-servlet/non-JSP/non-EJB
              >classes.
              ><p>Mike Reiche wrote:
              ><blockquote TYPE=CITE>You can always call BEA Support - 1.888.232.7878
              >to get the help you need.  This
              ><br>newsgroup is not official BEA Support. It is out of the goodness
              >of
              >their hearts
              ><br>that BEA engineers help people out here.
              ><p>I don't really think you wanted everyone that read your email and
              >didn't
              >know
              ><br>if such a feature was available, to send you an email saying 'No,
              >I
              >don't know
              ><br>if such a feature is available'. That's why there were zero responses.
              ><p>None of the posts you listed mention what version of WL. That makes
              >a difference.
              ><br> Also read the online documentation at edocs.bea.com, search
              >for
              >'hot deploy'.
              ><p>Mike Reiche
              ><p>"Paul H" <[email protected]> wrote:
              ><br>>
              ><br>>Subject to my last post I've since seen my questions has appeared
              >twice
              ><br>>on this
              ><br>>newsgroup, March 2001, and Nov 2000 and no responses to it those
              >times.
              ><br>>Aren't
              ><br>>there BEA engineers reading this newsgroup who would know the answer
              ><br>>to that question?
              ><br>>
              ><br>>http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=3776&utag=
              ><br>>
              ><br>>http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=5171&utag=</blockquote>
              ></html>
              >
              >
              

  • Can't access non ejb classes from JSP - NoClassDefFound error

              Hi,
              I have one session ejb which has a method returning a collection of non ejb class objects (say of Class 'Foo').
              The method signature is like :
              "Collection getFinacialData() throws RemoteException"
              It is working fine with normal java clients. Now when I run this from a JSP it gives a "NoClassDefFoundError". I kept class 'Foo' and the remote interface of the session bean in the same package and also in the same ejb jar file. Also I am running JSP and ejb in same WL server(ver 5.1, SP8 on solaris). What I have done is only deployed the bean jar file. Do I need to do anything more?
              thanks in advance.
              

    I ran into a similar problem. I solved it by putting the client classes for
              accessing my EJB in the WebLogic POST_CLASSPATH in the startWebLogic script
              file:
              set POST_CLASSPATH=d:\weblogic\myserver\myClient.jar
              For more information on class visibility between the JSP and EJB class
              loaders, check out
              http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_deployover.html#1056256
              Rick
              "niroja" <[email protected]> wrote in message
              news:3a6ed903$[email protected]..
              >
              > Hi,
              >
              > I have one session ejb which has a method returning a collection of non
              ejb class objects (say of Class 'Foo').
              > The method signature is like :
              > "Collection getFinacialData() throws RemoteException"
              > It is working fine with normal java clients. Now when I run this from a
              JSP it gives a "NoClassDefFoundError". I kept class 'Foo' and the remote
              interface of the session bean in the same package and also in the same ejb
              jar file. Also I am running JSP and ejb in same WL server(ver 5.1, SP8 on
              solaris). What I have done is only deployed the bean jar file. Do I need to
              do anything more?
              >
              > thanks in advance.
              >
              

  • Where to put jar file containing non ejb beans

              Hi everyone,
              i would appreciate a lot if someone could tell me where i could place my jar file
              which contains non ejb beans
              thanks
              

              Hi,
              I´n not sure what you mean. But if you mean a JAR containing utility classes for
              your EJBs or Servlets you should put it for EJBs into the META-INF/lib directory
              of your EJB JAR or for Servlets/Webapps into the WEB-INF/lib directory.
              So the JAR file will be automatically loaded from the right classloader and can
              be used.
              Christian Plenagl
              Developer Relations Engineer
              BEA Support
              "Mirza Khodabaccus" <[email protected]> wrote:
              >
              >Hi everyone,
              >
              >i would appreciate a lot if someone could tell me where i could place
              >my jar file
              >which contains non ejb beans
              >
              >thanks
              

  • 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

  • Interceptors for non EJB

    Hi,
    does the jee standard covers interceptors for non EJB classes? I'm using Glassfish and it worked for a plain java classes e.g.:
    @Interceptors(TraceInterceptor.class)
    public class PlainClass {
         public String doSomething() {
              return "somthing";
    Hoever when I use the intercepter with a DAO class that's depending an an EntityManager e.g.:
    @Interceptors(TraceInterceptor.class)
    public class PersonDao implements IPersonDao {
         @PersistenceContext
         private EntityManager em;
         @Override
         public Person getById(Integer id) {
              return em.find(Person.class, id);
    I get a NullPointer exeption because the Entity Manger is not injected.
    so my question is: does the jee standard covers interceptors for non EJB classes?
    Regards
    Sebastian

    Hi,
    thanks for your response.
    When I remove the @Interceptors annotation from the PersonDao everything works fine including the injection of the entity manager. When I add the @Interceptors annotation I get a null pointer at em.find(Person.class, id).
    I’m new to JEE6 because I have worked with Spring the last 6 years. Accidently I never used the @Named annotation. Surprisingly that is no problem (at least in Glassfish).
    Anyhow I added the @Named annotation to the DAO but that not changed anything, I still got a null pointer. What’s wrong?
    @Interceptors(TraceInterceptor.class)
    @Named
    public class PersonDao implements IPersonDao {
         @PersistenceContext
         private EntityManager em;
         @Override
         public Person getById(Integer id) {
              return em.find(Person.class, id);
    @Stateless
    @Interceptors(TraceInterceptor.class)
    public class TestSrv implements ITestSrv {
         @Inject
         private IPersonDao personDao;
         @Override
         public Person getPerson(Integer id) {
              return personDao.getById(id);
    Best regards
    Sebastian

  • JTA/JTS for non-EJB & non-J2EE server used

    I have a standalone java program which calls methods on 2 java classes (c1, c2) These are Non-EJB/non-RMI/non-CORBA plain java classes.
    the method in c1 updates table t1 in database db1
    the method in c2 updates table t2 in database db2
    I would like to use JTA for conducting a 2PC based transaction. I know this can be done in an application/server or a J2EE container environment because they have built-in Transaction Managers (TM). and one just has to use JNDI to look up the UserTransaction object and then define the transaction boundaries. However, how do I all the above if I don't have access to a J2EE server and an EJB server?
    It seems like I would have to use a standalone Transaction Manager (not bundled with the app-server).

    Hi,
    My company has just released a (beta!) version of a generic java transaction manager. Although it offers some lightweight beans as standard development model, this does not have to be the case: the core idea is an extensible and very advanced transaction kernel. JTA comptable.
    This software is server-oriented: the transactional kernel (which also does recovery) startup and shutdown events trigger the start (initialization) and shutdown of your 'extension' classes. This is necessary because otherwise your resources will not be recoverable: if the transaction manager starts up, then it will first do recovery, and therefore your resources need to be available.
    You can ask for a beta version through our website:
    http://www.atomikos.com
    Note, however: we did not yet implement the XA DataSources. Rather, we have a kind of 'external' stored procedures that allow distributed transactions over regular JDBC connections. You would have to implement your solution along this line, or wait for the XA datasources.
    If there proves to be a lot of demand,
    we can of course speed up development on XA. It is not a very big effort.
    Best regards,
    Guy
    Guy Pardon ( [email protected] )
    Atomikos Software Technology: Transactioning the Net
    http://www.atomikos.com/

  • Transaction & non-EJB objects (helper)

    hi i have a question about transactional behavior of non-EJB objects. i'm
              using
              weblogic 6.0 sp1 with ejb 2.0.
              say i have a session bean which starts a container managed transaction. and
              it calls
              out to helper class A(non-EJB), and that helper class A get a connection and
              update
              some tables. after A returns, session bean calls helper class B(non-EJB) in
              the
              same transaction. B is supposed to update some other tables but it throw an
              user
              exception. would the transaction in the session bean be rolled back? would
              it
              also roll back the changes made by helper class A?
              thanks for any help,
              z
              

    Thanks Rob!
              "Rob Woollen" <[email protected]> wrote in message
              news:[email protected]...
              > Ziqiang Xu wrote:
              >
              > > hi i have a question about transactional behavior of non-EJB objects.
              i'm
              > > using
              > > weblogic 6.0 sp1 with ejb 2.0.
              > >
              > > say i have a session bean which starts a container managed transaction.
              and
              > > it calls
              > > out to helper class A(non-EJB), and that helper class A get a connection
              and
              > > update
              > > some tables.
              >
              > You must get the JDBC connection from a TxDataSource.
              >
              > > after A returns, session bean calls helper class B(non-EJB) in
              > > the
              > > same transaction. B is supposed to update some other tables but it
              throw an
              > > user
              > > exception. would the transaction in the session bean be rolled back?
              >
              > Merely throwing an exception from a helper class will not rollback the
              > transaction.
              >
              > Within an EJB, the best way to rollback a tx is to use the
              > EJBContext.setRollbackOnly method.
              >
              > So you could do something like this:
              >
              > session_bean_method() {
              >
              > try {
              > B.foo();
              > } catch (MyException e) {
              > ctx.setRollbackOnly();
              > throw e;
              > }
              >
              > }
              >
              > > would
              > > it
              > > also roll back the changes made by helper class A?
              > >
              >
              > If they are all within a single transaction, then yes. As I mentioned
              before,
              > make sure that you use a TxDataSource for all of your JDBC Connections.
              >
              > -- Rob
              >
              > >
              > > thanks for any help,
              > >
              > > z
              >
              

  • Calling non ejb from ejb using jndi lookup

    Is it possible to call a non ejb java object from an ejb using a jndi lookup?
    For example, we have a java class where main registers itself with our application server (JBoss 3.0.1). We have a test client that can use jndi to look up the object, but we can't get an ejb inside the application server to use the object.
    Are we trying to do the impossible? If my question is not clear, please let me know so I can try to clarify.
    Thanks

    JNDI uses factories to create objects.
    It's possible that JBoss has a Bean Factory which you can use to create your instance.
    Tomcat has a Bean factory in its JNDI implementation. I use it just as you have indicated.
    The JBoss documenation may help?
    Dave

  • Custom Object Persistance (non-EJB)

    Hello friends.
    Could you please give examples, or links to resources, on implementing object persistance where database is the store. EJB is not considered.
    It would be great if you could share your experience.
    So far I found out two desing patterns for implementing object persistance, that can be found on www.javaworld.com (under Persistance).
    The idea expressed in the articles is that every Business Object has a corresponding Data Access Object, that handles all persistance tasks (namely writing, reading from database).
    Has anyone implemented it? What are the alternatives?
    Hope to hear everyone.

    It seems that managing connection is a difficult
    issue. Don't you think that factory has to accomplish
    connection management, and DAOs have to have a
    reference to factory, and call factory's
    getConnection() and closeConnection() methods, and
    factory will either open and close them, or return
    them to pool.You've got a point. Managing connections in a non-EJB environment is the difficult issue. (With EJBs and DataSources this is piece of cake.)
    When performance is not the issue, opening and closing a new connection for each db-operation should suffice. But when performance is the issue, things get a little more complex.
    A naive way of increasing performance is to have DAOs cache connection objects. The only problem with this is that you would then require one database connection for one DAO. For some applications this would not be a problem, but as a generic solution this is really, really bad.
    As for letting the DAOFactory handle connections I am not convinced. I would rather design and implement a separate connection pool (or find an open source / commercial one) than complicate my factories. After all, as the class name states, a UserDAOFactory is a user data access object factory, not a connection pool or a connection manager. Low coupling, high cohesion, eh? ;)
    One way of implementing a connection pool I thought of is to write a ConnectionPool class and a PoolableConnection class (or something like that) that implements java.sql.Connection and acts as a wrapper for the real connection. Closing one of these connection would not actually close the connection, but would just return it to the pool.
    What is cool about this approach is that you do not have to have your clients call some weird getConnectionFromPool() and returnConnectionToPool(...) methods, they would simply call ConnectionPool.getConnection() and when they are done with the connection they close it, just like a normal java.sql.Connection.
    I am oversimplyfying things, of course. But in principle this is precisely what is done in J2EE, just use a "DataSource" for a "ConnectionPool".
    Writing code for getting and closing connections in every dao seems a
    bit of overhead.It definetely is. With EJBs I used an abstract DAO class to implement connection retrieval (and to hide JNDI-code and cache DataSources) and had all my DAOs extended this class.
    Also, from your experience, you never used the generic
    CRUD methods? It seems that all your daos have
    specific methods, such as loadByUsername.
    The article in javaworld get away from this by using
    complicating mapping techniques. Have you ever used
    generic CRUD, or you found it usefull to have specific
    methods?Yep, I have never done anything with CRUD. And all this generic framework stuff and mapping things seems a bit complicated. Perhaps I will have a closer look.

  • Regular (non-boot) server classes found in Java -classpath

    I can't start the weblogic server from the start menu at all. Neither the console nor server menu works. I get this error:
    The WebLogic Server did not start up properly.
    Reason: Trying to start the server dynamically, specifying weblogic.class.path,
    but regular (non-boot) server classes found in Java -classpath.
    WebLogic Server terminated with an abnormal condition of 1
    Any tips!!
    Ahmad

    SO is there any fix for this? I get this after installing SP9. Things work fine
    without SP9
    "Ahmad" <[email protected]> wrote:
    >
    I can't start the weblogic server from the start menu at all. Neither
    the console nor server menu works. I get this error:
    The WebLogic Server did not start up properly.
    Reason: Trying to start the server dynamically, specifying weblogic.class.path,
    but regular (non-boot) server classes found in Java -classpath.
    WebLogic Server terminated with an abnormal condition of 1
    Any tips!!
    Ahmad

  • Is Dynamic Class Loading(RMI) Possible in EJB?

    In Java RMI,it allows dynamic class loading,that is when the stub and interface class files are modified by the server,the client side can download the updated stub and inteface classes.
    As the remote interface of EJB extends Javax.ejb.EJBObject which in turn extends java.rmi.remote.Also the Home interface of EJB extends
    javax.ejb.EJBHome which also extends java.rmi.remote.
    Therefore I wonder if EJB also supports dynamic class
    loading as RMI does.If yes,how to do so?Is it the responsibility of the Application Servers and transparent
    to client? If No,then is this a defect in EJB??
    Thank you very much in advance!!
    John

    This would be done by the container and is transparent to the client. Most app servers support "hot deploy" where you can deploy beans while the server is running. This requires dynamic class loading.

  • Why a non static member class can be defined in an interface

    Non-static member classes are defined as instance members of other classes, just like fields and instance methods are defined in a class. An instance of a non-static member class always has an enclosing instance associated with it.
    An interface can't be instantiated then how a non static member class will have an enclosing instance associated with it.
    interface outer
            public  class inner{
            public void p()
                System.out.println("inside interface's non static member class");
        public  static class inner1{
                public void p(){System.out.println("inside interface's  static member class");
    public class Client {                                           // (11)
        public static void main(String[] args) {                    // (12)
        outer.inner nonStatic = new outer.inner();
            nonStatic.p();
        outer.inner1 stat = new outer.inner1();
          stat.p();
    }inner is a non static member class even then " outer.inner nonStatic = new outer.inner();" working fine ?????????????

    class outer
            public  class inner{
            public void p()
                System.out.println("inside interface's non static member class");
    public class Client {                                           // (11)
        public static void main(String[] args) {                    // (12)
        outer.inner nonStatic = new outer.inner();
        nonStatic.p();
    }on compiling the above code the error message i got is
    "not an enclosing class: outer"
    the reason of this compilation error is "outer.inner nonStatic = new outer.inner();
    it should be "outer.inner nonStatic = new outer(). new inner();"
    now my question is
    interface outer
            public  class inner{
            public void p()
                System.out.println("inside interface's non static member class");
    public class Client {                                           // (11)
        public static void main(String[] args) {                    // (12)
        outer.inner nonStatic = new outer.inner();
        nonStatic.p();
    }on compiling the above code why compilation error is not coming??????????
    i think now it is more clear what i am asking

Maybe you are looking for