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.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

invalid column in ejb cmp

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
============
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
lmahesh kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
============
 
meka toka
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
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
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic