<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sebthom.de &#187; Java</title>
	<atom:link href="http://sebthom.de/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebthom.de</link>
	<description>IT Freelancer - Java, J2EE, IBM WebSphere Portal, Lotus Notes/Domino</description>
	<lastBuildDate>Sat, 03 Sep 2011 18:02:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Configuring EMF Teneo with Hibernate, Commons DBCP, Spring Hibernate Transaction Manager, and the OpenSessionInViewFilter</title>
		<link>http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/</link>
		<comments>http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 16:26:40 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[dbcp]]></category>
		<category><![CDATA[emf]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[teneo]]></category>
		<category><![CDATA[transaction]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=152</guid>
		<description><![CDATA[     <link rel="alternate" type="application/atom+xml" title="sebthom.de Category: Java" href="http://sebthom.de/category/it/development/java-coding/feed/" />
While trying to get an application working with]]></description>
			<content:encoded><![CDATA[<p>While trying to get an application working with <a href="http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install"EMF Teneo</a>, <a href="http://www.hibernate.org/">Hibernate</a>, <a href="http://commons.apache.org/dbcp/">Commons DBCP</a>, <a href="http://static.springsource.org/spring/docs/current/spring-framework-reference/html/orm.html#orm-hibernate-tx-declarative/">Spring Hibernate Transaction Manager</a> and the <a href="http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/orm/hibernate3/support/OpenSessionInViewFilter.html">OpenSessionInViewFilter</a> I encountered several unexpected issues. Here is an example of a working configuration for this software stack. Read the comments below the XML file for some explanations.</p>
<p><b>HbDataStoreWithDataSource.java:</b></p>
<pre class="java" name="code">
package de.sebthom.util;

import java.sql.*;
import java.util.Properties;
import javax.sql.DataSource;
import org.eclipse.emf.teneo.PersistenceOptions;
import org.eclipse.emf.teneo.hibernate.HbSessionDataStore;
import org.hibernate.HibernateException;
import org.hibernate.cfg.*;
import org.hibernate.connection.ConnectionProvider;

/**
 * @author Sebastian Thomschke
 */
public class HbDataStoreWithDataSource extends HbSessionDataStore {
  public final static class CustomConnectionProvider implements ConnectionProvider {
    private DataSource ds;

    public void close() throws HibernateException { }

    public void closeConnection(final Connection conn) throws SQLException {
      conn.close();
    }

    public void configure(final Properties props) throws HibernateException {
      ds = _CONFIG_TIME_DS_HOLDER.get();
    }

    public Connection getConnection() throws SQLException {
      return ds.getConnection();
    }

   public boolean supportsAggressiveRelease() {
     return false;
   }
  }

  private static final long serialVersionUID = 1L;
  private static HbDataStoreWithDataSource INSTANCE;

  /**
   * the data source holder acts as a thread safe bridge between the DSConnectionProvider which is instantiated by Hibernate internally
   * and the data source injected into the session factory during spring configuration time.
   */
  private static final ThreadLocal<DataSource> _CONFIG_TIME_DS_HOLDER = new ThreadLocal<DataSource>();

  public static HbDataStoreWithDataSource getInstance() {
		return INSTANCE;
  }

  private final Properties props = new Properties();

  public HbDataStoreWithDataSource() {
    INSTANCE = this;

    props.setProperty(PersistenceOptions.ADD_INDEX_FOR_FOREIGN_KEY, "true");
    props.setProperty(PersistenceOptions.FETCH_CONTAINMENT_EAGERLY, "false");
    props.setProperty(PersistenceOptions.FETCH_ASSOCIATION_EXTRA_LAZY, "false");

    // tell Teneo to not change the table names, we do this using Hibernate's ImprovedNamingStrategy
    props.setProperty(PersistenceOptions.SQL_CASE_STRATEGY, "none");
    props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH, "-1");
  }

  protected Configuration createConfiguration() {
    Configuration cfg = super.createConfiguration();
    cfg.setNamingStrategy(ImprovedNamingStrategy.INSTANCE);

    // only if a DS is injected we register our connection provider
    if (_CONFIG_TIME_DS_HOLDER.get() != null)
      cfg.setProperty(Environment.CONNECTION_PROVIDER, CustomConnectionProvider.class.getName());
    return cfg;
  }

  public void setDataSource(final DataSource ds) {
    _CONFIG_TIME_DS_HOLDER.set(ds);
  }

  public final void setHibernateProperties(final Properties hibernateProperties) {
    throw new UnsupportedOperationException();
  }

  public final void setPersistenceProperties(final Properties persistenceOptions) {
    throw new UnsupportedOperationException();
  }

  public void setProperties(final Properties props) {
    this.props.putAll(props);
    super.setProperties(this.props);
  }
}
</pre>
<p><b>web.xml:</b></p>
<pre class="xml" name="code">
<filter>
  <filter-name>openSessionInViewFilter</filter-name>
  <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    <init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
    </init-param>
    <init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value>realSessionFactory</param-value>
    </init-param>
</filter>
<filter-mapping>
  <filter-name>openSessionInViewFilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>ERROR</dispatcher>
</filter-mapping>
</pre>
<p><b>applicationContext.xml:</b></p>
<pre class="xml" name="code">
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" default-lazy-init="false">

  <context:property-placeholder location="WEB-INF/application.spring.properties"></context:property-placeholder>

  <bean id="dataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
      <bean class="org.apache.commons.dbcp.BasicDataSource" init-method="createDataSource" destroy-method="close">
<property name="driverClassName">${jdbc.driverClassName}</property>
<property name="url">${jdbc.url}</property>
<property name="username">${jdbc.username}</property>
<property name="password">${jdbc.password}</property>
<property name="defaultAutoCommit">false</property>
<property name="maxActive">${jdbc.maxConnections}</property>
<property name="maxIdle">${jdbc.minConnections}</property>
<property name="maxWait">10000</property>
<property name="initialSize">${jdbc.minConnections}</property>
<property name="validationQuery">${jdbc.validationQuery}</property>
<property name="testOnBorrow">false</property>
<property name="testWhileIdle">true</property>
<property name="timeBetweenEvictionRunsMillis">1200000</property>
<property name="minEvictableIdleTimeMillis">1800000</property>
<property name="numTestsPerEvictionRun">5</property>
      </bean>
    </property>
  </bean>

  <bean id="teneoSessionFactory" class="de.sebthom.util.HbSessionDataStoreWithDataSource" init-method="initialize" p:name="myDataStore" p:dataSource-ref="dataSource">
<property name="properties"><value>
      hibernate.dialect=${hibernate.dialect}
      hibernate.hbm2ddl.auto=${hibernate.hbm2ddl.auto}
      hibernate.jdbc.batch_size=2000
      hibernate.show_sql=${hibernate.show_sql}
      hibernate.transaction.auto_close_session=false
      hibernate.current_session_context_class=org.springframework.orm.hibernate3.SpringSessionContext
      hibernate.transaction.factory_class=org.springframework.orm.hibernate3.SpringTransactionFactory
    </value></property>
<property name="EPackageClasses">
<list><value>com.acme.ShopPackageImpl</value></list></property>
  </bean>

  <bean id="realSessionFactory" factory-bean="teneoSessionFactory" factory-method="getSessionFactory"></bean>

  <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" p:sessionFactory-ref="realSessionFactory" p:nestedTransactionAllowed="true" p:earlyFlushBeforeCommit="true"></bean>

  <tx:annotation-driven transaction-manager="transactionManager"></tx:annotation-driven>

</beans>
</pre>
<p><b>Comments:</b></p>
<ol>
<li><b>VERY IMPORTANT:</b>The <b>HibernateTransactionManager</b> does NOT get the teneoSessionFactory(HbSessionDataStore) object passed in as sessionFactory, but the underlying Hibernate SessionFactory that can be retrieved from the HbSessionDataStore via the getSessionFactory() method. Not doing so will result in duplicate Hibernate Sessions completely breaking the transaction managment. This happens because in that case the TransactionSynchronizationManager will sometimes internally bind the hibernate session to the current thread based on different keys and thus does not find it again. Here are some stacktraces showing the problem:
<pre>
TransactionSynchronizationManager.bindResource(Object, Object) line: 170
at OpenSessionInViewFilter.doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) line: 183
=> results in TransactionSynchronizationManager.bindResource(<b>HbSessionDataStore</b>, SessionHolder) => as key the <b>Teneo SessionFactory</b> is used

TransactionSynchronizationManager.bindResource(Object, Object) line: 170
at SessionFactoryUtils.doGetSession(SessionFactory, Interceptor, SQLExceptionTranslator, boolean) line: 339
at SessionFactoryUtils.doGetSession(SessionFactory, boolean) line: 256
at SpringSessionContext.currentSession() line: 60
at SessionFactoryImpl.getCurrentSession() line: 700
at HbSessionDataStore(HbBaseSessionDataStore).getCurrentSession() line: 161
=> results in TransactionSynchronizationManager.bindResource(<b>SessionFactoryImpl</b>, SessionHolder) => as key the <b>Hibernate SessionFactory</b> is used

TransactionSynchronizationManager.bindResource(Object, Object) line: 170
at HibernateTransactionManager.doBegin(Object, TransactionDefinition) line: 577
at HibernateTransactionManager(AbstractPlatformTransactionManager).getTransaction(TransactionDefinition) line: 371
at TransactionInterceptor(TransactionAspectSupport).createTransactionIfNecessary(PlatformTransactionManager, TransactionAttribute, String) line: 316
at TransactionInterceptor.invoke(MethodInvocation) line: 105
at ReflectiveMethodInvocation.proceed() line: 172
=> results in TransactionSynchronizationManager.bindResource(<b>HbSessionDataStore</b>, SessionHolder) => as key the <b>Teneo SessionFactory</b> is used
</pre>
<li><b>defaultAutoCommit</b> is set to <b>false</b> to ensure that Spring has full control over the transaction and that the connection pool is not committing statements automatically based on it&#8217;s own strategies.
<li>The example uses an extended version of the <b>org.eclipse.emf.teneo.hibernate.HbSessionDataStore</b> class that allows the usage of a DataSource object and that configures Teneo to not alter the table, column names but let&#8217;s Hibernate handle this via its ImprovedNamingStrategy.
<li><b>hibernate.transaction.auto_close_session</b> is set to <b>false</b> to avoid &#8220;SessionException: Session is closed!&#8221; in conjunction with the OpenSessionInViewListener.
<li><b>hibernate.current_session_context_class</b> and <b>hibernate.transaction.factory_class</b> are set to special Spring implementations to avoid &#8220;org.hibernate.HibernateException: No CurrentSessionContext configured!&#8221; when not using Spring Hibernate Template via HibernateDAOSupport. It is not recommended to use the Hibernate Template anymore, see <a href="http://blog.springsource.com/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/">http://blog.springsource.com/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/</a>
</ol>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=152" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2010. |
<a href="http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/">Permalink</a> |
<a href="http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/&amp;title=Configuring EMF Teneo with Hibernate, Commons DBCP, Spring Hibernate Transaction Manager, and the OpenSessionInViewFilter">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/dbcp/" rel="nofollow tag">dbcp</a>, <a href="http://sebthom.de/tag/emf/" rel="nofollow tag">emf</a>, <a href="http://sebthom.de/tag/hibernate/" rel="nofollow tag">hibernate</a>, <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/persistence/" rel="nofollow tag">persistence</a>, <a href="http://sebthom.de/tag/spring/" rel="nofollow tag">spring</a>, <a href="http://sebthom.de/tag/teneo/" rel="nofollow tag">teneo</a>, <a href="http://sebthom.de/tag/transaction/" rel="nofollow tag">transaction</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/152-configuring-emf-teneo-hibernate-dbcp-spring-transactions-opensessioninviewfilter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using EMF ECore model objects with Wicket components</title>
		<link>http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/</link>
		<comments>http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 19:56:26 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ecore]]></category>
		<category><![CDATA[emf]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=146&amp;langswitch_lang=de</guid>
		<description><![CDATA[Apache Wicket uses so called model objects to bind data objects to Wicket components. The framework provides a number of model implementations to access data objects and their properties in various ways. The PropertyModel implementation for example is used to access and set the value of a Java object using reflection. EPropertyModel If you are [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://wicket.apache.org">Apache Wicket</a> uses so called <a href="https://cwiki.apache.org/WICKET/working-with-wicket-models.html" target="_blank">model objects</a> to bind data objects to Wicket components. The framework provides a number of model implementations to access data objects and their properties in various ways. The <a href="https://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-PropertyModels" target="_blank">PropertyModel</a> implementation for example is used to access and set the value of a Java object using reflection.</p>
<h3>EPropertyModel</h3>
<p>If you are working with <a target="_blank" href="http://www.eclipse.org/modeling/emf/">EMF (Eclipse Modeling Framework)</a> generated model classes you can also use PropertyModels to bind structural features (properties in EMF terminology) of an EObject to a Wicket component. E.g. if your EObject has an attribute called &#8220;comment&#8221; you could instantiate a model like this</p>
<pre class="java" name="code">IModel model = new PropertyModel(myEObject, "comment");
</pre>
<p>This approach has several disadvantages. First, the name of the attribute is declared as a String and not as a compile-time reference to the actual attribute. This means the application could break during runtime if you have renamed the attribute at one point and forgot to also change the String value. Second, this property model uses runtime reflection which is a slow alternative to compile time based access.<br />
Java classes generated from EMF Models by default extend the <a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.4.3/org/eclipse/emf/ecore/EObject.html" target="_blank">EObject</a> class which provides a compile-time reflection API. Using the generic eGet and eSet methods any public property of the EObject can be accessed. The EMF Generator also generates a Package class for each EMF package that holds a Literals interface listing all available attributes and references of all generated EClasses of the given package. If you lets say have an EClass &#8220;Ticket&#8221; with the attribute &#8220;comment&#8221; in the package &#8220;com.acme.service&#8221; you could utilize the compile time reflection API as follows:</p>
<pre class="java" name="code">EAttribute commentAttribute = com.acme.service.ServicePackage.Literals.TICKET__COMMENT;
Ticket newTicket = com.acme.service.ServiceFactory.eINSTANCE.create(Ticket.class);
newTicket.eSet(commentAttribute, "my comment");
</pre>
<p>Using the EMF compile-time reflection API I created a generic EMF ECore Feature Model implementation that leverages the compile-time references to structural features. Most of the code is actually related to working around the fact that EAttributes and EReferences are not serializable but which they should to be part safely referenced in a model that potentially is serialized by Wicket between requests.</p>
<pre class="java" name="code">import org.apache.wicket.model.IDetachable;
import org.apache.wicket.model.IObjectClassAwareModel;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;

/**
 * A property model to bind an attribute of an EMF ECore object
 *
 * @author Sebastian Thomschke
 */
@SuppressWarnings("unchecked")
public class EFeatureModel&lt;T&gt; implements IObjectClassAwareModel&lt;T&gt;
{
	private static final long serialVersionUID = 1L;

	private transient EStructuralFeature feat;
	private String featContainerClassName;
	private String featName;
	private String featPackageNsURI;

	private EObject target;

	public EFeatureModel(EObject target, EStructuralFeature efeature)
	{
		this.target = target;
		this.feat = efeature;
		this.featName = efeature.getName();
		this.featContainerClassName = efeature.getContainerClass().getName();
		this.featPackageNsURI = ((EPackage) efeature.eContainer().eContainer()).getNsURI();
	}

	public void detach()
	{
		if (target instanceof IDetachable) ((IDetachable) target).detach();
	}

	public EStructuralFeature getFeature()
	{
		if (feat == null)
		{
			EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(featPackageNsURI);
			for (Object eClassifierItem : ePackage.getEClassifiers())
			{
				EClassifier eClassifier = (EClassifier) eClassifierItem;
				if (eClassifier.getInstanceClass().getName().equals(featContainerClassName))
					feat = ((EClass) eClassifier).getEStructuralFeature(featName);
			}
		}
		return feat;
	}

	public T getObject()
	{
		return (T) target.eGet(getFeature());
	}

	public Class&lt;T&gt; getObjectClass()
	{
		return getFeature().getEType().getInstanceClass();
	}

	public void setObject(T object)
	{
		// do nothing if the object is the same instance that is returned by the getter
		// this is esp. important for collection properties
		if (target.eGet(getFeature()) == object) return;

		target.eSet(getFeature(), object);
	}

	@Override
	public String toString()
	{
		return new StringBuilder("Model:classname=[").append(getClass().getName()).append("]").append(":target=[")
				.append(target).append("]").toString();
	}
}</pre>
<p>Using this new model implementation is as simple as using the PropertyModel provided by Wicket:</p>
<pre class="java" name="code">IModel model = new EFeatureModel(myTicket, com.acme.service.ServicePackage.Literals.TICKET__COMMENT);
</pre>
<p>You can now fully enjoy the compile-time safeness of your EMF model.</p>
<h3>Making EObjects serializable</h3>
<p>Wicket usually serializes components and their associated models between HTTP requests. If you are using the provided EPropertyModel your EObject classes must implement the Serializable interface. To achieve this, simply extend the EObject interface with the Serializables interface and set &#8220;Root Extends Interface&#8221; property in your genmodel configuration to this interface.</p>
<pre class="java" name="code">
/**
 * @author Sebastian Thomschke
 */
public interface SerializableEObject extends EObject, Serializable {
}
</pre>
<p>When you now regenerate the model classes they will extend the SerializableEObject interface and Wicket will stop complaining about objects in the model being not serializable.</p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=146" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2010. |
<a href="http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/">Permalink</a> |
<a href="http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/&amp;title=Using EMF ECore model objects with Wicket components">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/eclipse/" rel="nofollow tag">eclipse</a>, <a href="http://sebthom.de/tag/ecore/" rel="nofollow tag">ecore</a>, <a href="http://sebthom.de/tag/emf/" rel="nofollow tag">emf</a>, <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/reflection/" rel="nofollow tag">reflection</a>, <a href="http://sebthom.de/tag/wicket/" rel="nofollow tag">wicket</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/146-using-emf-ecore-model-objects-with-wicket-components/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Tomcat 6 on Debian Squeeze</title>
		<link>http://sebthom.de/142-installing-tomcat-6-debian-squeeze/</link>
		<comments>http://sebthom.de/142-installing-tomcat-6-debian-squeeze/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 16:07:35 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[port 80]]></category>
		<category><![CDATA[port forwarding]]></category>
		<category><![CDATA[quercus]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[vhost]]></category>
		<category><![CDATA[virtual servers]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[xinetd]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=142</guid>
		<description><![CDATA[This post describes how to setup Tomcat 6 on Debian Squeeze. The configured Tomcat serves requests on port 80 without the need of an additional web server. This is especially good for virtual servers (VPS) providing limit memory. It also has multiple virtual hosts configured, each with it&#8217;s own webapp with context root / and [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes how to setup Tomcat 6 on Debian Squeeze. The configured Tomcat serves requests on port 80 without the need of an additional web server. This is especially good for virtual servers (VPS) providing limit memory. It also has multiple virtual hosts configured, each with it&#8217;s own webapp with context root / and optional support for PHP via the Quercus PHP implementation.</p>
<h3>Installing Sun Java 6</h3>
<p>Ensure the non-free section is enabled for the APT repository configuration in /etc/apt/sources.list, e.g. &#8220;deb http://ftp.de.debian.org/debian testing main contrib non-free&#8221;</p>
<pre name="code" class="php">
apt-get update
apt-get install sun-java6-jdk
echo 'JAVA_HOME="/usr/lib/jvm/java-6-sun"' >> /etc/environment
echo 'JRE_HOME="/usr/lib/jvm/java-6-sun/jre"' >> /etc/environment
</pre>
<h3>Installing Tomcat 6</h3>
<pre  name="code" class="php">
apt-get install tomcat6 tomcat6-admin
/etc/init.d/tomcat6 stop
</pre>
<h3>Creating standard Tomcat directory layout</h3>
<pre name="code" class="php">
mkdir /opt/tomcat
cd /opt/tomcat
ln -s /etc/tomcat6/ conf
ln -s /usr/share/tomcat6/bin/ bin
ln -s /usr/share/tomcat6/lib/ lib
ln -s /var/lib/tomcat6/webapps webapps
ln -s /var/log/tomcat6/ logs
</pre>
<h3>Creating a Tomcat admin user</h3>
<p>In /opt/tomcat/conf/tomcat-users.xml add an entry like:</p>
<pre name="code" class="xml">
&lt;user name="ADMIN_USERNAME" password="ADMIN_PASSWORD" roles="admin,manager" /&gt;
</pre>
<h3>Setting up virtual hosts</h3>
<p>For each virtual host execute the following command. Replace &#8220;mydomain.com&#8221; with the desired virtual host name, but omit the &#8220;www.&#8221; part.</p>
<pre name="code" class="php">
mkdir -p /opt/tomcat/webapps.mydomain.com/ROOT
</pre>
<p>In the &lt;Engine&gt; tag of &#8220;/opt/tomcat/conf/server.xml&#8221; add one host entry for each virtual host.</p>
<pre name="code" class="xml">
&lt;Host name="mydomain.com" appBase="/opt/tomcat/webapps.mydomain.com"&gt;
    &lt;Alias&gt;www.mydomain.com&gt;/Alias&gt;
    &lt;Valve className="org.apache.catalina.valves.AccessLogValve" prefix="mydomain_access_log." suffix=".txt" pattern="common"/&gt;
&lt;/Host&gt;
</pre>
<p>The &lt;Alias&gt; tag tells Tomcat to redirect from www.mydomain.com to mydomain.com.<br />
The &lt;Valve&gt; tag enables access logging in the standard logging format.</p>
<h3>Using xinetd to configure port 80 for Tomcat</h3>
<p>Binding a service on port 80 requires root permissions. Thus we use port forwarding to &#8220;bind&#8221; Tomcat to port 80. My VPS does not support the use of &#8220;iptables -j REDIRECT&#8221; therefore I am using xinetd as a web proxy.<br />
Ensure that no other service is listening on port 80/443:</p>
<pre name="code" class="php">
netstat -pan | grep ":80\|:443"
</pre>
<p>Register the required xinetd services:</p>
<pre name="code" class="php">
echo echo "
service www
{
        socket_type     = stream
        protocol        = tcp
        user            = root
        wait            = no
        bind            = 88.80.198.181
        port            = 80
        redirect        = localhost 8080
        disable         = no
        flags           = REUSE
        log_type        = FILE /var/log/wwwaccess.log
        log_on_success  -= PID HOST DURATION EXIT

        per_source      = UNLIMITED
        instances       = UNLIMITED
}

service https
{
        socket_type     = stream
        protocol        = tcp
        user            = root
        wait            = no
        bind            = 88.80.198.181
        port            = 443
        redirect        = localhost 8443
        disable         = no
        flags           = REUSE
        log_type        = FILE /var/log/httpsaccess.log
        log_on_success  -= PID HOST DURATION EXIT

        per_source      = UNLIMITED
        instances       = UNLIMITED
}
" > /etc/init.d/tomcat
/etc/init.d/xinetd restart
</pre>
<p>If you want to use a different service name, e.g. &#8220;tomcat&#8221; instead of &#8220;www&#8221; you must add this service to /var/services, e.g. &#8220;tomcat 80/tcp&#8221;<br />
In /opt/tomcat/conf/server.xml modify the &lt;Connector&gt; as follows:</p>
<pre name="code" class="xml">
&lt;Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" proxyPort="80" address="127.0.0.1" /&gt;
</pre>
<p>This binds Tomcat to localhost. It also tells Tomcat that port 80 is the proxy port which is necessary for correct URL generation.<br />
From now on the Tomcat admin applications are only accessible via localhost. You can use SSH port forwarding to still access the applications from your workstation&#8217;s web browser. E.g. if you are using <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuTTY</a> you can use this command line option &#8220;-L 8080:localhost:8080&#8243; to forward the server&#8217;s local 8080 port to your workstation&#8217;s local 8080 port. On your workstation&#8217;s browser you then simply enter <a href="http://localhost:8080/manager/html">http://localhost:8080/manager/html</a> and are connected to the server&#8217;s Tomcat admin application.</p>
<h3>Enabling PHP support (optional)</h3>
<p>Download <a href="http://quercus.caucho.com/">Quercus</a>.</p>
<pre name="code" class="php">
mkdir -p /opt/downloads
wget -o /opt/downloads/quercus-4.0.3.war http://caucho.com/download/quercus-4.0.3.war
</pre>
<p>Install Quercus as a shared library.</p>
<pre name="code" class="php">
unzip -j /opt/downloads/quercus-4.0.3.war \*.jar -d /opt/tomcat/lib
</pre>
<p>Enable PHP support for the virtual hosts by installing the quercus web.xml. For each virtual host execute:</p>
<pre name="code" class="php">
unzip /opt/downloads/quercus-4.0.3.war *web.xml -d /opt/tomcat/webapps.mydomain.com/ROOT
</pre>
<h3>Starting Tomcat</h3>
<pre name="code" class="php">
/etc/init.d/tomcat start
</pre>
<h3>References</h3>
<ul>
<li><a href="http://www.ibm.com/developerworks/java/library/l-secjav.html#h5">Securing Linux for Java services: The port dilemma</a>
<li><a href="http://ruleoftech.com/journal/redirecting-http-and-https-traffic-to-tomcats-ports">Redirect HTTP and HTTPS traffic to Tomcat&#8217;s ports</a>
<li><a href="http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html">Tomcat 6: Virtual Hosting How To</a>
<li><a href="http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html">Tomcat 6: Classloader How To</a>
<li><a href="http://www.ex-parrot.com/pete/tomcat-vhost.html">Virtual Hosting with Tomcat</a>
<li><a href="http://wiki.caucho.com/Quercus:_Tomcat">Quercus: Tomcat</a>
<li><a href="http://www.ubuntugeek.com/how-to-install-tomcat-6-on-ubuntu-9-04-jaunty.html">How to install Tomcat 6 on Ubuntu 9.04 (Jaunty)</a>
</ul>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=142" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2010. |
<a href="http://sebthom.de/142-installing-tomcat-6-debian-squeeze/">Permalink</a> |
<a href="http://sebthom.de/142-installing-tomcat-6-debian-squeeze/#comments">4 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/142-installing-tomcat-6-debian-squeeze/&amp;title=Installing Tomcat 6 on Debian Squeeze">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/php/" rel="nofollow tag">PHP</a>, <a href="http://sebthom.de/tag/port-80/" rel="nofollow tag">port 80</a>, <a href="http://sebthom.de/tag/port-forwarding/" rel="nofollow tag">port forwarding</a>, <a href="http://sebthom.de/tag/quercus/" rel="nofollow tag">quercus</a>, <a href="http://sebthom.de/tag/tomcat/" rel="nofollow tag">tomcat</a>, <a href="http://sebthom.de/tag/vhost/" rel="nofollow tag">vhost</a>, <a href="http://sebthom.de/tag/virtual-servers/" rel="nofollow tag">virtual servers</a>, <a href="http://sebthom.de/tag/vps/" rel="nofollow tag">VPS</a>, <a href="http://sebthom.de/tag/xinetd/" rel="nofollow tag">xinetd</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/142-installing-tomcat-6-debian-squeeze/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>getpass for Jython</title>
		<link>http://sebthom.de/70-getpass-jython/</link>
		<comments>http://sebthom.de/70-getpass-jython/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 00:02:15 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Jython]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sebthom.de/?p=70</guid>
		<description><![CDATA[In my current project I am developing some Jython based command line tools and had the need for masking passwords entered in the command shell. Python provides the getpass module for this purpose. Unfortunately this module has not been made available for Jython. Here comes a module I wrote to provide this kind of functionality. [...]]]></description>
			<content:encoded><![CDATA[<p>In my current project I am developing some Jython based command line tools and had the need for masking passwords entered in the command shell. Python provides the <a href="http://www.python.org/doc/lib/module-getpass.html">getpass </a>module for this purpose. Unfortunately this module has not been made available for Jython.</p>
<p>Here comes a module I wrote to provide this kind of functionality. It uses the mechanism described here <a href="http://java.sun.com/developer/technicalArticles/Security/pwordmask/">http://java.sun.com/developer/technicalArticles/Security/pwordmask/</a> to mask characters entered at the command prompt. Additionally if Java 6 or higher is running Jython the module will instead use the new <a href="http://java.sun.com/javase/6/docs/api/java/io/Console.html#readPassword%28%29">Console.readPassword()</a> method. In case the module is running in an environment where the getpass module is available it will delegate to the corresponding methods of this module instead of using its own implementations.</p>
<pre class="python" name="code"># ext_getpass.py
# @author Sebastian Thomschke, http://sebthom.de/
import thread, sys, time, os

# exposed methods:
__all__ = ["getpass","getuser"]

def __doMasking(stream):
    __doMasking.stop = 0
    while not __doMasking.stop:
        stream.write("b*")
        stream.flush()
        time.sleep(0.01)

def generic_getpass(prompt="Password: ", stream=None):
    if not stream:
        stream = sys.stderr
    prompt = str(prompt)
    if prompt:
        stream.write(prompt)
        stream.flush()
    thread.start_new_thread(__doMasking, (stream,))
    password = raw_input()
    __doMasking.stop = 1
    return password

def generic_getuser():
    for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
        usr = os.environ.get(name)
        if usr: return usr

def java6_getpass(prompt="Password: ", stream=None):
    if not stream:
        stream = sys.stderr
    prompt = str(prompt)
    if prompt:
        stream.write(prompt)
        stream.flush()

    from java.lang import System
    console = System.console()
    if console == None:
	    return generic_getpass(prompt, stream)
    else:
        return "".join(console.readPassword())

try:
    # trying to use Python's getpass implementation
    import getpass
    getpass = getpass.getpass
    getuser = getpass.getuser
except ImportError, e:
    getuser = generic_getuser

    # trying to use Java 6's Console.readPassword() implementation
    try:
        from java.io import Console
        getpass = java6_getpass
    except ImportError, e:
        # use the generic getpass implementation
        getpass = generic_getpass
</pre>
<p>Here is an usage example:</p>
<pre class="python" name="code">
import ext_getpass as getpass

pw = getpass.getpass("Please enter your password:")
print "The entered password was: " + pw
</pre>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=70" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/70-getpass-jython/">Permalink</a> |
<a href="http://sebthom.de/70-getpass-jython/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/70-getpass-jython/&amp;title=getpass for Jython">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/jython/" rel="nofollow tag">Jython</a>, <a href="http://sebthom.de/tag/password/" rel="nofollow tag">password</a>, <a href="http://sebthom.de/tag/python/" rel="nofollow tag">python</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/70-getpass-jython/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments</title>
		<link>http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/</link>
		<comments>http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/#comments</comments>
		<pubDate>Thu, 15 May 2008 23:23:44 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[jdk]]></category>

		<guid isPermaLink="false">http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/</guid>
		<description><![CDATA[We are currently switching the build system of OVal from custom Ant scripts to Maven 2. During that process we accidentally compiled the project using the Java compiler of the Sun JDK 5 instead of the AspectJ compiler. Surprisingly javac did not complain about the missing aspect class files. Instead it already aborted while compiling [...]]]></description>
			<content:encoded><![CDATA[<p>We are currently switching the build system of <a title="OVal - the object validation framework for Java 5 or later" href="http://oval.sourceforge.net/" target="_blank">OVal</a> from custom Ant scripts to Maven 2. During that process we accidentally compiled the project using the Java compiler of the Sun JDK 5 instead of the AspectJ compiler. Surprisingly javac did not complain about the missing aspect class files. Instead it already aborted while compiling an ordinary Java class which only referenced other non-AspectJ related classes. This is the original error message:</p>
<pre>[INFO] [compiler:compile]
[INFO] Compiling 180 source files to C:\projects\oval\src\trunk\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
C:\projects\oval\src\trunk\src\main\java\net\sf\oval\Validator.java:[373,58]
addMethodParameterChecks(java.lang.reflect.Method,int,java.lang.Object)
has private access in net.sf.oval.internal.ClassChecks </pre>
<p>There exist multiple methods named <strong>addMethodParameterChecks</strong> in the class <strong>ClassChecks</strong> with different signatures. The problem is that javac tries to link against the wrong method when compiling the class calling one of the methods. </p>
<p>(...)<br/>Read the rest of <a href="http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/">Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments</a> (284 words)</p>
<hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2008. |
<a href="http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/">Permalink</a> |
<a href="http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/&amp;title=Sun JDK5/6 compilers broken when linking overloaded methods with variable arguments">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/bug/" rel="nofollow tag">bug</a>, <a href="http://sebthom.de/tag/compiler/" rel="nofollow tag">compiler</a>, <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/jdk/" rel="nofollow tag">jdk</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/56-sun_jdk5_6_compilers_broken_when_linking_overloaded_methods_with_variable_arguments/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search</title>
		<link>http://sebthom.de/search/</link>
		<comments>http://sebthom.de/search/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 18:29:13 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://sebthom.de/search/</guid>
		<description><![CDATA[Web sebthom.de var googleSearchIframeName = "searchResults"; var googleSearchFrameWidth = "500"; var googleSearchFrameborder = 0; var googleSearchDomain = "www.google.com"; window.setTimeout("searchResultsResize()", 500); function searchResultsResize() { document.getElementsByName("googleSearchFrame")[0].style.width="100%"; } &#169; sebthom for sebthom.de, 2007. &#124; Permalink &#124; No comment &#124; Add to del.icio.us Post tags: Java Feed enhanced by Better Feed from Ozh]]></description>
			<content:encoded><![CDATA[<p><!-- SiteSearch Google --></p>
<form method="get" action="http://sebthom.de/search" target="_top" align="center">
<table align="center">
<tr>
<td style="vertical-align:top"><a href="http://www.google.com/"><img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a></td>
<td style="white-space:nowrap;text-align:left">
<input type="text" name="q" size="40" maxlength="255" value="" id="sbi"></input>
<input type="submit" name="sa" value="Suchen" id="sbb"></input>
<div>
<input type="radio" name="sitesearch" value="">Web</input>
<input type="radio" name="sitesearch" value="sebthom.de" checked>sebthom.de</input>
</div>
<input type="hidden" name="domains" value="sebthom.de"></input>
<input type="hidden" name="client" value="pub-0319098943899066"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="0506707840"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="flav" value="0000"></input>
<input type="hidden" name="sig" value="5Y-9juMF77cv0yzO"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11"></input>
<input type="hidden" name="hl" value="de"></input>
</td>
</tr>
</table>
</form>
<p><!-- SiteSearch Google --></p>
<p><!-- Google Search Result Snippet Begins --></p>
<div id="searchResults"></div>
<p><script type="text/javascript">
   var googleSearchIframeName = "searchResults";
   var googleSearchFrameWidth = "500";
   var googleSearchFrameborder = 0;
   var googleSearchDomain = "www.google.com";
</script><br />
<script type="text/javascript"
         src="http://www.google.com/afsonline/show_afs_search.js">
</script><br />
<!-- Google Search Result Snippet Ends --></p>
<p><script type="text/javascript">
window.setTimeout("searchResultsResize()", 500);
function searchResultsResize() { document.getElementsByName("googleSearchFrame")[0].style.width="100%"; }
</script></p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=43" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2007. |
<a href="http://sebthom.de/search/">Permalink</a> |
<a href="http://sebthom.de/search/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/search/&amp;title=Search">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OVal 1.0 released!</title>
		<link>http://sebthom.de/42-oval-java-validation-framework-released/</link>
		<comments>http://sebthom.de/42-oval-java-validation-framework-released/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 12:10:22 +0000</pubDate>
		<dc:creator>Sebastian Thomschke</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[oval]]></category>

		<guid isPermaLink="false">http://sebthom.de/2007/07/oval-java-validation-framework-released/</guid>
		<description><![CDATA[OVal is a pragmatic and extensible validation framework for any kind of Java objects (not only JavaBeans). Constraints can be configured with annotations, POJOs or XML. Custom constraints can be expressed in pure Java or by using scripting languages such as JavaScript, Groovy, BeanShell, OGNL or MVEL. Besides simple object validation OVal implements Programming by [...]]]></description>
			<content:encoded><![CDATA[<p>OVal is a pragmatic and extensible validation framework for any kind of Java objects (not only JavaBeans). Constraints can be configured with annotations, POJOs or XML. Custom constraints can be expressed in pure Java or by using scripting languages such as JavaScript, Groovy, BeanShell, OGNL or MVEL. Besides simple object validation OVal implements Programming by Contract features by utilizing AspectJ based aspects. </p>
<p>Visit the project page at <a href="http://sourceforge.net/projects/oval/">http://sourceforge.net/projects/oval/</a></p>
 <img src="http://sebthom.de/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=42" width="1" height="1" style="display: none;" /><hr />
<p><small>&copy; sebthom for <a href="http://sebthom.de">sebthom.de</a>, 2007. |
<a href="http://sebthom.de/42-oval-java-validation-framework-released/">Permalink</a> |
<a href="http://sebthom.de/42-oval-java-validation-framework-released/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://sebthom.de/42-oval-java-validation-framework-released/&amp;title=OVal 1.0 released!">del.icio.us</a>
<br/>
Post tags: <a href="http://sebthom.de/tag/java/" rel="nofollow tag">Java</a>, <a href="http://sebthom.de/tag/oval/" rel="nofollow tag">oval</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://sebthom.de/42-oval-java-validation-framework-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

