AmitCdac Grover

Greenhorn
+ Follow
since Mar 30, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by AmitCdac Grover

Thanx , Now its working
18 years ago
i don'nt know which entries i have to do in connnection pool for non-XA
before that i did the following entries in connecton pool

URL=jdbc racle:thin:@192.168.3.27:1521:st
driver class name=oracle.jdbc.xa.client.OracleXADataSource
properties= user=scott
password=tiger

now plz tell me which entries i have to do for non-XA connection pool.
and i also don'nt know what is this non-XA connection pool.

server path
--------

actually it is not the server path it is the server classpath..
before that i tried to call class from one one jar file to another jar file some body from javaranch told me that put jar file into server classpath
18 years ago
i have given all the entries as told by u.

first i make connection pool

name: PoolName
url: jdbc racle:thin:@192.168.3.27:1521:st
driver class name: oracle.jdbc.xa.client.OracleXADataSource
Properties
(key=value):user=scott
password=tiger

ACL name: -NA-
Password: -NA-
Open String Password: -NA-

after that i create the XA datasources becoz my datsource is in remote machine

after creating the connection pool and XA datasources i open my cmp bean in
weblogic builder.

i done the following things..

1. give the datasource name and table name in the persistence tab in right pane.

2. in CMP fiels i done the mapping of

firstname with FIRST_NAME
id with ID
lastname with LAST_NAME

( FIRST_NAME, ID, LAST_NAME IS IN THE CUSTOMER TABLE IN DATABASE)

NOW I TRY TO DEPLOY the bean it gives me the following error


weblogic.management.ApplicationException: activate failed forCmpEmp

Start server side stack trace:
weblogic.management.ApplicationException: activate failed forCmpEmp
{
Module Name: CmpEmp, Error: Exception activating module: EJBModule(CmpEmp,status=PREPARED)


Unable to deploy EJB: EmpCmpBean2 from CmpEmp.jar:

Errors encountered ''The Container-Managed Persistence Entity EJB failed while creating its SQL Type Map. The error was:
Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:99',
'Error encountered while attempting to create Default DBMS Table: 'Customer'. Error Text: 'Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:98'.''




TargetException:

Unable to deploy EJB: EmpCmpBean2 from CmpEmp.jar:

Errors encountered ''The Container-Managed Persistence Entity EJB failed while creating its SQL Type Map. The error was:
Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:99',
'Error encountered while attempting to create Default DBMS Table: 'Customer'. Error Text: 'Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:98'.''




}

at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1093)

at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1074)

at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1110)

at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)

at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

End server side stack trace

{
Module Name: CmpEmp, Error: Exception activating module: EJBModule(CmpEmp,status=PREPARED)


Unable to deploy EJB: EmpCmpBean2 from CmpEmp.jar:

Errors encountered ''The Container-Managed Persistence Entity EJB failed while creating its SQL Type Map. The error was:
Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:99',
'Error encountered while attempting to create Default DBMS Table: 'Customer'. Error Text: 'Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:98'.''




TargetException:

Unable to deploy EJB: EmpCmpBean2 from CmpEmp.jar:

Errors encountered ''The Container-Managed Persistence Entity EJB failed while creating its SQL Type Map. The error was:
Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:99',
'Error encountered while attempting to create Default DBMS Table: 'Customer'. Error Text: 'Internal error: Cannot obtain XAConnection Creation of XAConnection for pool EmployeePool failed after waitSecs:98'.''

}

i didnot understand what is this error .how can i resolve this problem




regards
amit grover

i also want to know that what is the server path in wiblogic 7.0
18 years ago
hi ..........


i have created a CMP bean. now i want to deploy the bean . but the problem is before that i have to create datasource and connection pool

i want to connect with the Oracle...

In connection pool i did the following entries
name: EmployeeOraclePool

URL :jdbc racle:thin:@server ort:sid

Driver class name: oracle.jdbc.driver.OracleDriver

Properties
(key=value): user=SCOTT

ACLName:
Password:
Open String Password:

is the obove entries are correct my database is not on the my machine it is remote and its ip address is 192.2.2.37 and the connection string is MSRT
where sould i do this entries..

can it is necessary to give the ACLNAME ,password and Open String Password
if yes what are the entries for these.


there r two option in weblogic server for creating datasource
1. datasources
2. Tsdatasources

which option i have to choose and why...

apart from above is there is any another setting which i have to do while making datasource or connection pool..


after making what should i do to complete my deploy bean.

regards
amit grover
18 years ago
hi all...

