On Dec 19, 2008, at 5:29 PM, ericp56 wrote:


Well, I went back and made sure the demo was working, which it was.

I created a simple EJB project and ran unit tests on that to make sure I had
it all OK.

There were problems with the Junit classloader (I don't know why I didn't
run into this in my previous testing...) but got it all resolved.

Now I'm back to the same spot. I removed some of the lines last time. Here
they are in full:

       p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");

       p.put("OracleXA", "new://Resource?type=DataSource");
       p.put("OracleXA.JdbcDriver", "oracle.jdbc.OracleDriver");
       p.put("OracleXA.JdbcUrl",
"jdbc:oracle:thin:uid/pwd@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (Host=server)(Port=1521))(CONNECT_DATA=(SID=DBID)))");

       p.put("Oracle", "new://Resource?type=DataSource");
       p.put("Oracle.JdbcDriver", "oracle.jdbc.OracleDriver");
p.put("Oracle.JdbcUrl","jdbc:oracle:thin:uid/p...@server: 1521:DBID");
       p.put("Oracle.JtaManaged", "false");

       context = new InitialContext(p);

And I'm still getting the invalid username/password message. If I change the DBID to something bogus, I get an appropriate message, so I know it
recognizes the Oracle.JdbcUrl line.

Now the openejb.xml file doesn't help. I'm getting the same invalid login
message using that.

Hi Eric,

Try adding the username and password as so:

       p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");

       p.put("OracleXA", "new://Resource?type=DataSource");
       p.put("OracleXA.JdbcDriver", "oracle.jdbc.OracleDriver");
       p.put("OracleXA.JdbcUrl",
"jdbc:oracle:thin:uid/pwd@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (Host=server)(Port=1521))(CONNECT_DATA=(SID=DBID)))");
       p.put("OracleXA.Username", "scott");
       p.put("OracleXA.Password", "tiger");

       p.put("Oracle", "new://Resource?type=DataSource");
       p.put("Oracle.JdbcDriver", "oracle.jdbc.OracleDriver");
p.put("Oracle.JdbcUrl","jdbc:oracle:thin:uid/p...@server: 1521:DBID");
       p.put("Oracle.JtaManaged", "false");
       p.put("Oracle.Username", "scott");
       p.put("Oracle.Password", "tiger");

       context = new InitialContext(p);

If that turns out to solve your issue, ideas on how to make that more clear are welcome. Maybe we should just include them in the examples even though it makes the config look larger.

Thoughts?

-David

Reply via email to