Strut and EJB

Hi guys,
I am trying to call EJB in my strut action classes using @EJB and got the error java.lang.NullPointerException while I use InitialContext to lookup for the EJB manually it works. The error indicates, to me that the container did not inject the EJB object at the run time. Can anyone explain to me why using annotation to inject the EJB in action classes would not work? Am I doing something wrong?
Some environment info:
** Both my web application and EJB are on the same glassfish server
** The web application and EJB are not in the same .ear file, meaning they are separate applications
thanks in advance, Kenny
Edited by: user13433552 on 7/12/2010 16:36
Edited by: user13433552 on 7/12/2010 16:36

As far as I know, the JEE server can only inject into resources it "knows about", which are servlets, other EJBs, MDBs and for example JSF backing beans. Struts is not part of the JEE spec, so I guess it won't scan those classes.
But perhaps Struts itself has a mechanism to inject EJBs into an action class?

Similar Messages

  • 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

  • OC4J 9.0.3 and EJB 1.1 deployments???

    I can not deploy my ejb1.1 beans on 9.0.3 container.
    OC4J crashes with an XML parse error as a null pointer exception.
    If I remove my O-R mappings from my orion-ejb-jar.xml file, the container starts up ok (app wont run as it needs the mappings)
    9.0.3 docs claim I should be able to use my 1.1 ejb in this ejb 2.0 container.
    Solaris release notes for 9.0.3 claim I must migrate to ejb2.0
    Someone else posted this same question but got no replies.
    Anyone else deployed ejb1.1 with OR mappings in 9.0.3 successfully yet?
    thanks

    I have tried migrating to an ejb2.0 set of beans and ejb-jar.xml file.
    With no <query> tags installed for my finders I notice that a typical finder produces this:
    <!-- Generated SQL: "select Isp.isp_Id from Isp -->
    This is vastly different from the 1.1 orion-ejb-jar.xml which would list ALL column names in the finder - hence how am I going to do a findAll? The currently generated sql is way off. Deployment of the "ormap" demo also shows a lack of column names in the generated SQL finder methods in orion-ejb-jar.xml.
    Further, as soon as I introduce the query in the 2.0 version of ejb-jar.xml, the container dies with a null pointer exception. Removing this from the ejb-jar and bean deploys. Useless, cause theres no finders though.
    Also, attempts to add to the <finder-method query=...> tag yield container crashes with null pointers too.
    This is not very robust to say the least. Can you provide names of jar files that would cause such exceptions?
    When NO query tag is inserted in the ejb-jar file, attempts to run a sample client using findByPrimaryKey return successfully but use of findAll causes timeouts similar to whats described in
    "finders giving "timeout expired waiting for an instance" after 0, 1, or 2 calls" in this same forum.
    Heres the query out of the ejb-jar.xml file...
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params></method-params>
    </query-method>
    <ejb-ql>
    SELECT OBJECT(o) from IspTb o
    </ejb-ql>
    </query>
    IspTb is the <abstract-schema-name> Tables exist in db.
    The full error...which prevents deployment of the ejbs and hence no rewrite of the orion-ejb-jar file.
    =========
    10/23/02 1:54 PM: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
    10/23/02 1:54 PM: java.lang.NullPointerException
    10/23/02 1:54 PM: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
    10/23/02 1:54 PM: at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:135)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
    10/23/02 1:54 PM: at com.evermind.naming.ContextClassLoader.loadClass(ContextClassLoader.java:135)
    10/23/02 1:54 PM: at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getClass(PersistenceDescriptor.java:767)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getStateClass(PersistenceDescriptor.java:753)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getCMPFieldType(PersistenceDescriptor.java:1302)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.initializeFieldInfo(PersistenceDescriptor.java:1052)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getPersistentFieldInfo(PersistenceDescriptor.java:805)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.<init>(SQLGenerator.java:151)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:360)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:309)
    10/23/02 1:54 PM: at com.evermind.server.ejb.deployment.EJBPackage.translateEjbqlQeries(EJBPackage.java:2100)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.translateEjbqlQeries(Compilation.java:140)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:178)
    10/23/02 1:54 PM: at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:551)
    10/23/02 1:54 PM: at com.evermind.server.Application.postInit(Application.java:431)
    10/23/02 1:54 PM: at com.evermind.server.Application.setConfig(Application.java:136)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1635)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1585)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1240)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
    10/23/02 1:54 PM: at java.lang.Thread.run(Thread.java:479)
    10/23/02 1:54 PM: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getClass(PersistenceDescriptor.java:770)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getStateClass(PersistenceDescriptor.java:753)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getCMPFieldType(PersistenceDescriptor.java:1302)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.initializeFieldInfo(PersistenceDescriptor.java:1052)
    10/23/02 1:54 PM: at com.sun.enterprise.deployment.PersistenceDescriptor.getPersistentFieldInfo(PersistenceDescriptor.java:805)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.<init>(SQLGenerator.java:151)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:360)
    10/23/02 1:54 PM: at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:309)
    10/23/02 1:54 PM: at com.evermind.server.ejb.deployment.EJBPackage.translateEjbqlQeries(EJBPackage.java:2100)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.translateEjbqlQeries(Compilation.java:140)
    10/23/02 1:54 PM: at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:178)
    10/23/02 1:54 PM: at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:551)
    10/23/02 1:54 PM: at com.evermind.server.Application.postInit(Application.java:431)
    10/23/02 1:54 PM: at com.evermind.server.Application.setConfig(Application.java:136)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1635)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1585)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1240)
    10/23/02 1:54 PM: at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
    10/23/02 1:54 PM: at java.lang.Thread.run(Thread.java:479)

  • ABAP Objects and EJB

    Hi every one,
    Can <b>ABAP Objects and EJB</b> be compared?
    -Naveen.

    Hi Naveen,
    Check this guide- might be useful-
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/dc09af90-0201-0010-d09b-bd611a11070b
    Regards,
    Moorthy

  • Struts and JSF Integration in OPDk-java based portlet

    Hi,
    thanks in advance for your help.
    I'm developing a PDK java based portlet. For some reasons I cannot use the JSF bridge but I would like to integrate Struts and Jsf in my portlet, using Struts to manage actions and navigation and JSF (with ADF Faces components) for the view. I'm using the Strus-Faces library.
    When I try to submit my portlet form, I receive the error "request URL not found on this server". I'm posting some exstracts of my code.
    It's made of three pages: the main one "Integration1ShowPage", "error" and "result". The MainAction.java displays my mainPage, where there's a form. To keep it easy, when the user submits this form, the ActionName returns "success" and the "result" page should be displayed.
    The MainAction works properly: the portlet is displayed but when I tried to submit the form I receive
    The requested URL /provaDeploy/htdocs/integration1/integration1ShowPage.do was not found on this server.Could you please suggest me something?
    Many many thanks,
    B.
    <struts-config>
    <action-mappings>
      <action path = "/mainAction" type = "strutsjsfintegration1.MainAction">
        <forward name = "success" path = "/faces/htdocs/integration1/integration1ShowPage.faces"/>
      </action>
      <action path = "/nameAction" name = "nameForm"
      input = "/faces/htdocs/integration1/integration1ShowPage.faces" scope = "request"
      type = "strutsjsfintegration1.NameAction">
        <forward name = "success" path = "/faces/htdocs/integration1/result.faces"/>
        <forward name = "failure" path = "/faces/htdocs/integration1/error.faces"/>
        <forward name = "again" path = "faces/htdocs/integration1/integration1ShowPage.faces"/>
      </action>
    </action-mappings>
    <controller>
      <set-property property = "processorClass"
       value="org.apache.struts.faces.application.FacesRequestProcessor"/>
       </controller>
    <message-resources parameter="definitiveStrutsPortlet.ApplicationResources"/>
    </struts-config>

    Hi,
    have a look at this whitepaper for how to use JavaScript in ADF.
    http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    This link here (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html --> see sample 71) shows an integration sample between a Java Applet and ADF. Its a similar use case to yours
    Frank

  • Can Struts and JSF coexist?

    I have a Struts based application and now I want to build an additional module on top of that using pure JSF. My question is, can Struts and JSF co-exist in the same application? If yes, what are the cons of that approach? What are the places I need to tweak in the configuration files so that they work together?
    thanks,

    Hi,
    Yes they can coexist. Actually that's the approach recommended by Craig McClanahan. I have developed a full enterprise application (80% completed) which uses JSF in front and Struts in the back using Struts-Faces integration library (developed by Apache).
    So far I haven't faced any major issues with this approach. However, I haven't try using Struts validator on JSF objects.
    Read the article below on how to integrate JSF w/ Struts.
    http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk8.html

  • Using SWING and EJB

    Had nebody used Swing for GUI and EJBs for business logic. HEre i need to use Swing for gui rather than JSPs.
    Can nebody help??

    My question is ...
    How do u call EJBs from swing based applets..
    In J2EE transaction management cud be done at server side but how will we manage with the swing app??

  • Problems when using shared instances of struts and apache-commons?

    I found this worrisome statement on this page (http://struts.apache.org/1.3.8/userGuide/configuration.html) regarding sharing jar files across multiple applications:
    <i>When a class is loaded from a shared class loader, static variables used within that class become global as well. This can cause inter-webapp conflicts when the underlying code assumes that the statics are global only within a particular web applicaiton (which would be true if the class was loaded from the webapp class loader). There are many cases where the framework, and the Commons libraries it relies on, use static variables to maintain information that is presumed to be visible only within a single web application. <b>Sharing these JAR files can cause unwanted interactions, and probably cause incorrect behavior</b>.</i>
    For those of you currently using Struts and Apache Commons (and perhaps other open source libraries) have you run into any issues when sharing the jars amongst multiple applications?
    I would like to avoid having multiple applications loading their own copies of these libraries, for obvious reasons.  However, if there are issues with doing so, I may have to relax that position.

    To answer my own questions, while we didn't run into any issues with sharing Struts, it may be a good idea to incorporate the libraries directly into the web app if suspicious behaviour is observed by the application.
    Also, the taglib definitions could not be loaded from the referenced jar files - these had to be placed into the WEB-INF directory, which introduces a synchronization problem - you could conceivably have different versions of the tld's and the base libraries.

  • Login Box example and source code on adf struts and JSP

    Dear all..
    I want to make application using ADF struts and JSP using oracle 10g Jdeveloper.
    The user should login into the login box and verify everyone who has right to enter the home.jsp.
    Anybody could help me with the source code as well as the step by step explanation...
    I'm looking forward the help...

    http://www.oracle.com/technology/products/jdev/collateral/papers/10g/reviewer/viewlets/reviewer_struts_viewlet_swf.html

  • 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

  • ADF and EJB. Why so little samples / information

    Hi All,
    I was wondering if other JDev / ADF developers have the same feeling as me in regards to ADF / EJB.
    There is barely enough information and examples on using ADF with EJB. Seems that most examples and blogs are related to BC instead.
    I was reading an article (sorry, don't have the link to it) not long ago that an Oracle Executive was asked if BC or EJB was Oracle's future and EJB was the answer. However, that doesn't seem to be the what most blogs and sample are about.
    I know that BC has tight integration with ADF, but it's not a standards based back-end framework. We are locked in the ADF UI for all of our development, but not touching BC at all. All code is EJB compliant.
    So, my request is:
    - comments? do other developers out there feel the same way?
    - bloggers, the great articles from "Frank Nimphius" and "Andrejus Baranovskis", not to mention others, can you guys post a little more on using ADF with EJB?
    BTW: great article on that "http://www.oracle.com/technology/products/jdev/tips/fnimphius/ControlHintsWithPojos/controlHintsWithPojos.html" (How-to find and set control hints on POJO entities in bean Data Controls)
    Thanks and Regards
    Jonny Oenning

    Hi!
    I rised this issue long time ago - with TP3 I noticed regression in EJB/JPA support with ADFm (binding layer as referred by Shay). Following the development, I draw this conclusions:
    1. Oracle is oriented toward J2EE standards, including the strategic orientation to EJB/JPA. The team that managed JDev 11g initial development phases was oriented toward EJB (but was replaced/fired sometime between TP2 and TP3).
    2. Oracle decided that FMW 11g stack products as well as EBS migration from PL/SQL to EJB is not feasible in short time frame (I think that was poor judgment). So, the BCs got the push over the EJB and TP3/4 was biased toward BCs. Even the default Fusion technology stack is changed - in TP1/2 the Fusion Web project was ADF RC + EJB buy default and then changed to ADF RC + BC4J. Also the development guides were "rephrased".
    3. As BC4J are proprietary Oracle technology, the are lacking many J2EE standard features and many strong points of the modern multi-tier architecture. Many developers are witnessing the performance / scalability issues as the BC4J are basically a mutant: they are SQL based concept wrapped into EJB for deployment! But they are not relaying on proven scalable J2EE technologies (like JPA/JTA, object caching etc.). They are trying to reinvent the wheel, decalratively offering the heaven of J2EE multi-tear architecture to old fashion SQL-focused architects/developers. But it is just a marketing - the truth is that BC4J are not and cannot be the replacement for proven J2EE architecture. They are trying to mimic the concepts of J2EE (like object-entity mapping, like JTA/JPA, like scalability and caching, transparent web-services exposition etc.) but they are lagging behind even J2EE 1.4 and we are facing the J2EE 6 in few months!
    4. Oracle is aware that EJB is the future but they are trying to bridge the gap between their legacy code written mainly in PL/SQL. So they developed and they are developing the JDeveloper 11g in fashin that should support and serve for their primary goals - migration of their own old PL/SQL based products to new, J2EE, world (of BEA!).
    So, anyone who is expecting the that Oracle JDeveloper is what they are marketing (full scale J2EE IDE) - is going to waste some time and money waiting the Oracle to finish it's half-way migration from PL/QL and Forms/Reports to PL/SQL + ADF RC! In few years from now.
    Thus, if you need efficiency in J2EE standards development - try something else than JDeveloper. Or, as suggested by Shay, don't use overmarketed ADFm as it is not compatible with EJBs in scalable / clustered deployment! Yes, that is proven issue (but I wont elaborate here as it is already well elaborated in this forum in another tread but the Oracle guys wisely neglected that issue).
    And beside few very very old and for me useless blog entries (one of which is not working in 11g as you may read in comments) there will be no much support for EJBs in this release of JDeveloper - I can bet!
    But, as final message to the public, I'm still stuck with JDev and EJBs as. When you develop you own patterns, it is still the best combination for developing the scalable, high performance apps on Oracle FMW 11g platform - mandatory including several grid technologies that are making the difference in scalability of true J2EE apps and quasi-J2EE "Fusion" apps based on BC4Js "silently" wrapped in EJBs for deployment.
    Regards,
    PaKo

  • Using JMX to read ejb manifest jar and ejb-jar.xml in ejb jar inside ear

    Hello,
    I have an ear deployed on weblogic console. I need to check contents of manifest file and ejb-jar.xml of a jar that is present in the deployed ear.
    Currently I am using below code to access jar inside ear deployed :
    Hashtable env = new Hashtable(5);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    url);
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    mBeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    String type = "EJBComponentRuntime";
    Set beans = mBeanHome.getMBeansByType(type);
    try{
    for(Iterator it=beans.iterator();it.hasNext();)
    EJBComponentRuntimeMBean rt = (EJBComponentRuntimeMBean)it.next();
    if(rt.getParent().getName().equals("xxx")){
    System.out.println(rt.getName());
    l.add(rt.getName());
    Here xxx is the ear. Now I need to get inside the jar (represented) by variable rt and access its manifest file,ejb-jar.xml
    Does anyone have an idea how to do this?
    regards
    Sameer

    Isn't it possible to put them there manually? :)

  • SAS9.1 Persistence and EJB lookups (not registered in JNDI?)

    I am trying to deploy a very basic EJB3 module to test my learning. The module deploys via the Admin Console without apparnet error. Unfortunately, when using the generated test page for the web-service, I am having total failure which seems to be around the persistence unit and EJBs not being created in the JNDI.
    I have an @Stateless/@WebService bean:
    package com.flexit.buslogic;
    import java.util.logging.Level;
    import javax.ejb.Stateless;
    import javax.ejb.EJB;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import com.flexit.persistence.eao.OwnerFacade;
    @WebService
    @Stateless
    public class CreateOwner {
         @EJB
         private OwnerFacade ownerFacade;
         public CreateOwner(){}
         @WebMethod
         public Integer addOwner (
                   @WebParam(name="Name") String name){
             LogUtil.log("Add owner request " +
                        "received for "+name,
                        Level.INFO, null);
            return ownerFacade.findAll().size();
    }The OwnerFacade EJB injection fails with avax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJBIf I instantiate a 'normal' reference to OwnerFacade (ie OwnerFacade ownerFacade = new OwnerFacade(); I get a similar error in the OwnerFacade EJB in relation to an attempt to inject an EntityManager:
    package com.flexit.persistence.eao;
    import java.util.List;
    import java.util.logging.Level;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import com.flexit.persistence.LogUtil;
    import com.flexit.persistence.Owner;
    @Stateless
    public class OwnerFacade implements OwnerFacadeLocal, OwnerFacadeRemote {
         // fields
         @PersistenceContext(unitName="FlexIBuildPU")
         private EntityManager entityManager;
         public OwnerFacade () {
              if (entityManager == null) {
                   LogUtil.log("unable to get an Entity Manager Instance", Level.SEVERE, null);
    ...The constructor logs that the entityManager is, indeed, null.
    I have tried the code on SAS9 and 9.1 and using the default JavaDB and a MySQL connection pool (successful ping) and datasource (named 'jdbc/FlexDBDS') created through the Admin Console. The persistence unit is defined in a persistence.xml file in the META-INF folder:
    <?xml version="1.0" encoding="UTF-8"?>
         <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
              <persistence-unit name="FlexIBuildPU" transaction-type="JTA">
                   <jta-data-source>jdbc/FlexDBDS</jta-data-source>
              </persistence-unit>
    </persistence>Can anyone please save me from tearing my hair out (more)?

    Have managed to resolve. There were two problems
    First I was attempting to access a session bean directly rather than via an interface (eejit!) - ie:
    @EJB OwnerFacade ownerFacadewhen it should have been:
    @EJB OwnerFacadeLocal ownerFacadeSecond, the persistence unit wasn't created properly. In playing around with persistence.xml I moved from:
    <?xml version="1.0" encoding="UTF-8"?>
         <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
              <persistence-unit name="FlexIBuildPU" transaction-type="JTA">
                   <description>This unit manages BMS units, owners, offers, and acceptance.</description>
                   <jta-data-source>jdbc/FlexDBDS</jta-data-source>
                   <properties>
                          <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
                          <property name="toplink.ddl-generation" value="create-tables"/>
                     </properties>
              </persistence-unit>
    </persistence>to:
    <?xml version="1.0" encoding="UTF-8"?>
         <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
              <persistence-unit name="FlexIBuildPU" transaction-type="JTA">
                   <description>This unit manages BMS units, owners, offers, and acceptance.</description>
                   <jta-data-source>jdbc/FlexDBDS</jta-data-source>
                   <properties>
                          <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
                          <property name="toplink.application-location" value="C:\ddl\flexdb\"/>
                          <property name="toplink.create-ddl-jdbc-file-name" value="create.sql"/>
                          <property name="toplink.drop-ddl-jdbc-file-name" value="drop.sql"/>
                          <property name="toplink.ddl-generation.output-mode" value="both"/>
                          <property name="toplink.ddl-generation" value="create-tables"/>
                     </properties>
              </persistence-unit>
    </persistence>It seems the very action of writing the sql to file helps with the binding. It seems so extraordinary that I think I must of made another mistake which was corrected along the way. In any event, the properties specifying output files may prove useful to others. :)

Maybe you are looking for

  • A way to view your memory?

    hello all, so I saw recently that my hard drive space is getting rather crammed. and I am sure there is a ton of stuff I could delete, I just don't necessarily know what's really taking up the space. my question is, is there a way to easily view, the

  • Report Painter Tcode

    Hi, We are in the process of archiving some report painter reports, The Tcode was created in the Dev system  and moved to QA, but the archived program was directly created in the QA system, Now when we run the program thru SE38, we get the execute bu

  • FI-GL- FI Document mass change

    Hello friends, We are on ECC6 and having requirement from user to have field "VALUT - Value Date" in "Mass Change" option of FBL3n. Can any one give me solution to add VALUT field in mass change screen. Thanks, Parag +9120 9823053472

  • I am using iphone 5 and i didn't get notifications of whatapp,facebook,wechat

    i am using iphone 5 and i didn't get notifications of whatapp,facebook,wechat give me solution i also upgrad to ios7 but problem contui...

  • Photoshop CC Vector Shape Fill Defaults issue

    For some reason whenever I create a vector shape the default Fill is always Pattern instead of flat color.  It used to default to whatever the last style I used in CS6, but for some reason in CC no matter what all shapes I make are default ugly bubbl