Deploying entity beans with Local interfaces on Jboss

Hi, I'm trying to deploying a simple entity bean on Jboss. The EJB has been developed with Local Interfaces because then I want to access it with a session bean facade.
I get the following error:
<!-- ERROR BEGIN -->
23:41:25,984 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
23:41:25,984 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.4.7.1
Warning: The primkey-field element must name a public field in the bean implemen
tation class.
<!-- ERROR END -->
I'm following what is wrote in the Professional EJB editeb by wrox?
Is it possible to deploy an entity bean alone with Local interfaces? Is there something I'm missing? It's true that I defined the implementation class as abstract, but because there are abstract getter/setter methods.
Thanks for any help,
Marco

Greetings,
Hi, I'm trying to deploying a simple entity bean on
Jboss. The EJB has been developed with Local
23:41:25,984 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
23:41:25,984 WARN [verifier] EJB spec violation:
Bean : UsersEJB
Section: 9.4.7.1
Warning: The primkey-field element must name a public field in
the bean implementation class.What version of JBoss are you using? These errors indicate container compliance with EJB spec 1.1, not 2.0 to which your CMP beans are written. Download the latest JBoss release version - 3.2.1 - and you should not see this problem.
Is it possible to deploy an entity bean alone with
Local interfaces? Is there something I'm missing? It'sYes it is (no, you are not "missing something" ;). In fact, this is recommended practice in most cases under CMP 2.0 - CMR having been a major impetus to the development of Local interfaces in the specification. ;)
true that I defined the implementation class as
abstract, but because there are abstract getter/setter
methods.No problems. You are "right on track" for CMP 2.0. :)
Thanks for any help,
MarcoRegards,
Tony "Vee Schade" Cook

