EJB 3.0 indirection problem

Hi,
I'm trying to use lazy loading with EJB 3.0. I've generated CMP beans from tables in JDev. I have the same table schema as in tutorial:
http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos-ejb3/howtooutofcontainer/doc/how-to-ejb30-out-of-container.html
I have such a mapping:
@ManyToOne(fetch=EAGER)
@JoinColumn(name="CUST_ID", referencedColumnName="EJB_CUSTOMER.CUST_ID")
public EjbCustomer getEjbCustomer() {
return ejbCustomer;
It works fine, but when I change the value of "fetch" attribute to LAZY a get following Exception:
java.lang.NullPointerException
     at oracle.toplink.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:205)
     at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:61)
     at ejb_sample.EjbOrder.getEjbCustomer(EjbOrder.java:72)
     at ejb_sample.EjbSampleFacadeEJBClient.main(EjbSampleFacadeEJBClient.java:29)
Do I have to set anything else (more thane "fetch" attribute) to use indirection?
Thanks for any reply,
Piotr Bloch
Poznan Univerity of Technology, Poland

Piotr,
I assume from your stack trace that you are accessing the attribute on a remote client. When a JPA entity is returned from a remote session bean it is serialized. When this happens any non-instantiated relationships will no longer be able to trigger the lazy load capability as they are now detached from the persistence context of the server.
If you require lazy-loaded relationships on the client it is recommended that you trigger their loading on the server prior to returning them.
Doug