i am calling entity bean form session bean . i am getting the following error.
java.lang.NoClassDefFoundError .employee.EmpEntityHome


at run time session bean did not get enitybean home..

i have set all the class path..

follwing is the dir structure of my application

d:\demo\Jsp
d:\demo\WEB-INF\classes\servlet
d:\demo\WEB-INF\lib

d:\ejb\entity\classes\employee\.class files
d:\ejb\entity\src\employee\.java files

d:\ejb\session\classes\emp\.class files
d:\ejb\session\src\emp\.java files


i do the folling things..

1. deploy the entity bean i get the (entity.jar) and put the entity.jar into the lib folder then i the set classpath of that jar file. 2. deploy the session bean i get the (session.jar) and put that session.jar into the lib folder then i set classpath of that jar file.

now i i try to call the sessionbean form the servlet. it will give the above error which i have mentioned.

same code which i write in sessionbean if i write in the servlet and not use session bean give directly call from servlet to entity bean then it works fine if i use session bean between that it gives me error

i check the class path ,package i included many times. there is not problem

can i need to combine both the jar file into ear file,if so how can i make a ear file. i am using weblogic 7.0 .

plz help me out to solve this problem

Regards
amit grover
hi all.....


i have made BMP bean.which is running perfectly.when i call i from simple java class. but when i try to call it from servlet it's giving me following compliation errors

com\cdac\emp\servlet\ListEmp.java:34: cannot resolve symbol
symbol : class EntityHome
location: class com.cdac.emp.servlet.ListEmp
EntityHome home=(EmpEntityHome) PortableRemoteObject.na
rrow(o, EmpEntityHome.class);
^
com\cdac\emp\servlet\ListEmp.java:34: cannot resolve symbol
symbol : class EmpEntityHome
location: class com.cdac.emp.servlet.ListEmp
EntityHome home=(EmpEntityHome) PortableRemoteObject.na
rrow(o, EmpEntityHome.class);
^
com\cdac\emp\servlet\ListEmp.java:34: cannot resolve symbol
symbol : class EmpEntityHome
location: class com.cdac.emp.servlet.ListEmp
EntityHome home=(EmpEntityHome) PortableRemoteObject.na
rrow(o, EmpEntityHome.class);

^
3 errors


i am using weblogic7.0. the jar file which given by weblogic i put that jar file into the class path and also try to add while running from command prompt

javac -classpath %classpath%;Client.jar servletname.java

this is also giving an error. basically i am using an MVC architecture

follwing is my directory struture
--------------------------------

d:\demo
d:\demo\jsp\jsppages.....
d:\demo\WEB-INF\web.xml
d:\demo\WEB-INF\classes
d:\demo\WEB-INF\lib
d:\demo\WEB-INF\classes\com\cdac\emp\servlets\servlets...
d:\demo\WEB-INF\classes\com\cdac\emp\ejb
d:\demo\WEB-INF\classes\com\cdac\emp\ejb\entity\classes\ejbclasses....
d:\demo\WEB-INF\classes\com\cdac\emp\ejb\entity\src\ejbsourcefiles.....


now if i put my simple java class file in d:\demo\WEB-INF\classes\com\cdac\emp\ejb\entity foldet and also put Client.jar (produce by weblogic) and then compile it will run perfectly.

d:\demo\WEB-INF\classes\com\cdac\emp\ejb\entity>javac -classpath %classpath%;Client.jar ConnectClient.java // working fine


now when i try to run it from servlet and put Client.jar file into d:\demo\WEB-INF\classes\com\cdac\emp\servlets\Client.jar then it will give me the above compilation errors

d:\demo\WEB-INF\classes\com\cdac\emp\servlet>javac -classpath %classpath%;Client.jar ListEmp.java // not working
i also put client.jar file into classpath but still it not working

following is servlet coding
-----------------------------
package com.cdac.emp.servlet;

import javax.servlet.http.*;
import javax.servlet.*;
import com.cdac.emp.entitypo.EmpEntitypo;
import com.cdac.emp.entity.EmpEntity;
import com.cdac.emp.utilities.*;
import java.sql.*;
import java.io.*;

import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import javax.ejb.*;
import java.util.*;

public class ListEmp extends HttpServlet
{

public void doPost(HttpServletRequest pRequest, HttpServletResponse pResponse)throws IOException,ServletException
{
try
{
RequestDispatcher pRequestDispatcher;
InitialContext context=null;

Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");

Context ic=new InitialContext(ht);
Object o=ic.lookup("Entity");

EntityHome home=(EmpEntityHome) PortableRemoteObject.narrow(o, EmpEntityHome.class);


Collection ListEmp=home.findByEmployees();
pRequest.setAttribute("LISTEMP",ListEmp);

pRequestDispatcher = pRequest.getRequestDispatcher("/jsp/ListEmp.jsp");
pRequestDispatcher.forward(pRequest,pResponse);
}
catch(Exception e)
{
e.printStackTrace();
}

}


public void doGet(HttpServletRequest pRequest, HttpServletResponse pResponse)throws IOException,ServletException
{

doPost(pRequest,pResponse);
}
}


plz help me out this is urgent...

regards
amit grover
18 years ago
hi...

i have made bmp bean when i try to run the following method(ejbFindByFirstName()) from the client side it will give me the following error.here i am sending u client code ,menthod and a class which i am using

------------------
java.lang.ClassCastException: EmpEntityBean_xzbwyf_EOImpl_WLStub
at ConnectClient.go(ConnectClient.java:50)
at ConnectClient.main(ConnectClient.java:13)
---------------
public Collection ejbFindByFirstName(String lFirstName) throws FinderException
{
PreparedStatement pstmt = null;
Connection conn = null;
ResultSet result = null;
ReturnVector rv=new ReturnVector();

try
{
conn = this.getConnection();
System.out.println("ejbFindByFirstName(" + lFirstName + ") called");

pstmt = conn.prepareStatement("SELECT EMPID,EMPFIRSTNAME,EMPLASTNAME FROM EMPDATA WHERE EMPFIRSTNAME = ?");

pstmt.setString(1, lFirstName);
result = pstmt.executeQuery();
Vector keys=new Vector();

System.out.println("Before while in findbyfirst name");
while (result.next())
{
System.out.println("in while findbyfirst name");
System.out.println(result.getInt("EMPID"));
System.out.println(result.getString("EMPFIRSTNAME"));
System.out.println(result.getString("EMPLASTNAME"));

rv.EmpId=result.getInt("EMPID");
rv.FirstName=result.getString("EMPFIRSTNAME");
rv.LastName=result.getString("EMPLASTNAME");
keys.addElement(rv);
}
System.out.println("After while in findbyfirst name");
return keys;
}
catch (Exception e)
{
throw new FinderException(e.toString());
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}

}

----------------------
import java.io.Serializable;
public class ReturnVector implements java.io.Serializable
{
int EmpId;
String FirstName;
String LastName;
}
---------------------
client code
--------------------------
Collection c = home.findByFirstName("hello");

Vector v=new Vector(c);;
ReturnVector rv=(ReturnVector)v.firstElement(); // error is here
System.out.println(rv.EmpId);
System.out.println(rv.FirstName);
System.out.println(rv.LastName);

-------------------------

my ejbFindByFirstName() method returning a vector which contain the object of class ReturnVector. i used this class be becoz i want to return multiple values form method.plz help me out how can i solve this problem. i also want to know that if my method returning multiple records how i can i get from the client side...


in my above problem in find method returning vector contain object of RetunVector class. if my returning vector contain string or int then from the client if i access then there is not any error but it will print following

EmpEntityBean_xzbwyf_EOImpl_WLStub

i didnot understand what this is all about

plz help me to solve this problem.....

regards
amit grover
hi all...

i have made bmp bean. my bean is working fine. all the operation are working fine ( insert , delete , update) .but i some problem with searching records..here my code is

Home Interface
----------------------

import javax.ejb.*;
import java.rmi.RemoteException;
import java.util.Collection;
import java.sql.*;

public interface EmpEntityHome extends EJBHome
{
public EmpEntity create(Integer lEmpId,String lFirstName,String lLastName) throws CreateException,RemoteException;

public EmpEntity findByPrimaryKey(Integer lEmpId) throws FinderException,RemoteException;

public Collection findByFirstName(String firstname) throws FinderException,RemoteException;

public Collection findByLastName(String lastname) throws FinderException,RemoteException;
}

comopenent interfrace
-------------------------------------
import javax.ejb.*;
import java.rmi.RemoteException;

public interface EmpEntity extends EJBObject
{
public String getEmpFirstName() throws RemoteException;
public void setEmpFirstName(String FirstName) throws RemoteException;

public String getEmpLastName() throws RemoteException;
public void setEmpLastName(String LastName) throws RemoteException;

}

Bean
---------------

