WLS 6.1 And EJB Descriptors.

I have been meesign around with WLS6.1 and tryign to get my deployment
descriptors online. The auto generaator made a mess of things. However, why
is it that I cant find where to enter a JNDI name for my beans or their refs
and why cant I find out how to spcify a topic for a JMS bean. Im a tad lost
and would appricate some help.
Robert Simmons Jr.
Senior Software Engineer
Ingenium Pharmaceuticals, Munich Germany.

What's that "auto generator" you're talking about?
=========
The JNDI name is specified as the <jndi-name> element of
weblogic-ejb-jar.xml. This would be the last element of each bean's
description. Example:
<weblogic-enterprise-bean>
<ejb-name>example</ejb-name>
<jndi-name>beanJNDIName</jndi> <!-- HERE -->
</weblogic-enterprise-bean>
=========
JMS topics should be specified as resource references. Example:
In ejb-jar.xml:
<enterprise-beans>
<entity> <!-- or session or message-driven -->
<resource-ref> <!-- HERE -->
<res-ref-name>jms/aTopic</res-ref-name>
<res-type>javax.jms.Topic</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
and in weblogic-ejb-jar.xml:
<weblogic-enterprise-bean>
<ejb-name>example</ejb-name>
<reference-descriptor> <!-- HERE -->
<resource-description>
<res-ref-name>jms/aTopic</res-ref-name>
<jndi-name>example-topic-jndi-name</jndi-name>
</resource-description>
</reference-descriptor>
<jndi-name>beanJNDIName</jndi>
</weblogic-enterprise-bean>
and then you can look up this in the code with:
Topic t = (javax.jms.Topic)ctx.lookup("java:comp/env/jms/aTopic");
Good luck,
Emmanuel
"Robert Simmons" <[email protected]> wrote in message
news:[email protected]..
I have been meesign around with WLS6.1 and tryign to get my deployment
descriptors online. The auto generaator made a mess of things. However,why
is it that I cant find where to enter a JNDI name for my beans or theirrefs
and why cant I find out how to spcify a topic for a JMS bean. Im a tadlost
and would appricate some help.
Robert Simmons Jr.
Senior Software Engineer
Ingenium Pharmaceuticals, Munich Germany.

