Mey Mey

Greenhorn
+ Follow
since May 17, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mey Mey

Can any one give me suggestion how to invoke servlet from WSV3.5,
there are two servlet root directories
1. serverroot/servlet
2. serverroot/host/defaulthost/WSsamples_app/servlets
where to deploy or what makes the difference
is I have to create any servlet engine is WSAS, if so any resource link pls.
23 years ago
Hi,
I am able to do the same now, but the problem now is I am unable to start the persitent server in control center, I have configured with oracle database, while starting the server its saying ejs.jar not found, Name already exist exception its throwing, I am able to start servlet engine, Is any path I have to include in the classpath apart from oracle driver path, if so let me know.
thanks
23 years ago
Hi,
I installed visualage for java in linux and windows NT, in both case I didn't find EJB tab in the IDE, but for NT edition of VAJ i downloaded VAJ with EJB and JSP supports only, is there any special way to configure or am i committing mistake, can anybody help me
Hi,
I installed visualage for java in linux and windows NT, in both case I didn't find EJB tab in the IDE, but for NT edition of VAJ i downloaded VAJ with EJB and JSP supports only, is there any special way to configure or am i committing mistake, can anybody help me
23 years ago
Hi Jose,
I am coping, the entire code stuffs, go thro it and give a solution, package dept;
REMOTE INTERFACE
/**
* The remote interface of the MyDept entity bean.
*/
import java.rmi.*;
import javax.ejb.*;
public interface MyDept extends EJBObject {
String[] getRecord() throws RemoteException;
}
HOME INTERFACE
package dept;
/**
* The home interface of the MyDept entity bean.
**/
import java.rmi.*;
import java.util.*;
import javax.ejb.*;
public interface MyDeptHome extends javax.ejb.EJBHome {
MyDept create(MyDeptKey id) throws CreateException, RemoteException;
MyDept create(MyDeptKey id, String deptName) throws CreateException, RemoteException;
public MyDept findByPrimaryKey(MyDeptKey id) throws RemoteException, FinderException;
Enumeration findByDepartmentName(String deptName) throws RemoteException, FinderException;
}
FINDER HELPER CLASS
package dept;
/**
* The finder helper interface of the MyAccount entity bean.
* For each finder method defined in the home interface other than the create and
* findByPrimaryKey methods, a query Sting must be defined here.
*
* These query strings will be referenced by the finder implementation class generated by the
* deployment tool.
**/
public interface MyDeptBeanFinderHelper {
public static final String findByDepartmentNameQueryString = "select * from ejb.MyDeptBeantbl where deptName=?";
}
KEY CLASS
package dept;
/**
* The key class of the MyDept entity bean.
**/
import java.io.*;
public class MyDeptKey implements Serializable {
public long deptNo;
/**
* Constructs an MyDeptKey object.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
public MyDeptKey() {
super();
}
/**
* Constructs a newly allocated MyDeptBMKey object that represents the primitive long argument.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
public MyDeptKey(long deptNo) {
this.deptNo = deptNo;
}
public long asLong() {
return deptNo;
}
/**
* Determines if the MyDeptKey object passed to the method matches this MyAccountKey object.
* @param o java.lang.Object The MyDeptKey object to compare to this MyAccountKey object.
* @return boolean The pass object is either equal to this MyDeptBMKey object (true) or
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
public boolean equals(Object o) {
if (o instanceof MyDeptKey) {
MyDeptKey otherKey = (MyDeptKey) o;
return (((deptNo == otherKey.deptNo)));
}
else {
return false;
}
}
/**
* Generates a hash code for this MyDeptKey object.
* @return int The hash code.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
public int hashCode() {
return ((new Long(deptNo).hashCode()));
}
}

BEAN CLASS
package dept;
/**
* The bean class of the MyAccount entity bean.
**/
import java.rmi.RemoteException;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.ListResourceBundle;
import javax.ejb.*;
import java.lang.*;
public class MyDeptBean implements EntityBean {
private EntityContext entityContext = null;

public long deptNo = 0;
public String deptName;
public void ejbActivate() throws RemoteException { }
public void ejbCreate(MyDeptKey key) {
ejbCreate(key, "Sales" );
}
public void ejbCreate(MyDeptKey key, String deptName) {
deptNo = key.deptNo;
this.deptName= deptName;

}
public void ejbLoad () throws RemoteException { }
public void ejbPassivate() throws RemoteException { }
public void ejbPostCreate(MyDeptKey key) throws RemoteException {
ejbPostCreate(key, "Sales" );
}
public void ejbPostCreate(MyDeptKey key, String deptName) { }
public void ejbRemove() throws RemoteException { }
public void ejbStore () throws RemoteException { }
public String [] getRecord() {
String s[] = new String[2];
s[0]=""+deptNo;
s[1]=deptName;
return s;
}
public void setEntityContext(EntityContext ctx) throws RemoteException {
entityContext = ctx;
}
public void unsetEntityContext() throws RemoteException {
entityContext = null;
}
}
23 years ago
Yes,
Its an Oracle exception, I think, its happening due to ordering of column in xml file and oracle table, I read a document saying when u use VAJ u won't get such problem, when I deploy the eg. jar file I am not getting the same, but when I rename the same and deploy as my own bean then I am getting the error.
Still it the problem exist.
23 years ago
Hi ,
I am deploying an entity bean using jetace and admin console, with oracle database, when i ever I access that bean thro' client, the create and find method are working fine, but when i try to display the field values or access any business method I am getting FETCH EXCEPTION as shown below, I have also given the client code also, Is there any condition that order of columns in table should be similar to one in xml file, if so can anybody explain.
Caught an unexpected exception!
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
com.ibm.ejs.persistence.EJSPersistenceException: java.sql.SQLException: ORA-01002: fetch out of sequence
; nested exception is:
java.sql.SQLException: ORA-01002: fetch out of sequence
com.ibm.ejs.persistence.EJSPersistenceException: java.sql.SQLException: ORA-01002: fetch out of sequence
; nested exception is:
java.sql.SQLException: ORA-01002: fetch out of sequence
java.sql.SQLException: ORA-01002: fetch out of sequence
CLIENT SOURCE CODE:
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.util.*;
import dept.*;
public class MyDeptClient {
public static void main(String[] args) {
try {
Properties props = System.getProperties();
props.put( javax.naming.Context.PROVIDER_URL, "iiop://localhost:900" );
props.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory" );
Context initial = new InitialContext(props);
//HelloHome home =(HelloHome) initial.lookup("HelloHome");
Object objref =initial.lookup("MyDept");
MyDeptHome home =
(MyDeptHome)PortableRemoteObject.narrow(objref, MyDeptHome.class);
MyDept a = home.create( new MyDeptKey(30),"");
//Enumeration e = home.findLargeMyAccounts(199999.0f);
/* if ( e == null )
System.out.println( "NULL"+e.hasMoreElements() );
else
System.out.println( "Not NULL"+e.hasMoreElements() );*/
// MyAccount a = home.create(new MyAccountKey(1001), 1, 1000.00f);
System.out.println( "DeptName " + (a.getRecord())[0]);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}
23 years ago
Hi Rahul,
Thanks, now I am able to do the same, the problem is I have given the my oracle dba user id in configuration file, I found in a document when u deploy bean thro' admin console u should compulsorily have a user identified in the name EJB in oracle database, after creating the user with same name and giving previlages now I am able to deploy the bean and access the same thro' RMI client.
I hope if I use Visual age for dev. and deploying, I can have my own user id in database.
After Installation of WAS I found some 43 tables created for maintaining bean inforamtion, the number of tables keep on increasing when I deploy more beans, can any one explain now I am having 60 tables.
23 years ago
I am trying to deploy the Account Enity bean of websphere eg., I have changed the finder helper class query like the following one
select * from ejb.Accounttable where accountname=? to
select * from myoracleusername.Accounttable where accountname=?

My bean is deployed successfully but when I start the bean I am getting error saying permission denied for user "ejb", can any one help me out by going thro' the same eg.
23 years ago
Is it a must to define Primary Key class for every entity bean, can I not have the same as String, if so means how can i specify in jetace tool that this field is the primary key field, no option is there in the tool. if I am able to do the same thro' string means how can i define the query for find by primary key, is I have to define any FindByHelper class.
Is it possible to define a find method that returns a Collection object instead of Enumeration.
23 years ago
Is Bean , Remote Interface, Home Interface and other support classes neccessarily to be defined under package, because if I define bean without any package structure means I am unable to deploy my bean in the server, can anybody help me out in this regard.
23 years ago
Thanks a lot now I am able to connect with oracle thro' bean, its due to the problem of not specifying datasource.
23 years ago
Hi,
I am trying to deploy Account EJB of websphere examples, I am working on linux machine having oracle database on solaris, database configuration are ok, How to specify data source while creating container, when I click change button on admin console I am getting only NONE, I am not able to deploy the bean without specifying data source can anybody help me out in this regard.
23 years ago
I successfully deployed and executed the stateless bean eg. HelloBean comming along with websphere, but when i do my own bean I am getting error during deployment thro' admin console, I am getting ExecutionException while deploying, can any body help me out in this regard.
This is the exception
--------
com.ibm.ejs.sm.client.command.ExecutionException: Error during deploying jar file.
at com.ibm.ejs.sm.client.RepositoryOpException.<init>(RepositoryOpException.java:51)
at com.ibm.ejs.sm.client.command.ExecutionException.<init>(ExecutionException.java:63)
at com.ibm.ejs.sm.client.command.DeployJarCommand.execute(DeployJarCommand.java:86)
at com.ibm.ejs.sm.client.command.CommandManager$ExecutionThread.run(CommandManager.java:264)
at com.ibm.ejs.sm.client.command.ThreadPool$PooledThread.run(ThreadPool.java:89)
23 years ago