Similar Messages

  • EJB Entity transaction rollback problem

              Hello,
              I have created 2 beans one is a Stateless Session and the other a Bean Managed Entity Bean. The SS Bean has methods to retrieve an Oracle Connection from a DataSource defined connection pool, and to close a connection. The entity bean I have created is responsible for insterting a new record into one of the tables in my database.
              I have a client app that calls the ejbCreate method on the entity bean at which point the Entity EJB takes control, gets a valid connection from the SS EJB, runs a simple working SQL SELECT statement (obtaining correct values), and then attempts to perform an insert into a table using a prepared statement. My problem is that the application runs fine without any errors and all calls are made and all calls seem to be working fine. I have checked to make sure that the Datasource I am using is AutoCommit= false and it is and there are no exceptions being thrown in my EJB's but yet it appears as though the SQL statements executeUpdate() command is not being committed as their is no rows created in the database. Does anyone know what I may be doing wrong. I have all ACL parameters set up correctly and as I stated before the entire app runs without errors and I do have a SELECT statment that is working properly within the same method as the INSERT statement which is not!!! Please send any suggestions!!
              Justin
              

              I am using CMT, it is activated by default on Entity Beans I believe. The bean itself is marked as TX_REQUIRED so I believe all the methods automatically are all TX_REQUIRED.
              Here is my Bean ejbCreate Method, My PK class, and my ejb-jar.xml file-- I've pasted them below for convenience.
              ejbCreate:
                   public CustomerPK ejbCreate(String aUserName, String aPassword, String aFirstName,
                        String aMiddleInit, String aLastName, String aEmailAddr)
                        throws javax.ejb.CreateException {
                   Connection conn=null;
                   long nextPrsnID;
                   long nextCustID;
                   if (verifyParams(aUserName, aPassword, aFirstName, aMiddleInit,
                        aLastName, aEmailAddr)) {
                   if (isUniqueUserName(aUserName)) {
                   try {
                        conn=getConnection();
                        conn.setAutoCommit(false);
                        nextPrsnID=addPerson(conn,aFirstName,aMiddleInit,aLastName); // adds a person to the person table consists of just simple SQL
                        nextCustID=addCustomer(conn,nextPrsnID, aUserName,aPassword, aEmailAddr); //adds a customer to the customer table
                        // SET THE BEAN MANAGED PUBLIC VARIABLES
                        this.userName=aUserName;
                        this.password=aPassword;
                        this.firstName=aFirstName;
                        this.middleInit=aMiddleInit;
                        this.lastName=aLastName;
                        this.emailAddr=aEmailAddr;
                        this.personID=nextPrsnID;
                        this.custID=nextCustID;
                        conn.commit(); // with this statement here the transaction goes through otherwise the DB will not be updated
                   catch (Exception e){
                        throw new javax.ejb.CreateException("Experiencing Database Problems-- Unrecoverable Error"); // rollback transaction
                   finally{
                        cleanup(conn,null); // close the connection
                   else {           // UserName already exists
                   throw new javax.ejb.CreateException("Sorry username already exists please choose another one");
                   else {          // Registration parameters were not verifiable
                   throw new javax.ejb.CreateException("Registration paramater rules were violated");
                   CustomerPK custPK=new CustomerPK(nextCustID);
                   return custPK;
              EJB CUSTOMER PRIMARY KEY CLASS:
              public class CustomerPK implements java.io.Serializable {
              // PRIMARY KEY VARIABLES
              public long CustomerID;
              public CustomerPK(long aCustomerID) {
              this.CustomerID=aCustomerID;
              public CustomerPK() {
              public String toString(){
              return ((new Long(CustomerID)).toString());
              public boolean equals(Object aComparePK){
              if (this.CustomerID==((CustomerPK)aComparePK).CustomerID){
                   return true;
              return false;
              public int hashCode(){
              return ((new Long(CustomerID).toString()).hashCode());
              } // END-CLASS
              CUSTOMER ejb-jar.xml
              <?xml version="1.0"?>
              <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
              <ejb-jar>
              <enterprise-beans>
              <entity>
                   <ejb-name>Customer</ejb-name>
                   <home>CustomerHome</home>
                   <remote>Customer</remote>
                   <ejb-class>CustomerBean</ejb-class>
                   <persistence-type>Bean</persistence-type>
                   <prim-key-class>CustomerPK</prim-key-class>
                   <reentrant>False</reentrant>
                   <resource-ref>
              <res-ref-name>jdbc/DeveloperPool</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              </resource-ref>
              </entity>
              </enterprise-beans>
              <assembly-descriptor>
              <container-transaction>
                   <method>
                   <ejb-name>Customer</ejb-name>
                   <method-intf>Remote</method-intf>
                   <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
              </assembly-descriptor>
              </ejb-jar>
              "Cameron Purdy" <[email protected]> wrote:
              >Are you using CMT? Have you marked the methods as REQUIRED?
              >
              >Peace,
              >
              >--
              >Cameron Purdy
              >Tangosol, Inc.
              >http://www.tangosol.com
              >+1.617.623.5782
              >WebLogic Consulting Available
              >
              >
              >"Justin Jose" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Hello,
              >>
              >> I have created 2 beans one is a Stateless Session and the other a Bean
              >Managed Entity Bean. The SS Bean has methods to retrieve an Oracle
              >Connection from a DataSource defined connection pool, and to close a
              >connection. The entity bean I have created is responsible for insterting a
              >new record into one of the tables in my database.
              >> I have a client app that calls the ejbCreate method on the entity bean at
              >which point the Entity EJB takes control, gets a valid connection from the
              >SS EJB, runs a simple working SQL SELECT statement (obtaining correct
              >values), and then attempts to perform an insert into a table using a
              >prepared statement. My problem is that the application runs fine without
              >any errors and all calls are made and all calls seem to be working fine. I
              >have checked to make sure that the Datasource I am using is AutoCommit=
              >false and it is and there are no exceptions being thrown in my EJB's but yet
              >it appears as though the SQL statements executeUpdate() command is not being
              >committed as their is no rows created in the database. Does anyone know
              >what I may be doing wrong. I have all ACL parameters set up correctly and
              >as I stated before the entire app runs without errors and I do have a SELECT
              >statment that is working properly within the same method as the INSERT
              >statement which is not!!! Please send any suggestions!!
              >>
              >> Justin
              >
              >
              

  • EJB 3.0 Constraints Problem

    Hi everybody !
    Hope someone can help me !! Im really go crazy with this stuff :s...
    Im Using jdeveloper .... I have 2 Entity Bean called Jiverating and Jiveuser, I creadte them using "Create Entity Bean from Table".... also a Session Bean called ForumFacadeBean I created using a EJB diagram as EJB Sesion Bean ....
    I can execute query without any problem but when I want to sotre a new Jiverating the aplication thows an exception... I just call the following metold of ForumFacadeBean
    public Jiverating persistJiverating(Jiverating jiverating) {   
    em.persist(jiverating);
    return jiverating;
    The exception I got is:
    <Jan 13, 2012 8:42:48 PM PET> <Warning> <EclipseLink> <BEA-2005000> <2012-01-13 20:42:48.125--UnitOfWork(317933487)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)>
    <Jan 13, 2012 8:42:48 PM PET> <Warning> <EclipseLink> <BEA-2005000> <2012-01-13 20:42:48.126--UnitOfWork(317933487)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)>
    <Jan 13, 2012 8:42:48 PM PET> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB pe.com.gart.ejb.entities.ForumFacadeBean.persistJiverating(pe.com.bcts.gart.ejb.entities.Jiverating)],Xid=BEA1-001B5FB5B4DB06A00B5F(317932956),Status=Rolled back. [Reason=Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=30,SCInfo[osinergminWebPortalDesa+WC_Spaces]=(state=rolledback),properties=({weblogic.transaction.name=[EJB pe.com.gart.ejb.entities.ForumFacadeBean.persistJiverating(pe.com.bcts.gart.ejb.entities.Jiverating)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=WC_Spaces+192.168.101.124:9000+osinergminWebPortalDesa+t3+, XAResources={WSATGatewayRM_WC_Spaces_osinergminWebPortalDesa, CustomPortalServicesEJB@Portal@Portal_osinergminWebPortalDesa, webapp@Portal@Portal_osinergminWebPortalDesa},NonXAResources={})],CoordinatorURL=WC_Spaces+192.168.101.124:9000+osinergminWebPortalDesa+t3+): weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=[email protected]f34805
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
    *     bind => [2, 0, 2, 11]*Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1881)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:345)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:240)
         at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:627)
         at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
         at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
         at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl.persistJiverating(Unknown Source)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl_1035_WLStub.persistJiverating(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
         at $Proxy247.persistJiverating(Unknown Source)
         at customdiscussions.backing.AddRating.<init>(AddRating.java:51)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at oracle.adfinternal.controller.beans.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:187)
         at oracle.adfinternal.controller.beans.ManagedBeanFactory.instantiateBean(ManagedBeanFactory.java:874)
         at oracle.adfinternal.controller.state.ScopeMap.get(ScopeMap.java:83)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:250)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:513)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:782)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1354)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:75)
         at oracle.adfinternal.view.faces.unified.taglib.UnifiedDocumentTag.doStartTag(UnifiedDocumentTag.java:50)
         at jsp_servlet.__addrating_jspx._jspx___tag1(__addrating_jspx.java:154)
         at jsp_servlet.__addrating_jspx._jspx___tag0(__addrating_jspx.java:113)
         at jsp_servlet.__addrating_jspx._jspService(__addrating_jspx.java:74)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:417)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:268)
         at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:471)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:191)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:800)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:294)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:214)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    I dont underestand this error beacuse when I execute INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (2, 0, 2, 11) directly on the database I got no error !
    please help me !!!!!

    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not foundWell it is a database constraint, so it is the database that is blocking the insertion of the record.
    I dont underestand this error beacuse when I execute INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (2, 0, 2, 11) directly on the database I got no error !And did you actually attempt to -commit- the transaction? If you did then I can only conclude one thing: you are using two different databases. One has a constraint, the other does not. Constraints do not magically appear out of thin air, especially ones that generate an ORA error.

  • EJB 3.0 client problem

    here is my Entity class :
    package com.azry.employee;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import javax.persistence.TableGenerator;
    @Entity
    @TableGenerator(name = "EMP_GENERATOR",
                      table = "EMPLOYEE",
                      pkColumnName = "EMPLOYEE_ID",
                      pkColumnValue = "EMPLOYEE_ID",
                      allocationSize = 10)
    @Table(name = "EMPLOYEE")
    public class Employee implements java.io.Serializable {
         private int id;
         private String name;
         private String email;
         private int money;
         @Id
         @GeneratedValue(strategy = GenerationType.TABLE, generator = "EMP_GENERATOR")
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public String getEmail() {
              return email;
         public void setEmail(String email) {
              this.email = email;
         public int getMoney() {
              return money;
         public void setMoney(int money) {
              this.money = money;
    }i also have created database EmployeeDB in mysql and have also mysql-ds.xml :
    and also have a client class:
    package com.azry.employee.clients;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import com.azry.employee.*;
    public class Client {
         public static void main(String[] args) {
         try {
              Context jndContext=getInitialContext();
              Object ref=jndContext.lookup("EmployeeSession/remote");
              EmployeeRemote rem=(EmployeeRemote)PortableRemoteObject.narrow(ref,EmployeeRemote.class);
              Employee emp=new Employee();
             // emp.setId(1);
              emp.setMoney(1000);
              emp.setName("david");
              emp.setEmail("email");
              rem.insert(emp);
         catch(Exception ex) {
              ex.printStackTrace();
         private static Context getInitialContext()throws NamingException{
              Properties p=new Properties();
              p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              p.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              p.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
              return new InitialContext(p);
    }i also have remote interface and session bean that overrides remote interface but the real problem is that when i run server everything goes well but when i run client exception occurs :
    javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get or update next value
        at com.azry.employee.clients.Client.main(Client.java:24)
    Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get or update next value
         at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
         at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
         at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:182)
         at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
    Caused by: org.hibernate.exception.SQLGrammarException: could not get or update next value
         at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         at org.hibernate.engine.TransactionHelper$1Work.doWork(TransactionHelper.java:41)
         at org.hibernate.engine.transaction.Isolater$JtaDelegate.delegateWork(Isolater.java:106)
         at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:40)
         at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:51)
         at org.hibernate.id.MultipleHiLoPerTableGenerator.generate(MultipleHiLoPerTableGenerator.java:191)
         at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
         at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
         at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
         at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
         at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
         at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
         at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
         at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
         ... 37 more
    can anyone tell me what i am doing wrong?_

    here is my Entity class :
    package com.azry.employee;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    import javax.persistence.TableGenerator;
    @Entity
    @TableGenerator(name = "EMP_GENERATOR",
                      table = "EMPLOYEE",
                      pkColumnName = "EMPLOYEE_ID",
                      pkColumnValue = "EMPLOYEE_ID",
                      allocationSize = 10)
    @Table(name = "EMPLOYEE")
    public class Employee implements java.io.Serializable {
         private int id;
         private String name;
         private String email;
         private int money;
         @Id
         @GeneratedValue(strategy = GenerationType.TABLE, generator = "EMP_GENERATOR")
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public String getEmail() {
              return email;
         public void setEmail(String email) {
              this.email = email;
         public int getMoney() {
              return money;
         public void setMoney(int money) {
              this.money = money;
    }i also have created database EmployeeDB in mysql and have also mysql-ds.xml :
    and also have a client class:
    package com.azry.employee.clients;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import com.azry.employee.*;
    public class Client {
         public static void main(String[] args) {
         try {
              Context jndContext=getInitialContext();
              Object ref=jndContext.lookup("EmployeeSession/remote");
              EmployeeRemote rem=(EmployeeRemote)PortableRemoteObject.narrow(ref,EmployeeRemote.class);
              Employee emp=new Employee();
             // emp.setId(1);
              emp.setMoney(1000);
              emp.setName("david");
              emp.setEmail("email");
              rem.insert(emp);
         catch(Exception ex) {
              ex.printStackTrace();
         private static Context getInitialContext()throws NamingException{
              Properties p=new Properties();
              p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              p.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              p.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
              return new InitialContext(p);
    }i also have remote interface and session bean that overrides remote interface but the real problem is that when i run server everything goes well but when i run client exception occurs :
    javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get or update next value
        at com.azry.employee.clients.Client.main(Client.java:24)
    Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get or update next value
         at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
         at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
         at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:182)
         at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
    Caused by: org.hibernate.exception.SQLGrammarException: could not get or update next value
         at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         at org.hibernate.engine.TransactionHelper$1Work.doWork(TransactionHelper.java:41)
         at org.hibernate.engine.transaction.Isolater$JtaDelegate.delegateWork(Isolater.java:106)
         at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:40)
         at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:51)
         at org.hibernate.id.MultipleHiLoPerTableGenerator.generate(MultipleHiLoPerTableGenerator.java:191)
         at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
         at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
         at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
         at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
         at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
         at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
         at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
         at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
         ... 37 more
    can anyone tell me what i am doing wrong?_

  • Spring 2.5.5 and EJB 3.0 Deployment problem in WLS 10.3

    Hi,
    I am attempting to deploy a EAR file that previously ran on SJSAS 9.1 update 1 to WLS 10.3. As part of the deployment I get the following error related to the EJB3 classes.
    There are 1 nested errors: weblogic.j2ee.dd.xml.AnnotationProcessException: [EJB:015002]Unable to load class au.edu.cqu.cis.web.ajaxservice.AjaxServicesBean in Jar D:\dev\env\oracle\middleware\jdeveloper\system\system11.1.1.0.31.51.56\DefaultDomain\servers\DefaultServer\tmp\_WL_user\ProgEnrol-ear-3\v540rk\ProgEnrol-ejb-3.0.4-SNAPSHOT.jar : java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    I suspect that this is related to the @Autowired spring annotation in use in the session bean. Either, the server is not finding the Spring JAR correctly or it has a problem with the annotation.
    Can anyone point me in the right direction? Do I need to deploy the spring jar as a library?
    Thank you.
    Regards,
    Graeme.

    Hi, Graeme.
    Seems there is an existing CR on something related from v10.0: CR353213
    * WLS 10.0 - EJB 3.0 deployment fails when parsing class for Stateless annotation
    According to http://edocs.bea.com/wls/docs103/issues/known_resolved.html, this is not addressed in 10.3
    Closely review your classpath, and then (assuming you have access to the source) review the body of your ejb. If it is related to this CR, you may be able to workaround the issue by shortening the body and split large methods into more sub-methods.
    I hope this helps,
    -Adrian

  • EJB 3.0 deployment problem

    I just started learning EJB3.0. I created a slsb application very similar to the converter available in the tutorial sample. However when i build and deploy the app I am getting this error ->This application client has no ejb refernce by the name simpleSessionRemote. This happens when I have app-client jar inside the ear. For only jar and war inside the ear there is no deployement problems. I am using NetBeans 5.5 and Sun App server. Anyone has come across similar issue?

    How are you looking up the remote ejb dependency in the app client -- via @EJB or InitialContext()?
    Please post the source code for the app client, the full error message/stack trace, and any of the following files that exist in the .ear : sun-ejb-jar.xml, application-client.xml, sun-application-client.xml, ejb-jar.xml .
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • EJB and Dictionary Deployment Problem

    Hi,
    I am new to SAP J2EE engine. I tried deploying a simple EJB application with one entity(CMP) and one stateless session bean but cud not succeed. These were the problems:
    1. When I used SAPDB for CMP, it said the table TMP_EMPLOYEE (which the CMP bean maps to, as per persistet.xml) is not found in the catalog. Then I created a dictionary project with the TMP_EMPLOYEE table defined, but I couldn't deploy the dictionary archive. SDM (from the NWS IDE) says this:
    Result
    => deployment not executed : file:/C:/DOCUME1/i031278/LOCALS1/Temp/temp11240EmployeeDB.sda
    The SDA with development component 'EmployeeDB'/'sap.com'/'localhost'/'2004.11.25.19.41.45' changed its software type from J2EE to JDDSCHEMA. This change is not supported.
    Deployment will be aborted.
    Deployment exception : Got problems during deployment
    2. When I changed the DB provider to MS_SQL_SERVER, which had EMPLOYEEDB/TMP_EMPLOYEE defined, and the SQL server was started, the Table was again not found! (i.e., if I switch off deploy-time table verification, this TableLockingException is thrown. Otherwise ORMappingVerificationException is thrown when the deploy-time verification switch is on).
    I have specified the resource-ref etc properly now. This sample application also has a servlet which tries to access the session bean, which inturn talks to the CMP bean. I'm sure that the JNDI names are properly referred.
    I am using SAP J2EE engine 6.40 with SP9 and IDE is 2.0.9.
    Another thing: I tried to deploy the tutorial 'Car Rental EJB Application' application's dictionary. Even that failed with the same error!
    Please help me with this.
    Thanks a lot!
    Regards,
    Prashanth

    Problem solved in person

  • Servlet - EJB, caching home & context problem

    Hello,
    I just run into the following problem:
    I created a thin client which accesses the EJB's via a servlet.
    In this servlet I cached the InitialContext und and the reference
    to the Home interface. While creating the initial context I provided
    login/password to access the EJB so it can't be accessed from the guest
    user.
    The first method call works as expected, any further call results
    in a RemoteException - Insufficent permissions.
    Any hints? I'm using 5.1, SP6.
    Zhanxs in advance
    Marcel

    The security creditials you suppplied to the IntialContext are only applied
    to the thread that created the InitialContext. I have only found one
    work-around - Construct an otherwise useless IntialContext each time a
    thread attempts to use and EJB or its home. This is inefficient and almost
    (not quite) destroys the advantage of caching the stubs.
    Is there any other solution? Any thing coming down the pike?
    Chuck McCorvey
    "Marcel Zielinski" <[email protected]> wrote in message
    news:[email protected]..
    Hello,
    I just run into the following problem:
    I created a thin client which accesses the EJB's via a servlet.
    In this servlet I cached the InitialContext und and the reference
    to the Home interface. While creating the initial context I provided
    login/password to access the EJB so it can't be accessed from the guest
    user.
    The first method call works as expected, any further call results
    in a RemoteException - Insufficent permissions.
    Any hints? I'm using 5.1, SP6.
    Zhanxs in advance
    Marcel

  • TopLink Proxy Indirection problem when comitting uow

    We are trying to introduce the use of TopLink proxy indirection into our object model.
    We have run into situations where the uow cannot be committed because proxy indirection is being encountered.
    (See the stack trace provided below).
    What do we need to be aware of and what actions should we take to make it over this hurdle?
    Would ValueHolder cause the same problem, or would TopLink be better able to handle ValueHolder indirection than Proxy Indirection?
    Thanks for any help/hints guidance you can provide.
    2004.09.21 06:09:51.406--UnitOfWork(2820596)--Thread[ExecuteThread: '12' for queue: 'default',5,Thread Group for Queue: 'default']--Before JTS Completion
    2004.09.21 06:09:51.437--UnitOfWork(2820596)--Thread[ExecuteThread: '12' for queue: 'default',5,Thread Group for Queue: 'default']--Exception [TOPLINK-7009] (OracleAS TopLink - 10g (9.0.4.1) (Build 040128)): oracle.toplink.exceptions.ValidationException
    Exception Description: Missing descriptor for [$Proxy98]. Verify that the descriptor has been properly registered with the Session.Local Exception Stack:
    Exception [TOPLINK-7009] (OracleAS TopLink - 10g (9.0.4.1) (Build 040128)): oracle.toplink.exceptions.ValidationException
    Exception Description: Missing descriptor for [$Proxy98]. Verify that the descriptor has been properly registered with the Session.
         at oracle.toplink.exceptions.ValidationException.missingDescriptor(ValidationException.java:599)
         at oracle.toplink.internal.descriptors.DescriptorIterator.getDescriptorFor(DescriptorIterator.java:86)
         at oracle.toplink.internal.descriptors.DescriptorIterator.iterateReferenceObjectForMapping(DescriptorIterator.java:242)
         at oracle.toplink.mappings.ObjectReferenceMapping.iterateOnRealAttributeValue(ObjectReferenceMapping.java:267)
         at oracle.toplink.internal.indirection.IndirectionPolicy.iterateOnAttributeValue(IndirectionPolicy.java:186)
         at oracle.toplink.mappings.ForeignReferenceMapping.iterate(ForeignReferenceMapping.java:503)
         at oracle.toplink.internal.descriptors.ObjectBuilder.iterate(ObjectBuilder.java:1436)
         at oracle.toplink.internal.descriptors.DescriptorIterator.iterateReferenceObjects(DescriptorIterator.java:258)
         at oracle.toplink.internal.descriptors.DescriptorIterator.iterateReferenceObjectForMapping(DescriptorIterator.java:250)
         at oracle.toplink.mappings.ObjectReferenceMapping.iterateOnRealAttributeValue(ObjectReferenceMapping.java:267)
         at oracle.toplink.internal.indirection.IndirectionPolicy.iterateOnAttributeValue(IndirectionPolicy.java:186)
         at oracle.toplink.mappings.ForeignReferenceMapping.iterate(ForeignReferenceMapping.java:503)
         at oracle.toplink.internal.descriptors.ObjectBuilder.iterate(ObjectBuilder.java:1436)
         at oracle.toplink.internal.descriptors.DescriptorIterator.iterateReferenceObjects(DescriptorIterator.java:258)
         at oracle.toplink.internal.descriptors.DescriptorIterator.startIterationOn(DescriptorIterator.java:407)
         at oracle.toplink.publicinterface.UnitOfWork.discoverUnregisteredNewObjects(UnitOfWork.java:1361)
         at oracle.toplink.publicinterface.UnitOfWork.discoverAllUnregisteredNewObjects(UnitOfWork.java:1283)
         at oracle.toplink.publicinterface.UnitOfWork.assignSequenceNumbers(UnitOfWork.java:325)
         at oracle.toplink.publicinterface.UnitOfWork.collectAndPrepareObjectsForCommit(UnitOfWork.java:659)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabaseWithChangeSet(UnitOfWork.java:1123)
         at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(UnitOfWork.java:2465)
         at oracle.toplink.jts.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:151)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:540)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:92)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1044)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1581)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:237)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:208)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:282)

    Hello,
    Could you tell me a little more about what you are trying to do? From the stacktrace it appears that TopLink is searching for all new objects and finding a proxy, and doesn't know that it is uninstantiated.
    Could you show me the piece of code where your unit of work registers and commits this object?

  • Ejb and jsproc deployment problems

    Am trying to deploy the java stored procedure (jsp) example
    (jsproc subdirectory in acmevideo directory) and the enterprise
    java bean (ejb) example (ejb subdirectory in acmevideo
    directory). Both use the business and util subdirectries of
    acmevideo directory. These examples are provided with
    JDeveloper.
    In the case of the jsp example, the files compile fine in
    JDeveloper. The deployment profile file is created okay using
    the Stored Procedure Profile Wizard. But when the jsp is
    attempted to be deployed by right clicking the deployment
    profile file menu in JDeveloper, the following errors appear:
    SQL error during creation of acmevideo/util/DataWrapper
    ORA-00922 - missing or invalid option
    SQL error during creation of acmevideo/business/TitleQueries
    ORA-00922 - missing or invalid option
    Is there a corrective action for these errors? Are the details
    recorded in any log so that these errors can be troubleshooted?
    In the case of the jbe example, the files compile fine in
    JDeveloper. The deployment profile file is created okay using
    the EJB Profile Wizard. But when the jsp is attempted to be
    deployed by right clicking the deployment profile file menu in
    JDeveloper, the following happens:
    The message indicating that the deployment will take a few
    minues continues to show forever. There is no completion,
    and one is forced to cancel the process.
    This happens when using the port settings of 1521, 1526 (Oracle
    listener ports) or 2651 (OAS ORB port). Specifying the service
    or omitting it yeilds the same results.
    Is there a corrective action for this? Are the details recorded
    in any log so that these errors can be troubleshooted?
    For both the situations, is the classpath variable need to set
    outside the JDeveloper environment?
    Also am not able to locate the Oracle 8i CORBA and Enterprise
    Java Beans Developer's Guide and the Oracle 8i Java Stored
    Procedure Developer's Guide referenced in Building Java
    Applications for Oracle 8i anywhere.
    Would appreciate any help in this area.
    null

    : Has anyone been able to deploy an ejb from JDeveloper2 (Beta)?
    We have ;) But I guess that doesn't count... Please have a look
    at the online demo for Enterprise JavaBeans on this technet
    website. You can get there through the JDeveloper Tech Info page.
    Please open a new thread if that doesn't help you.
    Thanks,
    -Roel.
    phil gulesian (guest) wrote:
    : mark tomlinson (guest) wrote:
    : : pretty sure the first one is a bug that is fixed in a later
    : : build of JDeveloper (JSP deployment problem).
    : : As for the EJB deployment problem, here is the way to catch
    : what
    : : is really going on (in the Beta build -- this will be done
    much
    : : better in the production build):
    : : -edit the jdeveloper.ini (in the BIN directory), in the
    : : [environment] section add:
    : : LogConsole=1
    : : -edit the jdeveloper.properties file (in the LIB directory)
    : : change the line :
    : : jdeveloper.logOutput=nul
    : : to
    : : jdeveloper.logOutput=-
    : : Now when you run JDeveloper, you will get an output onsole
    : : window for the JVM running JDeveloper. You will be able to
    see
    : : the deployment messages for the EJB wizard being sent to this
    : : console. This will allow you to troubleshoot what is
    happening.
    : I had the same experience as Bansi (above) when I tried to
    deploy
    : a simple ejb. Following your suggestions about looking in the
    : output console window for the JVM, I observed the message
    : "PropertyEditor for borland.sql.dataset.ProcedureDescriptor
    could
    : not be registered ........" A subsequent search found no
    : ProcedureDescriptor in the borland.sql.dataset package.
    : Has anyone been able to deploy an ejb from JDeveloper2 (Beta)?
    null

  • WLS 10 and ejb 3 projct deployment problem

    hi all, my env. looks like :
    vls version : 10
    java version : 1.6.0.04
    operating system : Solaris SPARC 64-bit.
    problem :
    when i try to deploy my simplest ejb 3 project i got this error :
    weblogic.management.DeploymentException: [Deployer:149189]Attempt to operate 'distribute' on null BasicDeploymentMBean for deployment Test.
    at weblogic.deploy.internal.targetserver.DeploymentManager.assertDeploymentMBeanIsNonNull(DeploymentManager.java:1281)
    at weblogic.deploy.internal.targetserver.DeploymentManager.findDeploymentMBean(DeploymentManager.java:1322)
    at weblogic.deploy.internal.targetserver.DeploymentManager.createOperation(DeploymentManager.java:1022)
    at weblogic.deploy.internal.targetserver.DeploymentManager.createOperations(DeploymentManager.java:1368)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleUpdateDeploymentContext(DeploymentManager.java:160)
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.updateDeploymentContext(DeploymentServiceDispatcher.java:153)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doUpdateDeploymentContextCallback(DeploymentRe
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.updateDeploymentContext(DeploymentReceiverCall
    at weblogic.deploy.service.internal.statemachines.targetserver.ReceivedPrepare.callDeploymentReceivers(ReceivedPrepare.java:199)
    at weblogic.deploy.service.internal.statemachines.targetserver.ReceivedPrepare.handlePrepare(ReceivedPrepare.java:110)
    at weblogic.deploy.service.internal.statemachines.targetserver.ReceivedPrepare.receivedPrepare(ReceivedPrepare.java:52)
    at weblogic.deploy.service.internal.targetserver.TargetRequestImpl.run(TargetRequestImpl.java:211)
    at weblogic.deploy.service.internal.transport.CommonMessageReceiver$1.run(CommonMessageReceiver.java:408)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    i can't resolve this issues for a week, pls help me.
    everything works fine at home on my PC where i have windows XP Professional OS.
    any idea will be appreciated.
    Regards,
    Paata.
    Magticom LTD, Georgia.
    Edited by paatal at 02/11/2008 5:56 AM
    Edited by paatal at 02/11/2008 5:57 AM

    Hi, Graeme.
    Seems there is an existing CR on something related from v10.0: CR353213
    * WLS 10.0 - EJB 3.0 deployment fails when parsing class for Stateless annotation
    According to http://edocs.bea.com/wls/docs103/issues/known_resolved.html, this is not addressed in 10.3
    Closely review your classpath, and then (assuming you have access to the source) review the body of your ejb. If it is related to this CR, you may be able to workaround the issue by shortening the body and split large methods into more sub-methods.
    I hope this helps,
    -Adrian

  • Entity bean (ejb 3.0) refactoring problem

    I didn't find a better method than regenerating an entity bean after modifying the table definition and renaming the class after deleting the old one.
    I'm not sure i can delete the old class representing the entity bean before regenerating it without any effects into the others entity beans.
    It work fine but still a little problem. The refactoring process didn't change the name of the entity bean into the select clauses into queynamed injection.

    I am facing a similar problem. Does JDeveloper 10g (10.1.3.3.0) provide an automatic process to update an Entity Bean definition when the underlying database table definition changes?
    I also noticed that for JDeveloper to create all the relationships (i.e. @OneToMany, @ManyToOne) between multiple Entity beans, I need to create all the Entity beans together in one pass using the wizard. If two entities depend on each other, and not created together, JDeveloper will not create the relationships between them. Is there a way around that?
    Thank you

  • EJB 3.0 access problem

    Hello!
    I would like to know how I could access from a ManagedBean to the remote interface of a Session Bean. The structure of my ear file is de folowing:
    -Prototipo.ear
      -META-INF
        - MANIFEST.MF
        - application.xml
        - jboss-app.xml
    -PrototipoEJB.jar
      -entity
        -ProyectoCMP.class
      -META-INF
        -MANIFEST.MF
        -ejb-jar.xml
        -persistence.xml
      -session
        -GestorProyectosBean
        -GestorProyectosHome
        -GestorProyectosRemote
    -PrototipoWeb
        -META-INF
          -MANIFEST.MF
        -WEB-INF
           -classes
              -ManagedBean.class
           -lib
           -faces-config.xml
           -web.xmlIn the class ManagedBean I would acces to the session bean GestorProyectosRemote but I don't know how. I try to import the package session.GestorProyectosRemote but this doesn't work.
    I'm using JBoss 4.2.2GA + EJB3.0. In the ejb-jar.xml file there aren't any definition of a bean.This is not necesary for EJB3 doesn't true? This is the content of ejb-jar.xml
    <?xml version="1.0" encoding="utf-8"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
    </ejb-jar>How I can access to the Remote interface of my sessionBean (GestorProyectosRemote)? Because in the class ManagedBean if I put import session.*; Eclipse tells me that this is an error because cannot be resolved
    Thanks,

    Sorry!!! This is a stupid mistake! I forget establish the dependece between my web tier and my ejb tier. Thanks

  • EJB 3.0 entity problem

    I'm tearing my hair out at this one.
    Using JDeveloper 10.1.3, I am generating EJB 3.0 CMP entity beans from tables. On creation from one particular table, the Column I want to use as the primary key does not get automatically annotated with @Column(name="table_name") so I add this in manually and also annotate the column with @Id.
    Whenever I try and use a value which has been mapped as a String within the OC4J container in JDeveloper, it works fine. Whenever I try and access it from within OracleAS 10.1.3, I get a null pointer - but accessing values which are mapped as Long works fine! This is the only one of the Entities I created which does this. I also get a null pointer if I try and assign the entity to a member variable.
    What I want to know is has anyone else seen this behaviour before?
    Thanks in advance
    Paul

    haha I will take that as a no then... ;)
    One other thing is that the entity in question is also causing a serialization error when being transferred from the bean to the test client when run within JDeveloper. Really really weird.
    Any clues/comments appreciated.
    Paul

  • Entities from tables (JPA EJB 3.0) creation problem

    I have a problem to get all the entities created in JDev 10.1.3.3 on UBuntu Linux, JDK 1.5.11. I think that some relations missing also. When I try to connect from my Win XP machine to the same DB (Oracle XE) everything is fine. JDev on Win machine uses JDK 1.5.06. Maybe the problem is JDK version? Any advice?
    Thanks in advance

    Thank you, Andrej. It appears the tutorial has not been updated for the version of JDev I have. I was able to get a few steps further down in the tutorial, but hit more stumbling blocks. This probably isn't something for a true java newbie to try. I'll see if I can find something more in line with my experience (or lack thereof).
    Have a great evening.

Maybe you are looking for