I had written three files AdderHome.java, Adder.java and AdderBean.java and kept in com.ejb package. which i copied here
When I compile the AdderHome.java files it shows me follwing error
"Adder interface: can not resolve symbol"
Though I had successfully compiled Adder.java and AdderBean.java
All classpath settings are ok.
These are the files
The AdderHome Interface
package com.ejb;
import java.rmi.RemoteException;
import javx.ejb.EJBHome;
import javax.ejb.CreateExcetpion;
public interface AdderHome extends EJBHome{
Adder create() throws RemoteExcetion, CreateException;
}
The Adder Interface
package com.ejb;
import java.rmi.RemoteException;
import javx.ejb.EJBObject;
public interface Adder extends EJBObject{
public int add(int a, int b) throws RemoteException;
}
The AdderBean Class
package com.ejb;
import java.rmi.RemoteException;
import javax.ejb.SessionBean;
import javax.SessionContext;
public class AdderBean implements SesssionBean{
public int add( int a, int b)
System.out.println("From bean classs");
return(a+b);
}
public void ejbCreate() {
}
public void ejbRemove() {
}
public void ejbActivate() {
}
public void ejbPassivate() {
}
public void setSessionContext (SessionContext sc){
}
please tell me where I am wrong.
Thanks in adv.
Regards
Chintan
-
EJBHome compilation Error (6 messages)
- Posted by: chintan parekh
- Posted on: August 29 2003 00:37 EDT
Threaded Messages (6)
- EJBHome compilation Error by Suresh Babu on August 29 2003 00:43 EDT
- EJBHome compilation Error by chintan parekh on August 29 2003 01:30 EDT
- EJBHome compilation Error by BENMIRA Nabil on August 29 2003 09:52 EDT
- EJBHome compilation Error by chintan parekh on August 29 2003 01:30 EDT
- EJBHome compilation Error by Pranav Soni on August 29 2003 16:18 EDT
- EJBHome compilation Error by chintan parekh on August 30 2003 23:38 EDT
- EJBHome compilation Error by sk kumar on September 01 2003 04:04 EDT
- EJBHome compilation Error by chintan parekh on August 30 2003 23:38 EDT
-
EJBHome compilation Error[ Go to top ]
- Posted by: Suresh Babu
- Posted on: August 29 2003 00:43 EDT
- in response to chintan parekh
Hi Chintan,
Check your classpath. I think your local classpath is not porperly set thats why it giving the "Adder interface: can not resolve symbol".Your classpath should contain both j2ee jar and your local package directory path.
cheer,
Suresh Babu -
EJBHome compilation Error[ Go to top ]
- Posted by: chintan parekh
- Posted on: August 29 2003 01:30 EDT
- in response to Suresh Babu
i already have put ejb.jar in classpath
so what else i have to put so that i can remove this error. And one thing is that Adder.java is compiled successfully so if it is prob. of classpath then Both Home and Remote interface should not be compiled
Regrds
Chintan -
EJBHome compilation Error[ Go to top ]
- Posted by: BENMIRA Nabil
- Posted on: August 29 2003 09:52 EDT
- in response to chintan parekh
Hi Parekh,
try to add your yourPah/com/ejb/ directory in your CLASSPATH
or
try to compile files from the 'yourPath' directory
parekh$yourPah/com/ejb/> cd ..
parekh$yourPah/com/> cd ..
parekh$yourPah/> javac com/ejb/*.java
Nabil Benmira -
EJBHome compilation Error[ Go to top ]
- Posted by: Pranav Soni
- Posted on: August 29 2003 16:18 EDT
- in response to chintan parekh
Setting the CLASSPATH variable or using the -classpath command-line option overrides the default ie. current directory, so if you want to include the current directory in the search path, you must include "." in the new settings. -
EJBHome compilation Error[ Go to top ]
- Posted by: chintan parekh
- Posted on: August 30 2003 23:38 EDT
- in response to Pranav Soni
Stil I am not able to compile AdderHome.java But i am able to compile Adder.java and AdderBean.java
Please Help me
Thanks
Chintan -
EJBHome compilation Error[ Go to top ]
- Posted by: sk kumar
- Posted on: September 01 2003 04:04 EDT
- in response to chintan parekh
Hi Chintan,
This is happening because AdderHome is not able to find Adder while it is being compiled. Since AdderHome refers to Adder, it looks for this in the classpath but does not find it and hence it gives this error. Please make sure Adder is in the classpath. Set the classpath properly.
Since Adder and AdderBean do not refer to any files(other than the ones which you have imported), they get compiled successfully.
I know you might have taken care of this thing, but just mentioning it again:
Try from the command prompt:
(Say your files are located in c:\a\b)
c:\a\b> javac com\ejb\AdderHome.java (Set the classpath so that it begins looking for Adder from the current directory)
Regards,
Alongian