Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

invalid column in ejb cmp  RSS feed

 
lmahesh kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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.
============
 
meka toka
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!