In my project i have an
EJB module and Web Module(
JSP).
If i am calling the EJB from the ordinary client (
Java Program) for some database related tasks it is working.
But i want the EJB should be called from the Web module.
Things i had done are :
1) I have created a Connection Pool.
2) I have created a Data Source
3) I have deployed the EJB module in the Deployments -> EJB Modules
4) I have deployed the Web module in the Deployments -> Web Application
Modules.
5) My JNDI name for the EJB is MyRemote
6) My JNDI name for the Data Source is RemoteDB
The following is the code snippet in the JSP file
Properties p=new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ctx=new InitialContext(p);
DataSource ds=(DataSource)ctx.lookup("RemoteDB");
Connection con=ds.getConnection();
I have called database directly also (for checking purpose).
To call the EJB i have written the following code snippet.
Properties pt=new Properties();
pt.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
pt.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ic=new InitialContext(pt);
Object objref=initial.lookup("MyRemote");
RemoteUserHome home=(RemoteUserHome)PortableRemoteObject.narrow(objref,RemoteUserHome.class);
RemoteUser cfn1=home.create(serno,firstname,lastname,gender,id,password,security,ans,birth,Integer.parseInt(zip),code);
------------------------------------------------------------------------
When i run the program the following error is occuring :
Compilation of 'C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java' failed:
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:200: cannot resolve symbol
probably occurred due to an error in /InsertRecord.jsp line 73:
Object objref=initial.lookup("MyRemote");
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:202: cannot resolve symbol
probably occurred due to an error in /InsertRecord.jsp line 75:
RemoteUserHome home=(RemoteUserHome)PortableRemoteObject.narrow(objref,RemoteUserHome.class);
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:202: cannot resolve symbol
probably occurred due to an error in /InsertRecord.jsp line 75:
RemoteUserHome home=(RemoteUserHome)PortableRemoteObject.narrow(objref,RemoteUserHome.class);
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:202: cannot resolve symbol
probably occurred due to an error in /InsertRecord.jsp line 75:
RemoteUserHome home=(RemoteUserHome)PortableRemoteObject.narrow(objref,RemoteUserHome.class);
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:203: cannot resolve symbol
probably occurred due to an error in /InsertRecord.jsp line 76:
RemoteUser cfn1=home.create(serno,firstname,lastname,gender,id,password,security,ans,birth,Integer.parseInt(zip),code);
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java uses or overrides a deprecated API.
Full compiler error(s):
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:200: cannot resolve symbol
symbol : variable initial
location: class jsp_servlet.__insertrecord
Object objref=initial.lookup("MyRemote"); //[ /InsertRecord.jsp; Line: 73]
^
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:202: cannot resolve symbol
symbol : class RemoteUserHome
location: class jsp_servlet.__insertrecord
RemoteUserHome home=(RemoteUserHome)PortableRemoteObject.narrow(objref,RemoteUserHome.class); //[ /InsertRecord.jsp; Line: 75]
^
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:202: cannot resolve symbol
symbol : class RemoteUserHome
location: class jsp_servlet.__insertrecord
RemoteUserHome home=(RemoteUserHome)PortableRemoteObject.narrow(objref,RemoteUserHome.class); //[ /InsertRecord.jsp; Line: 75]
^
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:202: cannot resolve symbol
symbol : class RemoteUserHome
location: class jsp_servlet.__insertrecord
RemoteUserHome home=(RemoteUserHome)PortableRemoteObject.narrow(objref,RemoteUserHome.class); //[ /InsertRecord.jsp; Line: 75]
^
C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java:203: cannot resolve symbol
symbol : class RemoteUser
location: class jsp_servlet.__insertrecord
RemoteUser cfn1=home.create(serno,firstname,lastname,gender,id,password,security,ans,birth,Integer.parseInt(zip),code); //[ /InsertRecord.jsp; Line: 76]
^
Note: C:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_remote_remote\jsp_servlet\__insertrecord.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
5 errors
Thu Sep 21 08:59:33 GMT+05:30 2006