EJB/JPA Session/Entity Bean: Back Reference Id not set

Hello All,
I m using JPA as a persist tool. I have an entity Account and in Account there is a collection of entity AccountDetail. In Account entity relation for AccountDetail is One-To-Many and in AccountDetail the relation for Account is Many-To-One. When i save the Account, object of Account and AccountDetail are saved correctly. But the problem is that in AccountDetail the Id of Account is not saved in Database table. I have AccountId in AccountDetail table. plz help me??
Second thing is that how to generate automatically primary keys when entity saved in database ???

define the column you want to auto increment as an Integer with Identity attribute set to True (using the sql server management tool for example) and then put
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
in front of the ID declaration in the mapping file, it should generate the IDs automatically.

Similar Messages

  • Strange Session/Entity Bean Cross-Instance Calls in Cluster

    In one of our enviroments, we are seeing session entity bean cross-instance
              calls that are hard to explain. The following is our configuration:
              The cluster contains 4 instances on 2 machines (2 on each machine). The same
              beans are deployed to each instance. "jndi.properties" is on the classpath
              for the each instance with jndi provider url = mach1inst1-ip, mach1inst2-ip,
              mach2inst1-ip, mach2inst2-ip:70001. Same servlets are also deployed to each
              instances.
              Requests from the web are load balanced through weblogic's proxy plugin for
              IPlanet and are forwarded to the 4 weblogic cluster instances. The servlet
              processing the requests calls a stateless session bean which uses an entity
              bean. The entity bean is configured with "home-is-clusterable" set to
              "false".
              What we have observed is that when all 4 instances are up, sometimes (even
              when the load is not high) the session bean is accessing entity bean from an
              instance on one machine to an instnace on another machine, while if only one
              machine (with 2 instances) is up, we don't see such calls.
              My theory is that because the jndi provider url is the same for all
              instances, the jndi lookup from each instance goes to the instance bound to
              the first IP specified in the provider url: machine 1 istance 1. If the
              request is from machine 2, because of co-location optimization, even though
              the home stub is from machine 1 instance 1, the session bean returned from
              the home stub actually is from machine 2. However, when the session bean
              does jndi lookup to get an entity bean home, the home stub is from machine 1
              and instance 1. And unfortunately, because the entity bean home is not
              clusterable, the stub can only point back to machine 1, co-location can not
              work. Thus entity bean from machine 1 is referenced by the session bean
              located on machine 2. I do not have a chance to verify this. But it seems to
              make sense to me.
              Unfortunately, I don't feel that I have a theory to explain why we don't see
              cross instance session entity bean calls when only 1 machine is up (with 2
              instances).
              Any ideas or hints would be greatly appreciated.
              Thanks,
              David Chen
              

    rs = stmt.executeQuery() , insert statement is not a query. So use executeUpdate.

  • 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)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Deployment descriptor error for an EJB 3.0 entity bean module

    Hi all,
    i'm facing an error deploying an EJB 3.0 entity bean module wrapped in an enterprise application on WebLogic 10.
    The application is composed as follows:
    WASEnterprise.ear
    |-META-INF
    |-application.xml
    |-WAS.jar
    |-META-INF
    |-persistence.xml
    In other words the application server is unable to load persistence.xml deployment descriptor and,during deployment, it throws an error message like this:
    <Error> <J2EE> <BEA-160197> <Unable to load descriptor C:\bea\user_projects\domains\base_domain\autodeploy\WASEnterprise\WAS/META-INF/persistence.xml of module WAS. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed
    I suppose that the persistence.xml is correct since i can deploy the application on jboss without any problem.
    The persistence.xml deployment descriptor is:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence>
    <persistence-unit name="CNT4">
    <non-jta-data-source>cnt5ds</non-jta-data-source>
    <class>it.eni.italgas.was.db.entity.AsiDisco</class>
    <class>it.eni.italgas.was.db.entity.AsiErrori</class>
    <class>it.eni.italgas.was.db.entity.WasAsiRouting</class>
    <class>it.eni.italgas.was.db.entity.WasAsiRoutingId</class>
    <class>it.eni.italgas.was.db.entity.WasAsiSchemas</class>
    </persistence-unit>
    </persistence>
    and the application.xml deployment descriptor is:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd">
    <display-name>WASEnterprise</display-name>
    <module id="myeclipse.1188512259959">
    <ejb>WAS.jar</ejb>
    </module>
    </application>
    I don't use any other weblogic specific deployment descriptor.
    Have you ever experienced such a strange behaviour? Can you suggest something to solve the problem?
    Thanks inadvance.
    Denis Maggiorotto

    Hi all,
    i'm facing an error deploying an EJB 3.0 entity bean module wrapped in an enterprise application on WebLogic 10.
    The application is composed as follows:
    WASEnterprise.ear
    |-META-INF
    |-application.xml
    |-WAS.jar
    |-META-INF
    |-persistence.xml
    In other words the application server is unable to load persistence.xml deployment descriptor and,during deployment, it throws an error message like this:
    <Error> <J2EE> <BEA-160197> <Unable to load descriptor C:\bea\user_projects\domains\base_domain\autodeploy\WASEnterprise\WAS/META-INF/persistence.xml of module WAS. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed
    I suppose that the persistence.xml is correct since i can deploy the application on jboss without any problem.
    The persistence.xml deployment descriptor is:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence>
    <persistence-unit name="CNT4">
    <non-jta-data-source>cnt5ds</non-jta-data-source>
    <class>it.eni.italgas.was.db.entity.AsiDisco</class>
    <class>it.eni.italgas.was.db.entity.AsiErrori</class>
    <class>it.eni.italgas.was.db.entity.WasAsiRouting</class>
    <class>it.eni.italgas.was.db.entity.WasAsiRoutingId</class>
    <class>it.eni.italgas.was.db.entity.WasAsiSchemas</class>
    </persistence-unit>
    </persistence>
    and the application.xml deployment descriptor is:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd">
    <display-name>WASEnterprise</display-name>
    <module id="myeclipse.1188512259959">
    <ejb>WAS.jar</ejb>
    </module>
    </application>
    I don't use any other weblogic specific deployment descriptor.
    Have you ever experienced such a strange behaviour? Can you suggest something to solve the problem?
    Thanks inadvance.
    Denis Maggiorotto

  • 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?

  • I took my iMac to be fixed and when i got it back, mail was not set up. I called Apple Support and they helped me set up mail. Then the emails went to trash on the iMac and on the MacBook Pro (same emails). There are no numbers by the 'inbox' to tell how

    I took my iMac to be fixed and when I got it back, mail was not set, so I called Apple and they helped me set up mail. Now the new mail goes to trash and there is no number by the 'inbox' to tell me how many new messages I have. I cannot save a draft to 'drafts.' There is a large number by 'trash' (I think all mail went to trash - including drafts). When I send myself an emai, it goes to trash also. This is on both my iMac (the one taken in) and my MacBook Pro (same emails) which was not taken in.
    I went to 'rules' but have no idea what to do there. There are no rules in the rule box. When I click 'add rule' it puts 'rule 1' in the rule box, but since that was not there when I took it in, I delete it to have an empty rule box.
    Can someone pleasehelp me. I am completely stupid with all this. Do not under stand what is suppose to be set up in 'rules.'
    Thank you so much,
    Arudi

    Now new mail is coming to both computer's inboxes but there is no number on the stamp icon on dock to show number of emails on the iMac. Nor is there a number by either email address under MAILBOXES/inbox (sidebar) on the iMac. This number is showing on MacBook Pro.
    I also can save drafts now on both computers.
    Seems the Pro is fixed and the iMac is only missing the numbers on dock icon and by addresses in inbox.
    Now that the problem is less, I feel i am wasting your time but will continue so maybe I can get those numbers back.
    Two emails > AT&T email and gmail.
    Apple's Mail program for email - yes, and gmail.
    IMAP for both accounts.
    Did not change mail configuration on MacBook.
    The iMac and MacBook Pro have the same mail configuration except in Accounts/mailbox behaviours/store draft messages on the server was not marked on MacBook > it is now.
    'Store junk messages on the server' was marked on one computer for gmail, but is unmarked on both now.
    On the iMac, Accounts/Accounts info/Outgoing mail for gmail is smtpgmail.
    On the MacBook Pro for gmail it is smpt.gmail.com (plus) my email address.
    Rules/Add rule window, on the MacBook third line is 'Any Recipient', on the iMac third line is 'From."
    The last box on that line has my email address on the MacBook.
    The last box on that line has the last address I sent an emil to (last night), on the iMac.
    On the last line on iMac, no box was selicted for 'to mailbox' > I choose 'inbox' because it is on the MacBook Pro.
    Now I have a Rule #1 and am not sure I should have because there was no rules marked when I took the computer in.
    Thank you. I relized I had done the labeling wrong when so much of my question appeared twice and no one else's did. I know how to do it now.
    Thank you so much,
    Arudi

  • Microsoft Visual Studio is unable to load this document: Object reference is not set to an instance of an object

    Hi Everyone,
    Please help me on this issue. I'm a new SSIS User.
    I've installed Sql Server 2005 Developer Edition
    When I create a new SSIS Project in Business Intelligence Development Studio,
    I get the following message:
    "Microsoft Visual Studio is unable to load this document: Object reference is not set to an instance of an object".
    Error loading 'package.dtsx'bject reference is not set to an instance of an object
    When I try to debug the package, I get the below message:
    parameter Component(System.Design) is null.
    I've uninstalled and installed SS 2005 several times, yet the problem persists.
    Please help.
    This is the package.dtsx
    <?xml version="1.0"?><DTS:Executable xmlnsTS="www.microsoft.com/SqlServer/Dts" DTS:ExecutableType="MSDTS.Package.1"><DTSroperty DTS:Name="PackageFormatVersion">2</DTSroperty><DTSroperty DTS:Name="VersionComments"></DTSroperty><DTSroperty DTS:Name="CreatorName">US\kothand1</DTSroperty><DTSroperty DTS:Name="CreatorComputerName">US6051KOTHAND1</DTSroperty><DTSroperty DTS:Name="CreationDate" DTSataType="7">4/8/2008 10:53:39 AM</DTSroperty><DTSroperty DTS:Name="PackageType">5</DTSroperty><DTSroperty DTS:Name="ProtectionLevel">1</DTSroperty><DTSroperty DTS:Name="MaxConcurrentExecutables">-1</DTSroperty><DTSroperty DTS:Name="PackagePriorityClass">0</DTSroperty><DTSroperty DTS:Name="VersionMajor">1</DTSroperty><DTSroperty DTS:Name="VersionMinor">0</DTSroperty><DTSroperty DTS:Name="VersionBuild">0</DTSroperty><DTSroperty DTS:Name="VersionGUID">{FBD98635-EDDE-4F58-9D53-356E8CB653FB}</DTSroperty><DTSroperty DTS:Name="EnableConfig">0</DTSroperty><DTSroperty DTS:Name="CheckpointFileName"></DTSroperty><DTSroperty DTS:Name="SaveCheckpoints">0</DTSroperty><DTSroperty DTS:Name="CheckpointUsage">0</DTSroperty><DTSroperty DTS:Name="SuppressConfigurationWarnings">0</DTSroperty><DTSroperty DTS:Name="ForceExecValue">0</DTSroperty><DTSroperty DTS:Name="ExecValue" DTSataType="3">0</DTSroperty><DTSroperty DTS:Name="ForceExecutionResult">-1</DTSroperty><DTSroperty DTS:Name="Disabled">0</DTSroperty><DTSroperty DTS:Name="FailPackageOnFailure">0</DTSroperty><DTSroperty DTS:Name="FailParentOnFailure">0</DTSroperty><DTSroperty DTS:Name="MaxErrorCount">1</DTSroperty><DTSroperty DTS:Name="ISOLevel">1048576</DTSroperty><DTSroperty DTS:Name="LocaleID">1033</DTSroperty><DTSroperty DTS:Name="TransactionOption">1</DTSroperty><DTSroperty DTS:Name="DelayValidation">0</DTSroperty>
    <DTS:LoggingOptions><DTSroperty DTS:Name="LoggingMode">0</DTSroperty><DTSroperty DTS:Name="FilterKind">1</DTSroperty><DTSroperty DTS:Name="EventFilter" DTSataType="8"></DTSroperty></DTS:LoggingOptions><DTSroperty DTS:Name="ObjectName">Package</DTSroperty><DTSroperty DTS:Name="DTSID">{191D188C-EA6E-46D6-A46A-8C9F3C21C321}</DTSroperty><DTSroperty DTS:Name="Description"></DTSroperty><DTSroperty DTS:Name="CreationName">MSDTS.Package.1</DTSroperty><DTSroperty DTS:Name="DisableEventHandlers">0</DTSroperty></DTS:Executable>
    Thanks
    Best Regards

    No I have not yet. I've applied just the windows updates. I rebooted after the updates, but the problem persists.
    I evern tried importing the .vssettings file from my co-worker's. Also, I tried resetting the user settings
    using "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" /resetuserdata.
    I'm on Windows xp 2002 service pack 2. Sql server 2005 Developer edition.
    Visual Studio info:
    Microsoft Visual Studio 2005
    Version 8.0.50727.762  (SP.050727-7600)
    Microsoft .NET Framework
    Version 2.0.50727 SP1
    Installed Edition: IDE Standard
    Microsoft Visual Studio 2005 Premier Partner Edition - ENU Service Pack 1 (KB926601)  
    This service pack is for Microsoft Visual Studio 2005 Premier Partner Edition - ENU.
    If you later install a more recent service pack, this service pack will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/926601
    SQL Server Analysis Services  
    Microsoft SQL Server Analysis Services Designer
    Version 9.00.1399.00
    SQL Server Integration Services  
    Microsoft SQL Server Integration Services Designer
    Version 9.00.1399.00
    SQL Server Reporting Services  
    Microsoft SQL Server Reporting Services Designers
    Version 9.00.1399.00
    Thanks
    Best regards

  • Timeout of session / entity bean

    Hi all
    We are facing "RollbackException: The transaction has been marked for rollback (timed out)" excpetion. please help us in resolving this.
    Here is problem description.
    Code Description:
    Step1: Action class calls Session bean
    Step2:Session Bean does three things
    A. Reads various value from database and write it to fileOutputStream
    B. Generate a Sequence number using Sequence
    C. Call create method of Entity Bean by local reference to insert the created file (in step 2A) in database as blob
    As per our observation session bean takes around 20-30 sec in processing 2A and 2B.
    But at 2-C, code raises following error
    TariffDocumentBlob is the Entity Bean
    TariffSessionEJB is the Session Bean
    javax.ejb.CreateException: Error creating EntityBean: RollbackException: The transaction has been marked for rollback (timed out)
    05/10/24 16:04:01      at TariffDocumentBlobLocalHome_EntityHomeWrapper397.create(TariffDocumentBlobLocalHome_EntityHomeWrapper397.java:1135)
    05/10/24 16:04:01      at com.derc.rims.businessservice.businessinterface.TariffSessionEJBBean.createTariffBlobMasterRecord(TariffSessionEJBBean.java:102)
    05/10/24 16:04:01      at com.derc.rims.businessservice.businessinterface.TariffSessionEJBBean.uploadTariff(TariffSessionEJBBean.java:76)
    05/10/24 16:04:01      at TariffSessionEJBLocal_StatelessSessionBeanWrapper96.uploadTariff(TariffSessionEJBLocal_StatelessSessionBeanWrapper96.java:80)
    05/10/24 16:04:01      at com.derc.rims.businessservice.businessinterface.BISessionFacadeEJBBean.delegate(BISessionFacadeEJBBean.java:534)
    05/10/24 16:04:01      at BISessionFacadeEJB_StatelessSessionBeanWrapper4.delegate(BISessionFacadeEJB_StatelessSessionBeanWrapper4.java:101)
    05/10/24 16:04:01      at com.derc.rims.action.tariff.CalculateTariffAction.execute(CalculateTariffAction.java:75)
    05/10/24 16:04:01      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    05/10/24 16:04:01      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    05/10/24 16:04:01      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)05/10/24 16:04:01      at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)05/10/24 16:04:01      at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)05/10/24 16:04:01      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)05/10/24 16:04:01      
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)05/10/24 16:04:01      at
    oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)05/10/24 16:04:01      at
    com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)05/10/24 16:04:01      at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)05/10/24 16:04:01 TRANSACTION OVER05/10/24
    16:04:01      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    05/10/24 16:04:01      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    05/10/24 16:04:01      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    05/10/24 16:04:01      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    05/10/24 16:04:01      at java.lang.Thread.run(Thread.java:534)
    com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: timed out     at
    BISessionFacadeEJB_StatelessSessionBeanWrapper4.delegate(BISessionFacadeEJB_StatelessSessionBeanWrapper4.java:159)
    at com.derc.rims.action.tariff.CalculateTariffAction.execute(CalculateTariffAction.java:75)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    at java.lang.Thread.run(Thread.java:534)
         Nested exception is:java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:     at com.evermind.server.ejb.EJBUtils.makeException(EJBUtils.java:931)
         at BISessionFacadeEJB_StatelessSessionBeanWrapper4.delegate(BISessionFacadeEJB_StatelessSessionBeanWrapper4.java:159)     
         at com.derc.rims.action.tariff.CalculateTariffAction.execute(CalculateTariffAction.java:75)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)     
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:527)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)     
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)     
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)     
         at java.lang.Thread.run(Thread.java:534)
         Caused by: java.lang.Exception: No Exception - originate from:     at com.evermind.server.ejb.EJBUtils.makeException(EJBUtils.java:930)
         ... 17 more
    We have tried out .....
    - Making new Enity Bean
    - changing timeout of session bean by changing it in properties
    <session-deployment name="TariffSessionEJB" timeout="300" >
    We are using Oracle 10g application Sever and Oracle 10.1 database.

    Assuming you are using either 9.0.4 or 10.1.2, please note that default transaction time out is 30s and you can change that <transaction-config> element in server.xml. This is specified in millliseconds
    -Debu

  • EJB 3.0 entity beans and WebDynpro models

    Hi all,
    first off all my setup:
    WebDynpro Development Component: dcA
    EJB Module Development Component: dcB
    i wan't to create Entity Beans in dcB an use it for my model in dcA.
    My questions:
    1. Why does the "New Wizard" only offer EJB 3.0 Session and Message Beans an no Entity Beans? What is the correct way for creating Entity Beans in DevStudio?
    2. Is ist right that i have to define a public Part containing the Entity Bean to make it visible to dcA?
    Regards,
       Christian

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

  • Problem creating EJB 3.0 Entity bean in JDeveloper

    Hello all,
    I trying to create my first entity bean in JDeveloper.
    JDevelper create the entity bean with the code below:
    package model;
    import java.io.Serializable;
    import javax.persistence.Entity;
    @Entity
    public class BatchSettlementT implements Serializable {
    public BatchSettlementT() {
    The problem is that JDeveloper don't find the import command import javax.persistence.Entity;
    What am I doing wrong?
    I'm using JDeveloper Studio Edition Version 10.1.3.1.0.3914.
    My libraries are:
    - TopLink
    - Oracle XML Parser 2
    - EJB 3.0
    - Toplink Essentials JPA
    - J2EE
    Thanks in advance.

    It's very strange, when I type import.javax. in my class there is no persistence package available, do you have any idea what's wrong.
    I did set the technology scope to EJB either.
    Thanks!

  • Problem with ejb 3.0 entity beans with manyToMany relationship

    Hello everyone!
    I am using struts 1.2.9 and java ee 5 sdk update 2 for my enterprise application. Besides others i have these entity beans Targetgroup.java and City.java, (i would upload file but i do not know how:)
    with manytomany relationship with join table.
    when user updates Targetgroup, by clicking on web page with checkboxes and textfields, struts dispatch action calls following method stateless bean:
    public void update(String firmId, String targetgroupId, String newGender, String newMinYearsOld, String newMaxYearsOld, String[] newCities) {
    TargetgroupPK pkForUpdate = new TargetgroupPK(targetgroupId, firmId);
    Targetgroup targetgroupForUpdate = find(pkForUpdate);
    targetgroupForUpdate.setGender(newGender);
    targetgroupForUpdate.setMinyearold(Integer.parseIn t(newMinYearsOld));
    targetgroupForUpdate.setMaxyearold(Integer.parseIn t(newMaxYearsOld));
    //pronalazenje gradva za koje je vezana ciljna grupa
    Collection<City> newCitiesCollection = new ArrayList<City>();
    for(int i = 0; i < newCities.length; i++){
    String tmp_city_name = newCities;
    City city_obj = cityFacade.find(tmp_city_name);
    newCitiesCollection.add(city_obj);
    targetgroupForUpdate.setCityidCollection(newCities Collection);
    parameter newCities represents names of cities which user checked on his update page. When the page is showen to him some cities are allready check because they were connected with Targetgruoup when it was created (targetgroup).
    this code throws following exception:
    [#|2007-07-26T12:13:36.993+0200|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Threa dID=16;_ThreadName=httpWorkerThread-8080-0;_RequestID=f79d9c50-86b0-4b6c-96ab-97956dfb39c1;|StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    javax.transaction.RollbackException: Transaction marked for rollback.
    at
    .com.sun.enterprise.web.connector.grizzly.WorkerTh read.run(WorkerThread.java:75)
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    at com.sun.ejb.containers.BaseContainer.completeNewTx (BaseContainer.java:3659)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx( BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(Ba seContainer.java:1247)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dler.invoke(EJBLocalObjectInvocationHandler.java:1 92)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dlerDelegate.invoke(EJBLocalObjectInvocationHandle rDelegate.java:71)
    at $Proxy149.update(Unknown Source)
    at audiotel.sms.actions.backoffice.TargetgroupDispatc hAction.updateOrDelete(TargetgroupDispatchAction.j ava:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:270)
    at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:187)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
    com.sun.enterprise.web.connector.grizzly.WorkerThr ead.run(WorkerThread.java:75)
    |#]
    exceprion is throwen ONLY when in parameter newCities are city names allready connected to Targetgroup. when NewCities contains names of
    City objects which are not connected to Targetgroup it works fine, but it's of no use for me, because user must be able to add or remove certian cities from relaionship with Targetgroup. I think it's because there are rows in join table that contain primary keys of city and targetgroup which are connected so perisistence manager cann't write them again.
    i thought it was going to figure it out by itself, and only update those rows.
    Does anyone know what is the problem and solution?
    Thanks! (forgive my spelling errors :)

    solved the problem!
    I moved code from sesion bean to struts action as follows:
    CityFacadeLocal cityFacade = lookupCityFacade();
    //prikupljanje novih podataka o ciljnoj grupi
    String newGender = ctf.getGender();
    String newMaxYears = ctf.getMaxyears();
    String newMinYears = ctf.getMinyears();
    String[] newSelectedCities = ctf.getSelectedCities();
    //niz imena gradova se prevodi u kolekcju objekata City
    Collection<City> newCitiesObjCollection = new Vector<City>();
    for(int i = 0; i < newSelectedCities.length; i++){
    String tmpCityName = newSelectedCities;
    City tmpCityObj = cityFacade.find(tmpCityName);
    newCitiesObjCollection.add(tmpCityObj);
    //setovanje novih podataka
    targetgroupForUD.setGender(newGender);
    targetgroupForUD.setMinyearold(Integer.parseInt(newMinYears));
    targetgroupForUD.setMaxyearold(Integer.parseInt(newMaxYears));
    targetgroupForUD.setCityidCollection(newCitiesObjCollection);
    //pozivanje update metdoe u session beany
    targetgroupFacade.edit(targetgroupForUD);
    //korisnik se vraca na stranu sa svim postojecim ciljnim grupama
    forward = mapping.findForward("backend.targetgroups");
    and now it works fine. I guess probelm was same transaction scope for Targetgroup and City entities. Now when they are separated it works.
    Thanks!

  • Problems accessing ejb 3.0 entity bean from project

    I have written some code using ejb 3.0 and was previously accessing the entity bean without problem when both ejbs and the accessing code were in the same project. However I have moved the accessing code into a different project within the same application and now when the code tries to accessing the entity bean I get the following error:
    com.colwilson.web.ingestion.IdentifiedException: java.lang.ClassCastException: __Proxy3
         at com.colwilson.web.ingestion.IngestionHandler.recordArrived(IngestionHandler.java:140)
         at com.colwilson.web.ingestion.IngestionHandler.main(IngestionHandler.java:52)
    Caused by: java.lang.ClassCastException: __Proxy3
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.getFreshObject(StatelessSessionRemoteInvocationHandler.java:21)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.getReplacementObject(RecoverableRemoteInvocationHandler.java:64)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.handleRecovery(RecoverableRemoteInvocationHandler.java:41)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:30)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.mergeEntity(Unknown Source)
         at com.colwilson.web.ingestion.IngestionHandler.recordArrived(IngestionHandler.java:137)
         ... 1 more
    Now, of course I could move the code back into the same project, but as I understand it that is just the point of ejbs. I'm looking up the entity bean thus:
    final Context context = InitialContext();
    ingestionSessionEJB =
    (IngestionSessionEJB)context.lookup("IngestionSessionEJB");
    It may be true that I don't understand the way lookup works, but to be honest I can't find the docs that explain what I've got wrong.
    Please help.

    hi
    Double Click on the project which is goin to use the project which contains bean from the Application Navigator window. The project properties window will open. Choose the "Dependencies" item from left panel. click on the radio "User Project Settings" and select another project which contain ejb which you're goin to access...
    Best Of Luck
    Ravi A. Trivedi

  • Creating a Session & Entity bean in Weblogic

    Hii javaities
    I am new 2 EJB , and i want 2 create a apllication using EJB.
    I want 2 create a session , and entity bean in WEblogic.
    Can anybody help me i this
    Or if u have some good links , plz pass it 2 me.
    Thanking in anticipation

    http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html
    http://www.oracle.com/technology/sample_code/tech/java/j2ee/designpattern/businesstier/sessionfacade/readme.html
    google search for more.

  • @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 ?

  • Merge ejb Jar containing entity beans

    Hi,
    Is there a way I can merge two or more jar files which contain Entity beans, I
    am
    deploying under WAS 6.1 and am developing under Jbuilder 6??? I am using CMP
    2 entity beans
    Thanks In Advance

    Hi.
    Try posting this to the ejb newsgroup.
    Regards,
    Michael
    jack V wrote:
    Hi,
    Is there a way I can merge two or more jar files which contain Entity beans, I
    am
    deploying under WAS 6.1 and am developing under Jbuilder 6??? I am using CMP
    2 entity beans
    Thanks In Advance--
    Michael Young
    Developer Relations Engineer
    BEA Support

Maybe you are looking for