On Jan 19, 2009, at 2:20 PM, JensToerber wrote:


Hi David,

thanks a lot for your support:

I)
i tried the javax.mail.Session Resource:

What i found out:
a) If you specify the pass-through Properties in
<Resource id="BedsMailSession" type="javax.mail.Session">
        # mail.host=""
        mail.pop3.user=jens.toerber
        mail.pop3.host=pop.web.de
        mail.pop3.port=110
        mail.smtp.host=smtp.web.de
        mail.smtp.port=25
        mail.transport.protocol=smtp
        mail.smtp.auth="true"
        mail.smtp.user="jens.toerber"
        password="thrillie"
</Resource>

you get a WARN-Level log-entry that those Properties are not supported. I guess INFO-Level with a hint that they are passed through would be better.

Right, exactly. That's an oversight on our part. We'll need to get that code updated not to warn in situations where properties are passed directly through.

Logged that so we can track it:  
https://issues.apache.org/jira/browse/OPENEJB-989

b) You have to be very careful with the properties:
# "25" not allowed, not even 25<blank>, but
        mail.smtp.port=25
# "smtp" not allowed, not even smtp<blank>!!
        mail.transport.protocol=smtp
# "smtp.web.de" not allowed, but
        mail.smtp.host=smtp.web.de

, hence you have to be very careful and the values you specified do not work. I could not test everything, because there are different types of smtp-servers (pop3 before smtp, smtp authentification, ...). I guess also

mail.smtp.user="jens.toerber"

is not correct, but

mail.smtp.user=jens.toerber


, but i cannot prove it.

My mistake for showing with quotes, I forgot that java.util.Properties will not strip those out.

I was a bit surprised to find that java.util.Properties doesn't strip the whitespace off the end of a property value. I find that strange as it will strip the whitespace off the front and end of the property name and will strip the whitespace off the front of the property value. Seems inconsistent, but I can understand why they did it that way.

In our situation I don't think it's useful. We do have a more powerful subclass of java.util.Properties we use and in that we could add an option to trim whitespace off the end of property values as well.

Added a jira for this as well:  
https://issues.apache.org/jira/browse/OPENEJB-990

But if you take care, Mail-Sessions are working. Would be great to really
document this very precise.

Added this doc with the text from the thread.

http://cwiki.apache.org/OPENEJBx30/configuring-javamail.html

It could likely be more verbose perhaps even show a bean that uses javamail. Contributions are very welcome. If you're interested in helping I can hook you up in our wiki.

II)
New-Connection-sql:
JBoss has in it's datasource the new-connection-sql element and Weblogic 8.1 has an InitSQL on it's connection pool. Hence i could say, they support this
feature, and so should Openejb, but to be more specific:
a) In Oracle you may change NLS_SORT (XGERMAN_DIN) via ALTER SESSION ...
b) You may enable Database SQL trace:
ALTER SESSION SET SQL_TRACE=true (ok, you may do this by
DBMS_SESSION.SET_SQL_TRACE (sql_trace IN BOOLEAN), ... even from a different
session)
c) You may set the Oprimzer Mode for Oracle:
JBoss *-ds.xml:
...
 <new-connection-sql>begin EXECUTE IMMEDIATE 'ALTER SESSION SET
NLS_SORT=''XGERMAN_DIN''';EXECUTE IMMEDIATE 'ALTER SESSION SET
optimizer_mode=''FIRST_ROWS'''; end;</new-connection-sql>
...

Ok, not very typical. Hence i guess there are a lot of samples for needing a
New-Connection-SQL statement.

There may by EntityManager Interceptors or Listeners in EJB3, but our
Deployers like to control it like that.

Would be great to have this feature in Openejb as well.

We're using commons-dbcp for our jdbc connection pooling. If it has such functionality it should be fairly straightforward to wire it in.

III)
Timer
I'll attach my sample:
Simple Timer Bean with a Timeout-Method and an initialization Method, which
is called by a ServletContextListener.

The example is working in JBoss 4.2. In Openejb-JUnit it is also working, but i suppose it is because in my test i hold a reference to the TimerBean.
That's why i tried to put a reference to the TimerBean in the
ServletContextListener as an attribute in the ServletContext to simulate the
JUnit-Test behaviour.

It gets initialized, but never fires in Tomcat 6.0.18 and Openejb 3.1 in the
Container, but as already said in the JUnit test.

Any help appreciated.

That might be a little tricky to debug without an app that can reproduce the issue.

IV) I think CXF is ok delivered with Openejb. Would be nice to hear, if you try to upgrade the versions i told you, to support Hibernate without any
changes (it's because our old applications are used to it).

It should be possible to upgrade CXF or remove it entirely provided you also remove the openejb-cxf jar. Likely upgrading the slf4j jars without changing the CXF jars would be ok, but I can't say for certain.

-David

Reply via email to