PN Subramanian

Greenhorn
+ Follow
since Jun 22, 2001
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 PN Subramanian

Hai,
This error had occured a couple of times.On re-doing the entire process of bean deployment from scratch this error could sometimes be overcome.If anyone knows the actual reason do let me know.
This error occurs inspite of
1) Settings in jetace not being modified (Transaction settings)
2) Specifying a proper package name
3) Irrespective of whether the bean is a CMP/BMP
18 years ago
Hai all,
Could anyone help me out on deployment of entity bean.
DB2 is the backend.Is jetace tool alone sufficient ?If so, where does the mapping of the field to the instance variable take place?
The problem i face now is - After deployment, when i run my Client file instead of retreiving a row from table the contents of the table get updated.i.e
Before running client
EMPID NAME
E001 XXXX
E002 YYYY
After running client
EMPID NAME
E001 E001
E002 YYYY when i try to retreive the name corresponding to EMPID E001.
What could be the cause of the error.
My bean file is
public class PersonalBean implements EntityBean {
protected EntityContext context;
public String EmpId;
public String Name;
public PersonalPrimary ejbCreate(String EmpId,String Name)
throws CreateException
{
this.EmpId=EmpId;
this.Name=Name;
return null;
}
public void ejbPostCreate(String EmpId,String Name) throws java.rmi.RemoteException {

}
public String getName() {
return Name;
}
public void setName(String Name){
this.Name=Name;
}
public void ejbActivate() {
}
public void ejbPassivate() {
}
public void ejbLoad() {
}
public void ejbStore() {
}
public void ejbRemove()
throws RemoveException
{
}
public void setEntityContext(EntityContext context) {
this.context = context;
}
public void unsetEntityContext() {
this.context = null;
}
}

