Re-deploying replica aware EJBs
How does one update an app server with a new EJB when the app server
is running in a cluster? Doing a re-deploy on the EJB in a single instance
can even be a problem. First, you can have beans that are cached and
in use. locking the server and waiting until the last client has completed
it's operation until you do the redeploy should work. With clustered SLSBs
the replica aware stubs get distributed by JNDI so until all the servers
in the cluster have the update the classes are out of sync.
It seems like you have to bounce all the app servers in the cluster. Not
a very amicable solution.
In article <[email protected]>, [email protected] says...
>
> How does one update an app server with a new EJB when the app server
> is running in a cluster? Doing a re-deploy on the EJB in a single instance
> can even be a problem. First, you can have beans that are cached and
> in use. locking the server and waiting until the last client has completed
> it's operation until you do the redeploy should work. With clustered SLSBs
> the replica aware stubs get distributed by JNDI so until all the servers
> in the cluster have the update the classes are out of sync.
>
> It seems like you have to bounce all the app servers in the cluster. Not
> a very amicable solution.
>
>
>
Mike,
This is a toughy and something I've been trying to figure out for a
while. Maybe together we'll devise a strategy so here's what I've come
up with so far:
Maintain a set of "upgrade servers" on another network line (using a
switch). When upgrading, bring them online into the main cluster and
then start kiling the main machines. When they're all dead, unplug them
from the network and begin the upgrade. Test the upgrade after bringing
the new main cluster back up. Once confirmed, start locking out
transactions, etc from the backup cluster and have the web front end
give a "down for X minutes message to all new requests". Once the
backup app servers have no more requests, unplug them from the network
and plug the new app servers in. Reopen the flood gates at the front
end. You'll still lose some sessions, but this should be in a service
level agreement and be understood by customers.
Some variations, in case the switch isn't manageable and being
physically there is not on option would be to bring various interfaces
up and down to meet the needs described above.
It's not perfect; uptime is still purposely limited, but these are thing
that should be defined in any agreement you make with customers. Even
NASDAQ goes down. I'm currently working on a strategy for WebLogic 6.0
JT
Similar Messages
-
Questions on InitialContext and replica-aware stub caching
Hi All,
We have a cluster and deployed with some stateless ejb session beans. Currently we only cached the InitialContext object in the client code, and I have several questions:
1. in the current case, if we call lookup() to get a replica-aware stub, which server will return the stub object, the same server we get the InitialContext, or it will load balanced to other servers every time we call the lookup method?
2. should we just cache the stub? is it thread safe? if it is, how does the stub handle concurrent requests from the client threads? in parallels or in sequence?
One more question, when we call new InitialContext(), it will take a long time before it can return a timeout exception if the servers are not reachable, how can we set a timeout for this case?809364 wrote:
You can set the timeout value programatically by using the
weblogic.jndi.Environment.setRequestTimeout()
Refer: http://docs.oracle.com/cd/E12839_01/apirefs.1111/e13941/weblogic/jndi/Environment.html
or
set the REQUEST_TIMEOUT in the weblogic.jndi.WLContext
Refer: http://docs.oracle.com/cd/E11035_01/wls100/javadocs/weblogic/jndi/WLContext.html
Hi, I tried setting the parameters before, but it only works for stub lookup and ejb call timeout, not for the creation of InitialContext. And any idea for my 2nd question? -
Hi,
Can anyone explain about replica aware stub.
Thanks in advance.
Regards,
Vardhan.Hi Vardhan,
Please refer to : http://download.oracle.com/docs/cd/E11035_01/wls100/cluster/overview.html
Load balancing and failover for EJBs and RMI objects is handled using replica-aware stubs, which can locate instances of the object throughout the cluster. Replica-aware stubs are created for EJBs and RMI objects as a result of the object compilation process. EJBs and RMI objects are deployed homogeneously—to all the server instances in the cluster.
Failover for EJBs and RMI objects is accomplished using the object’s replica-aware stub. When a client makes a call through a replica-aware stub to a service that fails, the stub detects the failure and retries the call on another replica. To understand failover support for different types of objects, see Replication and Failover for EJBs and RMIs.
WebLogic Server clusters support multiple algorithms for load balancing clustered EJBs and RMI objects: round-robin, weight-based, random, round-robin-affinity, weight-based-affinity, and random-affinity. By default, a WebLogic Server cluster will use the round-robin method. You can configure a cluster to use one of the other methods using the Administration Console. The method you select is maintained within the replica-aware stub obtained for clustered objects. For details, see Load Balancing for EJBs and RMI Objects.
Above kind of Stubs are available only for *"EJBs and RMI Objects"* when we deploy an EJB/RMI based application on Cluster. -
Hi,
I am an absolute newbie in the world of web logic clustering. I am reading
the article "How Clusters work" in WLS 5.1 documentation.
I am not quite sure as to what do the term 'Replic aware'.
It will be great if some one could explain that
regards,
Abhishek.
Replica aware means this stub can be smart enough to know how many replicas(each replica means a deployed service on one server in the cluster) it represents and the detail information about these replicas(ie. it's ip address.)
The replica-aware stub can support load-balance and fail over accroding to these information. suppose if one replica fails, the stub can remove this replica from this stub and fail over to other.
Hope this can help you.
Abhishek <abisheks@no_spam.india.hp.com> wrote:
>Hi,
>
>I am an absolute newbie in the world of web logic clustering. I am reading
>the article "How Clusters work" in WLS 5.1 documentation.
>
>I am not quite sure as to what do the term 'Replic aware'.
>
>It will be great if some one could explain that
>
>regards,
>Abhishek.
>
-
Error in deploying a simple EJB 3.0
Hi ,
I am getting the following error while deploying my simple ejb of version 3.0 in Weblogic 9.2.
Exception preparing module: EJBModule(build) [EJB:011023]An error occurred while reading the deployment descriptor. The error was: Error processing annotations: java.lang.NullPointerException.
During my evaluation of Weblogic 9.2 for EJB 3.0 , I have got the following questions.
EJB Specification states that EJB's in EJB 3.0 can be developed and deployed without the need of deployment descriptors. I have created a simple EJB with two file Env.java and EnvBean.java and the source code is given below.
a) I just complied these class files and when I was trying to deploy without ejb-jar.xml and weblogic-ejb-jar.xml, the console was not at all allowing me to deploy.Why is this so?
b) After I created a META-INF file under root of classes directory by placing ejb-jar.xml with empty <enterprise-beans> element, console was allowing me to deploy with errors in parsing ejb-jar.xml. The error was either session/entity/mdb is a required under <enterprise-beans> element. Why is this required when there are several examples stating <enterprise-beans> element can be empty.
c) Later I updated ejb-jar.xml with <session> element under <enterprise-beans> with the following values. I got the above error when deployed with this change.
I had been struggling to deploy this simple bean for almost a day.Pleas point me if there is any documentation that solves my stated problem or if there is a solution.Thanks in advance.
regards
Karim
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<enterprise-beans>
<session>
<description>This is the stateless ejb</description>
<display-name>Env Bean</display-name>
<ejb-name>EnvBean</ejb-name>
</session>
</enterprise-beans>
</ejb-jar>
Env.java
package examples ;
public interface Env {
public void display();
EnvBean.java
package examples;
import javax.ejb.Remote;
import javax.ejb.Stateless;
@Stateless
@Remote(Env.class)
public class EnvBean implements Env {
public void display() {
System.out.println("Welcome to EJB 3.0");
}Presumably you're using the EJB3 tech preview, and not a vanilla WebLogic 9.2 install, right?
Can you post the full stack trace?
-Patrick -
Problems deploying a simple EJB
I am trying to deploy a simple EJB on the 8.1.5. The bean only owns a single method that needs a unique parameter.
No problems with compilation of source bean, home and remote interfaces, whatever the type of this parameter is.
But when I try to deploy the jar on the server, I only succeed if the parameter of my method is a simple type (int, String ...).
If I try the same passing a complex type (here a oracle.xml.parser.v2.XMLDocument type), I encounter this message from the deployejb tool :
Generating EJBHome and EJBObject on the server...
Compilation errors in oracle/aurora/ejb/gen/test_myFluxInsert/EjbObject_FluxInsert:ORA-29535: source requires recompilationjava/lang/Object: Authorization error for referenced class Oracle/xml/parser/v2/XMLDocument.java/lang/Object: Authorization error for referenced class oracle/xml/parser/v2/XMLDocument.oracle/aurora/ejb/gen/test_myFluxInsert/EjbObject_FluxInsert:50: Class oracle.xml.parser.v2.XMLDocument not found in type declaration.
public java.lang.String insereFlux (oracle.xml.parser.v2.XMLDocument arg0)
^ Info: 3 errors
And if I use an int instead of the XMLDocument parameter, everithing's right.
Can anybody submit a no-paranormal solution ?
Thanks.
GHParameter passing in EJB must implement Serializable. One way to solve this is:
1. Define a new class which implements
Serializable.
2. Place whatever you want to pass inside
this class.
3. Now use the new class as your parameter.
eg.
public class Params implements java.io.Serializable {
String p1;
XmlDocmuent xdoc;,
etc, etc
Your program now have to use the class Params for parameter passing.
Hope this helps.
Tam
null -
How to deploy and run EJB in eclipse without XDoclet
Hi Friends
I am new in j2ee.In my academic project i want to do some ejb programming.
For that purpose i want to write some ejb's.I have written all required class for ejb,created ejb-jar.xml file manually,weblogic .xml file manually. I am using weblogic8 as an server for deployment.
I know deployment with xdoclet but i want to know hoe to deploy ejb without xdoclet.
If u have saple code or useful link regarding this please send it as soon as possible.
Thanks in advance
How to deploy and run EJB in eclipse without XDocletHI Welcome to J2ee...
I am also new to this...But i ll share my ideas with you...
In EJB 3.0 No need of any Deployment Descriptors....
And If you are using Eclipse You can Deploy(as jar) using Export in File tab...
XDoclet is not mandatory...
Gopal V -
Is Replica aware stubs are in infinite loop when fail over????
Hi
Any help on this Appreciated
See in this senario, where there is four weblogic instance runs in the cluster
and a replica aware stub(stateless bean with idempodent methods) finds a particular
method fails on a server and it redircets the request to another one server but the
same method fails on all the server, then what is goin to happen?? is it going to
throw some exception or gonna be in a loop to keep on redirecting the method request
to all servers in Round???
Regards
Aruna
Aruna,
A stateless session bean whose methods have been declared idempotent will automatically
retry on another service provider in a fail-over situation. When a fail-over situation
occurs, the stub refreshes its list of service providers. Note: Just because your
method call fails, doesn't mean it's a fail-over situation.
Jane
"Aruna" <[email protected]> wrote:
>
>Hi
>
> Any help on this Appreciated
>
> See in this senario, where there is four weblogic instance runs in
>the cluster
>and a replica aware stub(stateless bean with idempodent methods) finds a
>particular
>method fails on a server and it redircets the request to another one server
>but the
>same method fails on all the server, then what is goin to happen?? is it
>going to
>throw some exception or gonna be in a loop to keep on redirecting the method
>request
>to all servers in Round???
>
>
>Regards
>Aruna
-
RMI callbacks with no replica aware stubs in a cluster?
We would like to use either an RMI ping mechanism or an RMI callback in an upcoming project but are limited to 1.1 and 1.2 JRE's. I don't believe generating a replica aware proxy is an option for us given those constraints, no support for dynamic proxies. So we have a remote server object that we would ideally like to be clusterable that we can register a callback interface with. How can we accomplish this given our client limitations with weblogic 8.1 RMI? Any options?
Yep you speak no lies. Of course once I thought about it some more I realized the error of assuming one could register a jdk rmi object with a weblogic rmi object. JRMP vs T3?. Not good.
We still like using plain jane RMI w/in weblogic. I can register my UnicastRemoteObject stub with a normal RMI object on the server and it can callback and deliver messages. It will also send heartbeats periodically. If the heartbeat isn't heard from in awhile we re-register through http. The advantage of this is that the http session has failed over to another box and the web tier manages the rmi registration for me. The client can remain ignorant of any RMI lookups, which are tedious when not using JNDI or the cluster aware proxy.
All of this to get back a few seconds and keep a few thousand clients from polling through a servlet every second. Argh JDK 1.1.
Thanks for hammering that final point in. -
I am trying to deploy BC4J as Ejb to 8i (8.1.6). I use the following deployment method with j: my Jdev root.
setjboenv j: ejb8i
loadjava - u user/passwd@host:port:sid - thin -v - r grant "SYS,PUBLIC" j:lib\xmlparserv2.jar
loadjava - u user/passwd@host:port:sid - thin -v - r grant "SYS,PUBLIC" j:lib\jbomt.zip
loadjava - u user/passwd@host:port:sid - thin -v - r grant "SYS,PUBLIC" j:lib\jboejb.jarI then create a deployment profile for ejb 8i with the ide. (Without deploying)
I then use loadjava outside the IDE to deploy the 2 jar files created
MyProject1CommonEJB.jar
and
Myproject1.jar
I then use the ide again to deploy the bean profile
Package1ModuleServerEJB.prf
The last step fails with the error :
Publishing EJBHome...org.omg.CORBA.BAD_PARAM: null Strings are illegal in IIOP. Please correct your application or run the ORB in backward compatibility mode. minor code: 0 completed: No
void oracle.aurora.ejb.deployment.GenerateEjb.invoke()
void oracle.aurora.server.tools.sess_iiop.ToolImpl.invoke(java.lang.String[], java.io.InputStream, java.io.PrintStream, java.io.PrintStream)
void oracle.aurora.ejb.deployment.GenerateEjb.main(java.lang.String[])
Exception in thread main
Strangely, when I test this EJB with the tester (middle tier = remote ejb) it works, but from JSP's I get an application error : "Unknown Exception"
I am using Jdev 3.1
Also using the deploy option when creating the deployment profile fails apparantly due to the missing grant "SYS,PUBLIC" when loading classes to the database before deploying the bean.
What can be done ?
nullHi Blaise
Thanks for the reply. I have tried to do the complete deployment from within Jdev, but now I get the following error right at the end of the deployment.
/BC4J1AppModuleEjb/EjbObject_RemoteBC4J1AppModuleEjb:ORA-29535: source requires recompilationjava.lang.NullPointerException at sun.tools.java.Environment.error(Environment.java) at sun.tools.java.Environment.error(Environment.java) at sun.tools.java.Environment.error(Environment.java) ..... etc.
I have tried to deploy to a clean schema with the java privilages granted as described in the Jdev release notes.
I included the following libraries in my project :
JBO JDBC816 PATCH
JBO OSQL Domains
JDeveloper Runtime
Oracle 8.1.6 JDBC
Connection Manager
JBO Runtime
JBO VB Runtime
JBO 8i Runtime
SQLJ Runtime
JBO 8i Client
JBO Vanilla Domains
JBO EJB Runtime
JServer
Oracle XML SQL Utility
ORACLE XML Parser 2.0
Then I just used the deployment wizzard
null -
Problems deployment servlet and ejb
Hello,
I'm Having the following problem hopefully someone can help me.
I'm working in a visualcafe 4.5 project and I have to external jar
files
one containing an EJB the other cotaining some classes.
testservlet.war : deployed by VC
ejb.jar
xxx.jar
Deploying from VC is no problem but when I want to start the
server it can not find some classes which are in the xxx.jar file
containing the classes. But when I open the xxx.jar I see that they
are located in WEB-INF/classes.
My first Idea is that it could be a classloader problem
In the startweblogic.cmd I add the testservlet.war to the classpath
(Project options)
In the ejbc additional classpath entrys of the testservlet.jar I add
the xxx.jar.
In the server additional classpath I added both ejb.jar and the
xxx.jar
can someone tell me where it is going wrong???
Thanks
Oskar
Depoly them both in an EAR file. You will have to edit the Class-Path: property in each of the MANIFEST.MF files to make the proper path to the Singleton visible to all three, as well.
-
Deploy Websphere built ejb on 9ias (r2)
Anyone had any experience of deploying WebSphere built EJB's to OC4J. The .xml files differ and I would like to know if there are any tools/utilities/experiences out there. The development environment is WASAD, the Server is Oracle9iAS release 2 (+patches) on Solaris (64bit).
You deploy BC4J as EJB on iAS exactly the same as deploying it on database, same iiop connection,etc... You are really deploying BC4J as EJB to database 8.1.7, named databse cache.
-
Proble with deployment of simple ejb, help me please
Hi there wnat to deploy a simple ejb bean is there any step by step process how to deploy a bean in weblogic server6.0 version please help me, I could able to create ejb-jar file but dont know how to deploy it on to the server, please help me, with regards and thanks in advance Raasi
set STARMODE=false in config/mydomain/startWebLogic script file to start WebLogic server in development mode.
Copy Ejb jar file to config/mydomain/applications directory. -
Deployment of VisualAge EJBs into iAS
I want to deploy EJBs (1.1) developed using IBM VisualAge 3.5.3 into ORACLE iAS (the one you can download from ORACLE's web site at the moment). My experiences in a former project were that due some incompatibilites between IBM's and ORACLE's EJB specifications I had to use JDeveloper when I want to deploy EJBs into ORACLE software. Has anyone out there some experiences with the deployment of EJBs developed with VisualAge 3.5.3 into the newest ORACLE iAS, and can you give some tips on what to do (Stay away from deployment, or: you can do this or that to get around the tricky things etc etc) ???
We actually deployed moost of the samples from IBM websphere/VisualAge to OC4J. We also have customers who smoothly migrated from Websphere/VisualAge to OC4J.
However in some cases you need to change code if are using any custom features.
There are a few issues you need to consider while migrating EJB code developed on VAJ3.5.3 to OC4J:
1. Aceess Beans: If you code is using Visual ages/websphere specific access beans you need to copy ivjejb35.jar file to $OC4J_HOME\j2ee\home\lib directory
2. Client Code changes:
In the client applications if you are using IBM specific JNDI server and RMI over IIOP to look up EJBs you need change you code to use OC4J ORMI and OC4J JNDI contextFactory.
3. Changes to EJB code :
The main thing you have to keep in mind is VAJ3.5.3 is not fully EJB 1.1 compliant and it uses 'finderhelper' classes to define custom finder methods. Most of the cases OC4J generates these finder. In case if you have custom finders defined in finderhelper classes you can easily customzie the OC4J generated deployment descriptors: orion-ejb-jar.xml to define your custom finders.
4.Finally you need to generate ejb-jar.xml and ejb.jar files since WebSphere/Visual age only supports serialized deployment descriptors. You can use Jdeveloper or Ant tool to do that.
Otherwise it is fairly straight forward.If you still till have any specific migration issue you can contact me:[email protected]. Note: We are in the process of releasing websphere 3.5.3 migration guide soon, which will give a step by step migration path from websphere 3.5.x to OC4J.
thanks
V
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by hdcordes2:
I want to deploy EJBs (1.1) developed using IBM VisualAge 3.5.3 into ORACLE iAS (the one you can download from ORACLE's web site at the moment). My experiences in a former project were that due some incompatibilites between IBM's and ORACLE's EJB specifications I had to use JDeveloper when I want to deploy EJBs into ORACLE software. Has anyone out there some experiences with the deployment of EJBs developed with VisualAge 3.5.3 into the newest ORACLE iAS, and can you give some tips on what to do (Stay away from deployment, or: you can do this or that to get around the tricky things etc etc) ???<HR></BLOCKQUOTE>
null -
Deploy a stateless ejb (an easy one)
Hi all,
deploying a stateless ejb I've got this error in
the calling code (that's in the servlet calling)
-- begin error---
com.evermind.server.rmi.OrionRemoteException: admin is not allowed to call this EJB method, check your security settings (method-permission in ejb-jar.xml and security-role-mapping in orion-application.xml).
--- end error---
sounds as if the role ADMIN was not authorized. Where should
I look for info?
daniele rizziHi Daniele,
I don't know if this will help you, but I suggest you point your web
browser at this URL:
http://kb.atlassian.com/search.jsp
and do a search on "principals.xml"
As the error message suggests, you need to check the following files
(that are all located beneath the root OC4J installation directory):
principals.xml
ejb-jar.xml
orion-ejb-jar.xml
orion-application.xml
application.xml
web.xml
orion-web.xml
Note that there may be several versions of any of the above files
in different directories. You need to locate the ones that are relevant
to your problematic app. I found that these files are laid out in a
fairly intuitive way -- I didn't have much trouble figuring out what
should be in each file by looking at the sample applications that
Oracle supply either with the OC4J distribution, or from the "Technet"
website.
I'm pretty sure you'll be able to figure it out if you go through
the information sources I've listed above.
Hope this helps you.
Good Luck,
Avi.
Maybe you are looking for
-
Problem using a sequence in a trigger
I am creating a table, sequence and trigger as below. When I insert into the table I get the error message 'ORA-04098: trigger 'SIMS2.BEF_INS_MATERIAL_COST' is invalid and failed re-validation' I am using TOAD rather than SQL Plus to do all this. Any
-
ITunes too old to sync photos to iPhone 3G?
When I first got my iPhone (late December) I set up a folder of photos in iPhoto that would sync with my iPhone... and did a successful sync. Since updating my iPhone to 2.1, and 2.11, I can no longer sync photos to my iPhone via that folder. I get a
-
802.1x configuration for 3500 switch and 2800 switc
Can anyone point me to a document on how to do a 3500 switch 802.1x configuration as well as a 2800 switch? How do you define the server auth-port? Thanks
-
How to give blinking effect to browser window in task bar from my applet
i am doing a chat project and want to give a visual notification to the user if a new message comes and his browser window is minimised. Something that the yahoo messenger provides
-
Modify or inserting the data from node data into standarad db table.
Hi ... I want to modify the standard db table( say some hr table pa0002) ..with the values available in node. But node consist of only 4 fields from pa0002. modify statement example: modify itab1 from wa1. here wa1 should be same structure of itab1