import javax.ejb.*;
import java.util.*;
import java.sql.*;
import javax.sql.*;
import java.lang.*;
import javax.naming.*;
import javax.rmi.*;

public class EmpEntityBean implements EntityBean
{
public EntityContext contex;
public Integer pEmpId;
public String pEmpFirstName;
public String pEmpLastName;
public int pEmpRowState;


public Integer ejbCreate(Integer lEmpId,String lEmpFirstName,String lEmpLastName) throws CreateException
{
System.out.println("ejbCreate() called.");
if( (lEmpId.intValue() < 1) || ( lEmpFirstName == null) || (lEmpLastName == null) )
throw new CreateException("Invalid Parameters");

this.pEmpId=lEmpId;
this.pEmpFirstName=lEmpFirstName;
this.pEmpLastName=lEmpLastName;
this.pEmpRowState=0;

PreparedStatement pstmt = null;
Connection conn = null;
try
{
conn = this.getConnection();

System.out.println("In try block");
System.out.println( pEmpId.intValue()+ " " + pEmpFirstName+ " " + pEmpLastName+ " " +pEmpRowState);
pstmt = conn.prepareStatement("INSERT INTO EMPDATA VALUES (?,?,?,?)");

pstmt.setInt(1,pEmpId.intValue());
pstmt.setString(2,pEmpFirstName);
pstmt.setString(3,pEmpLastName);
pstmt.setInt(4,pEmpRowState);
if(pstmt.executeUpdate()!=1)
{
throw new CreateException("Failed to add employee into database");
}

System.out.println("Successfully Inserted");
return lEmpId;

}
catch (Exception e)
{
throw new CreateException(e.toString());
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
}

public void ejbPostCreate(Integer lEmpId,String lEmpFirstName,String lEmpLastName)
{
System.out.println("ejbPostCreate() is called");
}


public String getEmpFirstName()
{
System.out.println("getEmpFirstName() called.");
return pEmpFirstName;
}

public void setEmpFirstName(String lFirstName)
{
System.out.println("setEmpFirstName() called.");
pEmpFirstName=lFirstName;
}

public String getEmpLastName()
{
System.out.println("getEmpLastName() called.");
return pEmpLastName;

}
public void setEmpLastName(String lLastName)
{
System.out.println("setEmpLastName() called.");
pEmpLastName=lLastName;
}


public void ejbActivate()
{
System.out.println("ejbActivate() called.");
}
public void ejbPassivate()
{
System.out.println("ejbPassivate() called.");
}

public void ejbRemove()
{
System.out.println("ejbRemove() called.");

PreparedStatement pstmt = null;
Connection conn = null;

try
{
conn = this.getConnection();
pstmt = conn.prepareStatement("DELETE FROM EMPDATA WHERE EMPID = ?");
pstmt.setInt(1, pEmpId.intValue());

if (pstmt.executeUpdate()!= 1)
{
throw new EJBException("Ejb Remove");
}
}
catch (Exception ex)
{
throw new EJBException(ex.toString());
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}

System.out.println("Successfully Deleted");
}



public void setEntityContext(EntityContext ctx)
{
System.out.println("setEntityContext called");
contex= ctx;
}

public void unsetEntityContext()
{
System.out.println("unsetEntityContext called");
contex = null;
}

public void ejbLoad()
{
System.out.println("ejbLoad() called.");

Integer pk=(Integer)contex.getPrimaryKey();

PreparedStatement pstmt = null;
Connection conn=null;
ResultSet result=null;
try
{
conn = this.getConnection();
pstmt = conn.prepareStatement("SELECT EMPID,EMPLASTNAME,EMPFIRSTNAME FROM EMPDATA WHERE EMPID = ?");
pstmt.setInt(1, pk.intValue());
result = pstmt.executeQuery();
if(result.next())
{
pEmpId=pk;
pEmpFirstName = result.getString("EMPFIRSTNAME");
pEmpLastName = result.getString("EMPLASTNAME");
System.out.println("Successfully Loaded");
}
else
{
throw new NoSuchEntityException();
}
}
catch (Exception ex)
{
throw new EJBException("EmployeeId " + pEmpId + " failed to load from database", ex);
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}

}
public void ejbStore()
{
System.out.println("ejbStore() called.");

PreparedStatement pstmt = null;
Connection conn = null;
int RowState=1;
try
{
conn = this.getConnection();
pstmt = conn.prepareStatement("UPDATE EMPDATA SET EMPFIRSTNAME = ?, EMPLASTNAME = ?,EMPROWSTATE= ? WHERE EMPID = ?");
pstmt.setString(1,pEmpFirstName);
pstmt.setString(2,pEmpLastName);
pstmt.setInt(3,RowState);
pstmt.setInt(4,pEmpId.intValue());
if(pstmt.executeUpdate()!=1)
{
throw new NoSuchEntityException("ejb Store");
}

}
catch (Exception ex) {
throw new EJBException("EMPLOYEE " + pEmpId + " failed to save to database", ex);
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
System.out.println("Successfully Updated");
}



public Integer ejbFindByPrimaryKey(Integer pk) throws FinderException
{
PreparedStatement pstmt = null;
Connection conn = null;
ResultSet result=null;

try
{
conn=this.getConnection();
System.out.println("ejbFindByPrimaryKey(" + pk + ") called");

pstmt = conn.prepareStatement("SELECT EMPID FROM EMPDATA WHERE EMPID = ?");
pstmt.setInt(1,pk.intValue());
result = pstmt.executeQuery();
if(!result.next())
{
throw new ObjectNotFoundException("Cannot find employee with ID=" + pk);
}
}
catch (Exception e)
{
throw new FinderException(e.toString());
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
return pk;
}

public Collection ejbFindByFirstName(String lFirstName) throws FinderException
{
PreparedStatement pstmt = null;
Connection conn = null;
ResultSet result = null;

try
{
conn = this.getConnection();
System.out.println("ejbFindByFirstName(" + lFirstName + ") called");

pstmt = conn.prepareStatement("SELECT * FROM EMPDATA WHERE EMPFIRSTNAME = ?");

pstmt.setString(1, lFirstName);
result = pstmt.executeQuery();
Vector keys=new Vector();
while (result.next())
{
keys.addElement(result.getObject("EMPID"));
}
return keys;
}
catch (Exception e)
{
throw new FinderException(e.toString());
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}

}
public Collection ejbFindByLastName(String lLastName) throws FinderException
{
PreparedStatement pstmt =null ;
Connection conn = null ;
ResultSet result=null;

try
{
conn=this.getConnection();
System.out.println("ejbFindByLastName(" + lLastName + ") called");

pstmt = conn.prepareStatement("SELECT EMPID ROM EMPDATA WHERE EMPLASTNAME = ?");
pstmt.setString(1, lLastName);
result = pstmt.executeQuery();
Vector keys = new Vector();
while (result.next())
{
keys.addElement(result.getObject("EMPID"));
}
return keys;
}
catch (Exception e)
{
throw new FinderException(e.toString());
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
}

private Connection getConnection() throws SQLException
{
try
{
String DriverName ="oracle.jdbc.driver.OracleDriver";
String DBUrl ="jdbc racle:thin:@192.168.3.27:1521:st";
String uid = "scott";
String pswd="tiger";
/*
* Loading the thin driver
*/
Class.forName(DriverName);
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

/* Getting a connection */
Connection pConnection=(Connection)DriverManager.getConnection(DBUrl,uid,pswd);
return pConnection;
}
catch (Exception e)
{
e.printStackTrace();
return null;
}
}

}





problem
-------------

problem is that. i don'nt know how search by primary key, lastname ,firstname from he client side . i want empid ,firstname,lastname at the clientside at every search .plz tell me the code how can i get above inforamtion through search at the client side.


regards

amit grover
thanks for ur response .. my problem is solved. there is somthing problem with my coding which is now resolved

amit grover
thanks .... now problem is solved .there is something problem with my coding

regards

amit grover
hi ...

i made an bmp bean.after compliation and deploy when i tried to run the client like suppose i all home.create or home.findbyprimarykey it will give me the following error .plz help me out how can i solve this problem



org.omg.CORBA.UNKNOWN: minor code: 0 completed: Maybe
at com.sun.corba.ee.internal.core.UEInfoServiceContext.<init>(UEInfoServ
iceContext.java:36)
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.sun.corba.ee.internal.core.ServiceContextData.makeServiceContext(
ServiceContextData.java:115)
at com.sun.corba.ee.internal.core.ServiceContexts.<init>(ServiceContexts
.java:110)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.read(ReplyMe
ssage_1_2.java:120)
at com.sun.corba.ee.internal.iiop.IIOPInputStream.unmarshalHeader(IIOPIn
putStream.java:126)
at com.sun.corba.ee.internal.iiop.IIOPConnection.getResponse(IIOPConnect
ion.java:671)
at com.sun.corba.ee.internal.iiop.IIOPOutputStream.invoke(IIOPOutputStre
am.java:124)
at com.sun.corba.ee.internal.iiop.ClientRequestImpl.invoke(ClientRequest
Impl.java:79)
at com.sun.corba.ee.internal.corba.ClientDelegate.invoke(ClientDelegate.
java:232)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:96)
at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at _EmpEntityHome_Stub.create(Unknown Source)
at ConnectClient.go(ConnectClient.java:27)
at ConnectClient.main(ConnectClient.java:14)


regards

amit grover
hi

i made the BMP bean. after compliation in deloy time when i when i say
tools -> verifier in j2ee 1.3.1 it will give me following faliure

1.

For [ EmpEntityBean ]
For EJB Class [ EmpEntityBean ] Finder method [ ejbFindByPrimaryKey ]
Error: A [ ejbFindByPrimaryKey ] method was found, but [ ejbFindByPrimaryKey ] return type must be the enterprise beans primary key type.

2.

For [ EmpEntityBean ]
Error: Transaction attributes must be specified for the methods defined in the home interface [ EmpEntityHome ]. Method [ create ] has no transaction attribute defined within this bean [ EmpEntityBean ].

3.

For [ EmpEntityBean ]
For Home interface [ EmpEntityHome ]
Error: No single arg findByPrimaryKey(PrimaryKeyClass) method was found in home interface class [ EmpEntityHome ].


follwowing are my home interface and component interface

public interface EmpEntityHome extends EJBHome
{
public EmpEntity create(int employeeid,String first,String last) throws CreateException,RemoteException;

public EmpEntity findByPrimaryKey(EntityPK key) throws FinderException,RemoteException;

public Collection findByFirstName(String firstname) throws FinderException,RemoteException;
public Collection findByLastName(String lastname) throws FinderException,RemoteException;

public Collection findByEmpEmployeeId(int id) throws FinderException,RemoteException;

}

public interface EmpEntity extends EJBObject
{
public String getEmpFirstName() throws RemoteException;
public void setEmpFirstName(String FirstName) throws RemoteException;

public String getEmpLastName() throws RemoteException;
public void setEmpLastName(String LastName) throws RemoteException;

public int getEmpEmployeeId() throws RemoteException;
public void setEmpEmployeeId(int EmpId) throws RemoteException;

}

this is my bean find by primary key method

public EntityPK ejbFindByPrimaryKey(EntityPK pk) throws FinderException
{
PreparedStatement pstmt = null;
Connection conn = null;
Vector v = new Vector();

try
{
DSManager.getConnection();
System.out.println("ejbFindByPrimaryKey(" + pk + ") called");

pstmt = conn.prepareStatement("SELECT EMPID FROM EMPLOYEE WHERE EMPID = ?");
int id=Integer.parseInt(pk.toString());
pstmt.setInt(1,id);
ResultSet rs = pstmt.executeQuery();
rs.next();
return pk;
}
catch (Exception e)
{
throw new FinderException(e.toString());
}
finally
{
try { if (pstmt != null) pstmt.close(); }
catch (Exception e) {}
try { if (conn != null) conn.close(); }
catch (Exception e) {}
}
}


plz help me out how i solve this problem

regards

amit grover
hi..

when i have created a session bean which returning me connection.
when i tried to run client it will give the following error. i alredy included the classes12.jar file in d:\j2ee1.3.1\lib folder .but again it will give me the same error . plz help me out



java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at com.sun.enterprise.util.EJBClassLoader.findClass(EJBClassLoader.java:
258)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at ConManager.ConBean.getConnection(ConBean.java:36)
at ConManager.ConBean_EJBObjectImpl.getConnection(ConBean_EJBObjectImpl.
java:22)
at ConManager._ConBean_EJBObjectImpl_Tie._invoke(Unknown Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(Ge
nericPOAServerSC.java:520)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(Gen
ericPOAServerSC.java:210)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAS
erverSC.java:112)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:255)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProces
sor.java:84)
at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadP
ool.java:99)



regards

amit grover
hi

i am creating the session bean .after compilation . in weblogic i give the path of classes folder it ask for descriptor. i press yes .after when i try to do validate descriptor it will give me the following error

ERROR: Error processing input descriptor
hi

i am creating the session bean .after compilation . in weblogic i give the path of classes folder it ask for descriptor. i press yes .after when i try to do validate descriptor it will give me the following error

ERROR: Error processing input descriptor
18 years ago