Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Problems hot-deploying EJBs to an existing application

 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I should be able to drop in a new stateless session bean into a live application (webapp + 2 'static' stateless session beans).
The problem I am facing is that after deploying the EJB using the console GUI, the existing classes don't see its home/remote interfaces and are throwing ClassNotFoundExceptions upon using the newly deployed EJB.
What to do? Could the command line tool be of help? (it sure wasn't documented too well by BEA)
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Forgot. Using WebLogic 6.1...
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These "existing classes" need access to the Home and Remote (or Local) interfaces of this new EJB.
If the existing classes are in a WebApp, you can build a client jar and add it to the webapp's WEB-INF/lib. An EJB can pick up a client jar for another EJB by using the Class-Path entry in the jar manifest.
But the best approach (IMO) is to package everything into a single EAR. See my response to this thread for more info.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dave Landers:
These "existing classes" need access to the Home and Remote (or Local) interfaces of this new EJB.
If the existing classes are in a WebApp, you can build a client jar and add it to the webapp's WEB-INF/lib. An EJB can pick up a client jar for another EJB by using the Class-Path entry in the jar manifest.
But the best approach (IMO) is to package everything into a single EAR. See my response to this thread for more info.



Are you saying that WebLogic is polling for changes in all .jar files in mywebapp/WEB-INF/lib?
Here's how I understood your suggestion:
- configure the "deploy at startup" EJBs to use a client.jar from path/to/client.jar
- instruct the developer of "hot-deploy while server is running" EJBs to add their interfaces to path/to/client.jar
This is the direction of the dependency. The hot-deployed EJBs don't need to know anything about existing EJBs, but the 2 EJBs deployed at startup time must see all interfaces of the hot-deployed EJBs.

Thanks for your input.
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer really depends on how you are deploying these three EJBs. If they are all in one application (an ear or exploded-ear directory with a META-INF/application.xml) then all three EJBs will "see" each other. When you redeploy, you actually redeploy the whole application - all 3 ejbs. Everything bounces as a unit, and all changes are picked up. Also you don't have to worry about client jars or whatever because all the code is loaded together.
If your ejbs are deployed in separate applications (or as stand-alone ejb-jars), then the two ejbs will need access to the remote and home interfaces of the hot-deployed ejb.
This requirement really has nothing to do with hot deploy, it is just that any class referencing another has to have access to whatever interfaces, etc. it needs. Same requirement was there when you compiled the code.
So, if you create a client jar for the "hot" ejb, and make it available to the other two (i.e. by referencing it in their manifest's Class-Path or by just including these classes in the other ejb jars), then this should work.
The only problem is if you change the Remote or Home interface and redeploy the "hot" EJB, you will also have to redeploy the other two so they are working with current versions of these interfaces.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Is it possible to update an EJB which is packed and deployed in an .ear file in weblogic. Whenever i do any modification to the file, i need
to restart the server, which is ofcourse time consuming. Any help appreciateed.
Thanks,
jai.
reply
    Bookmark Topic Watch Topic
  • New Topic