18 years ago
Hai Sandeep,
Thanks for your response.
By the way, the DD file you are talking about - isn't it the deployment descriptor file?Here i am making use of jetace tool and there in the details regarding the bean are specified.
And the same gets written to a xml file by making use of File->Write XML option in the jetace tool.If this be the DD file, what could be the syntax errors in it as it is being generated by the jetace tool itself? I'm not quite sure whether this is what you mean by the DD file..Any way the following is the XML output of the jetace tool
Since it is a XML file i've replaced the "< " symbol with "[" here for easier understanding <br /> [?xml version='1.0' encoding="ISO-8859-1" ?>
[ejb-JAR>
[input-file>C:\Personal\JetIn.jar</input-file>
[output-file>C:\Personal\JetOutput.jar</output-file>
[entity-bean dname="test/dd.ser">
[primary-key>test.PersonalPrimary</primary-key>
[re-entrant value="false"/>
[container-managed>Name</container-managed>
[container-managed>EmpId</container-managed>
[home-interface>test.PersonalHome</home-interface>
[remote-interface>test.Personal</remote-interface>
[enterprise-bean>test.PersonalBean</enterprise-bean>
[jndi-name>test</jndi-name>
[transaction-attr value="TX_SUPPORTS"/>
[isolation-level value="READ_COMMITTED"/>
[run-as-mode value="SPECIFIED_IDENTITY"/>
[env-prop name="javax.naming.Context.INITIAL_CONTEXT_FACTORY" comment="">com.ibm.ejs.ns.jndi.CNInitialContextFactory</env-prop>
[env-prop name="JNDIName" comment="">test</env-prop>
[dependency comment="">test.Personal.class</dependency>
[dependency comment="">test.PersonalPrimary.class</dependency>
[dependency comment="">test.PersonalHome.class</dependency>
[dependency comment="">test.PersonalBean.class</dependency>
[/entity-bean>
[/ejb-JAR>
Isn't the JNDIName called the publishing name?It is the same one being specified in the Client.java file also.
Hope, these are what you had mentioned in your response.Please do respond if any of the above are unsatisfactory for the proper functioning of the bean.
Thanks once again for your response.

[This message has been edited by PN Subramanian (edited June 26, 2001).]
18 years ago
Try doing these things
- Classpath settings :
ujc.jar;ejs.jar;Deployed<beanName>.jar
- lookup method returns an Object object - i.e it needs to be narrowed to the Home object using PortableRemoteObject method
- The PROVIDER_URL can be localhost only if the AS and client are in the same physical system - always better giving the IP address of the server.

Hope this solves your problem.Do respond if you have any further problems.
18 years ago
Sandeep,
Thanks for your reply.
As you had suggested i had run the code you had given.During deployment i got an exception
It says Deployment(Open) failed
This is followed by a few statements indicating that the ".ser" file was found etc....and an Exception statement like
com.ibm.ejs.sm.client.command.ExecutionException : Error during deploying jar file
com.ibm.ejs.sm.client.RepositoryOpException
com.ibm.ejs.sm.client.command.ExecutionException
com.ibm.ejs.sm.client.command.DeployJarCommand.execute
com.ibm.ejs.sm.client.command.CommandManager$ExecutionThread.run
I tried restarting the server too, but even then the response was the same.
Couldn't figure out the reason for such a behaviour.
18 years ago
Thanks for your prompt reply.
The ejbCreate method as in the Home interface has only one argument i.e EmpId.
Also, even when two arguments were included,with the corresponding changes to ejbPostCreate method and Home interface the same happens - the Name field getting updated in the table.
Looking forward to your assistance.

18 years ago
Firstly, thanks for your response.
Attaching alongwith the code (bean.java ) file...
public class PersonalBean implements EntityBean {
protected EntityContext context;
public String EmpId;
public String Name;

public PersonalPrimary ejbCreate(String EmpId)
throws CreateException
{
this.EmpId=EmpId;
return null;//this return implies CMP
}

public void ejbPostCreate(String EmpId) {
//for any follow-up operations
}

public String getEmpName() {
try{
System.out.println("Entered getEmpName method");
}
catch(Exception e){
System.out.println("Exception in getEmpname() :"+e);
}
return Name;

}
public void ejbActivate() {
}

public void ejbPassivate() {
}

public void ejbLoad() {
}

public void ejbStore() {
}

public void ejbRemove()
throws RemoveException
{
}

public void setEntityContext(EntityContext context) {
this.context = context;
}

public void unsetEntityContext() {
this.context = null;
}
}
This is a CMP bean and the getEmpName() method is expected to return the name corresponding to the EMPID being hardcoded in the Client.java file.However, this method returns EMPID itself.
Could you please guide me on this.
Thanks in advance for your help.
18 years ago
I was able to deploy a CMP entity bean in Websphere.However once i try to run the client, instead of retrieving data from the table, the corresponding data gets updated i.e
Initial table data
EMPID NAME
E001 adsf
E002 qewr
On executing the client instead of getting the name corresponding to the EMPID entered, the NAME gets "updated" to E001 and my output is also E001.I'm using DB2 as my backend and using COM.ibm.db2.jdbc.app.DB2Driver as my driver.

Could anyone please help me out on this?Any reason why the bean doesn't behave the way it should.The same bean gives the required result when using Weblogic v 5.1.

18 years ago
As per u'r initial error message the system is trying to make a registry entry and is unable to do so.It could well be due to admin rights in the system, otherwise registry error does crop up.
18 years ago
It could be because of two reasons - ujc.jar is not included in the classpath of the system and secondly the jdk being used must be IBM's jdk (NOT SUN's).
It should work alright now.
18 years ago
While deploying an entity bean(BMP) a Deployment exception occurs.I had set the Datasource name and chosen appropriate driver DB2 - COM.ibm.db2.jdbc.app.DB2Driver and created a table in DB2 database.
The following is the exception being shown :
Exception:
Deployment[Open] failed:
EJBDeploy: setupWorkingDir(): Setting up working directory D:\WebSphere\AppServer\deployedEJBs\productWorkingDir
EJBDeploy: open(): Processing jar file D:\WebSphere\AppServer\deployableEJBs\product.jar
EJBJar: processJar(): Extracting jar file D:\WebSphere\AppServer\deployableEJBs\product.jar to directory D:\WebSphere\AppServer\deployedEJBs\productWorkingDir\__ejbjar
EJBJar: processJar(): Parsing manifest file for deployment descriptors
Found product.ser
EJBJar: loadJarClasses(): Adding all classes in .jar file to custom class loader
EJBJar: processJar(): Deserializing deployment descriptors
product.ser
EJBDeploy: open(): Verifying EJB com.dexterf.product.ProductBean
com.ibm.ejs.sm.exception.DeploymentException: Deployment[Open] failed:
EJBDeploy: setupWorkingDir(): Setting up working directory D:\WebSphere\AppServer\deployedEJBs\productWorkingDir
EJBDeploy: open(): Processing jar file D:\WebSphere\AppServer\deployableEJBs\product.jar
EJBJar: processJar(): Extracting jar file D:\WebSphere\AppServer\deployableEJBs\product.jar to directory D:\WebSphere\AppServer\deployedEJBs\productWorkingDir\__ejbjar
EJBJar: processJar(): Parsing manifest file for deployment descriptors
Found product.ser
EJBJar: loadJarClasses(): Adding all classes in .jar file to custom class loader
EJBJar: processJar(): Deserializing deployment descriptors
product.ser
EJBDeploy: open(): Verifying EJB com.dexterf.product.ProductBean
--------
com.ibm.ejs.sm.client.command.ExecutionException: Error during create.
at com.ibm.ejs.sm.client.RepositoryOpException.(RepositoryOpException.java:51)
at com.ibm.ejs.sm.client.command.ExecutionException.(ExecutionException.java:63)
at com.ibm.ejs.sm.client.command.DeployEJBTaskCommand.execute(DeployEJBTaskCommand.java:136)
at com.ibm.ejs.sm.client.command.CommandManager$ExecutionThread.run(CommandManager.java:282)
18 years ago