Similar Messages

  • Problems deploying entity beans with local interfaces on Jboss?

    I'm trying to deploy a simple entity bean using local interfaces on Jboss 3.2.1 and I obtain the following exception:
    19:08:51,875 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.2.2
    Warning: The entity bean class must not be defined as abstract.
    19:08:51,875 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.4.7.1
    Warning: The primkey-field element must name a public field in the bean implemen
    tation class.
    Any idea?
    Thanks,
    Marco

    I guess you are missing <cmp-version>2.x</cmp-version> for your first warning and <primkey-field>primary key field </primkey-field> for you second warning in your ejb-jar.xml

  • Do I need to Create Primary Key Class for Entity beans with Local interface

    Do I need to Create Primary Key Class for Entity beans with Local interface?
    I have created my entity bean with the wizard in Sun One Studio and it does not create a primary key class for you.
    I thought that the primary key class was required. My key is made up of only one field.
    Anyone know the answer.
    Jim

    u dont need to create a primary key class for a entity bean.if ur table's primary key feild(int ,float) is a built in or primitive data type,then u dont need one.But if ur table has a primary key field which is non primitive (for example StudentID,ItemID etc)then u have to create a primary key class.
    hope this helps :-)

  • CMP Entity beans using local interfaces

    Why CMP entity beans with CMR relation ship using local interfaces only?
    Why we should not use remote interface to get the CMR field relationship?
    Pls give me the solutions

    "Local interfaces provide the foundation for container-managed relationships among entity beans and session beans. The bean uses the local interface to maintain its references to other beans. For example, an entity bean uses its local interfaces to maintain relationships to other entity beans. Using local interfaces, beans can also expose their state and use pass-by-reference to pass their state between related bean instances. "
    http://java.sun.com/developer/technicalArticles/ebeans/EJB20CMP/

  • Problem with Local Interfaces (WSAD 5)

    I built an Entity Bean with Local Interface and a Remote Interface (apperently they both have the same JNDI name in WSAD)
    and when I look up for the name from other Session Bean (same EJB group) and I try to cast it to the local interface there is a classCastException.............
    HELP ME

    Nidhi
    I had the same problems as you that went away. If you have both remote and local interfaces defined, and your remote inerface can be accessed via JNDI lookup using (say) "ejb/sessionbean/stateless/HelloHome", then you can access the local intercafe using "local:ejb/ejb/sessionbean/stateless/HelloHome".
    The URL http://localhost:9080/UTC/initialize?port=2809 is very useful to browse the JNDI tree. Just expand "Local EJB beans" and position your mouse over the item of interest. The JNDI lookup name will echo in the bottom (solid) frame of the browser. The only problem is that the jndilookup name will appear (mistakenly) as local:/ejb/ejb/stateless......, just get rid of the first forward-slash to make it look like local:ejb/ejb/stateless....
    Hope this helps
    Somnath

  • CMP Entity Bean with ejb-ql finder methods and INFORMIX database

    Hi,
    I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
        <entity>
          <abstract-schema-name>BeanName</abstract-schema-name>
          <cmp-field><field-name>fieldOne</field-name></cmp-field>
          <cmp-field><field-name>fieldTwo</field-name></cmp-field>
          <query>
            <query-method>
              <method-name>findAll</method-name>
              <method-params></method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
          </query>
        <entity>
    And in persistent.xml:
    <db-properties>
         <data-source-name>datasource_name</data-source-name>
    </db-properties>
    <entity-bean>
         <ejb-name>BeanName</ejb-name>
         <table-name>table_name</table-name>
         <field-map key-type="NoKey">
         <field-name>fieldOne</field-name>
         <column><column-name>column_one</column-name></column>
          </field-map>
         <field-map key-type="NoKey">
         <field-name>fieldTwo</field-name>
         <column><column-name>column_two</column-name></column>
          </field-map>
          <finder-descriptor>
              <method-name>findAll</method-name>
              <method-params/>
         </finder-descriptor>
    Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
    j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
    with names:
    BeanName0_0pm.java
    BeanName0_0PM.class
    and the generated java file contains this code:
      public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException  {
        TransactionContext tc = pm.getTransactionContext();
        Connection conn = null;
        PreparedStatement pSt = null;
        ResultSet ejb_rs = null;
        int status = javax.transaction.xa.XAResource.TMSUCCESS;
        try {
          conn = pm.getConnectionForFindMethod();
          pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
          ejb_rs = pSt.executeQuery();
    I'm trying to call this method but it throws a SQLException when preparing the statement.
    It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
    When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
    Is there any way to define how this SQL query is build?
    Thanks in advance.

    The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface

  • Deploying EJB with Local Interfaces.

    HI everybody
    I am trying example on EJB with LocalInterfaces with BMP.
    My bean without Local interface is deployed and working fine.
    Then i have changed Home & Remote interface code. Again i have deployed it . It is deployed but i am unable to Look Up.
    I am using J2SDKEE1.3 server & JDK1.3.
    I have changed both interface files as follow:-
    I have made my Home interface as :
    public interface RetrieveConditionHome extends javax.ejb.EJBLocalHome {
         public RetrieveCondition create(String SQL_WHERE_ID, String SQL_WHERE_NAME,
              String FROM_TABLE , String WHERE_CLAUSE , String LAST_UPD_USER_ID ,
              Date LAST_UPD_TMSTMP, int ROW_VERSION)
              throws CreateException;
    I have made my Remote interface as :
    public interface RetrieveCondition extends javax.ejb.EJBLocalObject {
         public String getSQLWHERENAME() ;
    -Viren

    In JMS tutorial : They have stated ejbCreateLocal method.
    I am not using this method in my Bean class. I am using general ejbCreate method as we normally do .
    I am really confused about these methods : ejbCreate & ejbCreateLocal.
    JMS Tutorial site (where they have used ejbCreateLocal):
    A J2EETM Application that Uses the JMS API with an Entity Bean
    java.sun.com/products/jms/tutorial/1_3-fcs/doc/j2eeapp3.html
    Viren

  • Error While Deploying A CMP Entity Bean With A Composite Primary Key

    Hello all,
    I have a problem deploying CMP Entity beans with composite primary keys. I have a CMP Entity Bean, which contains a composite primary key composed of two local stubs. If you know more about this please respond to my post on the EJB forum (subject: CMP Bean Local Stub as a Field of a Primary Key Class).
    In the mean time, can you please tell me what following error message means and how to resolve it? From what I understand it might be a problem with Sun ONE AS 7, but I would like to make sure it's not me doing something wrong.
    [05/Jan/2005:12:49:03] WARNING ( 1896):      Validation error in bean CustomerSubscription: The type of non-static field customer of the key class
    test.subscription.CustomerSubscriptionCMP_1530383317_JDOState$Oid must be primitive or must implement java.io.Serializable.
         Update the type of the key class field.
         Warning: All primary key columns in primary table CustomerSubscription of the bean corresponding to the generated class test.subscription.CustomerSubscriptionCMP_1530383317_JDOState must be mapped to key fields.
         Map the following primary key columns to key fields: CustomerSubscription.CustomerEmail,CustomerSubscription.SubscriptionType. If you already have fields mapped to these columns, verify that they are key fields.Is it enough that a primary key class be serializable or all fields have to implement Serializable or be a primitive?
    Please let me know if you need more information to answer my question.
    Thanks.
    Nikola

    Hi Nikola,
    There are several problems with your CMP bean.
    1. Fields of a Primary Key Class must be a subset of CMP fields, so yes, they must be either a primitive or a Serializable type.
    2. Sun Application Server does not support Primary Key fields of an arbitrary Serializable type (i.e. those that will be stored
    as BLOB in the database), but only primitives, Java wrappers, String, and Date/Time types.
    Do you try to use stubs instead of relationships or for some other reason?
    If it's the former - look at the CMR fields.
    If it's the latter, I suggest to store these fields as regular CMP fields and use some other value as the PK. If you prefer that
    the CMP container generates the PK values, use the Unknown
    PrimaryKey feature.
    Regards,
    -marina

  • Deployment error in 9.0.3 for app with local interface

    While attempting to port an EJB-application from jboss to oracle, I have encountered a deployment error in 9.0.3 9iASR2 which I cannot decipher. The same ear-file is successfully deployed on the 9.0.3. OC4J standalone version (both on a machine running winXP)
    I get a "syntax error in source" when I attempt the deployment and all my local-interface class-files end up on the j2ee_home root, i.e. <oracle-home>/j2ee/home/.
    Am I too early using local interface on version 9.0.3, is my packaging messed up or should I look for my bugs in some missed logfile?
    BTW: where do I find deployment stack traces for this version of 9iAS?
    Dag

    Hi,
    you can find deployment stack traces in the following location \ORACLE\806\opmn\logs. i think this might help u.
    I am also facing a problem like com.evermind.compiler.CompilationException: Syntax error in source,did u know cause for this.
    Thanks and Regards,
    Bala

  • Error deploying entity bean on web logic server

    i am trying to deploy a container managed persistence entity bean on web logic server when i run the command ejbc which generates the final jar file ready to deploy having its stub and skeleton it gives me the error that the return type of create(int) method should have a type of bean home interface while in accordance with ejb1.1 specicication it should be the type of primary key and a null value should be returned.
    plz let me know where i am doing it wrong.

    thanks for ur quick response sir i am using this services provided by sun microsystem first time and
    am really thankful to Sun Microsystem for this great deal of help to the new commers but sir my problem is still there.
    following is the method which i have written in the code
         public InvoicePK ejbCreate(int id)
              this.id=id;
              return null;
    and here it is the error generated by the server deployment tool.
    [9.2.8] In EJB Invoice, the return type for the create method create(int) must be the bean's remote interface type.
    [9.2.8] In EJB Invoice, the findByPrimaryKey method must return the Entity bean's remote interface type.
    [9.2.8] In EJB Invoice, the return type for the method findByPrimaryKey(com.swi.InvoicePK) must be the entity bean's remote interface type (for a single-object finder) or a collection thereof (for a mult-object finder).
    the detail of files created by me are as follows.
    1. Invoice (Entity Bean)
    2. InvoicePK (Primary Key file)
    3. MyRemoteInterface (remote interface for entity bean)
    4. MyHomeInterface (home interface for entity bean)
    plz let me know where i am doing wrong and oblige.

  • Bad Performance/OutOfMemory Error in CMP Entity Bean with Large DB

    Hello:
    I have an CMP Entity deployed on WLS 7.0
    The entity bean maps to a table that has 97,480 records.
    It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
    I have a JSP client that invokes the findALL()
    The performance is very poor ~ 150 seconds just to perform the findAll() - (Benchmark
    from within the JSP code)
    If more than one simultaneous call is made then I get outOfMemory Error.
    WLS is started with max memory of 512MB
    EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
    (without max-beans-in-cache directive the performance is worse)
    Is there any documentation available to help us in deploying CMP Entity Beans
    with very large number of records (instances) ?
    Any help is greatly appreciated.
    Regards
    Rajan

    Hi
    You should use a Select Method, it does support cursors.
    Or a Home Select Method combination.
    Regards
    Thomas
    WLS is started with max memory of 512MB
    EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>>
    (without max-beans-in-cache directive the performance is worse)>
    Is there any documentation available to help us in deploying CMP
    Entity Beans with very large number of records (instances) ? Any help
    is greatly appreciated.>
    Regards>
    Rajan>
    >
    "Rajan Jena" <[email protected]> schrieb im Newsbeitrag
    news:3dadd7d1$[email protected]..
    >
    Hello:
    I have an CMP Entity deployed on WLS 7.0
    The entity bean maps to a table that has 97,480 records.
    It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
    I have a JSP client that invokes the findALL()
    The performance is very poor ~ 150 seconds just to perform the findAll() -(Benchmark
    from within the JSP code)
    If more than one simultaneous call is made then I get outOfMemory Error.
    WLS is started with max memory of 512MB
    EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
    (without max-beans-in-cache directive the performance is worse)
    Is there any documentation available to help us in deploying CMP EntityBeans
    with very large number of records (instances) ?
    Any help is greatly appreciated.
    Regards
    Rajan

  • Error While deploying Entity Bean

    Hi,
    We are using JDeveloper 3.2.2 to deploy EJB into Oracle 9ias (Oracle 8.1.7 database). The following error occured while deploying entity bean.
    "Persistence provider declared in the deployment descriptor is not supported
    *** Errors occurred while deploying the EJB to 8i JVM ***
    *** Deployment completed ***"
    Please help us with the solution if anyone have come across this kind of error.
    Regards
    Santhosh
    null

    Thank you Raghu, We were in a position to deploy the entity bean to the database. We solved the problem by adding the following parameters to the init.ora file
    (a) Java_max_sessionspace_size
    (b) java_soft_sessionspace_limit
    When I tried to create an EJB for a table in another schema, it started deploying the BC4J to that schama also. Is it necessary that BC4J should deploy in all the schemas of the database ? Can I deploy BC4J to one schema and grant required permissions to others users or create public synonym for BC4J ? Can you please tell me how I can deploy BC4J globally for an instance of Oracle (Applicable to all the schemas in that instance) ?
    Santhosh

  • Oracle Application Server 10.1.3, error when deploying entity bean

    I am using 9.0.4.2 and am planning to upgrade to 10.1.3. When trying to deploy the application to 10.1.3 I get the following error for an Entity Bean with Container Managed Persistence
    006-03-20 10:05:51.436 NOTIFICATION Error while compiling EJB component: file:/C:/oc4j/j2ee/home/ap
    plications/ipower/InstitutionMgrSer-EJB.jar
    06/03/20 10:05:51 WARNING: EJBContainer.postInit Error generating wrappers for file:/C:/oc4j/j2ee/ho
    me/applications/ipower/InstitutionMgrSer-EJB.jarcom.evermind.compiler.CompilationException: Method p
    ublic abstract int com.eplinc.gv.bus.instmgr.AccessibleTrailerBean.getInstitution() can not be decla
    red abstract for entity 'AccessibleTrailerBean'
    at com.evermind.server.ejb.compilation.CMPObjectCompilation.verifyMethods(CMPObjectCompilati
    on.java:782)
    at com.evermind.server.ejb.compilation.CMPObjectCompilation.<init>(CMPObjectCompilation.java
    :56)
    at com.evermind.server.ejb.compilation.PersistenceManagerCompilation.<init>(PersistenceManag
    erCompilation.java:30)
    at com.evermind.server.ejb.compilation.EntityBeanCompilation.<init>(EntityBeanCompilation.ja
    va:121)
    at com.evermind.server.ejb.compilation.Compilation.generateAnyOldStyle(Compilation.java:1590
    at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:182)
    at com.evermind.server.ejb.compilation.Compilation.doGenerateCode(Compilation.java:250)
    at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:891)
    at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning
    .java:210)
    at com.evermind.server.Application.setConfig(Application.java:391)
    at com.evermind.server.Application.setConfig(Application.java:308)
    at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
    at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:50
    7)
    What am I missing? Note that on 9.0.4.2 and its previous versions the deployment was successful.

    We use EJB2.0 and as per the specifications entity class and getters/setters should be abstract. This is what we have. I have verified the dtd used in ejb-jars and it has references to the correct version. Here is an example <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">. Also the tag <cmp-version>2.x</cmp-version> is included for all the entity beans.
    Now I am just curious to know if anyone has tried deploying Entity Beans 2.0 on a 10.1.3? and if so was the deployment successful?

  • Can Entity Bean with Home Business Method replace Stateless Session Bean?

    Since Entity Bean can have business methods in the Home Interface, can we use Entity Bean with Home Business Methods to replace Stateless Session Bean?
    I am assuming we can get better performance by doing this since the overhead of creating Component Object can be avoided as compared to stateless session beans.

    Requires-new makes the container start a new transaction. Only use that flag
              at the point that you are certain that a NEW transaction should BEGIN. I
              suggest you use Required as your default for all methods in the application,
              and only change that to anything else when you are certain that you should.
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/download.jsp >>
              "A.J,LEE" <[email protected]> wrote in message
              news:3ba5adb2$[email protected]..
              >
              > I find it result in "dead lock"
              > when I call RequiresNew attributed CMP method in session Bean.
              > Then, Is it possible to use CMP which is set with "RequiresNew"
              transaction attribute?
              >
              > I Wonder why.
              >
              > Thanx in advance.
              

  • Multiple users accessing entity bean with same PK

    Hi,
    Some body please clarify the below issue.
    (EJB 1.1, WAS3.5)
    I have two app servers and two clones each clone is running in each app server.
    Stateful session bean access Entity beans to update/read record in the database.
    According to my requirement multiple users can access the same entity data (same primary key). Suppose user A created a Stateful session bean SB1 and the SB1 created Entity1 with PK1, this is happening at clone1.
    User B accessed the site and the request went to Clone2 and a new SB2 created, but the SB2 need to access the database with Same PK1.
    For the above situation, I guess container can not create a new Entity bean with PK1 because EB with PK1 is already there and it tries to allocate same EB1 with SB2, so if two requests are concurrent do the SB2 wait to get the handle of the EB1?
    Is there any way to create two Entity beans with same Primary Key at the same time but in different clone?
    Thanks,
    Sagar

    Hi,
    The concurrency level has to be set at the level of database and the database will take care of consistency & integrity of the data. So specity the concurrency level on the database connection in each appserver.

Maybe you are looking for

  • Moving iPhone from broken laptop

    Have wifes XP laptop, screen smashed, keyboard damaged, total loss. Have accesss to drive, drive ok Moving her iPhone to her xp desktop copied last backup from laptop to correct folder location. C:\Documents and Settings\USER NAME\Application Data\Ap

  • End-of-file error upon launching PS3

    Anyone have a solution?  Upon opening Photoshop CS3, the program goes through it's startup routine, and then I get this error message:  "Could not load actions because an unexpected end-of-file was encountered."  And the program shuts down.  After an

  • Package org.openuri.bea.samples.workshop.*

    Hi, I am going over workshop 8.1 tutorial. In Tutorial: Java Control Step 3: Add a Web Service Control, where is this package "import org.openuri.bea.samples.workshop.*"? When I typed this import statement, the IDE gave me error message "ERROR: Packa

  • How do i remove "other" space from i phone

    I have been trying everything i even restored my phone but there is just more "other" space in my phone being taken up now i want to download music but its saying all of my space is being taken up helpp!!

  • PaintComponent Method

    Hello, can any one tell me when paintComponent(Graphics gc){} method will be called??? it's needed that i have to extends JPanel. in my prog m extending theJApplet class. can paintComponent(Graphics gc){} will called if m extending the JApplet.. plz