Szenario:
Zugriff ueber JSP auf EJB mit DB-Abfrage.
Status:
Anfaenger
Ich bekomme einfach keine Datenbank-Connection (J2EE/Oracle).
Beim Zugriff auf die Seite http://localhost:8000/euroexchange
kommt schon die Fehlermeldung (siehe unten „Console“).
Was ist .keystore (siehe unten „error.log“)?
Ich weiss nicht genau, wo ich noch was setzen muss damit
es funktioniert.
Oder habe ich etwas zuviel gesetzt?
gesetzte Umgebungsvariablen:
JAVA_HOME
J2EE_HOME
J2EE_CLASSPATH
Hat jemand eine Idee/Anregung?
Vielen Dank.
Gruss
Patrick
******************
default.properties:
jdbc.drivers=oracle.jdbc.driver.OracleDriver
jdbc.datasources=jdbc/Euro|jdbc:oracle:thin:@localhost:1521:ISORCL
******************
Console:
…
Binding DataSource, name = jdbc/Euro, url = jdbc:oracle:thin:@localhost:1521:ISORCL
…
J2EE server startup complete.
rmi Couldn’t create euroexchange bean.RemoteException occurred in server thread;
nested exception is:
java.rmi.RemoteException: DB-Ref does not exist null
******************
error.log
Logging for J2EE Server Version: 1.2.1-q started at: Tue Jul 10 12:26:47 GMT+02:00 2001…
Using the Classic VM and the version number 1.2.2 from Sun Microsystems Inc…
VM is using the classpath: g:\j2ee\lib\classes;g:\j2ee\lib\locale;g:\j2ee\lib\j2ee.jar;d:\enfinity\jdk\jre\lib\rt.jar;d:\enfinity\jdk\lib\tools.jar;.;d:\enfinity\orasvr\Ora81\jdbc\lib\classes111.zip;g:\j2ee\lib\cloudscape\RmiJdbc.jar;g:\j2ee\lib\cloudscape\client.jar;g:\j2ee\lib\jhall.jar .
J2EE Home Directory has been set to: g:\j2ee.
Cannot find keystore file : D:\WINNT\Profiles\phille01.keystore
java.rmi.RemoteException: DB-Ref does not exist null
at EuroExchangeBean.ejbCreate(EuroExchangeBean.java:33)
…
******************
Code snippets:
index.jsp
...
public void jspInit() {
try {
InitialContext ic = new InitialContext();
Object objref = ic.lookup("java:comp/env/ejb/TheEuroExchange");
EuroExchangeHome home = (EuroExchangeHome) PortableRemoteObject.narrow
(objref, EuroExchangeHome.class);
euroexchange = home.create();
} catch (RemoteException ex) {
System.out.println("rmi Couldn't create euroexchange bean."+ ex.getMessage());
...
EuroExchangeBean.java
...
public void ejbCreate()
throws RemoteException, CreateException {
try {
InitialContext beanCtx = new InitialContext();
DataSource ds = (DataSource) beanCtx.lookup("java:comp/env/jdbc/Euro");
dbConnection = ds.getConnection();
dbStatement = dbConnection.createStatement();
...
} catch(NamingException ne) {
throw new RemoteException("DB-Ref does not exist " + ne.getMessage());
...