aspose file tools*
The moose likes Websphere and the fly likes java.sql.SQLException: The column contact_eid in table dbo.contact does not allow null values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "java.sql.SQLException: The column contact_eid in table dbo.contact does not allow null values" Watch "java.sql.SQLException: The column contact_eid in table dbo.contact does not allow null values" New topic
Author

java.sql.SQLException: The column contact_eid in table dbo.contact does not allow null values

Joe Kuttan
Greenhorn

Joined: Mar 20, 2011
Posts: 4
Hi,
I am migrating an application from weblogic to websphere 7.0 .The application is having ejb CMP 2.0 mapping.I am facing an error when try to insert bean in the database.

Error is
******************************************************************************
java.rmi.RemoteException: ; nested exception is:
+ javax.ejb.EJBException: nested exception is: javax.ejb.TransactionRolledbackLocalException: ; nested exception is: java.sql.SQLException: The column contact_eid in table dbo.contact does not allow null values.+
DSRA0010E: SQL State = 23000, Error Code = 233
+ at app.model.session.UserSessionBean.saveContactVO(UserSessionBean.java:2181)+
**********************************************************************************
EJB Deployment Descriptor:

<entity id="ContainerManagedEntity_1279641119575">
<display-name>News</display-name>
<ejb-name>News</ejb-name>
<local-home>app.model.entity.NewsHome</local-home>
<local>app.model.entity.News</local>
<ejb-class>app.model.entity.WebNewsBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>News</abstract-schema-name>
<cmp-field id="CMPAttribute_1280325864139">
<field-name>frontPage</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1280325864201">
<field-name>headline</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1280325864311">
<field-name>text</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1280325864389">
<field-name>webNewsEid</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1280325864467">
<field-name>active</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1280325864576">
<field-name>sortOrder</field-name>
</cmp-field>
<primkey-field>webNewsEid</primkey-field>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params />
</query-method>
<ejb-ql>SELECT Object (n) FROM WebNews As n</ejb-ql>
</query>
</entity>

_application_name.dbm_

<SQLConstraints:Index xmi:id="_RmxvwcoGEd-qVeyVvnGX2g" name="e_12000073062" Schema="_Rf7fcMoGEd-qVeyVvnGX2g" unique="true" systemGenerated="true" table="_Rmxvw8oGEd-qVeyVvnGX2g">
<members xmi:id="_RmxvwsoGEd-qVeyVvnGX2g" column="_RmxvxMoGEd-qVeyVvnGX2g"/>
</SQLConstraints:Index>
<SQLTables:PersistentTable xmi:id="_Rmxvw8oGEd-qVeyVvnGX2g" name="e_news" schema="_Rf7fcMoGEd-qVeyVvnGX2g" index="_RmxvwcoGEd-qVeyVvnGX2g">
<columns xmi:id="_RmxvxMoGEd-qVeyVvnGX2g" name="web_news_eid" nullable="false">
<containedType xsi:type="SQLDataTypes:FixedPrecisionDataType" xmi:id="_RmxvxcoGEd-qVeyVvnGX2g" name="NUMERIC" primitiveType="NUMERIC" precision="10"/>
<identitySpecifier xmi:id="_RmxvxsoGEd-qVeyVvnGX2g" generationType="ALWAYS_GENERATED" />
</columns>
<columns xmi:id="_Rmxvx8oGEd-qVeyVvnGX2g" name="headline" nullable="false">
<containedType xsi:type="SQLDataTypes:CharacterStringDataType" xmi:id="_RmxvyMoGEd-qVeyVvnGX2g" name="VARCHAR" primitiveType="CHARACTER_VARYING" length="255"/>
</columns>
<columns xmi:id="_RmxvycoGEd-qVeyVvnGX2g" name="w_text" nullable="false">
<containedType xsi:type="SQLDataTypes:CharacterStringDataType" xmi:id="_RmxvysoGEd-qVeyVvnGX2g" name="TEXT" primitiveType="CHARACTER_LARGE_OBJECT"/>
</columns>
<columns xmi:id="_Rmxvy8oGEd-qVeyVvnGX2g" name="front_page">
<containedType xsi:type="SQLDataTypes:IntegerDataType" xmi:id="_RmxvzMoGEd-qVeyVvnGX2g" name="INTEGER" primitiveType="INTEGER"/>
</columns>

<constraints xsi:type="SQLConstraints:PrimaryKey" xmi:id="_Rmxv0coGEd-qVeyVvnGX2g" name="e_12000073062" members="_RmxvxMoGEd-qVeyVvnGX2g"/>
</SQLTables:PersistentTable>

Error occured In :

News entity = home.create(r_vo);

The final error occured in derived file NewsBeanInjuctor :-

public void ejbCreate(com.ibm.ws.ejbpersistence.beanextensions.ConcreteBean cb, javax.resource.cci.IndexedRecord record) {
app.model.entity.ConcreteNews_601c5aad concreteBean=(hqp.model.entity.ConcreteNews_601c5aad)cb;
record.set(0,concreteBean.getHeadline());
record.set(1,app.model.util.TextToStringConverter.singleton().dataFrom(concreteBean.getText()));
record.set(2,new Boolean(concreteBean.getActive()));
record.set(3,concreteBean.getSortOrder());
record.set(4,new Boolean(concreteBean.getFrontPage()));
record.set(5,concreteBean.getNewsEid());
}

Can any one please help to solve this issue...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: The column contact_eid in table dbo.contact does not allow null values