rohit aggarwal

Greenhorn
+ Follow
since Jul 11, 2001
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 rohit aggarwal

I have installed weblogic6.1. when i run the console it's left applet doesnot show anything.
It opens other window and displays this message
%-- /** * This page is used only by the NavApplet. It generates an XML * document which the applet uses to populate the navigation tree. * * @author Copyright BEA Systems. All Rights Reserved. */ --%>
mean while other applets are working.
please help.
22 years ago
i have got the point where i was mistaking.
now my code is working well.
hi,
I am using JSP and ejb beans to fetch records from database and yhen shows them on JSP page through number of links.
now all is working well till the records get fetching from database,if clicking on any hyperlink does'nt fetch any records from database all the happening become stand still giving only one message i.e no records.
my querries are working well behind the scenes.
I am using stateless beans.
rohit
Hi Ilya,
Thanks for giving me solutions, actualy j2ee deploytool generates the stub classes automaticaly.
i have seen that, any way i think i been wrong some where else but could not able trace the error.
I have done it with taking two other ejb beans.
in j2ee there is no need to do anything explicitly as deploytool will do it for you. thanks all for helping me.
Rohit
Hi manju,
thanks for helping me,
i want to know one thing from you about directory structure.
when i deploy the application in j2ee,
the web part is stored in root directory i.e j2sdkee1.2.1/public_html/applicationName/*.jsp
j2sdkee1.2.1/public_html/applicationName/web-inf/classes/*.class
here *.class are the javBeans that act as clients to ejbs
and ejb jars are stored in
j2sdkee1.2.1/repository/machineName/applications/*.jar
where jar has sellLoginClient.jar,sellLogin1823703Server.jar andsellLogine6014793825.jar
now if i donot check the return client, i think it automaticaaly creats that client.jar into it.
I have tried what you have told but of no use,
either i am doing it in wrong way.
i am getting one client.jar for one application.
please tell me in steps what i have to do.
i have LoginEJB.class and CategoryEJB.calss plus their homes and Remotes.
LoginBean.class and CategoryBean.class javaBeans acts as cleints for their respective EJBbeans.
two jsp files Login.jsp and category.jsp.
first file of application to be called is category.jsp which checks the sessions for user.
please tell me what i have to do from scratch with there directory structure.
with thanks,
rohit
Hi,
what i am doing is that i am showing categories on a page but before it verifies that user is login or not, if not then it is redirected to login screen and asks userlogin and password.
all this is done through JSP. Now login form is submitted and its login name and login password is checked through stateless session bean i.e LoginEJB.if he exists then it sets sessions.
now it is redirected back to category screen where the categories are shown from CategoryEJB bean.
now what i have done is i have made one jar file for login bean and one for category bean through j2ee deploytool.
i also made one war file which contains JSP files,i.e auc_login.jsp,auc_sell_product.jsp,LoginBean.class and Category.class.
LoginBean and CategoryBean are java beans which acts client to their respective ejb's.
i have deployed them through an one application when i run the application, it reflects to login screen,after submitting login form it verifies the user but gives above error in CategoryBean. again if closes this window and open another window then again it asks login screen but this time after submitting the login form it gives above errors in loginBean but categoryBean is working(that i come to know through console where it shows me al the happenings).
hi Dorfman,
i could not able to get you. what are stubs.please clearly explain me step wise.
I am very desperate to solve it.
when loginBean is working then i get error in category bean , if category bean is working then i get error in login bean
i am sure the erroris on this line
java.lang.Object objref = ic.lookup("java:comp/env/ejb/Category");
objref is not getting initiated
i am getting error on this code in CategoryBean.java
Context ic = new InitialContext();
java.lang.Object objref = ic.lookup("java:comp/env/ejb/Category");
catHome = (CategoryHome) PortableRemoteObject.narrow(objref,ejbBeans.CategoryHome.class);
LoginBean.java
Context ic = new InitialContext();
java.lang.Object objref = ic.lookup("java:comp/env/ejb/Login");
loginHome = (LoginHome) PortableRemoteObject.narrow(objref,ejbBeans.LoginHome.class);
i have deployed an application with 2 jars and one war file.
war file has two JSP pages and two javaBeans.

now when i run my application either one of the ejbBean is working means if 1st ejb is working then 2nd one is giving error and vice versa.
they are giving following error:
java.lang.ClassCastException
at com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow(Portab
leRemoteObject.java:296)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
i am stuck to this problem from last week.
i have deployed the web application sucessfully in j2ee application server.When i run this application i am getting following errors:
java.lang.ClassCastException at com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow()
on this code
Context ic = new InitialContext();
java.lang.Object objref = ic.lookup("java:comp/env/ejb/Category");
catHome = (CategoryHome) PortableRemoteObject.narrow(objref,ejbBeans.CategoryHome.class);
I have been stuck to this for last 4 days.I have searched from net but do not get any clue.
i am guessing that home object is not getting initialized.
why??
you should define class path of j2ee.jar.
it exists in j2sdkee1.2.1/lib/j2ee.jar
i am getting this error:
java.lang.Exception: Errror in processRequest(): java.lang.Exception: categoryRemote = categoryHome.create() java.lang.NullPointerException
i am calling CategoryEJB.java through CategoryBean.java in jsp page.
CategoryBean.java is
/*
Page Name :-CategoryBean.java
Author(s) :-Rohit Aggarwal
Description of Page:-Acts as interface between auc_sell_product.jsp and CategoryEJB.java
Previous Page(s):-
Next Page(s):-
Date of Creation:-25/07/2001
Date of Last Modification :-25/07/2001
*/
package javaBeans;
import java.util.*;
import ejbBeans.*;
import java.io.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class CategoryBean
{
privateCollection categoryID ;
privateCollection categoryName ;
private String catstrname;
private String catstrid;
private CategoryHome catHome;
private CategoryRemote catRemote;
private String statefull;

public CategoryBean()
{
try
{
Context ic = new InitialContext();
java.lang.Object objref = ic.lookup("java:comp/env/ejb/Category");
catHome = (CategoryHome) PortableRemoteObject.narrow(objref,ejbBeans.CategoryHome.class);
}
catch (Exception re)
{
System.out.println ("Couldn't locate Category Home.Error CategoryBean.java");
re.printStackTrace();
}

}
public Collection getCategoryID()
{
return categoryID;
}

public Collection getCategoryName()
{
return categoryName;
}
public void setCatStrID(String id)
{
this.catstrid=id;
}
public void setCatStrName(String name)
{
this.catstrname=name;
}

public String getCatStrName()
{
return catstrname;
}
public String getCatStrID()
{
return catstrid;
}
public void setCategoryID(Collection id)
{
this.categoryID=id;
}

public void setCategoryName(Collection catname)
{
this.categoryName=catname;
}

public void processCategoryRequest() throws Exception
{
try
{
System.out.println("start processCategoryRequest");
statefull="no";
catRemote=catHome.create(statefull);
}
catch (Exception e)
{
throw new Exception("categoryRemote=categoryHome.create() "+e);//getting null pointer exception here
}

try
{
System.out.println("start loadfromejb");
loadFromCategoryEJB();
System.out.println("end of load from Categoryejb");
}
catch (Exception e)
{
throw new Exception("Errror in processCategoryRequest() while loadingFromCategoryEJB(): "+e);
}
} // try
catch (Exception e)
{
throw new Exception("Errror in processRequest(): "+e);
}

}
private void loadFromCategoryEJB() throws Exception
{
try
{
System.out.println("in loadfromejb");
setCatStrID(catRemote.getCatStrID());
setCatStrName(catRemote.getCatStrName());
setCategoryID(catRemote.getCategoryID());
setCategoryName(catRemote.getCategoryName());
}
catch (Exception re)
{
throw new Exception("Errror in loadFromEJB(): "+re);
}
}
}

[This message has been edited by rohit aggarwal (edited August 16, 2001).]
i am getting this error while deploying,
"no method matching getCategory() found in ejbBeans.CategoryEJB.java"
while i have declared this method in CategoryRemote.java