Similar Messages

  • OC4J EJBQL and EJB 2.0 features

    Hello Debu Panda and All
    I've got all howtos and I mangaged to get some parts of OC4J [Oracle9iAS (9.0.3.0.0) Containers for J2EE (build 020323.1689)] working.
    There are still some issues that are stalling our development. Could you please comment on them, maybe providing an estimate of when they will be solved/implemented?
    First of all, a little background. Our application uses many Java Swing application clients that connect to the EAR application in the container.
    The ear application has the following structure:
    All database access (Oracle 8i, located in its own server) is done exclusively by means of CMP entity beans. A entity bean may access other entity beans. There are workflow session beans (stateful and stateless) that access the entity beans. All clients see only the workflow session beans (session beans fagade).
    Our applicatoin is complex, having more than 80 session beans and more than 25 entity beans (not counting entity beans that exist only to represent relationships among entity beans).
    There goes the questions:
    1) It seems that entity beans cannot currently be referenced by remote interfaces. We couldn't deploy our application using it. Since we could use only local interfaces fot entity beans, thats what is been done now.
    2) There is no CMR supported. Is this true?
    3) EJBQL seems to be very limited. In the howto examples there are EJBQL statements that compare two numbers. However, when we tried to use String comparisons, it didn't work. Here is the statement:
    "SELECT DISTINCT OBJECT(p) FROM Person p WHERE p.name = ?1"
    If I compile, package and deploy the ear applicatin with the above EJBQL statement, OC4J generates an exception when executing the finder method. The exception is:
    "java.rmi.NoSuchObjectException: Session has timed out
    at com.evermind.server.ejb.StatefulSessionEJBObject.throwPassivisat
    ception(StatefulSessionEJBObject.java:188)
    at Cad023Remote_StatefulSessionBeanWrapper0.obterPessoasPorParteNom
    023Remote_StatefulSessionBeanWrapper0.java:754)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:8
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)"
    If I remove the where clause, the expection is gone. However, I get all records. ;-)
    4) It seems that all EJBQL clauses must be capitalized. Is this true?
    FINALY)
    Is there a newer OC4J build that could use to get the development going? Do you know where there will be one? Is there any way of contacting the OC4J development team to report bugs?
    If you would like, we could discuss it in private e-mail (please use my private mail [email protected]).
    Thanks for your attention,
    Luis Fernando Soeiro
    Hi !! OC4J 9.0.3 developer's preview has most features of EJB 2.0. We are working on updating on our docs and samples for EJB 2.0
    Please look at the following URL that has some How Tos on EJB 2.0 features such Local Interfacea, EJB QL, etc : http://otn.oracle.com/tech/java/oc4j/htdocs/oc4j-how-to.html#ejb
    regards
    Debu Panda
    Oracle --------------------------
    Luis Soeiro <mailto:[email protected]> <mailto:[email protected]>Type : Question Date : Apr 11, 2002 15:15 PT Hello
    Some colleagues and I are trying to port a large project from JBOSS to OC4J. We used JBOSS 3.0 (beta) in order to evaluate EJB2.0 features and see if we could use it. We already have OC4J in production, but only as a JSP/Servlet container. The next step would be to deploy our EJB application to OC4J.
    We have read the material and it is written that OC4J (developers preview) is EJB 2.0 compliant. However, the specific documentation and the examples don't show how to specify OC4J specifc XML files. We absolutely need CMR and Local Interfaces, because we don't have the time required to downgrade our JBoss EJB2.0 application to the EJB 1.1 specification. We have over 80 Session Beans and over 20 Entity Beans.
    Is there anybody there that can confirm that OC4J developer's preview is really EJB2.0 compliant? If so, could you send me some pointers to information about OC4J container specifc deployment descriptors? The docs listed at the web site don't have EJB2.0 features listed, nor does the Oracle samples.
    Thanks for your attention,
    desperately,
    Luis Fernando Soeiro

    HI,
    I worked out CMR and EJB-QL with single bean.
    Using CMR, it is possible to get one bean reference through other bean, but
    When I tried EJB-QL with bean to bean navigation then I run into problem.

  • Global transactions in OSB and EJB 2.1

    Hi,
    My team is working in a SOA service based on OSB 11g (11.1.1.5) using DB JCA Adapter and EJB 2.1 over WLS 10g(WLI environment). The logic of the service works in this way:
    1. A table in a database (XE) is polled by the DB Adapter which starts the service (1 row = 1 message).
    2. The message contains a collection of items to be inserted in another Oracle database.
         Once a message/row is picked, and after some steps (logging, validation,etc), there is a for..each action which extracts each item of the collection and executes a service callout action to a business service.
    3. This business service uses EJB protocol to call an EJB (2.1 + WLS Extensions). The EJB is deployed in another domain (WLS 10.3.0/10g and Oracle BEA drivers)  and only executes an store procedure with the parameters based on the message and inserts these values in a table.
    4. Once the for...each finishes, there is a call to another proxy service which marks the message/row as "processed" in the source table. This update is done via DB JCA also.
    5. In case of an error, the error handler of the proxy service calls the proxy service mentioned above to mark the row as "Failed" (in fact there is a retry mechanism, but it's not important for now).
    The service requires to work inside a global transaction. The main requirement is that the collection of items should be processed as "All or None", so basically we're using the options to manage the global transaction. However, the problem is that it's failing to rollback the whole insertion of items when an error is simulated. It only rolls back the last insertion/execution of SP.
    Additionally, the proxy service that should mark the row as FAILED, never updates this one, and the tables stay locked until we modify one of the store procedure in order to avoid the simulated error and commit the transaction.
    The EJB uses WLS extensions with the annotations to "transaction required". The proxy service has the option transaction required also. The database drivers are all XA and we're testing against Oracle11g XE (however, the EJB destiny will be Oracle 8i in production).
    We have tried different alternatives, splitting the logic in different proxies (Proxy services for JCA, Proxy with For Each for EJB, etc), isolating the specific part with the EJB call, without success.
    The security between domains is set as Global Trust.
    Do you have any idea, example or suggestion about this problem? Is EJB really supported in Global Transactions and XA?
    Thanks in advance.

    where do you find the J2EE Connector 1.5 compliant
    Resource Adapter?I wrote the compliant adapter myself. Hey Steve,
    Were you able to find a solution for this problem. I am struggling with the same problem with the RI Beta implementation.
    Sandeep

  • Creating  Standard EJB Descriptor (ejb-jar.xml) by JDeveloper

    Hi
    If I create a Session Bean by JDeveloper it create a weblogic-ejb-jar file (Weblogic EJB Descriptor) for it
    Do you know how can I use JDeveloper for creating Standard EJB Descriptor (ejb-jar.xml) for my Session Bean ? please if you can explain step by step
    thank you

    Hi,
    Right-click Model project and select New -> General -> Deployment Descriptors -> Java EE Deployment Descriptor and click OK, on the next screen you can choose ejb-jar.xml.
    Pedja

  • WLS hanger when calling EJB in second WLS

    Hello,
    I have a very strange problem I need to track down. The scenario is as follows:
    WLS6.1 SP3/Solaris 2.8
    One WLS containing an EJB A (stateless session) that has Trx=Required on method_A,
    the second WLS that has an EJB B deployed (stateless session) that has Trx=NotSupported
    on method_B. Now I call in a client method_A of EJB A, which calls method_B of
    EJB B. This works fine.
    Now I install the second WLS on an different machine (same OS=solaris), and repeat
    above scenario. The result is that I am able to call method_A of EJB A, which
    calls method_B of EJB B. But after I return from method_B/EJB in EJB A, I hang
    in EJB A/postInvoke.
    From the thread dump I see the following:
    "ExecuteThread: '46' for queue: 'default'" daemon prio=5 tid=0x7c20c0 nid=0x35d
    waiting on monitor [0xdb0f000..0xdb0fdc0]
    at java.lang.Object.wait(Native Method)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRetryCommit(ServerTransactionImpl.java:1970)
    at weblogic.transaction.internal.ServerTransactionImpl.globalCommit(ServerTransactionImpl.java:1899)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:220)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
    at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:272)
    at com.csg.pb.tit.tdc.cptypay.ejb.CounterpartyPayPathBean_43jp4t_EOImpl.routeCif(CounterpartyPayPathBean_43jp4t_EOImpl.java
    at com.csg.pb.tit.tdc.cptypay.ejb.CounterpartyPayPathBean_43jp4t_EOImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    How canI find out what is going on?
    Thanks
    Juerg

    I am getting the same exception about an assertion failed at weblogic.t3.srvr.T3Srvr.checkServerLock. Any ideas?

  • "Edit EJB Descriptor..."  Not working

    Hi
    When i press the "Edit EJB Descriptor..." in a EJB under Deployments in the web-logic
    6.1 console, I get this Error:
    Error Start -
    "There was an error while loading the descriptor for component:
    EnvelopeEntityBeans
    Please fix the error in the component descriptor file(s), redeploy the component
    and then press continue to attempt to edit this components descriptor.
    The following error(s) occurred:
    error in finding weblogic.Home"
    Error end
    I deploy a EAR File containing 2 EJB's - one of them have entity beans in it, and
    it is the one that have the error.
    Thanks
    Gal

    Just so everyone knows, I was on hold with Adobe tech support for ALMOST TWO HOURS despite the 2-minute wait time they estimated at the beginning of my call. I really don't know how else to describe how I feel, except:
    Clearly Adobe gives zero f*cks, even though I pay $40 per month for the creative cloud membership.
    Adobe, if you were a person (which you are, because now corporations are people in the USA), I would wish upon you the most severe case of herpes-slash-genital-rot the world has ever seen. I hope that the discomfort of this particular ailment results in your inability to participate in even the shortest meetings or conference calls, due to the fiery burning pain in your nether regions. Then perhaps maybe a more competent and ethical software company could assume your role in the marketplace.
    I will be especially amused if an Adherpe forum moderator has time to delete my post and/or ban me forever from the Adobe community, given that a tech support person has no time to answer my call. The plot thickens.
    Toodle-loo.
    PS: I am extremely sleep deprived, so I refuse to be held accountable for any offense taken to any of the statements set forth above.

  • JDO and EJB

    Parts of our application do not require distributed transactions and security provided by CMP entity beans.
    Instead, we need to use JDO behind a layer of session beans to provide transparent persistence for Java business object models. Standard JDBC calls with DAO objects are database vendor dependent and require additional SQL implementations, and hence not attractive.
    The existing JDO based persistent managers available for CMP entity beans, in S1AS 7, such as:
    <pm-descriptors>
    <pm-descriptor>
    <pm-identifier>IPLANET</pm-identifier>
    <pm-version>1.0</pm-version>
    <pm-class-generator>com.iplanet.ias.persistence.internal.ejb.ejbc.JDOCodeGenerator</pm-class-generator>
    <pm-mapping-factory>com.iplanet.ias.cmp.NullFactory</pm-mapping-factory>
    </pm-descriptor>
    <pm-inuse>
    <pm-identifier>IPLANET</pm-identifier>
    <pm-version>1.0</pm-version>
    </pm-inuse>
    </pm-descriptors>
    <cmp-resource>
    <jndi-name>jdo/roster</jndi-name>
    <default-resource-principal>
    <name>admin</name>
    <password>admin</password>
    </default-resource-principal>
    </cmp-resource>
    would be useful for non-EntityBean implementations.
    Please advise on the existing and future JDO based solutions for such implementations, as part of S1AS7.
    In addition, samples for the following scenarios would be very helpful:
    1- the Adventure J2EE 1.4 blueprints with JDO implementation
    2- Mixed CMP BeanEntity and JDO data objects
    Many thanks in advance.

    My question is If there's is a proper way to combine
    JDO and EJB...There are many ways to do it.
    For example:
    1) Call JDO's from session facade beans.
    2) Use JDO as persistence machanism for BMP entity beans.
    3) Write some layer which deals with persistence so you can use either EJB CMP or JDO, without changing client layer.
    (1) is the most simple case. (2) requires a lot of code

  • Classes, Stateful EJBs and EJB Container

    Hi,
    We have several doubts about classes, servlets, and EJBs.
    We have been told that the instance of non-static classes from JSPs or servlets
    can be a problem if we have a big number of clients connecting to weblogic (or
    any other app server). Would it be a problem? Is it a better practice to instantiate
    those classes from EJBs?
    We have been told that EJBs are managed by the EJB container, and it uses a pool
    for serving them to clients, passivating and activating them. This would include
    the classes instantiated inside them. Is it true?
    If all our guesses are true, the better way to implement a search with pagination
    would be a stateful EJB, using handlers to save it in the client's session. But
    we've heard that stateful EJBs are really bad for server's perfomance. Is it true?
    We are using Weblogic 7.0. If so, what are they useful for???
    If they can be a problem, how to build that searching using stateless EJBs?
    Best regards,
    Ignacio Sanchez

    You're right, the concrete tag to use seems to be:
    <replication-type>InMemory</replication-type>
    Anyway, do you have any further explanation on Stateful's behaviour with many
    clients and pagination implementation?
    "Stanley Beamish" <[email protected]> wrote:
    >
    "Ignacio Sanchez" <[email protected]> wrote in message
    news:[email protected]...
    Thanks for your replies.
    Anyway, I still have some questions about stateful EJBs. In a clusteredenvironment,
    we've been told that stateful EJBs are only balanced before create()method. So,
    if we have already "created" the Remote interface, we're using it,and the
    server
    fails and must be balanced to another instance, what will happen? Willwe
    lost
    that Remote interface and data included in it?
    Not necessarily, you can enable replication, which means that your stateful
    EJB's state (values of i-vars) can be replicated across nodes in a cluster.
    Search through the WLS cluster documentation for details.
    SB
    And about your suggestion on pagination using stateless. Could youplease
    explain
    it in more detail? I haven't understood it well.
    Thank you very much for your attention.
    "Sri" <[email protected]> wrote:
    Hi,
    Look below for my coments.
    S
    "Ignacio Sanchez" <[email protected]> wrote:
    Hi,
    We have several doubts about classes, servlets, and EJBs.
    We have been told that the instance of non-static classes from JSPsor
    servlets
    can be a problem if we have a big number of clients connecting to
    weblogic
    (or
    any other app server). Would it be a problem? Is it a better practice
    to instantiate
    those classes from EJBs?It all boils down to your architecture. If you have a lot of clients
    connecting
    to web container then and if each client needs objects stored in session
    then
    you have to refactor your object distribution. But this could be avoided
    by separating
    static content from dynamic content (using proxies, load balancersetc),
    having
    more web containers etc. It's not necessary to instantiate these classes
    in EJBs
    always (then you are increasing your memory footprint). The generalguidelne
    is
    to do more heavy duty work as you go deeper into tiers hopefully handling
    less
    connections etc.
    We have been told that EJBs are managed by the EJB container, and
    it
    uses a pool
    for serving them to clients, passivating and activating them. Thiswould
    include
    the classes instantiated inside them. Is it true?
    True.
    If all our guesses are true, the better way to implement a search
    with
    pagination
    would be a stateful EJB, using handlers to save it in the client'ssession.
    But
    we've heard that stateful EJBs are really bad for server's perfomance.
    Is it true?
    We are using Weblogic 7.0. If so, what are they useful for???
    True if misused as stateful EJBs, just like HTTP sessions could bereplicated
    and could be activated/passivated.
    If they can be a problem, how to build that searching using stateless
    EJBs?
    You could cache searchs and pass identity and page numbers to theSLSB.
    Best regards,
    Ignacio Sanchez

  • Weblogic console Edit EJB Descriptor link missing

    Hi..
    I am running weblogic 6.1 sp1. And I have a set of EJB's deployed. But when I click
    on any ejb in the tree view in console, i can not see the Edit EJB Descriptor link
    on the right hand side screen.
    I have two server instances running with the same set of EJB's deployed. And I can
    get this link on one console and do not get it on the other console.
    Can anyone tell me what is wrong with it ? Or is there any setting using which we
    can disable the access to Edit EJB Descriptor link ?
    Thanks in advance..
    Mandar

    hi..
    I have NOT disabled the link myself.... but for some reasons, the link is not available.
    I also checked the right click menu (right click on the deployed ejb in the tree
    view) and i didnt get the Edit EJB Descriptor option there also... I have two server
    instances running in Development mode and one console is not showing the link while
    the other is showing the link..
    I am attaching a screenshot to explain the situation. Can anyone has experienced
    this before ? Please help me..
    Regards
    Mandar
    "Mihir Kulkarni" <[email protected]> wrote:
    I am running weblogic 6.1 sp1. And I have a set of EJB's deployed. Butwhen I click
    on any ejb in the tree view in console, i can not see the Edit EJBDescriptor link
    on the right hand side screen.
    I have two server instances running with the same set of EJB's deployed.And I can
    get this link on one console and do not get it on the other console.
    Can anyone tell me what is wrong with it ? Or is there any setting usingwhich we
    can disable the access to Edit EJB Descriptor link ?No there is no such option to disable the access to edit the EJB
    Descriptors - its present both in the Dev and the Prod mode.
    Besides the link in the right frame, you can also right click on the EJB
    Name in the navigation tree to edit the descriptors ....
    cheers,
    Mihir
    Thanks in advance..
    Mandar
    [Ejb Descriptor missing.JPG]

  • What is the difference between ejb reference and ejb handle?

    Hi:
    I am newbie for J2EE.
    I want to know what is the difference between ejb reference and ejb handle
    from the client view and from the container view?
    Very Thanks!
    Stive

    Hi John,,
    1) Ejb Object Handle are nothing but a long lived proxy for the
    ejb object, using this handle user can disconnect from the Ejb Server/Container
    at any time
    and after some time using the same handle he can able to resume the conversational
    state
    with the server / container where he was been disconnected From.
    And there are currently two Handles , HomeHandle and Handle for EjbHomeObject
    and EjbObject
    Respectively. Both these handles have Persistent reference to the EJB Object
    2) Ejb Reference is used to lookup a bean from other Enterprise Bean
    Ejb reference is a nickname for the JNDI Location that you want to lookup a bean.
    your code will looks up a Home object via using this nickname
    and the deployer will bind the
    nickname to the JNDI location of its choice
    EJb Reference are declared in the deployment descriptor
    Regards
    Karthikeyan Gangadharan
    SIP Technologies, Chennai
    E-mail-ID : [email protected]
    "John Stive" <[email protected]> wrote:
    >
    Hi:
    I am newbie for J2EE.
    I want to know what is the difference between ejb reference and ejb
    handle
    from the client view and from the container view?
    Very Thanks!
    Stive

  • Mod_weblogic.c in wls 6.1 and case insensitive URL

    Hi,
    We need to send URL of a given application to a dedicated managed server (7126), the rest on the "default" managed server (7122). The URL may come in uppercase or in lowercase. I do not understand in the httpd.conf below, why only the "/db/owa/pp_pack" Urls are sent to port 7126, but not the "/db/owa/PP_PACK" which go the the 7122.
    Thank's for your help.
    <IfModule mod_weblogic.c>
    <Location /db/owa/pp_pack>
    WebLogicHost lidanl.pt.ch
    WebLogicPort 7126
    SetHandler weblogic-handler
    Order allow,deny
    Allow from all
    </Location>
    <Location /db/owa/PP_PACK>
    WebLogicHost lidanl.pt.ch
    WebLogicPort 7126
    SetHandler weblogic-handler
    Order allow,deny
    Allow from all
    </Location>
    <Location /db>
    WebLogicHost lidanl.pt.ch
    WebLogicPort 7122
    Idempotent OFF
    SetHandler weblogic-handler
    Order allow,deny
    Allow from all
    </Location>
    </IfModule>

    Alex,
    I am facing the same problem as you. It works on certain machines but others.
    Would like to know the answer if you already have one. Thanks
    -Qi
    [email protected] (Alex) wrote:
    I am doing a migration from WLS 5.1 to WLS 6.1.
    My java clients (application for Java Web Start and usual applet)
    call to EJB.
    Both types of applications work fine in WLS 5.1
    as well as a standalone application in WLS 6.1.
    But in WLS 6.1 for Java Web Start application and applet I get an
    exception:
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    My code:
    properties = new Properties();
    properties.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, "t3://localhost:7001");
    Context ctx = new InitialContext(properties);
    Object ref = ctx.lookup("EBcatalog");
    System.err.println("Object returned by 'lookup' is of type: " +
    ref.getClass().getName());
    Object obj = PortableRemoteObject.narrow(
    ref, EBcatalogHome.class); /////////// Causes exception !!!!!
    PS. System.err.println writes "$Proxy1&" for standalone application in
    WLS 6.1 and for Java Web Start application and applet in WLS 5.1.
    It writes "weblogic.rmi.internal.StubInfo" for Java Web Start
    application and applet in WLS 6.1.
    What should I do? Thank in advance.
    Best Regards,
    Alex

  • Shared classes between webapplication and ejb

    Hello,
    If I have some java classes that are used by both WebApplication and EJB, do
    I have to include those classes into both war and jar files?
    Regards,
    Peter

    Yes accorinding to WLS Documentation
    --Naggi
    "Programming today is a race between software engineers
    striving to build bigger and better idiot-proof programs, and the universe
    trying to build bigger and better idiots.
    So far, the universe is winning."
    "Peter Tsang" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hello,
    If I have some java classes that are used by both WebApplication and EJB,do
    I have to include those classes into both war and jar files?
    Regards,
    Peter

  • Update EJB descriptor through JMX

    I specifically want to update the max-beans-in-free-pool value in the EJB descriptor. I am able to update this through the console, so I believe this should be possible through MBeans. Anyone know how to update this value through the use of MBeans?
    Thanks,
    Andree

    Thanks Dips,
    That sample pointed me to the correct classes and functions to use. I have one other problem though. I am able to use setMaxBeansInFreePool, and when I use getMaxBeansInFreePool, it shows the updated value. The problem I have is that it is not being updated in the actual weblogic-ejb-jar.xml and the console. Here is the following code I am using:
    MBeanHome home = null;
    String url = "t3://localhost:7001";
    String username = "weblogic";
    String password = "weblogic";
    EJBComponentMBean ejbmbean = null;
    EJBDescriptorMBean ejbDescMBean = null;
    WeblogicEJBJarMBean weblogicEjbJarMBean = null;
    try
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(username);
    env.setSecurityCredentials(password);
    Context ctx = env.getInitialContext();
    home = (MBeanHome) ctx.lookup("weblogic.management.adminhome");
    catch (Exception e)
    System.out.println("Exception caught: " + e);
    Set mbeanSet = home.getMBeansByType("EJBComponent");
    Iterator mbeanIterator = mbeanSet.iterator();
    while (mbeanIterator.hasNext())
    ejbmbean = (EJBComponentMBean) mbeanIterator.next();
    ejbDescMBean = ejbmbean.findOrCreateEJBDescriptor();
    weblogicEjbJarMBean = (WeblogicEJBJarMBean) ejbDescMBean.getWeblogicEJBJarMBean();
    int maxBeansInFreePool = weblogicEjbJarMBean.getWeblogicEnterpriseBeans()[0].getMessageDrivenDescriptor().getPool().getMaxBeansInFreePool();
    assertEquals(4, maxBeansInFreePool);
    weblogicEjbJarMBean.getWeblogicEnterpriseBeans()[0].getMessageDrivenDescriptor().getPool().setMaxBeansInFreePool(2);
    maxBeansInFreePool = weblogicEjbJarMBean.getWeblogicEnterpriseBeans()[0].getMessageDrivenDescriptor().getPool().getMaxBeansInFreePool();
    assertEquals(2, maxBeansInFreePool);
    Even though my JUnit asserts are true, when I go to the console, the maxBeansInFreePool is still 4, and the weblogic-ejb-jar.xml shows 4 also.
    Thanks,
    Andree

  • Diff b/w bc4j model and ejb model in adf11g

    hi all,
    iam murali iam new for adf 11g i have some dout's in adf11g ,can u please solve my probleam
    what is the difference b/w bc4j componet and ejb componet,how to develop ejb application in adf11g.

    ,how to develop ejb application in adf11gTake a look at this tutorial for starters:
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ejb/ejb.html

  • JDBC, JMS and EJB transactions - possible problem?

    Hello,
              I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
              XDoclet.
              In my current project I have the following piece of code
              in one of my message driven beans (code cited as pseudocode
              without unnecessary details):
              * @ejb.bean name="MyMessageProcessor"
              * display-name="Display name for a MyMessageProcessor"
              * jndi-name="ejb/MyMessageProcessor"
              * description="Bean MyMessageProcessor"
              * destination-type="javax.jms.Queue"
              * transaction-type="Container"
              * acknowledge-mode="Auto-acknowledge"
              * subscription-durability="Durable"
              * generate="false"
              * @ejb.transaction type="Required"
              public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
              public void onMessage(Message msg) {
                   try {
                        //obtaining connections to two different databases via JNDi
                        java.sql.Connection connOne =
                        ((DataSource)ctx.lookup("DataSourceOne")).getConnection();          
                        java.sql.Connection connTwo =
                             ((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
                        // performing some UPDATEs and INSERTs on connOne and connTwo
                        // calling some other methods of this bean
                        //creating the reply JMS message and sending it to another JMS queue
                        Message msgTwo = this.createReplyMessage(msg)
                        this.queueSender.send(msgTwo);
                        //commiting everything
                        this.queueSession.commit();          
                   } catch (Exception ex) {
                   try {
                        if (this.queueSession!=null) this.queueSession.rollback();
                   } catch (JMSException JMSEx) {};     
                   this.context.setRollbackOnly();
              Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
              connection pool with non-XA jdbc driver. Everything worked fine
              including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
              to database and the incomming message was thrown back to the my bean's
              queue).
              When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
              participate in a global transaction. When I changed both datasources
              to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
              EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
              and the JMS message wasn't resent to the JMS queue.
              So here are my questions:
                   1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
                   Are there any global server configurations, which may influence this situation?
                   2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
                   (of course, if necessary)?
                   3. Are there any JMS Queue settings, which would disable the container to send message back to the
                   queue in case of setRollbackOnly()? How should be the Queue configurated?
              As I am new to the topic and the deadline for the project seems to be too close I would be grateful
              for any help.
              This message was sent to EJB list and JDBC list.
              Sincerely yours,
              Marcin Zakidalski

    Hi,
              I found these information extremely useful and helpful.
              The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
              Anyway, I still have some problems. I have made some changes to the
              code cited in my previous mail. These changes included changing QueueSessions
              to non-transactional. I also set the "Honorate global transactions" to true.
              I am using XA JDBC driver. After setting "Enable local transactions" to false
              (I did it, because I assume that JDBC transactions should be part on the global
              EJB transaction) I got the following error:
              java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
              driver supports performing SQL operations with no global transaction, explicitly allow it by setting
              "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
              transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
              complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
              I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
              the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
              My questions are as follows:
              1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
              thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
              from doing that? Can using setAutocommit(true/false) change the situation for better?
              2. How to encourage the JDBC driver to be a part of EJB transaction?
              3. As I have noticed each of ejb method has its own transactions (transactions have different
              Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
              way that if already started transaction exists it is used by the called method?
              4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
              impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
              enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
              solved programmically?
              Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
              I am loosing the ability to perform all actions in one transaction.
              Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
              Marcin

Maybe you are looking for

  • Two Game Center Accounts on One Apple ID

    Hello, From the looks of things I'm the only one experiencing this issue and it's really starting to bug me out unfortunately. There's an APP that I use on my spare time. When I first installed the app it was registered under my Apple ID and Nickname

  • How to use "global variable" in Xcelsius ?

    HI experts, In our projects, many Xcelsius web pages on BusinessObjects enterprise may have the same year/month variable related to present, for example, 2009/02.  We want use this varible when the user open any Xcelsius web page. Can this be impleme

  • Can we writeoff/any other solution for difference amount in group currency?

    Hi All, One of the G/L account are getting difference between Local Currency (Co. Code Currency - CAD) and Group Currency (USD) as follows. Our Client wants to clear this amount in Group Currency (USD). Can any one help me out on this? Problem descri

  • Blue background?

    Is there a way in Pages to set a blue background on screen with white type?

  • Getting Data from 2 different table and saving it in the third table

    Hi, My question is i have 2 different table where the data is stored. And Nothing is at Level0 and i don't need it. Table A will be at Level1, this is a scroll and depending on this value the level2 grid will be populated with the values. Say for exa