Win a copy of Pipeline as Code this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

cmr relation

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai,
can any help in this code i am having a cmp bean with depended value , i caught the exception as well source code.
**********
business logic
import javax.ejb.*;
import java.rmi.*;
public interface inter extends EJBObject
{
public String getName()throws RemoteException;
public AddressNa getAddress()throwsRemoteException;
}
********
home interface
import javax.ejb.*;
import java.rmi.*;
public interface home extends EJBHome
{
public inter create(String name,AddressNa add1)throws RemoteException,CreateException;
public inter findByPrimaryKey(String name)throws RemoteException,FinderException;
}
************
bean program
import javax.ejb.*;
import java.rmi.*;
public abstract class be implements EntityBean
{
public abstract void setName(String name);
public abstract String getName();

public abstract AddressNa getAddress();
public abstract void setAddress(AddressNa add1);
public String ejbCreate(String name,AddressNa add2)throws CreateException
{
System.out.println(add2);
setName(name);
setAddress(add2);
return null;
}
public void ejbPostCreate(String name,AddressNa add1)throws CreateException
{
System.out.println("post");
}
public void setEntityContext(EntityContext ctx)
{
System.out.println("ct");
}
public void unsetEntityContext()
{
System.out.println("unset");
}
public void ejbRemove()
{
System.out.println("remove");
}
public void ejbActivate()
{
System.out.println("activate");
}
public void ejbPassivate()
{
System.out.println("passivate");
}
public void ejbLoad()
{
System.out.println("load");
}
public void ejbStore()
{
System.out.println("store");
}
}
************************
import java.io.*;
public class AddressNa implements Serializable
{
public String na1;
public AddressNa(){}
public AddressNa(String na)
{ na1=na; }
public String getAddress()
{return na1;}
public void setAddress(String na)
{na1=na;}
}

***************
client
import java.io.*;
import javax.ejb.*;
import java.rmi.*;
import java.util.*;
import javax.ejb.*;
import javax.naming.*;
import javax.naming.Context.*;
import javax.rmi.*;
public class cl
{
public static void main(String ar[])
{try {
Properties pr=new Properties();
pr.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.T3InitialContextFactory");
InitialContext cont=new InitialContext(pr);
Object ob=cont.lookup("be2");
home home1=(home)PortableRemoteObject.narrow(ob,home.class);
inter inet1=home1.create(new String("wel"),new AddressNa(new String("bha")));
System.out.println("name"+inet1.getName());
System.out.println("success");
}
catch(Exception h)
{
System.out.println("h1"+h);
}
}
}
*****************
when run client i getting this exception in my client
D:\ss\re>java cl
h1javax.transaction.TransactionRolledbackException: EJB Exception: : java.sql.SQ
LException: ORA-01401: inserted value too large for column

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1894)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:109
4)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
va:2132)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
a:2015)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:2877)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
edStatement.java:608)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStateme
nt.java:95)
at weblogic.ejb20.manager.BaseEntityManager.executeInsertStmt(BaseEntity
Manager.java:546)
at weblogic.ejb20.manager.BaseEntityManager.executeDBOperations(BaseEnti
tyManager.java:435)
at weblogic.ejb20.internal.TxManager$TxListener.executeDBOperations(TxMa
nager.java:596)
at weblogic.ejb20.internal.TxManager$TxListener.executeDBOperationsDrive
r(TxManager.java:571)
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
er.java:731)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
erSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
rverSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
dChain(ServerTransactionImpl.java:1142)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
ServerTransactionImpl.java:1868)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
rverTransactionImpl.java:250)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
sactionImpl.java:221)
at weblogic.ejb20.internal.BaseEJBHome.postHomeInvoke(BaseEJBHome.java:3
93)
at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:268)
at be2_1jpfbm_HomeImpl.create(be2_1jpfbm_HomeImpl.java:73)
at be2_1jpfbm_HomeImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:404)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
--------------- nested within: ------------------
weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - wit
h nested exception:
[java.sql.SQLException: ORA-01401: inserted value too large for column
]
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
er.java:743)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
erSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
rverSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
dChain(ServerTransactionImpl.java:1142)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
ServerTransactionImpl.java:1868)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
rverTransactionImpl.java:250)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
sactionImpl.java:221)
at weblogic.ejb20.internal.BaseEJBHome.postHomeInvoke(BaseEJBHome.java:3
93)
at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:268)
at be2_1jpfbm_HomeImpl.create(be2_1jpfbm_HomeImpl.java:73)
at be2_1jpfbm_HomeImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:404)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
; nested exception is:
weblogic.utils.NestedRuntimeException: Error writing from beforeCompleti
on - with nested exception:
[java.sql.SQLException: ORA-01401: inserted value too large for column
]


when run client i getting this exception in my client
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From Exception it seems the size of value that you are passing to CMP that will maps to one database table exceeds from database colomn width.

I have seen your CMP bean.
Can you tell me which database colomn contains the value for AddressNA class. And how you map your CMP to database table?

I think your problem is related to CMR.
But I didn' find any CMR related information in your class.
It's better for you to check your descriptor files.
 
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic