This week's giveaway is in the Testing forum. We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line! See this thread for details.
Dear All, After deploying the bean and when i run the client i am getting the following error .. E:\CONTAINERMANAGED\ENTITY_BEAN_GOPAL>java CheckingClient home object is created EJB Exception:; nested exception is: java.sql.SQLException: ORA-00904: invalid column name
E:\CONTAINERMANAGED\ENTITY_BEAN_GOPAL> kindly advice .. Mahesh L. ============
Hi, If you are beginner, then you have to keep this is mind. Since the last deployment, if you add a new column into any entity bean, then you may face such errors. Please check you ejb-jar.xml and the SQL command the container is applying for that operation. You can look at the container log for this Regards Meka Toka
hI Meka Kota , Here the ejb-jar.xml file ------------------------- <?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>containerManaged</ejb-name> <home>CheckingHome</home> <remote>Checkings</remote> <ejb-class>CheckingsBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>checkingsPK</prim-key-class> <reentrant>False</reentrant> <cmp-field> <field-name>account_number</field-name> </cmp-field> <cmp-field> <field-name>customer_name</field-name> </cmp-field> <cmp-field> <field-name>balance</field-name> </cmp-field>
</entity> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>containerManaged</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> The table structure is SQL> desc checkings Name Null? Type ----------------------------------------------------- -------- ---------------------------- ACCOUNT_NUMBER NOT NULL NUMBER CUSTOMER_NAME VARCHAR2(20) BALANCE NUMBER(10,2) SQL> Kindly help me in resolving the same .. Mahesh L. ============
Hi, I dont see anything wrong in your files. But i do doubt one thing, as you are using CMP the container applies all the fields to the fetch statement. You have a primary key class, so dont you have to store the primary key field into the database ? Cuz when the container applies the fields to the fetch/get statement it applies 3 fields + primary key. Probably thats why its giving you an invalid column. I would suggest you to look into the log file if the container to see whats the SQL statemnt the container appplying Hope that helps Meka Toka
Thanks<br />MekaToka<br />SCJP 1.4
I don't always make ads but when I do they're tiny
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth