Clustering annotation for EJBs ?

Hi all,
from the Oracle WLS documentation I have learnt that you can specify clustering via weblogic-ejb-jar.xml:
<stateless-clustering>
<stateless-bean-is-clusterable>True
</stateless-bean-is-clusterable>
<stateless-bean-load-algorithm>random
</stateless-bean-load-algorithm>
</stateless-clustering>
However is it possible to specify this via annotations too ?
Thanks a lot
Frank

Hi Frank --
The general pattern is that settings such as clustering, bean pool sizing, etc. are not exposed as annotations since these typically are configuration elements that define behaviour of an application at runtime and are better expressed in the external form of the deployment descriptor.
Happy to hear about your requirements here though.
-steve-

Similar Messages

  • Annotation for EJB 3

    I'm a java programmer for a few years .
    I'm new EJB environment.
    ejb is very difficlut to get.
    and futhermore,
    like @EJB,
    what's @XXX form?
    does any body know the simple starting point?
    any artices or information is welcomed.
    Thanks.

    EJB 3.1 is easy to learn.
    To lean in general about annotations (@XXX) go to: http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html
    To Learn about EJB technology: http://jcp.org/en/jsr/detail?id=318
    To learn more about EJB in GlassFish visit: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • Home-is-clusterable for EJB 3.0

    Hello,
    We had several EJB's of version 2.1 and we wre using home-is-clusterable element of weblogic-ejb-jar.xml. Now we have converted all the ejb's to version 3.0. I am wondering is there any alternative for home-is-clusterable in weblogic-ejb-jar.xml? Since there is no home interface in 3.0.
    Regards,
    Syed

    Please cross-post this in the WLS - EJB sub-forum as you'll probably get a more specialized audience there:
    WebLogic Server - EJB

  • Error in stateless-clustering in weblogic-ejb-jar.xml

    Hi,
    This is my <weblogic-ejb-jar.xml> and I see an error in <stateless-bean-is-clusterable>. Can anybody please help me regarding this.
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>Sample1</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <initial-beans-in-free-pool>10</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    <stateless-bean-is-clusterable>TRUE</stateless-bean-is-clusterable>
    </stateless-clustering>
    </stateless-session-descriptor>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>Sample2</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <initial-beans-in-free-pool>10</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    <stateless-bean-is-clusterable>TRUE</stateless-bean-is-clusterable>
    </stateless-clustering>
    </stateless-session-descriptor>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>Sample3</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <initial-beans-in-free-pool>10</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    <stateless-bean-is-clusterable>TRUE</stateless-bean-is-clusterable>
    </stateless-clustering>
    </stateless-session-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    I am using weblogic 10.3 and EJB 3.0 Can I include all the EJBs in a single <weblogic-ejb-jar.xml> file and can I put it in the EAR->EarContent->META-INF folder, where the application.xml and weblogic-application.xml files exist.
    Basically, I am trying to include <initial-beans-in-free-pool> and <stateless-bean-is-clusterable> for each of my EJBs. Since there is no annotation equivalent for them in EJB 3.0, I had to include the <weblogic-ejb-jar.xml> file. I appreciate if anybody can suggest me if there is any annotation equivalent for these.
    Thank you,
    Sowmya

    Hi,
    1. please try with <stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
    2. the EJB Specification requires "The deployment descriptor must be stored with the name META-INF/ejb-jar.xml in the ejb-jar file." So you shouldn't put the weblogic-ejb-jar.xml to EAR's META-INF folder.
    3. <stateless-bean-is-clusterable> has a default value as "true". so you needn't specify it in your weblogic-ejb-jar.xml if you just want to have the "true" value.
    4. default value of <initial-beans-in-free-pool> is 0. Since you're changing the default value, you'll have to specify it in weblogic-ejb-jar.xml. If you can put all EJBs in one ejb jar file, you can have only one weblogic-ejb-jar.xml in the META-INF folder of this ejb jar.
    Thanks,
    Amy

  • Writing a Standalone Client for EJB 3.0 Bean For Weblogic 10

    Steps for Writing a Standalone Client
    Client Code
    package com.client;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import com.StatelessService;
    public class StatelessClient {
         public static void main(String [] args){
              Context ctx = null;
              try {
                   ctx = getInitialContext("t3://localhost:7001/protossbservice","weblogic","weblogic");
                   Object ref = ctx.lookup("StatelessService#"+StatelessService.class.getName());
                   StatelessService service = (StatelessService)PortableRemoteObject.narrow(ref,StatelessService.class);     
                   System.out.println("StatelessClient.getMessage() ++");
                   String  message = service.getMessage();
                   System.out.println("StatelessClient.getMessage --");
                        System.out.println("Message from Bean "+message);
         } catch (NamingException e) {
                   e.printStackTrace();
         private static Context getInitialContext(String url, String user, String password) throws NamingException {
            Properties h = new Properties();
            h.put(Context.INITIAL_CONTEXT_FACTORY,
                    "weblogic.jndi.WLInitialContextFactory");
            h.put(Context.PROVIDER_URL, url);
            h.put(Context.SECURITY_PRINCIPAL, user);
            h.put(Context.SECURITY_CREDENTIALS, password);
            return new InitialContext(h);
    Business Interface
    package com;
    public interface StatelessService {
         public String getMessage();
    Stateless Session Bean
    package com;
    import javax.annotation.PostConstruct;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    * Test Stateless Session Bean
    @Stateless(mappedName="StatelessService")
    @Remote(StatelessService.class)
    public class StatelessServiceBean implements StatelessService {
         public String getMessage(){
              return "I am invoked";

    emekaco wrote:
    Hi,
    I am a trainee although with a good background in java.
    I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
    http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss
    Here's a good free e-book but without Netbean. It covers everything you would need to know about EJBs.
    >
    Again, is container managed bean good for a big project?
    The question is too vague to be answered. It's a design decision that needs more details.

  • A free ebook for EJB 3.0 with the latest version of Netbean

    Hi,
    I am a trainee although with a good background in java.
    I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
    Again, is container managed bean good for a big project?
    Thanks.
    Emeka

    emekaco wrote:
    Hi,
    I am a trainee although with a good background in java.
    I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
    http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss
    Here's a good free e-book but without Netbean. It covers everything you would need to know about EJBs.
    >
    Again, is container managed bean good for a big project?
    The question is too vague to be answered. It's a design decision that needs more details.

  • JNDI Lookup in JSP fails for EJB 3.0

    I am new to Java technology. I read the EJB FAQ, NetBeans docs and may forum discussions and I am still confused with the error I am having.
    Background:
    I have developed a persistance bean and related sessions beans (similar to the customer-cmp-ear application in the Java App Server samples). Now I am trying to access this bean using a JSP. After deploying the war file in the App Server and try to access the page, I get the following error.
    javax.naming.NameNotFoundException: No object bound to name java:comp/env/ConsumerSessionLocal
    After reading many articles, I understood that I dont have to prepare any descriptors, or JAR files for EJB 3.0.
    Environment Details:
    Java App Server Ver 9.0
    NetBeans 5.5
    I normally build the war files using NetBeans.
    I use App Server Admin console to deploy the web applications using the above war file.
    EJB details:
    Persistance EJB : person.java
    Session Objects
    Consumer.java (this implements ConsumerSessionLocal, ConsumerSessionRemote). This Stateless bean accesses the methods in person.java.
    ConsumerSessionLocal.java - local interface
    ConsumerSessionRemote.java - remote interface
    SearchConsumer.jsp
    This JSP page is calling the ConsumerSessionLocal using the JNDI lookup through InitialContext.
    Here is the Code snippet:
    try {
    InitialContext ic = new InitialContext();
    Object o = ic.lookup("java:comp/env/ConsumerSessionLocal");
    ConsumerSessionLocal consSession = (ConsumerSessionLocal) o;
    I am able to see the jsp page in the browser, however, after a submit action, I get the Java Naming Exception error.
    javax.naming.NameNotFoundException: No object bound for java:comp/env/ConsumerSessionLocal
    I would appreciate your help/any of your thoughts.
    Thanks in advance.
    -Ram

    I did not really solve it. Instead I used some of the tutorials that used JNDI lookup and modified those as my way forward. I did not really find out exactly what I was doing wrong.
    /Anders

  • Error while using LiveCycle java APIs with Http servlets:"Remote EJBObject lookup failed for ejb/Inv

    Hi all,
    When i try to run more than one servelt of the Quick Start samples that using Livecycle Java APIs and i get an error of "Remote EJBObject lookup failed for ejb/Invocation provider" from any servelt i run.
    I try some Quick samples which is not servelts (java class) and it works fine, which makes me sure that my connection properties is true.
    Environment:
    The LiveCycle is based on "Websphere v6.1", and i use "Eclipse Platform
    Version: 3.4.1".
    i install "tomcat 5.5.17" to test the servelts in developing time through Eclipse.(only for test in developing time not for deploy on )
    The Jars i added in the classpath:
    adobe-forms-client.jar
    adobe-livecycle-client.jar
    adobe-usermanager-client.jar
    adobe-utilities.jar
    ejb.jar
    j2ee.jar
    ecutlis.jar
    com.ibm.ws.admin.client_6.1.0.jar
    com.ibm.ws.webservices.thinclient_6.1.0.jar
    server.jar
    utlis.jar
    wsexception.jar
    My code is :
    Properties ConnectionProps = new Properties();
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "iiop://localhost:2809");
    ConnectionProps.setProperty ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_ EJB_PROTOCOL);
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE,ServiceClientFa ctoryProperties.DSC_WEBSPHERE_SERVER_TYPE);
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "Administrator");
    ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
    ConnectionProps.setProperty("java.naming.factory.initial", "com.ibm.ws.naming.util.WsnInitCtxFactory");
    //Create a ServiceClientFactory object
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);
    //Create a FormsServiceClient object
    FormsServiceClient formsClient = new FormsServiceClient(myFactory);
    //Get Form data to pass to the processFormSubmission method
    Document formData = new Document(req.getInputStream());
    //Set run-time options
    RenderOptionsSpec processSpec = new RenderOptionsSpec();
    processSpec.setLocale("en_US");
    //Invoke the processFormSubmission method
    FormsResult formOut = formsClient.processFormSubmission(formData,"CONTENT_TYPE=application/pdf&CONTENT_TYPE=app lication/vnd.adobe.xdp+xml&CONTENT_TYPE=text/xml", "",processSpec);
    List fileAttachments = formOut.getAttachments();
    Iterator iter = fileAttachments.iterator();
    int i = 0 ;
    while (iter.hasNext()) {
    Document file = (Document)iter.next();
    file.copyToFile(new File("C:\\Adobe\\tempFile"+i+".jp i++;
    short processState = formOut.getAction();
    ...... (To the end of the sample)
    My Error was:
    com.adobe.livecycle.formsservice.exception.ProcessFormSubmissionException: ALC-DSC-031-000: com.adobe.idp.dsc.net.DSCNamingException: Remote EJBObject lookup failed for ejb/Invocation provider
    at com.adobe.livecycle.formsservice.client.FormsServiceClient.processFormSubmission(FormsSer viceClient.java:416)
    at HandleData.doPost(HandleData.java:62)
    at HandleData.doGet(HandleData.java:31)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    a

    I assume here that your application is deployed on a different physical machine of where LCES is deployed and running.
    Do the following test:
    - Say that LCES is deployed on machine1 and your application is deployed on machine2. Ping machine1 from machine2 and note the ip address.
    - Ping machine1 from machine1 and note the ip address.
    The two pings should match.
    - Ping machine2 from machine1 and note the ip address.
    - Ping machine2 from machine2 and note the ip address.
    The two pings should match.
    Usually this kind of error would happen if your servers have internal and external ip addresses.

  • Can't create a JAXB binding for ejb-jar.xml using xjc

    Hi all,
    I have been trying to build a JAXB binding for EJB deployment descriptors, mainly because I have to update a hand-cranked ejb-jar.xml file on the fly with some additions that have come from a code generator.
    I have tried to use
    xjc ejb-jar_2_1.xsd j2ee_1_4.xsd ejb-jar_2_1.xsd
    xjc on the schema definitions I found at http://java.sun.com/xml/ns/j2ee/ but I can't get it to work. It produces reams of errors, see below for a short extract.
    Of course, someone could put me out of my misery and tell me where to find a binding that someone else has done. I can't be the first chimp on the planet that has wanted to do this!
    Any help much appreciated.
    errors:
    [WARNING] warning: "blockDefault" attribute of <schema> is not supported
    line 3 of xml.xsd
    [WARNING] warning: "finalDefault" attribute of <schema> is not supported
    line 3 of xml.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 117 of j2ee_web_services_client_1_1.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 115 of ejb-jar_2_1.xsd
    [WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
    line 129 of ejb-jar_2_1.xsd
    [WARNING] warning: <key> identity constraint will be ignored by JAXB validation
    line 145 of ejb-jar_2_1.xsd
    [WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
    line 159 of ejb-jar_2_1.xsd

    Exception initializing 'oracle.dbtools.raptor.MonitorJDBCAddin' in extension 'Oracle SQL Developer': oracle.classloader.
    util.AnnotatedNoClassDefFoundError:
    Missing class: oracle.jdbc.OracleDriverThe Oracle driver is not on the classpath.

  • Difference between narrow() method usage and simple class cast for EJB

    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?
    P.S. I'm working with WL 6.1 sp2
    Any help would be appreciated.
    Thanks in advance,
    Orly

    [email protected] (Orly) writes:
    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?(1) is mandated by the spec. It is required because CORBA systems may
    not have sufficient type information available to do a simple case.
    P.S. I'm working with WL 6.1 sp2 You should always use PRO.narrow()
    andy

  • How to Define a Data Source in a Standard Way for EJB 3.0?

    I have an EJB 3.0 project that I want to deploy to different kinds of servers. I got it to work for OC4J, but when I tried to deploy it to JBoss I found out really quick that there are actually no data sources defined in my EJB Jar and that JDeveloper does not (that I am aware of) define data sources by default in a portable way.
    I could be wrong on this. Not sure. Any info for explicitly defining data sources for EJB 3.0 in a portable way would be greatly appreciated.
    Thank You,
    KurzHome

    Frank,
    Thanks for your response. I will try that.
    One thing I am confused about is how to link the EJB and the data source name. Unless I am missing something obvious, I can't find a configuration setting that explicitly states that my Entity EJB uses XYZ data source (when using OC4J). Where is this defined? Also, what configuration do I add to to my EJB or other file to link it to the JBoss defined data source?
    Thanks,
    KurzHome

  • IDE for EJB's

    Hi there
    I'm looking for IDE's for EJB development.
    Best would be if it support UML notation or any other modeling language
    if you know any, please let me now
    thanks
    Thomas

    There are quite a few available, you can try Oracle's JDeveloper, you can
    download it from oracle for free (evaluation), you can also try ArgoUML,
    that you can get from www.sourceforge.net or www.freshmeat.com . It's an
    opensource utility written in java that resamlbes Rational Rose. Hope that
    helps.
    -alex
    Thomas Egeter wrote:
    Hi there
    I'm looking for IDE's for EJB development.
    Best would be if it support UML notation or any other modeling language
    if you know any, please let me now
    thanks
    Thomas

  • Combine Annotation Driven EJB Web Services with BPEL

    Hi friends,
    We developed two Annotation Driven EJB Web Service and deployed successfully .
    webservice 1 accepts username and password as input and returns true if ldap authentication is successful.
    webservice 2 accepts username and password,and groupname as input and returns true if user is part of ldap group.
    How can we combine these two services in SOA with input (username,password,group) and output (isAuthenticated ,isGroupMember) using BPEL process...
    Regards,
    jdev

    I will create a schema with input as (username,password,group) and Output as (isAuthenticated ,isGroupMember).
    Then based on your requirement you have to create either Sync or Async service.
    From the BPEL process i will call the 2 webservices using webservice call.
    On receiving the result, populate the output variable(isAuthenticated ,isGroupMember) and send as response.
    Thanks,
    Vijay

  • Excessive cxs socket connections created for ejb access

    We are seeing a large number of TCP connections being created to the cxs engine for ejb access in our application.
    We are running iPlanet application server 6.0, sp3 on Solaris 8. We have a web application that accesses a singleton component running in a kjs engine. That singleton accesses cmp entity beans and stateless session beans for serving client requests over the RMI/IIOP bridge. When three clients are connected and making requests, the number of TCP connections to the IIOP port (9010) starts to increase until everything freezes. I believe the "freezing" of the client apps is due to the open socket limit of 1024 being exceeded. According to the developer doc we can increase rlim_fd_max to 8192 to fix that problem.
    However, my question is why are there an increasing number of socket connections? We are caching the ejb instances in the singleton so we should not be creating a large pool of EJBs. I have verfied the large number of sockets using netstat and also using RMI runtime logging in the kjs engine.
    Does anyone have any ideas what could be happening here?
    Thanks,
    Mark

    I noticed that most of the TCP connections are made to port 32787. Can anyone from iPlanet tell me what is listening on this port? The large number of socket connections is really tying up server resources.
    Thanks,
    Mark

  • Help for EJB

    Hi,
    after I added a busness method in EJB Bean class, I cannot add the method in remote interface.
    can anybody help me?
    zhou

    Yes, you should have an application server for EJB container. Try JBoss; it's free.

Maybe you are looking for

  • Problems with Safari Version 6.1.6 (8537.78.2)

    Since this latest update to Safari under Mountain Lion 10.8.5 I've noticed problems: freezing, links not opening, unexpected closing, spinning beachballs, etc. Has anyone else had these problems with this update?

  • Message folders split in 2 columns

    Hi there, I really need to be able to split my message folders column in 2 or 3, so I can see all the folders in one. Does anyone found a way to do that? Many thanks, Em

  • ODI and Import Data Server in Essbase Error

    Hi, I have added Essbase Technology in Topology Manager. When I am trying to add my Essbase Server under Essbase Technology am getting the error. Here are the steps I have followed. Trying to add Essbase Server by Import Data Server -- Specified name

  • ANYBODY used the Currrency Conversion / Translation Rules Table yet???  Thx

    hi guys, we are working on the BUSINESS RULE: CURRENCY CONVERSION TABLE. here we have a easy three row table: Account Rate Type: AVG; Formula: [AVG] Account Rate Type: END; Formula: [END] Line 3: Account Rate Type: TRANS: Destination Account: XYZ;  >

  • Config table have column is space in OGGv11.2

    Hi experts, How config table have column is space in OGGv11.2?And not primary key in source and target. Config in extract process extract msext sourcedb hr, userid sa, password ***** exttrail C:\SGolden\dirdat\st tranlogoptions managesecondarytruncat