@EJB annotation in entity bean does not work

I just started with ejb3. I have created a couple of beans. One session bean that looks like this:
@Stateless
public class MySessionBean implements MySession
     @Resource(name="jdbc/mydb")
     private DataSource myDB;
public void someMethod() {
myDB.getConnection()
This works great. The other bean is an entity bean, and there the resource injection doesn't work. It looks like this:
@Entity
public class MyEntityBean
@Resource(name="jdbc/mydb")
     private DataSource myDB;
public void someMethod() {
myDB.getConnection()
Is resource injection any different in an entity bean then in a session bean? Both beans belong to the same package and are in the same application, (ear). I have exactly the same problem with @EJB injection: it works fine in the session bean but not in the entity bean...
Any help is appreciated...
John

<code>
@Entity
@Table(name = "assetfault")
@NamedQueries( {@NamedQuery(name = ... )})
public class Assetfault implements Serializable {
@javax.ejb.EJB private com.novadent.data.assetmg.sessionbeans.AssetFacadeLocal aF;
@javax.ejb.EJB private com.novadent.data.assetmg.sessionbeans.AssetfaultFacadeLocal afF;
</code>
importing javax.ejb.EJB ?

Similar Messages

  • Creation of an existing entity bean does not throw a CreateException

    Hi.
    I am using update 1 with oracle 9i thin driver. I am currently working on a unit test that handles CreateExceptions if creation of a duplicate entity occurs. To test this I preloaded my db and then tried in my code to create an entity with the same primary key (a String). When I executed this test what I got back was not a CreateException but rather TransactionRollbackException with a nested SQLException that complained about a constraint violation (my primary key constraint). Looking at the logs it appears the that Persistance Manager or Transaction Manager just marched right on and tried to enter the db row even though a duplicate key was found.
    I should see a createException right? Here is my table:
    CREATE TABLE CREDIT_CARD (
    ID VARCHAR(10) NOT NULL,
    CONSTRAINT PK_CREDIT_CARD PRIMARY KEY (ID)
    and my test code:
    CreditCardLocalHome home = (CreditCardLocalHome)new javax.naming.InitialContext().lookup("java:comp/env/ejb/local/CreditCard");
    home.create("key");
    home.create("key");
    and this is the relavant error trace:
    [23/Nov/2003:01:40:29] SEVERE ( 5605): EJB5071: Some remote or transactional roll back exception occurred
    com.sun.jdo.api.persistence.support.JDODataStoreException: Got a JDBC SQLException. Please read the remaining error stack for more information.
    NestedException: java.sql.BatchUpdateException: ORA-00001: unique constraint (APP.PK_CREDIT_CARD) violated
    FailedObjectArray: [CreditCardEJB1720332142_JDOState@1c737be]
    at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeUpdateBatch(SQLStoreManager.java:1644)
    at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeBatch(SQLStoreManager.java:1559)
    at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.updatePersistent(SQLStateManager.java:997)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.beforeCompletion(PersistenceManagerImpl.java:1251)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.notifyBeforeCompletion(TransactionImpl.java:1115)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.commitBefore(TransactionImpl.java:743)
    at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.beforeCompletion(TransactionImpl.java:646)
    at com.sun.ejb.containers.ContainerSynchronization.beforeCompletion(ContainerSynchronization.java:105)
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:183)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:310)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:1809)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:1608)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:529)
    at CreditCardEJB1720332142_ConcreteImpl_LocalHomeImpl.create(CreditCardEJB1720332142_ConcreteImpl_LocalHomeImpl.java:34)
    at jasper.test_jsp._jspService(_test_jsp.java:69)
    As you can see I call the test via a jsp and that the transaction never seems to be mark as rollback. As a result the Persistance Manager tries to enter the row and fails.
    Any thoughts?
    Matt

    Hi, I'm having the same problems, but my table has several constraints (primary key, foreign key, and unique key) set up. I need to know exactly which constraint was violated so that I can return the inputted data that caused the violation in the error message (e.g. "Card No. 1234 already exists" or "User ABCD already exists").
    I want to avoid using vendor-specific code to catch the exception (which is thrown as a persistence manager exception), then later extract the parent exception (which I would try to cast as an SQLException and then work from there).
    If I follow marina's suggestion, then this means that I need to perform a findBy<myConstraintKey> method for every unique or primary key constraint I have set for my table. Is there another alternative? My concern is how this would affect application performance. Thanks.

  • XMLAnonymizerBean does not work properly

    Hi all,
    I do upgrade from 7.0 scenario to 7.1. In soap adapter I use mentioned module to send some namespaces. I used the same parameters as in 7.0 but that didn't work - all namespaces were cut. Then I spent 2 more hours testing the module and all I figured out was: if I use the module, all the namespaces are cut, if I dont - they present with ns1 prefix (the actual goal is to cut it).
    Any ideas why the bean does not work? It's a new PI installation, maybe some steps were missed on AE configuration phase?
    Thanks,
    Dmitriy

    Did you apply the latest patch for PI 7.1?
    I think there was an issue in SP 6.

  • Java bean, works in Integration Engine but does not work in Adapter Engine.

    In connection to the following thread:
    PayloadZipBean - variable filename inside the archive
    I am trying to use the same bean.
    However I can see, that the bean is working correctly when I use Integration Engine.
    But if I am using ICo (AAE) and using the same bean in the receiver, I can see, that the bean gets called but does not work correctly.
    The audit log added to my bean shows, that the bean could read the filename correctly from the Dyanic Config in the message, but it cannot write the same into the message.
    Could you please help on this?

    Your above posted system details show multiple Java Console extensions.
    You can uninstall (remove) the Java Console extensions and disable the Java Quick Starter extension, you do not need them to run Java applets.
    See http://kb.mozillazine.org/Java#Multiple_Java_Console_extensions
    See also http://www.java.com/en/download/help/quickstarter.xml - What is Java Quick Starter (JQS)? What is the benefit of running JQS? - 6.0
    Disable the Java Quick Starter extension: Tools -> Addons -> Extensions
    Control Panel -> Java -> Advanced tab -> Miscellaneous -> Java Quick Starter (disable)
    You can try a direct connection: <br />
    Control Panel > Java > General tab > "Network Settings...": "Direct Connection" (enable)

  • Css3 animation does not work when triggerd by backing bean method

    Hi,
    I use Jdev 11.1.1.4 (but I guess the Jdev/ADF version does not matter in this case) and Firefox 15.0.1.
    I tested some parts of article https://blogs.oracle.com/groundside/entry/css_animations_the_panel_flip from Duncan Mills.
    The CSS3 animation for styleClass "rotateOut" works fine when I trigger it from mouse hover.
    The problem is that the animation does not work when I set the styleclass in a backing bean.
    In this case the UI component to rotate (in my case the calender component) changes immediatelly to the transition target without the transition-duration of 2 seconds and therefor there is no animation effect visible for the user.
    Here the backing bean code:
        public void doRotate() {
           afCalender.setStyleClass("rotateOut");
           AdfFacesContext.getCurrentInstance().addPartialTarget(getAfCalender());
        }Here the skin:
      .rotateOut {
        -moz-transition-property: -moz-transform;
        -moz-transition-delay: 2s;
        -moz-transform: rotateY(45deg);
        -moz-transition-timing-function: ease-in-out;
        -moz-transition-duration: 2s;
      .rotateReturn {
        -moz-transition-property: -moz-transform;
        -moz-transform: rotateY(0deg);
        -moz-transition-timing-function: ease-in-out;
        -moz-transition-duration: 2s;
      }In Duncan's article java script is used to change the style class.
    Does the CSS3 animation only work when java script is used to change the style class or shoud java in a backing bean also work?
    Any hints?
    regards
    Peter

    I have tested several other settings but no success.
    Any ideas?
    regards
    Peter

  • @Intertseptors does not work for web bean (for JSF page)

    @Named
    @ConversationScoped
    @Interceptors(MyInterceptor.class)
    public class BeanWeb implements Serializable {
        public String methodThrowException throws Exception() {
            throws new Exception();
    public class MyInterceptor {
        @AroundInvoke
        public Object intercept(InvocationContext ic) throws Exception {
            try {
                return ic.proceed();
            } catch (Exception e) {
                return null;
    }For @Stateless beans interceptor works, but for the BeanWeb interceptor does not work. And we have never entered into "intercept" method.
    1. Why is this happening?
    2. How could intercept method calls in BeanWeb?
    P.S.: All this spin under Glassfish 3.x.

    All the links on this page work for me. Did you empty your browser cache before visiting the published site?

  • @Id does not work with @Enumerated

    Hi,
    I am using an EJB that has a field annotated with @Id and @Enumerated. However, if I query a simple dataset, the dataset is not found:
    Here is the part of the code of the Entity Bean:
    @Entity     // Set in deployment descriptor
    public class Country implements Serializable
    private static final long serialVersionUID = 1L;
    @Enumerated(EnumType.STRING)
    @Id
    private ISO31661Country id;
    private int priority;
    }Here is the Enumeration:
    public enum EISO31661Country
    AUT,
    BEL,
    BGR,
    }Here is the code of the Stateless Bean where I do the query:
    public Country getCountry(ISO31661Country id)
    // This method always returns null, I do not know why ?!?
    return entityManager.find(Country.class, id);
    }So the entity manager does not find any entity. When I reset the id to a different field, it works however:
    @Enumerated(EnumType.STRING)
    private ISO31661Country id;
    @Id
    private int priority;If I now query for a priority, the entity manager finds the corresponding entity.
    It seems that @Id and @Enumerated do not work together?
    Did anyone see such a problem before?
    Can anyone give me an anser?
    Thank you for help,
    wasu

    I don't think that enumerated types can be used as primary keys. The primary key (individual or parts of a composite) must be a Java primitive, wrapper, String, or Date (with restrictions).
    Change your annotation to use a String for the @Id and do a conversion to and from the enumerated type in get/setCountry().

  • Em.merge does not work while em.persist does?

    Hello,
    I have a stateless session bean with code snippets below.
        @PersistenceContext
        private EntityManager em;
        public void setList(ContainerList list, int key) {
            ContainerList stored = (ContainerList)em.find(ContainerList.class, key);
            list.setId(key);
            if (stored == null) { em.persist(list); }
            else {
                em.merge(list); // 1st alternative
    //            stored.copy(list); // 2nd alternative
    ...When I call the method setList for a non existing key, the entity is stored in the database. When I call the method for an existing key, the old value is not updated by the new, i.e. the merge method has no effect. If I comment out the 2nd alternative, it has no effect either. Does anyone has an idea why this does not work? I am using Netbeans 5.5 and 5.5.1 release candidate 1. (With the included application server.)

    Hello,
    I will try to summarise my knowledge of the JAVA persistence API as the documentation is not always clear and may be misleading.
    In SQL you have 4 main statements: INSERT, SELECT, UPDATE and DELETE.
    with
    @PersistenceContext
    private EntityManager em;some documentation appears to make the following associations:
    em.persist(Object entity) -> INSERT
    em.find(Class entityClass, Object primaryKey) -> SELECT
    em.merge(Object entity) -> UPDATE
    em.remove(Object entity) -> REMOVE
    However, practice shows that this is NOT the case!
    em.merge(Object entity) does exactly the same thing as em.find(Class entityClass, Object primaryKey)! The only difference is that the em.merge(Object entity) method takes a detached object of the entity class as argument with the same primary key as the attached object you are loading.
    Detached objects are objects of the entity class the database manager is not aware of. Attached objects are objects in the database and are managed by the persistence context. Every newly created object of an entity class is detached. You can attach them to the database with the em.persist(Object entity) method call. Attached objects can be retrieved with the em.find(Class entityClass, Object primaryKey) or with the em.merge(Object entity) method. All changes made to attached objects are automatically stored in the database. There thus is no explicit method for the UPDATE statement. You just make changes to attached objects and the entity manager copies the changes to the database (at the end of the persistence context). An easy way to make all the changes you need at once is to have a detached object that contains the right values and then copy all these values to the associated attached object with a self defined copy method in the entity class as in
       Entity detached;
    // --> begin persistence context
       Entity attached = em.merge(detached);
       attached.copy(detached);
    // <-- end persistence contextIf you are working with session beans, the persistence context standard begins with the beginning of a transaction and ends with the end of a transaction. A transaction standard begins with the start of a session bean method and ends with the session bean method. If you choose to, you can make the persistence context of type extended with
    @PersistenceContext(type=PersistenceContextType.EXTENDED)
    private EntityManager em;In this case, the persistence context ends when the session bean is removed from the EJB container. (Can be useful to keep attached entities in the state of an stateful session bean.)
    Without session beans, you have to declare explicitely the start and end of a persistence context or transaction, but I refer to existing documentation for this, as I do not actively know how to handle things without session beans.
    Finally, the methods em.persist(Object entity) and em.merge(Object entity) use a detached object as argument, while em.remove(Object entity) uses an attached object as argument (using a detached object results in an Exception thrown).
    I hope this makes some things clear

  • Deploying EJB 3.0 entity beans without a Datasource

    [Cross-posted from the TopLink list]
    My question: Is there any way to configure the container or persistence provider to defer trying to connect to the Datasource until I make some call that involves persistence? Or any other way to deploy an app containing entity beans without having a database configured?
    Background: I am working on a component that can be configured to run in either persistent or in-memory mode. For the persistent mode we would like to use EJB 3.0 entity beans; for the in-memory mode we would like the component to be deployable without having to have a database available.
    However in my prototype of the application, when I try to deploy to OC4J 10.1.3, as soon as the entity beans are detected the TopLink persistence provider tries to establish a connection to the db via either the configured or default DataSource. So if the db is unavailable, deployment fails. Since this is occuring at deployment, it happens regardless of whether I am actually using any persistence features or not.

    Hi,
    I'm experiencing same problems, is this a bug or an feature?

  • For what reason on my tablet with OS Android 4.1 does not work flash on the sites?

    Hi! I recently bought a Google Nexus 7 tablet with Android 4.1 operating system and on my tablet does not work flash sites. Why adobe does not release a new version of flash for android 4.1? Why it was necessary to buy a company Macromedia, if adobe does not want to develop web technology? I think against Adobe can sue for violation of antitrust

    I found this for example:
    http://www.slashgear.com/adobe-no-jelly-bean-flash-flash-player-pulled-altogether-august-1 5-29236404/

  • Select All in a table does not work for Drag and Drop

    Hi. I am using Jdeveloper 11.1.1.2 but have also reproduced in 11.1.1.3.
    I am trying to implement drag and drop rows from one table to another. Everything works fine except when I do a Select All (ctrl-A) in a table, the table visually looks like all rows are selected, but when I try to click on one of the selected rows to drag to the other table, only the row I click on is dragged.
    I tried setting Range Size -1, fetch mode to FETCH_ALL, content delivery to "immediate" but nothing works.
    I even have reproduced not using a view object but just a List of beans with only 5 or 10 beans showing in the table.
    Does anyone know how to get Select All to work for a Drag Source?
    Thanks.
    -Ed

    Frank-
    OK, thanks for looking into that. I also submitted this service request, which includes a simple sample app to demonstrate the problem:
    SR #3-2387481211: ADF Drag and Drop does not work for rows in table using Select All
    Thanks again for the reply.
    -Ed

  • Visible attribute does not work for af:showDetailItem using EL

    I cannot get the visible attribute to work using EL and ppr.
    Here is a simple test. I have a jspx with a button (cb1) that toggles a boolean (tab1visible) in a Backing Bean. The af:panelTabbed and af:showDetailItem have partialTriggers="cb1".
    The af:showDetailItem has visible="#{TabTestBk.tab1visible}" and the EL is also set in the title so that I can see how it's set.
    When I press the button (cb1) the visibility of the tab does not change but the title does.
    Any help would be greatly appreciated!
    Here is the code:
    ------------------------- JSPX -----------------------------------------------------
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document>
    <af:form>
    <af:spacer height="10"/>
    <af:commandButton text="Toggle Tab 1 - visible = #{TabTestBk.tab1visible}" binding="#{TabTestBk.cb1}"
    id="cb1"
    actionListener="#{TabTestBk.toggleTab1AL}"/>
    <af:spacer height="20"/>
    <af:panelTabbed id="detailNavPane" partialTriggers="cb1">
         <af:showDetailItem id="tab1" visible="#{TabTestBk.tab1visible}" text="Tab 1 visible = #{TabTestBk.tab1visible}" partialTriggers="cb1">
                                  <af:outputText value="Tab 1 Content"/>
    </af:showDetailItem>
    <af:showDetailItem id="tab2" text="Tab 2">
                                  <af:outputText value="Tab 2 Content"/>
    </af:showDetailItem>
    <af:showDetailItem id="tab3" text="Tab 3">
                                  <af:outputText value="Tab 3 Content"/>
    </af:showDetailItem>
    </af:panelTabbed>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    ------------------------- BACKING BEAN -----------------------------------------------------
    package com.riscs.ui.backing.jsp.claim;
    import javax.faces.event.ActionEvent;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    public class TabTestBk {
    private RichCommandButton cb1;
    private boolean tab1visible = true;
         public void toggleTab1AL(ActionEvent event) {
              setTab1visible(!tab1visible);
         public void setTab1visible(boolean tab1visible) {
              this.tab1visible = tab1visible;
         public boolean isTab1visible() {
              return tab1visible;
    public void setCb1(RichCommandButton cb1) {
    this.cb1 = cb1;
    public RichCommandButton getCb1() {
    return cb1;
    Thanks!
    Matt
    Edited by: Matt Cannon IBI on Apr 3, 2010 2:45 PM
    Edited by: Matt Cannon IBI on Apr 5, 2010 12:20 AM

    Hi Frank,
    Thanks for the reply! When providing the simple example I left partialSubmit="true" off by mistake... I put it on and still does not work...
    Thanks,
    Matt

  • EJB 3.0 Entity Bean

    Hi Friends,
    I am Facing a problem in EJB 3.0 Entity Bean. I am Using Eclipse 3.3.2 and JBoss 4.2 Application Server. Im getting the error such as *"javax.naming.NameNotFoundException: EntityBean not bound"* when im trying to lookup the entity bean. Herewith i had attached the servlet code. Can anyone suggest me.
    package common;
    import java.io.IOException;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import example.BookRemote;
    public class CounterServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
    static final long serialVersionUID = 1L;
    private BookRemote hello;
         public CounterServlet() {
              super();
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              try
         InitialContext ctx = new InitialContext();
         hello = (BookRemote) ctx.lookup("EntityBean/remote");
         hello.test();
         Integer count = 1;
         request.setAttribute("counter", count);
         request.getRequestDispatcher("result.jsp").forward(request, response);
         catch (NamingException e)
         e.printStackTrace();
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
         }

    I think the Bean haven't been registered. I had look into the jmx-console and this is the result which i have got for my sample application (EntityBean).
    java:comp namespace of the EntityBean.ear/EntityBeanWeb.war application:
    +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
    +- env (class: org.jnp.interfaces.NamingContext)
    | +- security (class: org.jnp.interfaces.NamingContext)
    | | +- realmMapping[link -> java:/jaas/other] (class: javax.naming.LinkRef)
    | | +- subject[link -> java:/jaas/other/subject] (class: javax.naming.LinkRef)
    | | +- securityMgr[link -> java:/jaas/other] (class: javax.naming.LinkRef)
    | | +- security-domain[link -> java:/jaas/other] (class: javax.naming.LinkRef)
    Global JNDI Namespace
    +- persistence.units:ear=EntityBean.ear,unitName=CounterServlet (class: org.hibernate.impl.SessionFactoryImpl)
    +- persistence.units:ear=TaskEnitity.ear,unitName=FirstEjb3Tutorial (class: org.hibernate.impl.SessionFactoryImpl)
    +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
    +- jmx (class: org.jnp.interfaces.NamingContext)
    | +- invoker (class: org.jnp.interfaces.NamingContext)
    | | +- RMIAdaptor (proxy: $Proxy48 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
    | +- rmi (class: org.jnp.interfaces.NamingContext)
    | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
    +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
    +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
    +- UserTransactionSessionFactory (proxy: $Proxy14 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
    +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
    +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
    +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
    +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
    +- OnlineSurveyTool (class: org.jnp.interfaces.NamingContext)
    | +- RegisterBean (class: org.jnp.interfaces.NamingContext)
    | | +- remote (proxy: $Proxy79 implements interface online.IRegister,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
    | +- OnlineSurveyBean (class: org.jnp.interfaces.NamingContext)
    | | +- remote (proxy: $Proxy75 implements interface online.OnlineSurveyRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
    +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
    +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
    +- queue (class: org.jnp.interfaces.NamingContext)
    | +- A (class: org.jboss.mq.SpyQueue)
    | +- testQueue (class: org.jboss.mq.SpyQueue)
    | +- ex (class: org.jboss.mq.SpyQueue)
    | +- DLQ (class: org.jboss.mq.SpyQueue)
    | +- D (class: org.jboss.mq.SpyQueue)
    | +- C (class: org.jboss.mq.SpyQueue)
    | +- B (class: org.jboss.mq.SpyQueue)
    +- topic (class: org.jnp.interfaces.NamingContext)
    | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
    | +- testTopic (class: org.jboss.mq.SpyTopic)
    | +- securedTopic (class: org.jboss.mq.SpyTopic)
    +- console (class: org.jnp.interfaces.NamingContext)
    | +- PluginManager (proxy: $Proxy49 implements interface org.jboss.console.manager.PluginManagerMBean)
    +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
    +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
    +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
    +- persistence.units:unitName=TestServlet (class: org.hibernate.impl.SessionFactoryImpl)
    +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
    +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean BranchDescFlex. If this in not intended, please go back to correct the data or contact your Systems Administrator for assi

    Hi ,
    We have enabled context sensitive DFF in Bank Branch Page for HZ_PARTIES DFF , We have created Flex Map so that only bank branch context fields are only displayed in the bank branch page and  as we know party information DFF is shared by supplier and Customer Page so we dint want to see any Bank Branch fields or context information in those pages.
    We have achieved the requirement but when open existing branches bank branch update is throwing below error message :
    "The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean BranchDescFlex. If this in not intended, please go back to correct the data or contact your Systems Administrator for assistance."
    this error is thrown only when we open existing branches, if we save existing branch and open then it is not throwing any error message.
    Please let us know reason behind this error message.
    Thanks,
    Mruduala

    You are kidding?  It took me about 3 minutes to scroll down on my tab to get to the triplex button!
    Habe you read the error message? 
    Quote:
    java.sql.SQLSyntaxErrorException: ORA-04098: trigger 'PMS.PROJECT_SEQ' is invalid and failed re-validation
    Check the trigger and it should work again.
    Timo

  • This.print(pp) with interactive type silent or automatic does not work  after upgrade acrobat reader 9 to acrobat reader 11

    After an upgrade of acrobat reader 9 to acrobat reader 11 the automatic printing of a pdf. The pdf is opened, but the print does not happen. With acrobat reader 9 it works. But with acrobat reader 11 the printing does not happen.
    I discovered when you specify pp.constants.interactionLevel.full it works on acrobat reader 11. But when you specify pp.constants.interactionLevel.silent or pp.constants.interactionLevel.automatic it does not work on acrobat reader 11. But with the full option we have a dialog  print box
    we do not want.
    In our jsp we load a pdf document and create a message handler to detect the print events of a pdf document that is in an <object> tag.
    In the pdf document we add
    package be.post.lpo.util;
    import org.apache.commons.lang.StringEscapeUtils;
    import org.apache.commons.lang.StringUtils;
    public class AcrobatJavascriptUtil {  
        public String getPostMessageToHostContainer(String messageName, String messageBody){
            return "var aMessage=['"+messageName+ "', '"+ messageBody+"'];this.hostContainer.postMessage(aMessage);";
        public String getAutoPrintJavaScript(String interactiveType, String printerName,String duplexType) {    
            String interactiveTypeCommand = "";
            if (StringUtils.isNotBlank(interactiveType)){
                interactiveTypeCommand = "pp.interactive = " + interactiveType + ";";
            String duplexTypeCommand = "";
            if (StringUtils.isNotBlank(duplexType)){
                duplexTypeCommand = "pp.DuplexType = " + duplexType + ";";
            return "" + // //
                    "var pp = this.getPrintParams();" + // //
                    // Nointeraction at all dialog, progress, cancel) //
                    interactiveTypeCommand + //
                    // Always print to a printer (not to a file) //
                    "pp.printerName = \"" + StringEscapeUtils.escapeJavaScript(printerName) + "\";" + //
                    // Never print to a file. //
                    "pp.fileName = \"\";" + //
                    // Print images using 600 DPI. This option MUST be set or some barcodes cannot //
                    // be scanned anymore. //
                    "pp.bitmapDPI = 600;" + //
                    // Do not perform any page scaling //
                    "pp.pageHandling = pp.constants.handling.none;" + //
                    // Always print all pages //
                    "pp.pageSubset = pp.constants.subsets.all;" + //
                    // Do not autocenter //
                    "pp.flags |= pp.constants.flagValues.suppressCenter;" + //
                    // Do not autorotate //
                    "pp.flags |= pp.constants.flagValues.suppressRotate;" + //
                    // Disable setPageSize i.e. do not choose paper tray by PDF page size //
                    "pp.flags &= ~pp.constants.flagValues.setPageSize;" + //
                    // Emit the document contents. Document comments are not printed //
                    "pp.printContent = pp.constants.printContents.doc;" + //
                    // printing duplex mode to simplex, duplex long edge, or duplex short edge feed //
                    duplexTypeCommand +
                    // Print pages in the normal order. //
                    "pp.reversePages = false;" + //
                    // Do the actual printing //
                    "this.print(pp);";
    snippets for java code that adds
    package be.post.lpo.util;
    import org.apache.commons.lang.StringUtils;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.pdf.PdfAction;
    import com.lowagie.text.pdf.PdfDestination;
    import com.lowagie.text.pdf.PdfImportedPage;
    import com.lowagie.text.pdf.PdfName;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    public class PdfMergerUtil{
        private static final PdfName DID_PRINT = PdfName.DP;
        private static final PdfName WILL_PRINT = PdfName.WP;
        private List<PdfActionJavaScriptHolder> actionJavaScripts = new ArrayList<PdfActionJavaScriptHolder>();
        private class PdfActionJavaScriptHolder{
            private final PdfName actionType;
            private final String javaScript;
            public PdfActionJavaScriptHolder(PdfName actionType, String javaScript) {
                super();
                this.actionType = actionType;
                this.javaScript = javaScript;
            public PdfName getActionType(){
                return this.actionType;
            public String getJavaScript(){
                return this.javaScript;
        public void writePdfs(OutputStream outputStream, List<InputStream> documents, String documentLevelJavaScript) throws Exception {
            Document document = new Document();
            try {          
              // Create a writer for the outputstream
              PdfWriter writer = PdfWriter.getInstance(document, outputStream);
              document.open();      
              // Create Readers for the pdfs.
              Iterator<PdfReader> iteratorPDFReader = getPdfReaders(documents.iterator());
              writePdfReaders(document, writer, iteratorPDFReader);
              if (StringUtils.isNotBlank(documentLevelJavaScript)){
                  writer.addJavaScript(documentLevelJavaScript);
              addAdditionalActions(writer);
              outputStream.flush();      
            } catch (Exception e) {
                e.printStackTrace();
                throw e;
            } finally {
                if (document.isOpen()){
                    document.close();
                try {
                    if (outputStream != null){
                        outputStream.close();
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                    throw ioe;
        public void addAdditionalDidPrintAction(String javaScript){
            actionJavaScripts.add(new PdfActionJavaScriptHolder(DID_PRINT, javaScript));   
        public void addAdditionalWillPrintAction(String javaScript){
            actionJavaScripts.add(new PdfActionJavaScriptHolder(WILL_PRINT, javaScript));   
        private void writePdfReaders(Document document, PdfWriter writer,
                Iterator<PdfReader> iteratorPDFReader) {
            int pageOfCurrentReaderPDF = 0;      
              // Loop through the PDF files and add to the output.
              while (iteratorPDFReader.hasNext()) {
                PdfReader pdfReader = iteratorPDFReader.next();
                // Create a new page in the target for each source page.
                while (pageOfCurrentReaderPDF < pdfReader.getNumberOfPages()) {
                  document.newPage();
                  pageOfCurrentReaderPDF++;          
                  PdfImportedPage page = writer.getImportedPage(pdfReader, pageOfCurrentReaderPDF);
                  writer.getDirectContent().addTemplate(page, 0, 0);          
                pageOfCurrentReaderPDF = 0;
        private void addAdditionalActions(PdfWriter writer) throws DocumentException{
            if (actionJavaScripts.size() != 0 ){
                PdfAction action = PdfAction.gotoLocalPage(1, new PdfDestination(PdfDestination.FIT), writer);
                writer.setOpenAction(action);
                for (PdfActionJavaScriptHolder pdfAction : actionJavaScripts ){
                    if (StringUtils.isNotBlank(pdfAction.getJavaScript())){
                        action = PdfAction.javaScript(pdfAction.getJavaScript(), writer);
                        writer.setAdditionalAction(pdfAction.getActionType(), action);
        private Iterator<PdfReader> getPdfReaders(Iterator<InputStream> iteratorPDFs) throws IOException {
            List<PdfReader> readers = new ArrayList<PdfReader>();
              while (iteratorPDFs.hasNext()) {
                InputStream pdf = iteratorPDFs.next();
                PdfReader pdfReader = new PdfReader(pdf);
                readers.add(pdfReader);        
            return readers.iterator();
    JSP code
    <script type="text/javascript" src="<bean:message key="scripts.js.internal.jquery" bundle="app"/>"></script>
        <script language="javascript">
        function goToDidPrintUrl(){
            var url = "<%=didPrintUrl%>";
            window.location.assign(url);
        function createMessageHandler() {
            var PDFObject = document.getElementById("myPdf");
            PDFObject.messageHandler = {
                onMessage: function(msg) {
                     if (msg[0] == "WILL_PRINT"){      
                        $("#printingTransitFeedBackMessage").text('<%=willPrintMessage%>');                   
                     if(msg[0] == "DID_PRINT"){
                        $("#printingTransitFeedBackMessage").text('<%=didPrintMessage%>');               
                        setTimeout('goToDidPrintUrl()',4000);
                onError: function(error, msg) {
                    alert(error.message);
        </script>
    </head>
    <body onLoad="createMessageHandler();">
    <div id="printingTransitFeedbackArea">
      <div class="info" id="printingTransitFeedBackMessage"><%=documentOpenMessage%></div>
    </div>
    <object id="myPdf" type="application/pdf" width="100%" height="100%"  data="<%=toBePrintedUrl%>">
    </object>
    </body>

    From the JS API Reference of the print method:
    Non-interactive printing can only be executed during batch, console, and menu
    events.
    Outside of batch, console, and menu events, the values of bUI and of interactive are ignored
    and a print dialog box will always be presented.

Maybe you are looking for