Category Archives: apache

Configure TopLink Essentials logging

By default Oracle TopLink uses a TopLink native logger DefaultLogger (oracle.toplink.essentials.logging.DefaultSessionLog). This logger doesn’t offer log level and category settings.

If you try to set a log level, e.g. to get rid of debug output of SQL statement, this setting in persistence.xml won’t have any effect:

<property name="toplink.logging.level.sql" value="WARNING"/>

You have to configure explicitly Java logging in persistence.xml:

<property name="toplink.logging.logger" value="JavaLogger"/>
<property name="toplink.logging.level.sql" value="WARNING"/>

If you are using Spring, you may want to redirect the output to Apache Commons Logging. Spring provides a class org.springframework.orm.toplink.support.CommonsLoggingSessionLog. However, this class works with TopLink full version. To bring it to work with TopLink Essentials, grab the CommonsLoggingSessionLog source and change all imports starting with oracle.toplink to oracle.toplink.essentials.

Finally, register your new SessionLog implementation in persistence.xml:

<property name="toplink.logging.logger" value="foo.MyTopLinkEssentialsCommonsLoggingSessionLog"/>

For more information on settings, refer to TopLink Essentials documentation on logging.

Apache CXF JBoss 4.2 deployment – tips and tricks

If you are not able to deploy an application using Apache CXF library in JBoss, you might want to check first Application Server Specific Configuration Guide chapter of CXF user’s guide.

Furthermore, check if the JBossWS framework is already deployed (jbossws.sar directory in the JBoss deployment directory) and try to remove it. It contains already a lot of APIs and implementations that can confict with APIs and implementations provided with CXF.

Concrete example – I was using CXF 2.0 series which implements JAX-WS 2.0 standard. JBossWS 2.0 framework, shipped with JBoss 4.2, implements JAX-WS 2.1 specification. In some situations when a dateTime was parsed I was getting NullPointerException with a message about marshalling error. Removing the jbossws.sar helped.

Follow

Get every new post delivered to your Inbox.

Join 318 other followers