Problem in running entity bean examples
I am trying to run a entity bean example in my bea ,earlier i was getting the error
that the data source name could not be found ,and so i replaced the data source
name in my .xml file
as cgDataSource and now i am not finding that error ,and the
jsp page is also displayed ,but the data is not inserted into
my database table.
I tried it using my personal domain ,and i edited the weblogic.properties file
also ,but now i am getting the error that the data source name could not be found
Hi,
An error saying a data source can't be found indicates one of two problems:
1. The data source name in your cmp descriptor doesn't match the JNDI name of
the actual data source. To rule this out, verify the names are indeed the same.
2. The data source didn't deploy. Usually this is caused by the underlying connection
pool not deploying. Look in you server log to verify the data source and the
underlying connection pool both deployed properly.
- Matt
"Vipin Nair" <[email protected]> wrote:
>
I am trying to run a entity bean example in my bea ,earlier i was getting
the error
that the data source name could not be found ,and so i replaced the data
source
name in my .xml file
as cgDataSource and now i am not finding that error ,and the
jsp page is also displayed ,but the data is not inserted into
my database table.
I tried it using my personal domain ,and i edited the weblogic.properties
file
also ,but now i am getting the error that the data source name could
not be found
Similar Messages
-
Resource problem when running Entity Bean
Hi,
can someone please help me with the following problem I am getting
weblogic.common.ResourceException: No resources available
at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
java:568)
at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
java:400)
at weblogic.common.internal.ResourceAllocator.reserveNoWait(ResourceAllo
cator.java:368)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.j
ava:166)
at weblogic.jdbc.common.internal.ConnectionPool.reserveNoWait(Connection
Pool.java:127)
at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiData
Source.java:194)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:219)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSP
ersistenceManager.java:313)
at CatalogueCMPEJB_WebLogic_CMP_RDBMS.__WL_exists(CatalogueCMPEJB_WebLog
ic_CMP_RDBMS.java:1381)
at CatalogueCMPEJB_WebLogic_CMP_RDBMS.__WL_create(CatalogueCMPEJB_WebLog
ic_CMP_RDBMS.java:1351)
at CatalogueCMPEJB_WebLogic_CMP_RDBMS.ejbPostCreate(CatalogueCMPEJB_WebL
ogic_CMP_RDBMS.java:1257)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.manager.DBManager.create(DBManager.java:583)
at weblogic.ejb20.manager.DBManager.remoteCreate(DBManager.java:462)
at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:190)
at CatalogueCMPBean_knt3og_HomeImpl.create(CatalogueCMPBean_knt3og_HomeI
mpl.java:84)
at CatalogueMgrBean.createBook(CatalogueMgrBean.java:32)
at CatalogueMgrBean_pt5olq_EOImpl.createBook(CatalogueMgrBean_pt5olq_EOI
mpl.java:259)
at CatalogueMgrBean_pt5olq_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:257)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
thanks in advance,
Jason :)Increase the max. count on JDBC Connection pool, also as a good practice close
any openconnection after doing any BMP.
V
"ajay" <[email protected]> wrote:
>
Hi ,
this exception might also occur if u r not using an entity bean but using
the
conection pool to get connections and not closing them
what happens is the connection in the pool are exausted and it throws
a no resources
available exception.
regards
ajay
"Neeraj" <[email protected]> wrote:
"Jason" <[email protected]> wrote:
Hi,
can someone please help me with the following problem I am getting
weblogic.common.ResourceException: No resources available
at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
java:568)
at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
java:400)
at weblogic.common.internal.ResourceAllocator.reserveNoWait(ResourceAllo
cator.java:368)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.j
ava:166)
at weblogic.jdbc.common.internal.ConnectionPool.reserveNoWait(Connection
Pool.java:127)
at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiData
Source.java:194)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:219)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSP
ersistenceManager.java:313)
at CatalogueCMPEJB_WebLogic_CMP_RDBMS.__WL_exists(CatalogueCMPEJB_WebLog
ic_CMP_RDBMS.java:1381)
at CatalogueCMPEJB_WebLogic_CMP_RDBMS.__WL_create(CatalogueCMPEJB_WebLog
ic_CMP_RDBMS.java:1351)
at CatalogueCMPEJB_WebLogic_CMP_RDBMS.ejbPostCreate(CatalogueCMPEJB_WebL
ogic_CMP_RDBMS.java:1257)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.manager.DBManager.create(DBManager.java:583)
at weblogic.ejb20.manager.DBManager.remoteCreate(DBManager.java:462)
at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:190)
at CatalogueCMPBean_knt3og_HomeImpl.create(CatalogueCMPBean_knt3og_HomeI
mpl.java:84)
at CatalogueMgrBean.createBook(CatalogueMgrBean.java:32)
at CatalogueMgrBean_pt5olq_EOImpl.createBook(CatalogueMgrBean_pt5olq_EOI
mpl.java:259)
at CatalogueMgrBean_pt5olq_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:257)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
thanks in advance,
Jason :)-------------
Its failing in ejbPostCreate, i.e. entering record in the database involving
CMR
fields. Please check your relationships in *.xml files. -
SOS problem using one Entity bean for editing records. please help me
Hello
I have one great problem using one entity bean 2.1 and i am working with this problem several days and i dont solve it.
i am using this jb 2.1 for add new records to one oracle database and for editing records.
I have one great problem for editing records
I have one objets that is as one of my database table. (PersonaObj.java)
//personaObj.java
public class PersonaObj implements Serializable{
private Integer id_persona; //this ishte database table autonumeric
private java.lang.String nombre;
now the set/get methods.
One field of this objets (bean) is the primary key of the table, and this field is one part of the pk from the entity bean.
From one session bean i call the entity bena passing the objet
into the entity bean (interface) i have one methods:
public getPersona getT56aaat04();
public void setPersona(PersonaObj obj);
into the entitybean bean i have:
public PersonaEntityPK ejbCreate(PersonaObj obj) throws CreateException {
this.setT56aaat04(obj);
public abstract Integer getId_persona();
public abstract void setId_persona(Integer Id_persona);
public abstract java.lang.String getNombre();
public abstract void setNombre(java.lang.String Nombre);
public PersonaObj getPersona() {
PersonaObj obj = new PersonaObj();
obj.setId_persona(getId_persona());
obj.setNombre(getNombre());
return obj;
public void setPersona(PersonaObj obj) {
setId_persona(obj.getId_persona());
setNombre(obj.getNombre());
But i have one graet problem.
adding new record to the database i runs well but if i want to edit one recor appears this error:
=> Error <=
java.rmi.RemoteException: EJB Exception: ; nested exception is: javax.ejb.EJBException: EJB Exception: : java.lang.IllegalStateException:[EJB:010144]The setXXX method for a primary key field may only be called during ejbCreate.
at PersonasEJB_a43o8n__WebLogic_CMP_RDBMS.setId_persona(PersonasEntityEJB_a43o8n__WebLogic_CMP_RDBMS.java:328)
at PersonasEntityBean.setPersona(PersonasEntityBean.java:114)
at PersonasEntityEJB_a43o8n_ELOImpl.setPersona(PersonasEntityEJB_a43o8n_ELOImpl.java:45)
at PersonasSessionBean.editarPersona(PersonasSessionBean.java:849)
at PersonasSessionBean_bszo9t_EOImpl.editarPersona(PersonasSessionBean_bszo9t_EOImpl.java:208)
at PersonasSessionBean_bszo9t_EOImpl_WLSkel.invoke(Unknown Source)
into the session bean i make this (the session recibes one PersonaObj obj):
T56aContactosEntityLocal personaLocal ;
try {
personaLocal = personaHome.findByPrimaryKey(new T56aContactosEntityPK(obj.getId_a04()));
T56aaat04Obj objTmp = new T56aaat04Obj();
objTmp.setAp1_a04(obj.getAp1_a04());
objTmp.setEstado_a04("false");
personaLocal.setT56aaat04(obj);
Please can you help me to solve this problem?Hello Werner,
The mappings seem to be alright at a first glance.
Have you tried out un- and redeploying your application? Sometimes values appear to be cached in the server. So if you have deployed the application before you entered DB_BANK as alias this might solve the problem...
BR
Daniel -
Problem while deploying entity beans
Hi,
We are using JDeveloper 3.2.2 (NT) and 8.1.7 (NT) to deploy EJB's.
Now we are trying to deploy the entity bean to Oracle JVM. We are facing the following problem while deploying an entity bean .
"Persistence provider declared in the deployment descriptor is not supported
*** Errors occurred while deploying the EJB to 8i JVM ***
*** Deployment completed ***"
We would appreciate if anyone could help us to solve this error.
nullHi,
The error was coming because of the table structure. All the columns were composite keys. I alter the structured by removing composite keys and added a new column as primary key. Now it is getting deployed successfully.
Can anybody comment on such a behaviour of OC4J?
Regards,
Jinal Shah -
Problem deploying EJB entity bean
Hi all!
I'm trying to deploy an CMP entity bean with composite primary key.
My environment is Oracle 8i (8.1.7) on W2K Professional and I'm using JDK 1.3.1_02.
The error I get is:
Compiling Stubs...done
Generating Jar File...done
Loading EJB Jar file and Comm Stubs Jar file...done
Generating EJBHome and EJBObject on the server...
An exception occurred during code generation: null
I don't understand what am I doing wrong...
Any help will be highly appreciated.
[Could anyone point me out sample code for CMP entity beans with composite primary key?]
Apologies for the length of the POST, just trying to pass as much info as I can...
The table is the following:
CREATE TABLE GPS_HIST (
gps_date_of_fix VARCHAR2(40) NOT NULL,
gps_time_of_fix VARCHAR2(40) NOT NULL,
issi NUMBER(10) NOT NULL,
gps_condition NUMBER(5),
gps_latitude VARCHAR2(40),
gps_longitude VARCHAR2(40),
gps_speed_knt NUMBER(10),
constraint gps_hist_pk primary key (gps_date_of_fix, gps_time_of_fix, issi))
TABLESPACE AVLDATA
PCTFREE 10 PCTUSED 40
INITRANS 1 MAXTRANS 255
STORAGE (
INITIAL 128K NEXT 128K PCTINCREASE 0
MINEXTENTS 1 MAXEXTENTS 4096)
NOCACHE;
The primary key class is the following:
package gps;
public class GPSEntryPK implements java.io.Serializable
public int ISSI;
public String gpsTimeOfFix;
public String gpsDateOfFix;
public GPSEntryPK() {}
public GPSEntryPK (String gpsDateOfFix, String gpsTimeOfFix, int ISSI)
this.gpsDateOfFix = gpsDateOfFix;
this.gpsTimeOfFix = gpsTimeOfFix;
this.ISSI = ISSI;
public String getGPSDateOfFix()
return this.gpsDateOfFix;
public String getGPSTimeOfFix()
return this.gpsTimeOfFix;
public int getISSI()
return this.ISSI;
public boolean equals(Object obj) {
if ((obj instanceof GPSEntryPK) &&
(this.ISSI == ((GPSEntryPK)obj).ISSI) &&
(this.gpsTimeOfFix.equals(((GPSEntryPK)obj).gpsTimeOfFix)) &&
(this.gpsDateOfFix.equals(((GPSEntryPK)obj).gpsDateOfFix)))
return true;
return false;
public int hashCode() {
return (this.gpsTimeOfFix.concat(this.gpsDateOfFix)).hashCode() * this.ISSI;
The bean implemantation (part of it) is as follows:
public void setEntityContext(EntityContext ctx)
this.ctx = ctx;
Properties props = ctx.getEnvironment();
public void unsetEntityContext()
this.ctx = null;
public GPSEntryPK ejbCreate(String gpsDateOfFix, String gpsTimeOfFix, int ISSI, int gpsCondition,
String gpsLatitude, String gpsLongitude, double gpsSpeedKnt)
throws CreateException, RemoteException
try {
setGPSDateOfFix(gpsDateOfFix);
setGPSTimeOfFix(gpsTimeOfFix);
setISSI(ISSI);
setGPSCondition(gpsCondition);
setGPSLatitude(gpsLatitude);
setGPSLongitude(gpsLongitude);
setGPSSpeedKnt(gpsSpeedKnt);
} catch (java.rmi.RemoteException e) {
throw new CreateException();
return null;
public GPSEntryPK ejbFindByPrimaryKey(GPSEntryPK pk) throws RemoteException, FinderException {
return null;
public void ejbPostCreate(String gpsDateOfFix, String gpsTimeOfFix, int ISSI, int gpsCondition,
String gpsLatitude, String gpsLongitude, double gpsSpeedKnt)
throws CreateException
// get primarykey
GPSEntryPK pk = (GPSEntryPK)ctx.getPrimaryKey();
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void ejbLoad()
// You can get to the primary key
GPSEntryPK pk = (GPSEntryPK)ctx.getPrimaryKey();
public void ejbStore(){}
The descriptors are the following:
"gpsentry.xml"
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems Inc.//DTD Enterprise JavaBeans 1.1//EN" "ejb-jar.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<description>no description</description>
<ejb-name>GPSEntry</ejb-name>
<home>gps.GPSEntryHome</home>
<remote>gps.GPSEntry</remote>
<ejb-class>gpsServer.GPSEntryBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>gps.GPSEntryPK</prim-key-class>
<reentrant>False</reentrant>
<cmp-field><field-name>gpsDateOfFix</field-name></cmp-field>
<cmp-field><field-name>gpsTimeOfFix</field-name></cmp-field>
<cmp-field><field-name>ISSI</field-name></cmp-field>
<env-entry>
<env-entry-name>realmName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>gps.realm</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>GPSEntryBean.databaseURL</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>jdbc:oracle:kprb:</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>GPSEntryBean.JDBCDriverName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>oracle.jdbc.driver.OracleDriver</env-entry-value>
</env-entry>
</entity>
</enterprise-beans>
</ejb-jar>
"oracle_gpsentry.xml"
<?xml version="1.0"?>
<!DOCTYPE oracle-descriptor PUBLIC "-//Oracle Corporation.//DTD Oracle 1.1//EN" "oracle-ejb-jar.dtd">
<oracle-descriptor>
<mappings>
<ejb-mapping>
<ejb-name>GPSEntry</ejb-name>
<jndi-name>test/gpsentry</jndi-name>
</ejb-mapping>
</mappings>
<persistence-provider>
<description> specifies a type of persistence manager </description>
<persistence-name>psi-ri</persistence-name>
<persistence-deployer>oracle.aurora.ejb.persistence.ocmp.OcmpEntityDeployer</persistence-deployer>
</persistence-provider>
<persistence-descriptor>
<description> This specifies a particular type of persistence manager to be used for a bean. param is where you would put bean specific persistence info in the format of params. The deployment process just passes what's in the param to the persistence deployer. For the baby persistence, we do parse the persistence-mapping but for other persistence backend we don't do anything with the params </description>
<ejb-name>customerbean</ejb-name>
<persistence-name>psi-ri</persistence-name>
<psi-ri>
<schema>AVLMIS</schema>
<table>gps_hist</table>
<attr-mapping>
<field-name>gpsDateOfFix</field-name>
<column-name>gps_date_of_fix</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsTimeOfFix</field-name>
<column-name>gps_time_of_fix</column-name>
</attr-mapping>
<attr-mapping>
<field-name>ISSI</field-name>
<column-name>issi</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsCondition</field-name>
<column-name>gps_condition</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsLatitude</field-name>
<column-name>gps_latitude</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsLongitude</field-name>
<column-name>gps_longitude</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsSpeedKnt</field-name>
<column-name>gps_speed_knt</column-name>
</attr-mapping>
</psi-ri>
</persistence-descriptor>
</oracle-descriptor>
Thanks in advance.Hi Nikos,
I obviously don't know what your entire situation is, but you may not
be aware that Oracle's DBMS embedded EJB container does not work well,
and as a result, Oracle decided to replace it with an external EJB
container which is part of a product called "Oracle Containers for
J2EE" (otherwise known as "OC4J"). The "other" forum (the J2EE forum)
deals mainly with OC4J.
As far as I know, Oracle recommends doing your EJB related work with
OC4J and not with the embedded EJB container.
Good Luck,
Avi. That's correct
Java code, implementing data bound logic, can still run in the database as Java stored procedures/packages/functions/triggers
while J2EE componentsdeployed in middle-tier implement business logic. Java in database enable the database to be an active participant to your deployment platform
in 9iDB R2 you will even be able to call-out Web client (using HTTP Client), EJB client (using oc4jclient.jar) or Web Service client
(using SOAP libraries)
Kuassi -
Problem woking with entity beans on WL 8.1
Hi,
I'm evaluating WL8.1.I'm able to deploy session beans & MDBs & test successfully.Similarly
, I' m able to deploy entity beans but, not able to test it successfully.It says
there was a problem in identifying the bean using the specified JNDI name.The
underlying table name contains '_'(underscorre).Does this create problem.Is there
any patch for this from bea?
It 'll be greate if some one respond with the details.
Thanks
RajaThanks for ur info.Is this 'CR122524_81sp1.jar' available from bea site?
Regards
Raja
"Deepak Vohra" <[email protected]> wrote:
>
>
CR122524_81sp1.jar
is required if a table has a underscore(_).
"raja" <[email protected]> wrote:
Hi,
I'm evaluating WL8.1.I'm able to deploy session beans & MDBs & testsuccessfully.Similarly
, I' m able to deploy entity beans but, not able to test it successfully.It
says
there was a problem in identifying the bean using the specified JNDI
name.The
underlying table name contains '_'(underscorre).Does this create problem.Is
there
any patch for this from bea?
It 'll be greate if some one respond with the details.
Thanks
Raja -
Problem with getting Entity Beans refreshed within Session bean methods
I hav following code in session and entity beans:
Session bean pseudo code: (PrimaryKey is primary key class for the entity
bean referred here, and MySessionHome is the home interfac class for this
session bean).
public class MySession implements SessionBean {
// This method is present in remote interface class as well.
public void methodA(PrimaryKey pk) {
// code to find entity bean by primary key specified.
update the entity bean, and mark it as isModified.
public void methodB(PrimaryKey pk) {
// code to find entity bean by primary key specified.
do something.
public void methodC() {
MySessionHome sessHome = code to lookup sessionhome from JNDI.
MySessionRI sess = sessHome.create(); // MySessionRI is the remote
interface class for MySession
PrimaryKey pk = new PrimaryKey(params);
sess.methodA(); // LINE ABC1
sess.methodB(); // LINE ABC2
all the entity and session bean methods have required as the TX attribute.
In methodB() on LINE ABC2, the entity bean obtained by findByPrimaryKey does
not reflect the changes made in call to methodA() on LINE ABC1.
Now if I change the LINE ABC1 and LINE ABC2 to
methodA(); // LINE ABC1
methodB(); // LINE ABC2
in this case the entity bean obtained in methodB() has the changes made in
methodA().
Any idea why this is happening?Hi ad13217 and thanks for reply.
I'm sorry but my code is like this:
javax.naming.Context ctx=new javax.naming.InitialContext();
arguments was an error on copy, but it doesn't work.
Thanks
Fil -
Problem when running session bean
Hi all,
I am a new comer to jdeveloper11g and weblogic10.In these days i am trying to create session bean in jdeveloper. but i got this error when i am try to run the program using new sample client.
mapped name=New-SessionEJB
package=project1
Remote interface=NewSession
SessionBean=NewSessionBean
javax.naming.NameNotFoundException: While trying to lookup 'New-SessionEJB#project1.NewSession' didn't find subcontext 'New-SessionEJB#project1'. Resolved '' [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'New-SessionEJB#project1.NewSession' didn't find subcontext 'New-SessionEJB#project1'. Resolved '']; remaining name 'New-SessionEJB#project1/NewSession'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:392)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at project1.NewSessionClient.main(NewSessionClient.java:16)
Caused by: javax.naming.NameNotFoundException: While trying to lookup 'New-SessionEJB#project1.NewSession' didn't find subcontext 'New-SessionEJB#project1'. Resolved ''
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Process exited with exit code 0.
Here is my client program
public class NewSessionClient {
public static void main(String [] args) {
try {
final Context context = getInitialContext();
NewSession newSession = (NewSession)context.lookup("New-SessionEJB#project1.NewSession");
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// WebLogic Server 10.x connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
env.put(Context.PROVIDER_URL, "t3://localhost:7101");
return new InitialContext( env );
If anybody know what the problem is please tell me.
thanks.......
(tcr)I ran into the EXACT same problem described by Tracy, and I assembled my .ear file manually.
According the error message, it would appear that the server is looking for the EJB remote interface in the ../temp/__session_bean_rpc directory when it is trying to generate its session bean wrapper class. As Tracy notes, when the file Hello.class is copied into the directory, the problem goes away. Furthermore, once the wrapper class has been generated, Hello.class is no longer needed and can be deleted from the directory.
Better still, I found a way to deploy the web services web module and make the error go away. I created the ejbws.war file with a copy of the remote interface Hello.class in the WEB-INF/classes directory. This makes the class available when the wrapper class is generated.
The WebServicesAssembler tool doesn't copy the EJB remote interfaces into the .war web module, which would appear to be
necessary.
Hope this helps. -
Problem while executing entity bean - Exception
Hi Everybody,
I have installed weblogic6.1
I have checked for my datasouce with the external program that works properly.
Getting the following error when i deploy my ejbc jar.
cabinmethd is the ejb name
table name is cabin_table
JNDI Name for datasource is CabinEntityJndi
Unable to deploy EJB: cabinmethod from ejb_cabin.jar:
Unable to bind EJB Home Interface to the JNDI name: CabinEntityJndi. The error w
as:
javax.naming.NameAlreadyBoundException: Can't rebind anything but a replica-awar
e stub to a name that is currently bound to a replica-aware stub; remaining name
<>
>
.\config\mydomain\applications\ejb_cabin.jar: java.lang.reflect.UndeclaredThrowa
bleException>
Thanks
AmitMake sure that the JNDI name for the datasource and that for the EJB is different. It seems that both the datasource and the EJB are getting bound to the same name and hence the problem. You'll have to check the deployment descriptor to ensure that JNDI names for the datasource and EJB are different.
-
Hello everybody
i need a simple example about EntityBean to deploy it on Sun Application Server 8 or 9 .....
i found examples in the J2EE tutorila but they are too huge,,, so i need a simple one please if any one has.......
thanks alotWell Mr Eng this subject is very complicated anyway...
This helped me a lot...
MeTitus -
CMP Entity Bean's problem with MS-SQL Server 2000
Hi everyone!
I have a problem regarding CMP Entity Bean on OC4J.
I made one CMP Entity Bean and deployed it to OC4J.
It was successful.
I used MS-SQL Server 2000 as Datasource.
So, I installed MS-SQL Server's JDBC Driver and add some jar files to classpath.
And I updated 'data-sources.xml' in OC4J's config directory.
Then, I updated also 'orion-ejb-jar.xml' in my application's directory.
I changed data-source's name to my data-source's name which use MS-SQL Server 2000.
Finally, I started OC4J and EJB Client program which called Enitiy Bean's create method.
But, The error occured which was 'Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence'.
What's wrong? I need any helps.
Here is stack overflow message. Thank you. Best regards.
com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence.
at UserHome_EntityHomeWrapper2.create(UserHome_EntityHomeWrapper2.java:1114)
at java.lang.reflect.Method.invoke(Native Method)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
at connection to localhost/127.0.0.1 as admin
at com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1530)
at com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1453)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:53)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
at __Proxy0.create(Unknown Source)
at com.emc.ksc.ejb.user.UserBeanTestClient1.create(UserBeanTestClient1.java:73)
at com.emc.ksc.ejb.user.UserBeanTestClient1.<init>(UserBeanTestClient1.java:49)
at com.emc.ksc.ejb.user.UserBeanTestClient1.main(UserBeanTestClient1.java:1077)Hi Young,
From the information you have supplied, my guess is that the SQL
string that OC4J is sending to SQL-Server is incorrect. So it may
help if you could see the exact SQL string. In order to see the
SQL string, I suggest you either run OC4J in "debug" mode, or try
using "P6 Spy".
The following web page has details on running OC4J in "debug" mode:
http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
And here is the web page for "P6 Spy"
http://www.provision6.com/
And these other web sites may also be of help (in general):
http://www.orionserver.com
http://www.orionsupport.com
http://www.atlassian.com
http://www.elephantwalker.com
Good Luck,
Avi. -
JDBC issue when accessing an Entity Bean
Hi,
WLCS 3.1
WLS 5.1 sp6
Windows NT
Oracle 8.1.6
I am having problems with an Entity bean, I have originaly deployed and had it
running on cloudscape. I decided I need to deploy it to Oracle 8.1.6, on startup
of WLCS the bean was deployed to the connection pool correctly using Weblogic
JDriver.
The bit I cannot understand is when I try and do a FindByPrimaryKey on the Entity
Bean the following exception is thrown by oracle, which leads me to believe this
must be an Oracle/Jdbc problem.
Here you can see that the bean has been deployed on a valid connection pool.
Tue Sep 18 15:47:39 GMT+03:00 2001:<I> <EJB JAR deployment /export/home/mccann/tester2.jar>
EJB home interface: 'com.testerHome' deployed bound to the JNDI name
: 'tester'
Heres the exception raised when a findByPrimaryKey is invoked on the bean....
Tue Sep 18 15:47:57 GMT+03:00 2001:<I> <EJB JAR deployment /export/home/mccann/t
ester2.jar> Exception in non-transactional EJB invoke:
java.sql.SQLException: ORA-00942: table or view does not exist
at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:228)
at weblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:869)
at weblogic.jdbc.pool.PreparedStatement.executeUpdate(PreparedStatement.
java:65)
at com.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
S.java:199)
at com.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
S.java:162)
at weblogic.ejb.internal.EntityEJBContext.create(EntityEJBContext.java:1
18)
at weblogic.ejb.internal.StatefulEJBObject.postCreate(StatefulEJBObject.
java:268)
at com.testerEJBEOImpl.create(testerEJBEOImpl.java:61)
at com.testerEJBHomeImpl.create(testerEJBHomeImpl.java:32)
at com.testerEJBHomeImpl_WLSkel.invoke(testerEJBHomeImpl_WLSkel.java:68)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
jectAdapter.java:347)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
tHandler.java:69)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
Any help here would be great, this is annoying problem because the Entity bean
deploys fine and no issues are raised at startup time, so the table must of existed
and the structure must of been correct. But minutes after the server started I
ran my client which tried to invoke this bean with the above exception.
Thanks
Wayne.Hi Wayne,
I'd recommend you installing of latest SP for WL plus installing of Oracle
8.1.7 thing driver.
Regards,
Slava Imeshev
"Wayne Highland" <[email protected]> wrote in message
news:[email protected]...
>
Hi,
WLCS 3.1
WLS 5.1 sp6
Windows NT
Oracle 8.1.6
I am having problems with an Entity bean, I have originaly deployed andhad it
running on cloudscape. I decided I need to deploy it to Oracle 8.1.6, onstartup
of WLCS the bean was deployed to the connection pool correctly usingWeblogic
JDriver.
The bit I cannot understand is when I try and do a FindByPrimaryKey on theEntity
Bean the following exception is thrown by oracle, which leads me tobelieve this
must be an Oracle/Jdbc problem.
Here you can see that the bean has been deployed on a valid connectionpool.
>
Tue Sep 18 15:47:39 GMT+03:00 2001:<I> <EJB JAR deployment/export/home/mccann/tester2.jar>
EJB home interface: 'com.testerHome' deployed bound to the JNDI name
: 'tester'
Heres the exception raised when a findByPrimaryKey is invoked on thebean....
>
Tue Sep 18 15:47:57 GMT+03:00 2001:<I> <EJB JAR deployment/export/home/mccann/t
ester2.jar> Exception in non-transactional EJB invoke:
java.sql.SQLException: ORA-00942: table or view does not exist
at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:228)
atweblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:869)
atweblogic.jdbc.pool.PreparedStatement.executeUpdate(PreparedStatement.
java:65)
atcom.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
S.java:199)
atcom.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
S.java:162)
atweblogic.ejb.internal.EntityEJBContext.create(EntityEJBContext.java:1
18)
atweblogic.ejb.internal.StatefulEJBObject.postCreate(StatefulEJBObject.
java:268)
at com.testerEJBEOImpl.create(testerEJBEOImpl.java:61)
at com.testerEJBHomeImpl.create(testerEJBHomeImpl.java:32)
atcom.testerEJBHomeImpl_WLSkel.invoke(testerEJBHomeImpl_WLSkel.java:68)
atweblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
jectAdapter.java:347)
atweblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
tHandler.java:69)
atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
Any help here would be great, this is annoying problem because the Entitybean
deploys fine and no issues are raised at startup time, so the table mustof existed
and the structure must of been correct. But minutes after the serverstarted I
ran my client which tried to invoke this bean with the above exception.
Thanks
Wayne. -
Entity Beans stop working after some time
hi,
I am facing this strange problem. I am devloping a Learning Management System. Once I deploy the app it works profectly fine. It calls all the session and ejb beans perfectly.
I am using the sun one 7 PE and J2EE 1.3. After the product has been deployed for a couple of hours, and i re run the application, it gives a null pointer exception. The session bean cannot connect to the entity bean.
I am using mysql as db and have a pool defined.
Is there a connection time-out problem or some problem with the entity bean, because the session beans work fine even days after deployment, but entity bean stop functioning in a couple of hours.
Some help needed !Have you looked at the server.log to see if you have any other clues to the point of failure?
-
Error While Deploying A CMP Entity Bean With A Composite Primary Key
Hello all,
I have a problem deploying CMP Entity beans with composite primary keys. I have a CMP Entity Bean, which contains a composite primary key composed of two local stubs. If you know more about this please respond to my post on the EJB forum (subject: CMP Bean Local Stub as a Field of a Primary Key Class).
In the mean time, can you please tell me what following error message means and how to resolve it? From what I understand it might be a problem with Sun ONE AS 7, but I would like to make sure it's not me doing something wrong.
[05/Jan/2005:12:49:03] WARNING ( 1896): Validation error in bean CustomerSubscription: The type of non-static field customer of the key class
test.subscription.CustomerSubscriptionCMP_1530383317_JDOState$Oid must be primitive or must implement java.io.Serializable.
Update the type of the key class field.
Warning: All primary key columns in primary table CustomerSubscription of the bean corresponding to the generated class test.subscription.CustomerSubscriptionCMP_1530383317_JDOState must be mapped to key fields.
Map the following primary key columns to key fields: CustomerSubscription.CustomerEmail,CustomerSubscription.SubscriptionType. If you already have fields mapped to these columns, verify that they are key fields.Is it enough that a primary key class be serializable or all fields have to implement Serializable or be a primitive?
Please let me know if you need more information to answer my question.
Thanks.
NikolaHi Nikola,
There are several problems with your CMP bean.
1. Fields of a Primary Key Class must be a subset of CMP fields, so yes, they must be either a primitive or a Serializable type.
2. Sun Application Server does not support Primary Key fields of an arbitrary Serializable type (i.e. those that will be stored
as BLOB in the database), but only primitives, Java wrappers, String, and Date/Time types.
Do you try to use stubs instead of relationships or for some other reason?
If it's the former - look at the CMR fields.
If it's the latter, I suggest to store these fields as regular CMP fields and use some other value as the PK. If you prefer that
the CMP container generates the PK values, use the Unknown
PrimaryKey feature.
Regards,
-marina -
Wrong version of an entity bean object being updated
We are having a problem with an entity bean that uses bean managed persistence. The "order" entity bean has
been used as part of our Order Routing System for the last 2 years with no problems. The entity bean is
accessed via calls from a "Order Manager" session bean. No change has been done to the entity bean but the
frequency of calls from the session bean to update the entity bean have increased significantly.
The "order" entity bean wraps an Order object that contains order properties (i.e. id, quantity, price,
version, etc). The entity bean has a "void setOrder(Order param)" function that writes the Order to a database
and a "Order getOrder()" function that clones and returns the internal Order object. The "ejbLoad()" function
reads the Order object from the database and the "ejbStore()" function is not implemented.
The "OrderEntityPK ejbFindByPrimaryKey()" function checks if the order entity primary key (an "int") exists
on the database.
We are using the SilverStream 3.5 application server as our EJB container. According to the SilverStream manual
it does not maintain a pool of idle/unused entity beans, instead it instantiates beans as requested.
Our problem is:
1) The wrong version of the entity object is sometimes being updated (i.e. an old instance of the order entity is being
picked up and updated on the database).
2) We sometimes get a TransactionRequired exception thrown when we have concurrent updates to two different
objects of the entity bean.
Any idea as to what our problem could be?
Thanks in advance for your help,
The following are the main code snippets:
Original Code
Session Bean A
Method 1 --- gets entity Bean B and calls a method on a different object passing this entity bean
in as a parameter to enable a method on this bean to be called.
EntityBean lOrderEntity = findOrderEntity(callerUnixLogin, currOrderId);
currOrder = lOrderEntity.getOrder();
//Logic to update the currOrder object via a method call.
persistManager.persistOrder(lOrderEntity, callerUnixLogin, currOrder, psTransactionType);
persistManager.persistOrder Method:
lOrderEntity.setOrder(callerUnixLogin, order);
findOrderEntity method:
OrderEntity lOrderEntity = null;
OrderEntityBeanPK orderPK = new OrderEntityBeanPK(orderId);
try
if (orderEntityHome == null)
connectToOrderEntityBean(callerUnixLogin);
lOrderEntity = orderEntityHome.findByPrimaryKey(orderPK);
... etc
Current Code
Session Bean C
Method 2 ---- calls method 1 in Session Bean A
Calls to method 2 above happens in quick succession.
OrderEntityBean class
... important methods ...
private Order order = null;
public OrderEntityBeanPK ejbFindByPrimaryKey(OrderEntityBeanPK primaryKey)
throws FinderException, RemoteException, DBOException
try
orderObjectManager.orderIdExists(primaryKey.orderId);
catch (OMOrderValidationException exc)
throw new FinderException(exc.getMessage());
return primaryKey;
public void setOrder(String userUnixLogin, Order newOrder)
throws EJBException, RemoteException, DBOException, OMFormattingException, OMOrderValidationException
callerUnixLogin = userUnixLogin;
int version = newOrder.getOrderVersion().intValue();
if (order.getOrderVersion().intValue() == version)
order = null;
order = newOrder;
Integer newVersion = new Integer(version + 1);
order.setOrderVersion(newVersion);
newVersion = null;
order.setSysUser(callerUnixLogin);
orderObjectManager.updateOrder(callerUnixLogin, order);
else
Debug.Print(userUnixLogin, "OrderEntityBean.setOrder: wrong version number for order " + newOrder.getOrdId() +
": expected " + order.getOrderVersion() + " and got " + newOrder.getOrderVersion(), 0);
throw new OMOrderValidationException("wrongVersion", order, order.getOrdId(), IName.Order.VERSION, newOrder.getOrderVersion());
public Order getOrder()
throws EJBException, RemoteException
return ((Order)order.clone());
The following transactions exists for the entity bean ...
Required:
create and setOrder methods
Not Supported
findByPrimary and getOrder methods"The entity bean has a "void setOrder(Order param)" function that writes the Order to a database"
This functionality should be performed in the ejbStore method().
"a "Order getOrder()" function that clones and returns the internal Order object."
Sounds reasonable, except for the cloning part.
"The "ejbLoad()" function reads the Order object from the database"
Cool.
""ejbStore()" function is not implemented."
Whoops. Looks like your setOrder method is doing too much. It should do the inverse of getOrder (namely, setting the interal Order object), nothing more. Defer the persistence code to the ejbStore method.
"According to the SilverStream manual it does not maintain a pool of idle/unused entity beans, instead it instantiates beans as requested."
Manual? What's that? Assuming that is correct, better hope you don't ever get a high load. You might wanna look into JBoss.
"2) We sometimes get a TransactionRequired exception thrown when we have concurrent updates to two different objects of the entity bean."
How can you have concurrent access to two different objects?? Concurrency is inherently applicable to only one object.
In summary:
Write your beans properly, ejbLoad populates the bean with data, ejbStore persists the bean's data.
Get a better (and possibly free) appserver.
Maybe you are looking for
-
Application loader error?
My computer keeps saying "Application loader was unable to connect with your device. Please reconnect your device, enter the password, if required, and click retry." when i try to update the phone. The issue before was that the phone kept shutting o
-
Is it possible to get message screens of the Office jet 100 without the full package?
i have a office jet 100 and want to have interaction with my printer (get messages if my cartages empty, no paper, etc), but i don't want to install 800MB of software for a couple of pop-up screens. I want to know if it is possible to get the followi
-
How to define "User defined" palette in IMAQ Display?
When I select the "User defined" palette in the display, it just shows the regular grayscale palette. I want to replace this with the "Rainbow" palette but slightly modified in range. How do I do this? Thanks! MK Solved! Go to Solution.
-
Connect to oracle xe from another machine
How i can set oracle xe for connect from another machine i can connect with : sqlplus system/pass@xe listener and tnsnames are fine on base machine, but I can't do it from another machine i can't do it with html db (from browser), too ist it possible
-
I have msg that says "We are having trouble verifying your membership" - What do I do?
I have msg that says "We are having trouble verifying your membership" and also that my anual membership will expire in 3 days. In my account, at "plans and product" says that my CC Membership is "expired". But it's suppose to expire 6 months from no