<?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>TechJava&#187; TechJava &#8211; Articles on enterprise systems</title>
	<atom:link href="http://www.techjava.de/topics/category/es/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techjava.de</link>
	<description>Journal on Java Technology</description>
	<lastBuildDate>Thu, 17 Jun 2010 10:41:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JSF 2.0 Reality Check</title>
		<link>http://www.techjava.de/topics/2010/02/jsf-2-reality-check/</link>
		<comments>http://www.techjava.de/topics/2010/02/jsf-2-reality-check/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 21:50:42 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[bean]]></category>
		<category><![CDATA[cdi]]></category>
		<category><![CDATA[di]]></category>
		<category><![CDATA[ioc]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[jsf 2.0]]></category>
		<category><![CDATA[jsr 303]]></category>
		<category><![CDATA[jsr 330]]></category>
		<category><![CDATA[managed baen]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=632</guid>
		<description><![CDATA[
Abstract
The JavaServer Faces (JSF) 2.0 is the newest Java presentation technology that is covered in JSR-314 and was publicly released on July 01, 2009. It became a part of the JEE6 standard and can be comfortably used in conjunction with other JEE frameworks, with Spring or just on its own. This article reveals the possible [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: right; margin-left:5px;" title="check" src="http://www.techjava.de/wp-content/uploads/check-150x150.jpg" alt="" width="150" height="150" /></p>
<h2>Abstract</h2>
<p>The JavaServer Faces (JSF) 2.0 is the newest Java presentation technology that is covered in JSR-314 and was publicly released on July 01, 2009. It became a part of the JEE6 standard and can be comfortably used in conjunction with other JEE frameworks, with Spring or just on its own. This article reveals the possible scenarios and shows the required configuration for the usage of JSF 2.0 with EJB 3.1 and with Spring 3.0. It also discusses several auxilary technologies which can be used along with JSF 2.0. <span id="more-632"></span></p>
<h2>Management Summary</h2>
<p>There are many presentation frameworks available, so why JSF 2.0? The short answer is simple: it has an extensible component-oriented presentation layer and event-driven programming model, which both abstract from HTML/JS and leverage the developement. In more detail, the most important features are:</p>
<ul>
<li>Facelet Support</li>
<li>Validation &amp; Conversion Mechanisms</li>
<li>Resources Support</li>
<li>Templating</li>
<li>Expression Language</li>
<li>Annotation Support</li>
</ul>
<p>JSF 2.0 makes strong use of the SoC (Separation of Concerns) principle, promoting the MVC (Model View Controller) design pattern. Its declarative view is based on facelets: the view documents can be defined using XHTML. These documents build their own component tree from the core or third-party components. The use of special composition elements allows effective templating. The model or/and the controller are realized using so called backing beans / managed beans. A backing bean is an annotated POJO (Plain Old Java Object). The access from the view to the backing beans is possible using the expression language. The navigation can be influenced directly from the view or from the backing beans, by pointing to the logical names of the pages. JSF offers a flexible validation model, which suports Bean Validation (JSR 303) out of the box.</p>
<h2>Presentation with JSF 2.0</h2>
<p>This chapter discusses the model of the presentation used in JSF 2.0.</p>
<h3>Initial setup</h3>
<p>A JSF project is an ordinary Java Web project. The result of it runs inside of a web container, like Tomcat or Jetty. A characteristical descriptor has to contain the servlet definitions/mappings of the JSF servlet and third-party component servlets.  Here is an exammple for JSF 2.0 and Prime Faces, an open-source component library.</p>
<pre class="brush: xml;">
&lt;web-app xmlns=&quot;.../javaee&quot; xmlns:xsi=&quot;...&quot;
	xsi:schemaLocation=&quot;.../web-app_2_5.xsd&quot; version=&quot;2.5&quot;&gt;
...
	&lt;!-- Activating the Expression Language --&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;com.sun.faces.expressionFactory&lt;/param-name&gt;
		&lt;param-value&gt;com.sun.el.ExpressionFactoryImpl&lt;/param-value&gt;
	&lt;/context-param&gt;

	&lt;!-- Java Server Faces Servlet --&gt;
	&lt;servlet&gt;
		&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
		&lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
	&lt;/servlet&gt;
	&lt;!--  Prime Faces Resource loading --&gt;
	&lt;servlet&gt;
		&lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
		&lt;servlet-class&gt;org.primefaces.resource.ResourceServlet&lt;/servlet-class&gt;
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
	&lt;/servlet&gt;
	&lt;!-- Java Server Faces Servlet Mapping --&gt;
	&lt;servlet-mapping&gt;
		&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
		&lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
	&lt;/servlet-mapping&gt;
	&lt;!--  Prime Faces Resource loading --&gt;
	&lt;servlet-mapping&gt;
		&lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
		&lt;url-pattern&gt;/primefaces_resource/*&lt;/url-pattern&gt;
	&lt;/servlet-mapping&gt;
...
&lt;/web&gt;
</pre>
<h3>The View</h3>
<p>The definition of a JSF presentation is relatevely simple. Just create a simple XHTML document and import the JSF namespaces in the header.</p>
<pre class="brush: xml;">
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
	xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
	xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
	xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
	xmlns:p=&quot;http://primefaces.prime.com.tr/ui&quot;&gt;
	 &lt;f:loadBundle var= &quot;msgs&quot; basename= &quot;ViewMessages&quot; /&gt;
	 &lt;h:head&gt;
		 &lt;title&gt;#{msgs.welcomeTitle}&lt;/title&gt;
		 &lt;h:outputStylesheet library=&quot;css&quot; name=&quot;default.css&quot; target=&quot;head&quot;/&gt;
	 &lt;/h:head&gt;
	 &lt;h:body&gt;
		 &lt;p:dataTable id= &quot;customers&quot; value=&quot;#{cusomterProvider.customer}&quot; var=&quot;customer&quot;&gt;
			 &lt;p:column&gt;
				 &lt;h:outputText id=&quot;customerName&quot; value=&quot;#{customer.name}&quot; /&gt;
			 &lt;/p:column&gt;
			...
		 &lt;/p:dataTable&gt;
	 &lt;/h:body&gt;
&lt;/html&gt;
</pre>
<p>Please note, that along with the JSF core components, the PrimeFaces component <code>dataTable</code> is used. At runtime the components will be transformed into the corresponding HTML elements.</p>
<h3>The Backing Bean</h3>
<p>In the previos example, special strings have been used <code>#{customerProvider.customers}</code> and <code>#{customer.name}</code>. Both of them are expressions specified in the Expression Language. This language allows to address elements known inside the application. The <code>customer.name</code> accesses the property <code>name</code> of the variable defined inside the iteration over the elements delivered from the <code>customerProvider.getCustomers()</code>. The <code>customerProvider</code> is a Java Object that delivers data to the view and is called Backing Bean. A Backing Bean is a serializeable POJO, that is attached to the view. It can be declared using JSF Annotation <code>javax.faces.ManagedBean</code>, using the <code>ManagedBean</code> element of the <strong>faces-config.xml</strong> or by other mechanisms compatible with the Expression Language resolvers.</p>
<pre class="brush: java;">
@ManagedBean
@SessionScope
public class CustomerProvider
{
	public List &lt;Customer &gt; getCustomers()
	{
		...
	}
}
</pre>
<h3>Internationalization</h3>
<p>Internationalization is an important requirement for the presentation layer. In the previous example, a special string has been used <code>#{msgs.welcomeTitle}</code> to provide a message. The <code>msgs</code> variable is bound to a resource file, containing the localized messages, so the <code>#{msgs.welcomeTitle}</code> is pointing to the key <code>welcomeTitle</code> inside the property file.</p>
<h3>Validation</h3>
<p>Input validation is another important requirement for web applications. Especially, the ability to validate parts of the input using technologies like AJAX has to be supported in order to deliver the state-of-the-art technology. JSF fosters numerous different validation approaches. For example:</p>
<pre class="brush: xml;">
...
 &lt;h:inputText id=&quot;customerName&quot; value=&quot;#{customerService.current.name}&quot; required= &quot;true&quot; /&gt;
	 &lt;f:validateLength minimum=&quot;7 &quot;/&gt;
 &lt;/h:inputText&gt;
 &lt;h:message for=&quot;customerName&quot;/&gt;
...
</pre>
<p>Please note, that in the example above, the input of the customer name is mandatory and the minimum length is seven.</p>
<p>Another validation approach is defined in the Bean Validation Standard (JSR 303) and is supported if the components are deployed and available. According to JSR 303, the data container can define format constraints which can be used for purposes of validation. There is a set of predefined constraints available, which can be extended by custom constraints. For example:</p>
<pre class="brush: java;">
public class Customer
{
	@Size(min=2, max=50, message= &quot;Customer name must be at least 2 and at most 50 characters long. &quot;)
	private String name;
	// getters and setters
	...
}
</pre>
<p>This example shows that the customer name has to be at least two and at most fifty characters long and defines a custom error message which is displayed on violation. Remember the previous section Internationalization? Yes, the validation error message can be localized too, by suppliying EL-expressions instead of the message description:</p>
<pre class="brush: java;">
public class Customer
{
	@Size(min=2, max=50, message= &quot;{customerNameError} &quot;)
	private String name;
	// getters and setters
	...
}
</pre>
<p>Thus, the value of <code>{customerNameError}</code> (without a #) is a key in the file which must be named <strong>ValidationMessages.properties</strong> and must be available on classpath.</p>
<h2>JSF 2.0 with other frameworks</h2>
<p>The use of JSF fosters comfort in implementing the presentation tier. The presentation-tier is usually built on top of the business logic layer. The latter can be implemented using different technolgies.</p>
<h3>JSF 2.0 and EJB 3.1</h3>
<p>Enterprise Java Beans is a standard way to implement business logic inside JEE applications. The current EJB 3.1 specification fosters the usage of Stateless and Statefull Session Beans for this purpose. Since JEE6-compliant servers support Context and Dependency Injection (CDI) and the EJB and Resource Injection, the session beans can be directly referenced from the backing beans. JSF 2.0 is also a part of the JEE 6, every JEE-compliant server will support JSF out-of-the-box, too.</p>
<pre class="brush: java;">
@ManagedBean
public class CustomerProvider
{
	@EJB
	private CustomerService service;
	...
}
</pre>
<h3>JSF 2.0 and Spring 3.0</h3>
<p>If you don&#8217;t want to run a full-blown JEE server, but a web-container only, you have to include some libraries into your application deployment.</p>
<ul>
<li>JSF 2.0 API and Implementation: e.g. Mojarra 2.0.2 (
<a  href="https://javaserverfaces.dev.java.net/files/documents/1866/146040/mojarra-2.0.2-FCS-binary.zip" onclick="javascript:pageTracker._trackPageview('/external/javaserverfaces.dev.java.net/files/documents/1866/146040/mojarra-2.0.2-FCS-binary.zip');" >mojarra-2.0.2-FCS-binary.zip</a>)</li>
<li>Expression Language 2.2 API and Implementation: 
<a  href="http://download.java.net/maven/glassfish/javax/el/el-api/2.2.0-SNAPSHOT/el-api-2.2.0-SNAPSHOT.jar" onclick="javascript:pageTracker._trackPageview('/external/download.java.net/maven/glassfish/javax/el/el-api/2.2.0-SNAPSHOT/el-api-2.2.0-SNAPSHOT.jar');" >el-api-2.2.jar</a>, 
<a  href="http://download.java.net/maven/glassfish/org/glassfish/web/el-impl/2.2.0-SNAPSHOT/el-impl-2.2.0-SNAPSHOT.jar" onclick="javascript:pageTracker._trackPageview('/external/download.java.net/maven/glassfish/org/glassfish/web/el-impl/2.2.0-SNAPSHOT/el-impl-2.2.0-SNAPSHOT.jar');" >el-impl-2.2.jar</a></li>
<li>Content and Dependency Injection (CDI, JSR 330) API and Implementation: 
<a  href="http://atinject.googlecode.com/files/javax.inject.zip" onclick="javascript:pageTracker._trackPageview('/external/atinject.googlecode.com/files/javax.inject.zip');" >javax.inject.zip</a></li>
<li>Bean Validation (JSR 303) API and Implementation: e.g. Hibernate Validator (
<a  href="http://sourceforge.net/projects/hibernate/files/hibernate-validator/4.0.2.GA/hibernate-validator-4.0.2.GA-dist.zip/download" onclick="javascript:pageTracker._trackPageview('/external/sourceforge.net/projects/hibernate/files/hibernate-validator/4.0.2.GA/hibernate-validator-4.0.2.GA-dist.zip/download');" >hibernate-validator-4.0.2.GA-dist.zip</a>)</li>
</ul>
<p>This list will be extended by libraries required to run the Spring framework. In order to activate Spring, the context listeners have to be activated. The application context parameter can be provided as a context parameter.</p>
<pre class="brush: xml;">
 &lt;!-- Spring Activation --&gt;
 &lt;listener&gt;
	 &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
 &lt;/listener&gt;
 &lt;listener&gt;
	 &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
 &lt;/listener&gt;
 &lt;context-param&gt;
	 &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
	 &lt;param-value&gt;/WEB-INF/spring-config.xml&lt;/param-value&gt;
 &lt;/context-param&gt;
</pre>
<p>In addition, the Expression Language variable resolvers of JSF should be replaced by those from Spring. This is configured in the <code>faces-config.xml</code></p>
<pre class="brush: xml;">
&lt;faces-config xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd&quot;
	version=&quot;2.0&quot;&gt;
	&lt;application&gt;
		&lt;el-resolver&gt;org.springframework.web.jsf.el.SpringBeanFacesELResolver&lt;/el-resolver&gt;
	&lt;/application&gt;
&lt;/faces-config&gt;
</pre>
<p>In order to enable the Spring&#8217;s IoC (Inversion of Control), we need to activate the component scan in the application-context configuration file:</p>
<pre class="brush: xml;">
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
	xmlns:xsi=&quot;...&quot; xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
	xsi:schemaLocation=&quot;...&quot;&gt;

	&lt;context:component-scan base-package=&quot;de.techjava&quot;&gt;
		&lt;context:include-filter type=&quot;annotation&quot;
			expression=&quot;org.springframework.stereotype.Service&quot; /&gt;
	&lt;/context:component-scan&gt;
&lt;/beans&gt;
</pre>
<p>Instead of using JSF for resolving the backing beans, the Spring framework can be used. The backing bean is annotated with the Spring annotation <code>Controller</code>. The controller is a special kind of Spring component, which is used in the presentation layer. The Spring&#8217;s way of implementing business logic is to provide Spring services. Spring service has to be annotated with <code>Service</code> annotation.</p>
<pre class="brush: java;">
@Controller
@Scope( &quot;session &quot;)
public class CustomerProvider implements Serializable
{
	@Inject
	private CustomerService customerService;
	...
}

@Service
@Scope( &quot;singleton &quot;)
public class CustomerServiceImpl implements CustomerService
{
	...
}
</pre>
<p>This is not as elegant as inside the JEE server, but it will work.</p>
<h3>References</h3>
<ul>
<li>
<a  href="http://jcp.org/en/jsr/detail?id=303" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/jcp.org/en/jsr/detail');" >JSR 303: Bean Validation</a></li>
<li>
<a  href="http://jcp.org/en/jsr/detail?id=330" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/jcp.org/en/jsr/detail');" >JSR 330: Dependency Injection for Java</a></li>
<li>
<a  href="http://blog.ralscha.ch/?p=652" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/blog.ralscha.ch/');" >JSR 330 with Spring (in German)</a></li>
<li>
<a  href="https://javaserverfaces.dev.java.net/" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/javaserverfaces.dev.java.net/');" >Mojarra Project</a></li>
<li>
<a  href="http://download.java.net/maven/glassfish/javax/el/el-api/2.2.0-SNAPSHOT/" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/download.java.net/maven/glassfish/javax/el/el-api/2.2.0-SNAPSHOT/');" >Expression Language API</a></li>
<li>
<a  href="http://download.java.net/maven/glassfish/org/glassfish/web/el-impl/2.2.0-SNAPSHOT/" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/download.java.net/maven/glassfish/org/glassfish/web/el-impl/2.2.0-SNAPSHOT/');" >Expression Language Implementation</a></li>
<li>
<a  href="https://www.hibernate.org/412.html" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/www.hibernate.org/412.html');" >Hibernate Validator (JSR 303 Implementation)</a></li>
<li>
<a  href="http://code.google.com/p/atinject/" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/code.google.com/p/atinject/');" >AtInject (JSR 330 Implementation)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2010/02/jsf-2-reality-check/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Launching Eclipse RCP via Java Web Start</title>
		<link>http://www.techjava.de/topics/2010/02/launching-rcp-via-jws/</link>
		<comments>http://www.techjava.de/topics/2010/02/launching-rcp-via-jws/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 16:32:15 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[rcp]]></category>
		<category><![CDATA[Application id not found]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[delivery]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[Java Web Start]]></category>
		<category><![CDATA[JNLP]]></category>
		<category><![CDATA[JWS]]></category>
		<category><![CDATA[osgi]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=582</guid>
		<description><![CDATA[The Eclipse RCP became a prominent platform for building client software. One of the delivery mechanisms supported by Eclipse RCP is Sun&#8217;s Java Web Start (JWS). Since Galileo Edition some changes has been introduced in the platform. This article provides some hints for creation of the RCP delivered by Java Web Start.
Packaging
In order to package [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.techjava.de/wp-content/uploads/eclipse-rcp.png" alt="" title="eclipse-rcp" width="237" height="237" style="float:right; margin:5px" />The Eclipse RCP became a prominent platform for building client software. One of the delivery mechanisms supported by Eclipse RCP is Sun&#8217;s Java Web Start (JWS). Since Galileo Edition some changes has been introduced in the platform. This article provides some hints for creation of the RCP delivered by Java Web Start.</p>
<h2>Packaging</h2>
<p>In order to package the RCP I suggest to use feature-based products as described in 
<a  href="http://www.techjava.de/topics/2009/07/packaging-eclipse-based-rcp-for-the-use-in-enterprise-context/">a previous article</a>. Following it, you should have a top-level plug-in (also refered as product-defining plug-in) and top-level feature, which is called &#8220;wrap&#8221;-feature in the context of the Java Web Start. </p>
<h3>Exporting the product</h3>
<p>Before you start with Java Web Start (JWS), export the product and make sure it starts as a standalone application. In doing so, you have to ensure that your references to the plug-ins are correct. One of the way of doing it is to hit the Validate button in the top left of the product editor. <img src="http://www.techjava.de/wp-content/uploads/validate-product.png" alt="" title="validate-product" width="196" height="79" style="float:right; margin:5px;" /> If the validation is successful, try to export the product. The PDE builder will run and create a distribution. The errors of the compiler/builder/assembler, if any, are reported to files zipped to the <code>logs.zip</code> file in the distribution directory. <span id="more-582"></span> A prominent error is</p>
<pre class="brush: plain; light: true;">
Compliance level '1.3' is incompatible with source level '1.6'. A compliance level '1.6' or better is required.
</pre>
<p>Which actually means that the plug-in classes has not been compiled at all. In order to avoid this error make sure to set the following properties in the <code>build.properties</code> file of the corresponding plug-in:</p>
<pre class="brush: plain; light: true;">
javacSource=1.3
javacTarget=1.3
</pre>
<h3>Exporting the wrap-feature</h3>
<p>After a successful export of the product, just export the top-level feature (the wrap-feature). Make sure to provide the signing information, since JWS requires all resources to be signed. If you are aiming to deliver for different platforms, make sure to define a target platform (<strong>Window > Preferences > Plug-in Development > Target Platform</strong>) which contains a Delta Pack. A Delta Pack is a set of plug-ins which can be downloaded separately on the 
<a  href="http://ww.eclipse.org/downloads/" onclick="javascript:pageTracker._trackPageview('/external/ww.eclipse.org/downloads/');" >Eclipse Homepage</a>. Also, don&#8217;t forget to switch over to the Java Web Start tab of the Feature Export Wizard, activate the checkbox &#8220;Create JNLP manifest for the JAR archives&#8221; and specify the site URL where the resulting JNLP will be located. Make sure all your features has the provider attribute set, since it is used as the &#8220;vendor&#8221; inside of the JNLP file, which is a mandatory attribute.</p>
<h3>Creating the main JNLP</h3>
<p>The PDE build will run and create a distribution in the specified directory. Along with the exported JARs in features and plug-ins, the packaging script will generate the JNLP descriptors for every feature. Still, the main JNLP file required for launching the application is missing and has to be provided separately. Here is, how it looks like:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;jnlp spec=&quot;1.0+&quot; codebase=&quot;http://localhost/app/&quot; href=&quot;app.jnlp&quot;&gt;
    &lt;information&gt;
        &lt;title&gt;application titel&lt;/title&gt;
        &lt;vendor&gt;provider&lt;/vendor&gt;
        &lt;offline-allowed/&gt;
    &lt;/information&gt;

    &lt;security&gt;
        &lt;all-permissions/&gt;
    &lt;/security&gt;

    &lt;application-desc main-class=&quot;org.eclipse.equinox.launcher.WebStartMain&quot;&gt;
	&lt;argument&gt;-product&lt;/argument&gt;
	&lt;argument&gt;de.techjava.app.webstart.productid&lt;/argument&gt;
	&lt;argument&gt;-application&lt;/argument&gt;
	&lt;argument&gt;de.techjava.app.webstart.appid&lt;/argument&gt;
    &lt;/application-desc&gt;

    &lt;resources&gt;
        &lt;j2se version=&quot;1.4+&quot; ax-heap-size=&quot;128m&quot; /&gt;
	&lt;jar href=&quot;plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar&quot;/&gt;
	&lt;extension name=&quot;wrap feature&quot; href=&quot;features/wrap_feature_1.0.0.jnlp&quot; /&gt;
	&lt;!-- OSGI setup --&gt;
        &lt;property name=&quot;osgi.instance.area&quot; value=&quot;@user.home/app&quot;/&gt;
        &lt;property name=&quot;osgi.configuration.area&quot; value=&quot;@user.home/app&quot;/&gt;
    &lt;/resources&gt;
&lt;/jnlp&gt;
</pre>
<p>Important is to specify both, the <strong>product id</strong> and the <strong>applciation id</strong>, otherwise you will see the &#8220;Application id not found&#8221; exception. Of course you can specify 
<a  href="http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html" onclick="javascript:pageTracker._trackPageview('/external/help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html');" >additional options</a> as command-line arguments of the launcher itself. I found it useful to be able to let the OSGi running and then connect to it and query for loaded bundles. You can do it by adding the following arguments:</p>
<pre class="brush: xml;">
	&lt;argument&gt;-console&lt;/argument&gt;
	&lt;argument&gt;1234&lt;/argument&gt;
	&lt;argument&gt;-noExit&lt;/argument&gt;
</pre>
<p>This will allow to connect via telnet with running OSGi, even after the application finishes.<br />
This is basically it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2010/02/launching-rcp-via-jws/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Real World Java EE Practices &#8211; Rethinking Best Practices by Adam Bien</title>
		<link>http://www.techjava.de/topics/2010/02/rethinking-best-practices/</link>
		<comments>http://www.techjava.de/topics/2010/02/rethinking-best-practices/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 23:21:43 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[adam bien]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=594</guid>
		<description><![CDATA[
I just returned from the furious event given by Adam Bien on 
Real World Java EE Practices. The presentation has been held in Lehmanns Bookstore in Hamburg in co-operation with the JUGHH. It was a full success with no space left in the bookstore. I think, I got the last seat and there were some [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.techjava.de/wp-content/uploads/adambien-225x300.jpg" alt="" title="adambien" width="225" height="300" style="float:right; margin:5px;" /><br />
I just returned from the furious event given by Adam Bien on 
<a  href="http://www.adam-bien.com/roller/abien/entry/free_jug_session_in_hamburg" onclick="javascript:pageTracker._trackPageview('/external/www.adam-bien.com/roller/abien/entry/free_jug_session_in_hamburg');" >Real World Java EE Practices</a>. The presentation has been held in Lehmanns Bookstore in Hamburg in co-operation with the JUGHH. It was a full success with no space left in the bookstore. I think, I got the last seat and there were some people standing. </p>
<p>Adam made it in an hour and presented many interesting topics. He started with new subjects introduces in JEE6, like optional local interfaces, cronjob-like Timer Service and other nice goodies. Then he covered new stuff from JEE like REST and CDI (Context and Dependency Injection). Finally, he moved to the best practices, patterns and anti-pattern. As usual, it was quick and precise &#8211; Adam answered many questions and gave a good overview of the technology.</p>
<p>After the presentation, JUGHH / Lehmanns offer a glass of sparkling wine for the smaller audience and Adam spoke about the possibility to speak about JavaFX next time. This time I left my camera at home and only had my phone with me, so sorry for the low-resolutioned picture&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2010/02/rethinking-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exposing Functionality using Web Services and JEE</title>
		<link>http://www.techjava.de/topics/2010/01/functionality-web-services-jee/</link>
		<comments>http://www.techjava.de/topics/2010/01/functionality-web-services-jee/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 11:11:22 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[bean]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[ejb3]]></category>
		<category><![CDATA[java 5]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=554</guid>
		<description><![CDATA[
Abstract
About two years ago, I published an 
article about Exposing the Functionality implemented in Stateless Session Beans (EJB 2.1) using Web Services. J2EE 1.4 times are over and the new version of the Java Enterprise framework, called Java Enterprise Edition 5 (JavaEE 5, or simply JEE) has emerged. In this article the same business scenario [...]]]></description>
			<content:encoded><![CDATA[<h2>
<a  href="http://www.techjava.de/wp-content/uploads/valve.jpg" onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/valve.jpg');" ><img style="float: right; margin: 5px;" title="valve" src="http://www.techjava.de/wp-content/uploads/valve-150x150.jpg" alt="" width="150" height="150" /></a>Abstract</h2>
<p>About two years ago, I published an 
<a  href="http://www.techjava.de/topics/2008/02/ws4j2ee14/">article</a> about Exposing the Functionality implemented in Stateless Session Beans (EJB 2.1) using Web Services. J2EE 1.4 times are over and the new version of the Java Enterprise framework, called Java Enterprise Edition 5 (JavaEE 5, or simply JEE) has emerged. In this article the same business scenario is repeated in the new framework. </p>
<h2>Requirements</h2>
<p>Before we dive into code examples, some software is required. The good news about the software is, that it also evolved over time. Here is what we use:</p>
<ul>
<li>Sun&#8217;s Java 6 SDK</li>
<li>JBoss AS 5.1.0 GA for JDK6</li>
<li>Eclipse Galileo 3.5.1 for JEE development</li>
</ul>
<p><span id="more-554"></span><br />
Some words about the used software. It is important to get the JDK6-compiled version of the JBoss Application Server. There are some issues with running the version compiled with Java 5 on JDK6, since JDK6 has its own JAX-WS implementation which causes problems with JBoss (affected should be all versions of JBoss &lt; 5.2. Currently it seems like version 5.2 will be compiled with JDK6 by default.) If you launch JBoss from Eclipse, make sure to add the <code>-Djava.endorsed.dirs=PATH_TO_JBOSS/jboss-5.1.0.GA/lib/endorsed</code> as a VM argument, if launched from the command line, please add it as an option inside of the <code>run.conf.bat</code> file:</p>
<pre class="brush: bash;">
set &quot;JAVA_OPTS=%JAVA_OPTS% -Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed&quot;
</pre>
<p>Otherwise you will get the following exception:</p>
<pre class="brush: java;">java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage</pre>
<p>After installation (unpacking) of Eclipse, make sure to configure the JDK (under <strong>Preferences &gt; Java &gt; Installed JREs</strong>) and the JBoss instance (<strong>Preferences &gt; Server &gt; Runtime Environment</strong>).</p>
<h2>Use Case</h2>
<p>In order to demonstrate the technology by example, imagine the following use case. The system under construction is capable of providing measurements of some sensors. The sensors are identified by numbers and can be queried by the user by providing the timespan of measurements. As a result, the systems delivers the set of measurements for the given timespan with one measurement per minute but at most sixty measurements. Every measurement contains the id of sensor from which it has been recorded, the timestamp, the value as a byte array, the measurement unit and finally a flag whether the measurement exceeds the limits or specified alarm values.</p>
<h2>Implementation</h2>
<p>We start the implementation with the creation of a JEE Session Bean and then expose the functionality using a second Facade bean. In doing so we follow the EJB 3 specification.</p>
<h3>Eclipse for Java EE development</h3>
<p>The plugins in Eclipse for Java EE provide massive support and foster the development by deep integration withe JEE servers. Instead of a simple Java Project, start with an <strong>Enterprise Application Project</strong>. Then, create a new <strong>EJB Project</strong> and add it to the created Enterprise Application Project. In order to deploy the resulting application to the server, right-click on the enterprise project and select <strong>Run As &gt; Run on Server </strong>.</p>
<p>To check the deployment on the application server, use the JBoss Consoles. These can be accessed via 
<a  href="http://localhost:8080/" onclick="javascript:pageTracker._trackPageview('/external/localhost/');" >http://localhost:8080/</a> for the locally installed JBoss. An additional Web Service Console is accessible via 
<a  href="http://localhost:8080/jbossws/" onclick="javascript:pageTracker._trackPageview('/external/localhost/jbossws/');" >http://localhost:8080/jbossws/</a>.</p>
<h3>Implementing the Functionality</h3>
<p>In order to implement the functionality in a stateless session bean, we start with the creation of the business interface.</p>
<pre class="brush: java;">
/**
 * Defines the sensor manager functionality
 */
public interface SensorManager
{
	/**
	 * Retrieve sensor data
	 * @param sensorId id of the sensor
	 * @param timespan the measurement period
	 * @return a list of measurements in the given period
	 * @throws SensorManagerException on any kinds of errors
	 */
	public List&lt;Measurement&gt; getSensorData(SensorID sensorId, Timespan timespan) throws SensorManagerException;
}
</pre>
<p>The POJOs <code>Measurement</code>, <code>SensorID</code> and <code>Timespan</code> are used to show the usage of custom user types:</p>
<pre class="brush: java;">
public class Measurement
{
	private SensorID sensorID;
	private Date timestamp;
	private boolean critical;
	private byte[] value;
	private String unit;
...
// getters and setters
}
....
public class SensorID
{
	private long sensorId;
...
// getters and setters
}

public class Timespan
{
	private Date start;
	private Date end;
...
// getters and setters
}
</pre>
<p>After the creation of the business interface, let us create the actual Session Bean. The class is annotated with the <code>@javax.ejb.Stateless</code> annotation in order to indicate that the bean is a Stateless Session Bean. Since it implements the business interface (and only it), the container will be able to deduce that the given interface is the Local Business interface: this is just one of many examples of the Configurations by Exception in EJB 3. In order to be able to reference the bean from other beans, we annotate the binding of the local interface to a specific JNDI name using the vendor-specific annotation <code>org.jboss.ejb3.LocalBinding</code>.</p>
<pre class="brush: java;">
@Stateless
@LocalBinding(jndiBinding=&quot;de.techjava.sensor/SensorManager&quot;)
public class SensorManagerBean implements SensorManager
{
	/** Logging facility */
	protected static Logger LOG = Logger.getLogger(SensorManagerBean.class);
	/** Max number of returned values */
	private static final long MAX_DURATION = 60;

	/**
	 * Implementation of the business method
	 */
	public List&lt;Measurement&gt; getSensorData(SensorID sensorId, Timespan timespan) throws SensorManagerException
	{
		LOG.debug(&quot;Entering getSensorData()&quot;);
		if (sensorId == null || timespan == null || timespan.getStart() == null || timespan.getStart() == null)
		{
			throw new SensorManagerException(&quot;Missing a mandatory parameter, that was null (not set)&quot;);
		} else if (!timespan.getStart().before(timespan.getEnd()))
		{
			throw new SensorManagerException(&quot;The timespan is defined by the start that should be before end&quot;);
		}

		List&lt;Measurement&gt; measurements = new LinkedList&lt;Measurement&gt;();
		for (long i = 0; i &lt; getNumberOfElements(timespan); i++)
		{
			Date date = new Date();
			date.setTime(timespan.getStart().getTime() + i * 1000 * 60);
			if (date.after(timespan.getEnd()))
				break;
			Measurement measurement = createMeasurement(sensorId, date, i);
			measurements.add(measurement);
		}

		LOG.debug(&quot;Leaving getSensorData(). Returning &quot; + measurements.size() + &quot; values.&quot;);
		return measurements;
	}

	/**
	 * Retrieves the number of measurements in timespan
	 */
	private long getNumberOfElements(Timespan timespan) { ... }

	/**
	 * Creates a measurement instance, a dummy implementation
	 */
	private Measurement createMeasurement(SensorID sensorId, Date timestamp, long number) { ... }
}
</pre>
<h2>Web Service Definition</h2>
<p>The quality of the web service interface is an important design consideration. As described in 
<a  href="http://www.techjava.de/topics/2008/02/ws4j2ee14/">the previous post</a>, in many cases it is a good idea to create it by hand instead of generation by a tool. In this particular case, we create another annotated Stateless Session Bean, which is used as a Facade and contains all Web Service-specific settings. From this Bean we generate the WSDL and then tune it in order to show the capability of the customization. In doing so we try to match the WSDL from the previous example as close as possible.</p>
<p>Firstly, we create the business interface and the bean class, then annotate it and finally add the code delegating the Web Service request to the SensorManager.</p>
<pre class="brush: java;">
public interface MeasurementProviderFacade
{
	public List&lt;Measurement&gt; getSensorData(SensorID id, Timespan timespan) throws SensorDataOperationFault;
}

...

@Stateless
public class MeasurementProviderFacadeBean implements MeasurementProviderFacade
{
	public List&lt;Measurement&gt; getSensorData(SensorID id, Timespan timespan) throws SensorDataOperationFault
	{
	...
	// implementation code
	}
}
</pre>
<p>In order to have a Session Bean exposed as a Web Service, the JAX-WS specification defines a set of annotations. The most important two are <code>@javax.jws.WebMethod</code> and <code>@javax.jws.WebService</code>. The <code>@WebService</code> annotation is used to mark the class to be exposed e.G.</p>
<pre class="brush: java;">
@Stateless
@WebService(
	serviceName = &quot;MeasurementProviderService&quot;,
	name = &quot;MeasurementProviderPortType&quot;,
	portName = &quot;MeasurementProviderPort&quot;,
	targetNamespace = &quot;http://www.techjava.de/2010/ws4jee/measurement/&quot;
)
public class MeasurementProviderFacadeBean implements MeasurementProviderFacade
{
	@WebMethod(
		operationName=&quot;GetSensorDataOperation&quot;,
		action=&quot;http://www.techjava.de/2010/ws4jee/measurement/GetSensorDataOperation&quot;
	)
	public List&lt;Measurement&gt; getSensorData(SensorID id, Timespan timespan) throws SensorDataOperationFault { ... }
}
</pre>
<p>All the attributes of the annotation are optional and their values will be derived from the classname and the name of the business interface. The default target namespace for the service definition is derived from the package name, the annotated class is located in. By default, all public methods of the annotated class will be exposed as WSDL operations, with operation&#8217;s name derived from the method name. Using the <code>@WebMethod</code> annotation, the name of the WSDL operation and the SOAP action can be changed.</p>
<p>The careful reader might have observed that the <code>getSensorData</code>-method is throwing an exception. In order to map the exception to a SOAP-Fault, the <code>javax.xml.ws.WebFault</code> class-level annotation can be used. The <code>faultBean</code> attribute is used to provide the full-qulified class name of the exception.</p>
<pre class="brush: java;">
...
@WebFault(
	name=&quot;GetSensorDataFault&quot;,
	targetNamespace=&quot;http://www.techjava.de/2010/ws4jee/measurement/&quot;,
	faultBean=&quot;de.techjava.sensor.bean.SensorDataOperationFault&quot;)
public class MeasurementProviderFacadeBean implements MeasurementProviderFacade { ... }
</pre>
<p>In order to increase the quality of the WSDL further, the method parameters and return type can be annotated with <code>javax.jws.WebParam</code> and <code>javax.jws.WebResult</code> respectively, so the method signature becomes a little unreadable. In order not to copy the long string containing the taget namespace a String constant can be used.</p>
<pre class="brush: java;">
...
	public final static String TYPES = &quot;http://www.techjava.de/2010/ws4jee/measurement/types/&quot;;
...
	@WebResult(name=&quot;measurement&quot;, targetNamespace=TYPES)
	public List&lt;Measurement&gt; getSensorData(
		@WebParam(name=&quot;sensor-id&quot;, targetNamespace=TYPES) SensorID id,
		@WebParam(name=&quot;timespan&quot;, targetNamespace=TYPES) Timespan timespan) throws SensorDataOperationFault	{ ... }
</pre>
<p>Finally, in order to force the marshaller / unmarshaller to map the custom data types (<code>Measurement</code>, <code>SensorID</code> and <code>Timespan</code>) to belong to the same namespace, the JAX-B class-level annotation <code>javax.xml.bind.annotation.XmlType</code> has to be used. By default, the datatypes will be mapped to XML Schema types according to their package name and class name.</p>
<pre class="brush: java;">
@XmlType(namespace = &quot;http://www.techjava.de/2010/ws4jee/measurement/types/&quot;, name = &quot;TimeSpan&quot;, propOrder = { &quot;start&quot;, &quot;end&quot; })
public class Timespan
{
	private Date start;
	private Date end;
</pre>
<p>If deployed to the JBoss, the resulting WSDL looks as following:</p>
<pre class="brush: xml; collapse: true; light: false; toolbar: true;">
&lt;definitions name='MeasurementProviderService' targetNamespace='http://www.techjava.de/2010/ws4jee/measurement/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://www.techjava.de/2010/ws4jee/measurement/types/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://www.techjava.de/2010/ws4jee/measurement/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'&gt;
 &lt;types&gt;
  &lt;xs:schema targetNamespace='http://www.techjava.de/2010/ws4jee/measurement/types/' version='1.0' xmlns:tns='http://www.techjava.de/2010/ws4jee/measurement/types/' xmlns:xs='http://www.w3.org/2001/XMLSchema'&gt;
   &lt;xs:element name='measurement' type='tns:Measurement'/&gt;
   &lt;xs:element name='sensor-id' type='tns:sensor-id'/&gt;
   &lt;xs:element name='timespan' type='tns:TimeSpan'/&gt;
   &lt;xs:complexType name='sensor-id'&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element name='sensorId' type='xs:long'/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name='TimeSpan'&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element minOccurs='0' name='start' type='xs:dateTime'/&gt;
     &lt;xs:element minOccurs='0' name='end' type='xs:dateTime'/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name='Measurement'&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element name='critical' type='xs:boolean'/&gt;
     &lt;xs:element minOccurs='0' name='sensorID' type='tns:sensor-id'/&gt;
     &lt;xs:element minOccurs='0' name='timestamp' type='xs:dateTime'/&gt;
     &lt;xs:element minOccurs='0' name='unit' type='xs:string'/&gt;
     &lt;xs:element minOccurs='0' name='value' type='xs:base64Binary'/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  &lt;xs:schema targetNamespace='http://www.techjava.de/2010/ws4jee/measurement/' version='1.0' xmlns:ns1='http://www.techjava.de/2010/ws4jee/measurement/types/' xmlns:tns='http://www.techjava.de/2010/ws4jee/measurement/' xmlns:xs='http://www.w3.org/2001/XMLSchema'&gt;
   &lt;xs:import namespace='http://www.techjava.de/2010/ws4jee/measurement/types/'/&gt;
   &lt;xs:element name='GetSensorDataOperation' type='tns:GetSensorDataOperation'/&gt;
   &lt;xs:element name='GetSensorDataOperationResponse' type='tns:GetSensorDataOperationResponse'/&gt;
   &lt;xs:element name='SensorDataOperationFault' type='tns:SensorDataOperationFault'/&gt;
   &lt;xs:complexType name='GetSensorDataOperation'&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element minOccurs='0' ref='ns1:sensor-id'/&gt;
     &lt;xs:element minOccurs='0' ref='ns1:timespan'/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name='GetSensorDataOperationResponse'&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element maxOccurs='unbounded' minOccurs='0' ref='ns1:measurement'/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
   &lt;xs:complexType name='SensorDataOperationFault'&gt;
    &lt;xs:sequence&gt;
     &lt;xs:element minOccurs='0' name='message' type='xs:string'/&gt;
    &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
 &lt;/types&gt;
 &lt;message name='MeasurementProviderPortType_GetSensorDataOperation'&gt;
  &lt;part element='tns:GetSensorDataOperation' name='GetSensorDataOperation'&gt;&lt;/part&gt;
 &lt;/message&gt;
 &lt;message name='SensorDataOperationFault'&gt;
  &lt;part element='tns:SensorDataOperationFault' name='SensorDataOperationFault'&gt;&lt;/part&gt;
 &lt;/message&gt;
 &lt;message name='MeasurementProviderPortType_GetSensorDataOperationResponse'&gt;
  &lt;part element='tns:GetSensorDataOperationResponse' name='GetSensorDataOperationResponse'&gt;&lt;/part&gt;
 &lt;/message&gt;
 &lt;portType name='MeasurementProviderPortType'&gt;
  &lt;operation name='GetSensorDataOperation' parameterOrder='GetSensorDataOperation'&gt;
   &lt;input message='tns:MeasurementProviderPortType_GetSensorDataOperation' /&gt;
   &lt;output message='tns:MeasurementProviderPortType_GetSensorDataOperationResponse' /&gt;
   &lt;fault message='tns:SensorDataOperationFault' name='SensorDataOperationFault' /&gt;
  &lt;/operation&gt;
 &lt;/portType&gt;
 &lt;binding name='MeasurementProviderPortTypeBinding' type='tns:MeasurementProviderPortType'&gt;
  &lt;soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/&gt;
  &lt;operation name='GetSensorDataOperation'&gt;
   &lt;soap:operation soapAction='http://www.techjava.de/2010/ws4jee/measurement//GetSensorDataOperation'/&gt;
   &lt;input&gt;&lt;soap:body use='literal'/&gt;&lt;/input&gt;
   &lt;output&gt;&lt;soap:body use='literal'/&gt;&lt;/output&gt;
   &lt;fault name='SensorDataOperationFault'&gt;&lt;soap:fault name='SensorDataOperationFault' use='literal'/&gt;&lt;/fault&gt;
  &lt;/operation&gt;
 &lt;/binding&gt;
 &lt;service name='MeasurementProviderService'&gt;
  &lt;port binding='tns:MeasurementProviderPortTypeBinding' name='MeasurementProviderPort'&gt;
   &lt;soap:address location='http://127.0.0.1:8080/de.techjava.ws4ee-de.techjava.ws4ee.sensor/MeasurementProviderFacadeBean'/&gt;
  &lt;/port&gt;
 &lt;/service&gt;
&lt;/definitions&gt;
</pre>
<p>Please note, that the domain datatypes are mapped to the different namespace as the target namespace of the Web Service.</p>
<p>After some tuning the WSDL, like changing the cardinality of elements (minOccurs = 1, maxOccurs = 1) or adding comments we can let the container use the changed WSDL file instead of generating a new one. In order to do this, let us package the WSDL together with the source code. A good place for it is for example <code>/META-INF/wsdl/</code>, so we can provide a reference to it in an <code>wsdlLocation</code>attribute of the <code>@WebService</code> annotation:</p>
<pre class="brush: java;">
@WebService(
...
        wsdlLocation=&quot;META-INF/wsdl/MeasurementProviderService.wsdl&quot;
)
</pre>
<h2>Putting all together</h2>
<p>After the creation of the Facade Bean and its exposure as a Web Service, we need to delegate the call to the SensorManagerBean, providing the actual implementation. In order to do so, add a private member of type <code>SensorManager</code> inside of the facade bean and annotate it with the <code>javax.ejb.EJB</code> annotation. The container will intialize the member using Dependency Injection and provide a valid reference which can be simply used inside of the method.</p>
<pre class="brush: java; highlight: [4,5,20];">
...
public class MeasurementProviderFacadeBean implements MeasurementProviderFacade
{
	@EJB(mappedName=&quot;de.techjava.sensor/SensorManager&quot;)
	private SensorManager sensorManager;

	/**
	 * Simple delegate to the business method of the sensor manager
	 */
	@WebMethod(
			operationName=&quot;GetSensorDataOperation&quot;,
			action=TNS + &quot;/GetSensorDataOperation&quot;
	)
	public @WebResult(name=&quot;measurement&quot;, targetNamespace=TYPES) List&lt;Measurement&gt; getSensorData(
			@WebParam(name=&quot;sensor-id&quot;, targetNamespace=TYPES) SensorID id,
			@WebParam(name=&quot;timespan&quot;, targetNamespace=TYPES) Timespan timespan) throws SensorDataOperationFault
	{
		try
		{
			return sensorManager.getSensorData(id, timespan);
		} catch (SensorManagerException e)
		{
			throw new SensorDataOperationFault(&quot;Error accessing the Sensor Manager: &quot; + e.getMessage() + &quot;&quot;);
		}
	}
}
</pre>
<p>Here is the call in Web Service Explorer:<br />

<a  href="http://www.techjava.de/wp-content/uploads/ws-explorer.png" onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/ws-explorer.png');" ><img style="margin: 5px;" title="WS Explorer" src="http://www.techjava.de/wp-content/uploads/ws-explorer.png" alt="image WS Explorer" /></a></p>
<h2>Outline</h2>
<p>In this article we showed how to expose the functionality implemented in an EJB 3 Session Bean using Web Service Technology. In fact, the creation of a FacadeBean was not required since one could annotate the <code>SensorManager</code>-Bean directly, but we separated the implementation Bean from the exposing Bean to make it easier to understand. Even if we didn&#8217;t match the WSDL from the J2EE 1.4 example exactly, we came very close. Merely some message-related datatypes have different names. In this example we used the Document/Literal/Wrapped style of Web Services in order to gain maximum interoperability. Even though the creation of the Web Service is a simple task using the annotations. The number of tools and dependencies has dramataically reduced since J2EE 1.4 and the development became less error-prone. Together with other EJB3 improvements it makes the JEE framework suitable for development in the context of enterprise distributed systems.</p>
<h2>References and Resources</h2>
<p>The example source code is available for download (
<a  href="http://www.techjava.de/download/examples/ws4jee.zip" onclick="javascript:pageTracker._trackPageview('/downloads/download/examples/ws4jee.zip');" >ws4jee.zip</a>). Just import the projects from the archive into Eclipse Worskspace. Make sure to set up the JRE and JBoss Server instance for the projecst to work.</p>
<ul>
<li>
<div>[2008,techreport] 
<a  href="#JAVAEE" class="toggle">bibtex</a>  
<a  href='http://java.sun.com/javaee/5/docs/tutorial/doc/' title='Go to document' onclick="javascript:pageTracker._trackPageview('/external/java.sun.com/javaee/5/docs/tutorial/doc/');" ><img src='http://www.techjava.de/wp-content/plugins/bib2html/external.png' width='10' height='10' alt='Go to document' /></a></div>
<div>E. Jendrock, J. Ball, D. Carson, I. Evans, S. Fordin, and K. Haase, &quot;The Java EE 5 Tutorial,&quot; 2008.</div>
<div class="bibtex" id="JAVAEE">
         <code>@techreport{JAVAEE, <br />
 &nbsp;&nbsp;author =	{Eric Jendrock and Jennifer Ball and Debbie Carson and Ian Evans and Scott Fordin and Kim Haase}, <br />
 &nbsp; title =	{The Java EE 5 Tutorial}, <br />
 &nbsp; url = {http://java.sun.com/javaee/5/docs/tutorial/doc/}, <br />
 &nbsp; month =	{Oct}, <br />
 &nbsp; year =	{2008}<br />
}</code>
    </div>
</li>
<li>
<div>[2007,book] 
<a  href="#IHNS_2003" class="toggle">bibtex</a>  
<a  href='Oliver Ihns, Dierk Harbeck, Stefan M. Heldt, Holger Koschek, Roman Schlömmer, Jo Ehm, Carsten Sahling' title='Go to document'><img src='http://www.techjava.de/wp-content/plugins/bib2html/external.png' width='10' height='10' alt='Go to document' /></a></div>
<div>O. Ihns, D. Harbeck, S. M. Heldt, H. Koschek, R. Schl&#5954405;r, J. Ehm, and C. Sahling, <em>EJB 3 professionell. Grundlagen- und Expertenwissen zu Enterprise JavaBeans 3 fr Einsteiger, Umsteiger und Fortgeschrittene , publisher	DPunkt Verlag</em>, , 2007.</div>
<div class="bibtex" id="IHNS_2003">
         <code>@Book{IHNS_2003, <br />
 &nbsp;&nbsp;author =	{Oliver Ihns and Dierk Harbeck and Stefan M. Heldt and Holger Koschek and Roman Schlömmer and Jo Ehm and Carsten Sahling}, <br />
 &nbsp; title =	{EJB 3 professionell. Grundlagen- und Expertenwissen zu Enterprise JavaBeans 3 für Einsteiger, Umsteiger und Fortgeschrittene }, <br />
 &nbsp; publisher	{DPunkt Verlag}, <br />
 &nbsp; year =	{2007}, <br />
 &nbsp; month =	{Jul}, <br />
 &nbsp; url = {Oliver Ihns, Dierk Harbeck, Stefan M. Heldt, Holger Koschek, Roman Schlömmer, Jo Ehm, Carsten Sahling}<br />
}</code>
    </div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2010/01/functionality-web-services-jee/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Configuring JBoss Datasource for Firebird DB</title>
		<link>http://www.techjava.de/topics/2010/01/configuring-jboss-datasource-for-firebird-db/</link>
		<comments>http://www.techjava.de/topics/2010/01/configuring-jboss-datasource-for-firebird-db/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 00:33:17 +0000</pubDate>
		<dc:creator>shuron</dc:creator>
				<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[Datasource]]></category>
		<category><![CDATA[firebird]]></category>
		<category><![CDATA[jaybird]]></category>
		<category><![CDATA[jca]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[rar]]></category>
		<category><![CDATA[server-side]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=537</guid>
		<description><![CDATA[
Accessing a relational database system from Java is a basic step required for many applications. The JEE architecture defines a standard for gaining this access, calls Java Connector Architecture (JCA). This article is a short HOWTO of configuring JCA-compliant datasource to a Firebird 2.x RDBMs using JBoss AS 5.1.0 as example. This tutorial is based [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 5px; float:right;" title="FirebirdPhoenix_Logo" src="http://www.techjava.de/wp-content/uploads/FirebirdPhoenix_Logo-150x150.gif" alt="FirebirdPhoenix_Logo" width="150" height="150" /><br />
Accessing a relational database system from Java is a basic step required for many applications. The JEE architecture defines a standard for gaining this access, calls Java Connector Architecture (JCA). This article is a short HOWTO of configuring JCA-compliant datasource to a Firebird 2.x RDBMs using JBoss AS 5.1.0 as example. This tutorial is based on a Windows installation, but can be easily ported to Linux, or other OS.</p>
<p>For the configuration of the datasource two steps are required:</p>
<ul>
<li>Deployment of the Firebird RAR resource adapter (<code>jaybird-*.rar</code>)</li>
<li>Creation of the <code>firebird-ds.xml</code> configuration</li>
</ul>
<p><span id="more-537"></span></p>
<h2>RAR Resource Adapter</h2>
<p>The RAR Resource Adapter is a version of RDBMs drivers packaged in a special way, defined by the JCA specifcation. The<br />

<a  href="http://www.ibphoenix.com/main.nfs?page=ibp_download_jaybird" target="_blank" onclick="javascript:pageTracker._trackPageview('/external/www.ibphoenix.com/main.nfs');" >latest versions of Type 4 JCA-JDBC Firebird Driver</a> (JayBird) can be downloaded from the IBPhoenix site. Inside of the downloaded archive you will find <code>jaybird-*.rar</code> (The version used during the creation of this tutorial was jaybird-2.1.6.rar). Since deployment in JBoss AS is performed by simple file copy, make sure to put the RAR-adapter-file into the deployment location of the application server. (e.G. ${JBOSS_ROOT}\server\default\deploy\).</p>
<p>After deployment, you can check the status of the resource adapter, by looking on the Administration Console of the JBoss (by default accessing the server URL http://localhost:8080/admin-console/ if run locally).</p>
<h2>Datasource Description</h2>
<p>After a successful deployment of the Resource RAR, the configuration of the datasource has to be created. The Firebird datasource configuration is supplied in a file, located in the default deployment location. JBoss AS auto-deplyoer will automatically look for the  <code>*-ds.xml</code> files, so we name it e.G. <code>firebird-ds.xml</code>.</p>
<p>The following datasource configuration defines a local transactional datasource. You just need to replace placeholders USERNAME, PASSWORD and path to your database-file (In the used installation the file was located in: <code>c:\databses\tesdb.fdb</code>)</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

  &lt;!-- ==================================================================== --&gt;
  &lt;!-- New ConnectionManager setup for firebird dbs using jca-jdbc xa driver--&gt;
  &lt;!-- Build jmx-api (build/build.sh all) and view for config documentation --&gt;
  &lt;!-- ==================================================================== --&gt;

&lt;connection-factories&gt;
	&lt;local-tx-datasource&gt;
		&lt;jndi-name&gt;DataSourceFirebirdDS&lt;/jndi-name&gt;
		&lt;connection-url&gt;jdbc:firebirdsql:localhost/3050:c:${/}databses${/}tesdb.fdb&lt;/connection-url&gt;
		&lt;driver-class&gt;org.firebirdsql.jdbc.FBDriver&lt;/driver-class&gt;
		&lt;transaction-isolation&gt;TRANSACTION_REPEATABLE_READ&lt;/transaction-isolation&gt;
		&lt;connection-property name=&quot;lc_ctype&quot; type=&quot;java.lang.String&quot;&gt;ISO8859_1&lt;/connection-property&gt;
		&lt;connection-property name=&quot;maxStatements&quot;&gt;10&lt;/connection-property&gt;
		&lt;user-name&gt;USERNAME&lt;/user-name&gt;
		&lt;password&gt;PASSWORD&lt;/password&gt;
		&lt;min-pool-size&gt;0&lt;/min-pool-size&gt;
		&lt;max-pool-size&gt;10&lt;/max-pool-size&gt;

		&lt;blocking-timeout-millis&gt;5000&lt;/blocking-timeout-millis&gt;

		&lt;idle-timeout-minutes&gt;15&lt;/idle-timeout-minutes&gt;
		&lt;check-valid-connection-sql&gt;SELECT CAST(1 as INTEGER) FROM rdb$database&lt;/check-valid-connection-sql&gt;
		&lt;track-statements&gt;false&lt;/track-statements&gt;
		&lt;prepared-statement-cache-size&gt;0&lt;/prepared-statement-cache-size&gt;
		&lt;metadata&gt;
			&lt;type-mapping&gt;Firebird&lt;/type-mapping&gt;
		&lt;/metadata&gt;
	&lt;/local-tx-datasource&gt;
&lt;/connection-factories&gt;
</pre>
<h2>Usage</h2>
<p>The datasource in the example above is registered in the <code>java</code> JNDI namespace and is called <code>DataSourceFirebirdDS</code>. In the source code, this resource should be accessible via <code>java:/DataSourceFirebirdDS</code>. Here is the example using Dependency Injection (DI):</p>
<pre class="brush: java;">
@Ressource(mappedName = &quot;java:/DataSourceFirebirdDS&quot;)
private DataSource firebirdDataSource;
</pre>
<p>In order to use the datasource in a JPA, the persistence unit has to be configured. For example, for using Hibernate, the following persistence unit can be configured.</p>
<pre class="brush: xml;">
...
&lt;persistence-unit name=&quot;testunit&quot;&gt;
	&lt;jta-data-source&gt;java:/DataSourceFirebirdDS&lt;/jta-data-source&gt;
	&lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
	...
	&lt;properties&gt;
		&lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.FirebirdDialect&quot;/&gt;
		&lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot; /&gt;
		...
	&lt;/properties&gt;
&lt;/persistence-unit&gt;
...
</pre>
<p>Then in the DAO for manipulation of Persistent Entities, the Persistence Context can be injected by:</p>
<pre class="brush: java;">
@Stateless
public class TestDAOBean implements TestDAO {

	@PersistenceContext(unitName = &quot;testunit&quot;)
	private EntityManager manager;

	...
}
</pre>
<p>Have fun and please provide some feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2010/01/configuring-jboss-datasource-for-firebird-db/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>EWiTa and ESE 2009</title>
		<link>http://www.techjava.de/topics/2009/11/ewita-and-ese-2009/</link>
		<comments>http://www.techjava.de/topics/2009/11/ewita-and-ese-2009/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 21:24:55 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[announce]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[business information]]></category>
		<category><![CDATA[Eclipse Summit Europe]]></category>
		<category><![CDATA[ESE2009]]></category>
		<category><![CDATA[ewita]]></category>
		<category><![CDATA[mdsd]]></category>
		<category><![CDATA[summit]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=512</guid>
		<description><![CDATA[Even if some time has passed since the events EWiTa 2009 and Eclipse Summit Europe 2009, I would like to share my impressions, since I took part in both events&#8230;
EWiTa 2009

EWiTa 2009 stands for Elmshorner Wirtschaftsinfromatiktag, that is German for &#8220;Elmshorn Business Information Systems Day&#8221;. The event has been organized by Frank Zimmermann, of 
Nordakademie [...]]]></description>
			<content:encoded><![CDATA[<p>Even if some time has passed since the events EWiTa 2009 and Eclipse Summit Europe 2009, I would like to share my impressions, since I took part in both events&#8230;</p>
<h3>EWiTa 2009</h3>
<p><img style="margin: 5px; float: right;" src="http://farm3.static.flickr.com/2550/4037739235_3fc88b8416_m.jpg" alt="_MG_9975" width="160" height="240" />
<a  href="http://ewita.nordakademie.de/index.html" onclick="javascript:pageTracker._trackPageview('/external/ewita.nordakademie.de/index.html');" >EWiTa 2009</a> stands for Elmshorner Wirtschaftsinfromatiktag, that is German for &#8220;Elmshorn Business Information Systems Day&#8221;. The event has been organized by Frank Zimmermann, of 
<a  href="http://www.nordakademie.de/" onclick="javascript:pageTracker._trackPageview('/external/www.nordakademie.de/');" >Nordakademie</a> &#8211; a private university in Northern Germany. Even if the event is not an official sequel of the 
<a  href="http://mdsd08.techjava.de/" onclick="javascript:pageTracker._trackPageview('/external/mdsd08.techjava.de/');" >MDSD Today</a>, there were many similarities. The event had two tracks: the process modeling track and the MDSD track. After an excellent keynote from Mathias Weske about the importance of collaboration during the process of (business) modeling I stayed in the business track to listen to the Andrea Grass (
<a  href="http://www.oose.de/" onclick="javascript:pageTracker._trackPageview('/external/www.oose.de/');" >oose GmbH</a>) on the combination of UML and BPMN 2.0. To say the truth, I&#8217;m not a big fan of this approach, especially, because the conceptual mismatch of modeling of business behavior and technical behavior. After a coffee break I enjoyed an excellent talk of 
<a  href="http://www.heikobehrens.net/>Heiko Behrens</a> (<a href="http://www.itemis.com/" onclick="javascript:pageTracker._trackPageview('/external/www.heikobehrens.net/>Heiko Behrens</a> (<a href=');" >itemis</a>), reporting about the success story of xText in a big project of Deutsche BĂ¶rse AG (German Stock Exchange).</p>
<p>After a small lunch, I was listening to two Arcando consultants reporting about their eTicketing project. The strange thing about this talk was that they just made some ads on a standard Microsoft product. After this, I enjoyed an interesting talk on business modeling based on CobIT process. Finally, I switched the track again to MDSD and listend to the an interesting usage of MDSD techniques for generation of DynPro and ABAP code. 
<a  href="http://flickriver.com/photos/sza/sets/72157622523990299/" onclick="javascript:pageTracker._trackPageview('/external/flickriver.com/photos/sza/sets/72157622523990299/');" ><img title="simon.zambrovski - View my 'EWiTa 2009' set on Flickriver" src="http://flickriver.com/badge/user/set-72157622523990299/recent/shuffle/medium-horiz/ffffff/333333/73775153@N00.jpg" border="0" alt="simon.zambrovski - View my 'EWiTa 2009' set on Flickriver" /></a></p>
<p>In general I enjoyed the event. I think the MDSD track was a little more technical, but the combination was good.</p>
<h3>Eclipse Summit Europe 2009</h3>
<p><img src="http://farm3.static.flickr.com/2679/4058140264_9e2eab48aa_m.jpg" width="240" height="160" alt="_MG_0117" style="margin: 5px; float: left;" />The Eclipse Summit Europe 2009 (ESE 2009) took place on October 27-29 in Ludwigsburg, Germany, it is the European complement to the EclipseCon in the US. In contrast to the spring event in Santa Clara, CA, the ESE is an autumn event in a beautiful baroque town near Stuttgart. The event lasted three days and is a must for Eclipse-related technology people. As usual, the venue was great, the keynotes excellent and the talks interesting. And of course it was the place to meet the committers, evangelists, see them in action, talk to them and discuss the future directions.</p>
<h4>Symposium Day</h4>
<p>The first day is an arrival day. People arrive during the day, some of them are already there. I was visiting the Modeling Track the whole day and had much fun with Ed Merks, Eike Stepper and Thomas Schindl in the morning. Later, in the Modeling Symposium, Eike showed the eDine RCP based on CDO, UBS envisioned the modeling tool pipeline and so on, and so on. About 10 people showed different technologies on and about modeling. Intersting, unstructured and relaxed. And of course, the first evening is the opportunity to speak with all the Eclipse VIPs and drink a cold beer.</p>
<h4>First Day</h4>
<p>The main conference day was Wednesday and it started with a great keynote on functional programming held by Don Syme, the father of F#. Suprisingly, the talk was about F#. For some of us, there was not enough functional beauty exposed in the talk, so I scheduled a private session with Don and he told 
<a  href="http://www.voelter.de/" onclick="javascript:pageTracker._trackPageview('/external/www.voelter.de/');" >Markus Voelter</a>, 
<a  href="http://www.heikobehrens.net/" onclick="javascript:pageTracker._trackPageview('/external/www.heikobehrens.net/');" >Heiko Behrens</a> and 
<a  href="http://simon.zambrovski.org/" onclick="javascript:pageTracker._trackPageview('/external/simon.zambrovski.org/');" >me</a> about some interesting F# features.<img src="http://farm3.static.flickr.com/2694/4057390437_56df43864f_m.jpg" width="160" height="240" alt="_MG_0090" style="margin: 5px; float: right;"/></p>
<p>I took part in the 
<a  href="http://www.eclipsecon.org/summiteurope2009/sessions?id=924" onclick="javascript:pageTracker._trackPageview('/external/www.eclipsecon.org/summiteurope2009/sessions');" >How about I/O</a> session on 
<a  href="https://wiki.sdn.sap.com/wiki/display/Java/JPicus" onclick="javascript:pageTracker._trackPageview('/external/wiki.sdn.sap.com/wiki/display/Java/JPicus');" >JPicus</a>. A very interesting tool for tracking I/O problems in Java programs developed by SAP. The 
<a  href="http://www.eclipsecon.org/summiteurope2009/sessions?id=861" onclick="javascript:pageTracker._trackPageview('/external/www.eclipsecon.org/summiteurope2009/sessions');" >Climb The Tower of Babel</a> was about the Eclipse translation project. Intersting is the runtime editor allowing you to translate you runnig application. After a delicios lunch, I enjoyed two modeling talks: Xtext and EMF Query. The itemis team introduced some really new features, which make Xtext in my oppinion to a unique technology. Just to mention few of them: white-space aware parsing, usage of scopes and qualified names, usage of index (construted by a builder) in your own language, separation of markers and annotations in the editor, integration of the generator on-save, declarative quick-fix in your DSL, strings with special meaning, references to java types, and much more&#8230; The EMF Query is a project developed by the SAP team, that leverages the index by a query language. The language is a SQL-like DSL for querying the EMF-based models. The infrastructure is very intersting and allows complex scenarios with multiple model providers &#8211; very technical, and I believe, very interesting project.</p>
<h4>Second Day</h4>
<p><img src="http://farm3.static.flickr.com/2747/4057438031_aa2a25e400_m.jpg" width="160" height="240" alt="_MG_0171" style="margin: 5px; float: right;" /><br />
After the keynote on the importance of software ecosystems and a deep economical analysis of Eclipse ecosystem, I switched off the track to be able to prepare 
<a  href="http://www.eclipsecon.org/summiteurope2009/sessions?id=911" onclick="javascript:pageTracker._trackPageview('/external/www.eclipsecon.org/summiteurope2009/sessions');" >my talk</a>. I was reporting about the IDE for TLA+ which I was building the last nine month at Microsoft Research, and which will be 
<a  href="http://www.tlaplus.net/posts/2009/08/coming-soon-tla-toolbox/" onclick="javascript:pageTracker._trackPageview('/external/www.tlaplus.net/posts/2009/08/coming-soon-tla-toolbox/');" >available soon</a>. The main emphasis of the talk, was not the demo of the IDE, but the exchange of experiences on building one. Especially, I focused on the possible pitfalls and conceptual mismatches of IDEs depending on the integrated language. The slides will be available soon. </p>
<p>At the end, I enjoyed the event very much. I even liked it more than EclipseCon. Modeling still seems to be the most interesting part of Eclipse ecosystem. Technologies like Xtext and CDO gain maturity, new technolgoes like EMF Query are being developed. It was nice to see the people again&#8230;  As usual, some pictures:<br />

<a  href="http://www.flickriver.com/photos/sza/sets/72157622569740211/" onclick="javascript:pageTracker._trackPageview('/external/www.flickriver.com/photos/sza/sets/72157622569740211/');" ><img src="http://www.flickriver.com/badge/user/set-72157622569740211/recent/shuffle/medium-tiny/ffffff/333333/73775153@N00.jpg" border="0" alt="simon.zambrovski - View my 'Eclipse Summit Europe 2009' set on Flickriver" title="simon.zambrovski - View my 'Eclipse Summit Europe 2009' set on Flickriver"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2009/11/ewita-and-ese-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Packaging Eclipse-based RCP for the use in enterprise context</title>
		<link>http://www.techjava.de/topics/2009/07/packaging-eclipse-based-rcp-for-the-use-in-enterprise-context/</link>
		<comments>http://www.techjava.de/topics/2009/07/packaging-eclipse-based-rcp-for-the-use-in-enterprise-context/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 20:00:33 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rcp]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[packaging]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[product]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=394</guid>
		<description><![CDATA[
Abstract
Using Eclipse-based rich-clients as stand-alone applications is discussed in many 
books and 
articles. In the context of enterprise systems, the software development adopted several paradigms to improve the quality of the overall architecture. This short article describes some issues in packaging the application for using it in the context of enterprise systems.
Architectural Assumptions
Designing enterprise architectures [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 5px; float: right" title="Packaging" src="http://www.techjava.de/wp-content/uploads/packaging.jpg" alt="Packaging" width="120" height="120" /></p>
<h2>Abstract</h2>
<p>Using Eclipse-based rich-clients as stand-alone applications is discussed in many 
<a  href="http://www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612" onclick="javascript:pageTracker._trackPageview('/external/www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612');" >books</a> and 
<a  href="http://www.eclipse.org/articles/Article-RCP-1/tutorial1.html" onclick="javascript:pageTracker._trackPageview('/external/www.eclipse.org/articles/Article-RCP-1/tutorial1.html');" >articles</a>. In the context of enterprise systems, the software development adopted several paradigms to improve the quality of the overall architecture. This short article describes some issues in packaging the application for using it in the context of enterprise systems.</p>
<h2>Architectural Assumptions</h2>
<p>Designing enterprise architectures is a standard discipline for IT-consulting companies or freelancers involved in software development. Maybe one of the main characteristics of enterprise architectures is the framework-driven approach of software creation. Thus, the software has to comply certain rules and standards adopted inside the enterprise. In order to simplify such constrained development process, it is common to use an in-house software framework, which enforces theÂ  compliance of the enterprise-internal standards and acts as glue between different technologies adopted as parts of the enterprise architecture.</p>
<p>Using such frameworks has major implications for the software development in general, and especially for the rich client development. The design issues are summarized in the next section.</p>
<h2>Usaging an Enterprise Framework</h2>
<p>The major goal of the enterprise in-house framework is to simplify the process of software systems development and to enforce standardization among the software systems. This usually includes the following aspects:</p>
<ul>
<li>Domain-specific component framework</li>
<li>Methods for master data management</li>
<li>Infrastructure services: authentication, authorization, communication, security, printing, reporting</li>
<li>Application skeletons and launchers</li>
</ul>
<p>The more unification and standardization is included inside the framework, the easier it is for a software developer to concentrate on the particular business task and the easier is the maintenance of the software system.</p>
<p>From the previous list, the most interesting part related to RCP packaging and deployment is the existence of the application skeletons and launchers. So, when launching an application, the framework libraries are loaded and executed first and pass the control to the application-specific modules. The advantage of this approach is that infrastructure services can be loaded first, which can be developed and shared among different applications.<br />
<span id="more-394"></span></p>
<h2>The required plug-ins</h2>
<p>Following the general idea of RCP packaging (see rules provided in the 
<a  href="http://www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612" onclick="javascript:pageTracker._trackPageview('/external/www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612');" >RCP Book</a>) and assuming one target platform (in terms of one RCP product), <strong>one top-level plug-in and should be defined</strong>. In addition, we assume at least one <strong>in-house framework plug-in</strong> and at least <strong>one application-specific plug-in</strong>. Usually there will be more of each type, but it will not change the picture much. Important at this point is the fact, that the application-specific code depends on the in-house framework code. In order to simplify the identification of the plug-ins, an example project is introduced. Letâ€™s assume the project is called <strong>FooBar</strong>. Then, the plug-ins are called:</p>
<ul>
<li><code>de.techjava.foobar</code>: This is the functional plug-in, which contains the application-specific code.</li>
<li><code>de.techjava.framework</code>: This is the framework plug-in, which contains framework component code.</li>
<li><code>de.techjava.foobar.product.standalone</code>: This is an application and product definition plug-in which contains the definition of the product and application-agnostic code for launching the application.</li>
</ul>
<h2>Managing plug-in dependencies</h2>
<p>A difficult issue for the RCP beginners is the management of dependencies between plug-ins. Especially, the transition from the development of a single plug-in to the configuration of features and products seem to be non-trivial. In order to solve this problem, there are simple rules to follow. You can violate these rules in sophisticated scenarios, but for the beginners it is a good idea to follow them.</p>
<ol>
<li><em>Create dependencies only if you need them</em>. Each plug-in should only list plug-ins (or even better packages) it really depends on. Make sure to check it with the â€ś<strong>Find unused dependencies</strong>â€ť action available on the right-click in the Dependencies Tab of the Plug-in Manifest Editor.</li>
<li><em>Use versioning information. </em>Plug-ins (or better bundles, or as 
<a  href="http://www.aniszczyk.org/" onclick="javascript:pageTracker._trackPageview('/external/www.aniszczyk.org/');" >Chris</a> call them Plundles) provide version information. And it is highly advisable to include them in the import statements of the plug-ins, which simplifies the migration later onâ€¦</li>
<li><em>Donâ€™t forget anything</em>. Every Plug-in should appear in at least in one Plug-In section of the Feature definition. Every feature should be included by another feature, higher in the hierarchy.</li>
<li><em>Keep the hierarchy flat</em>. For simple scenarios, it is sufficient to have two levels of features (top-level feature, one per-product and the underlying features include their plug-ins).</li>
<li><em>Donâ€™t re-export dependencies</em>. Every Feature for a group of plug-ins should also include plug-ins required by the members of the group. It does not hurt if a plug-in is included several times, but it does if it is not included at all. You can optimize here if you check which plug-ins are imported by the Eclipse RCP feature (which can be considered as stable), but it does not make assumptions about features developed by third parties.</li>
</ol>
<p>Following these rules it is simple to create features for the corresponding plug-ins. Several plug-ins which belong together and are handled as a fixed piece can be grouped into Features. Usaging Features is highly advisable, and sometimes simply required (e.G. by RCP in a Java Web Start target deployment strategy). So in addition to the previously mentioned plug-in projects, at least three feature projects are required:</p>
<ul>
<li><code>de.techjava.foobar.feature</code>: This is a functional feature, which includes the <code>de.techjava.foobar</code> plug-in and all plug-ins required by it, which do not appear in the Eclipse RCP feature</li>
<li><code>de.techjava.framework.feature</code>: This is a framework feature, which includes the <code>de.techjava.framework</code> plug-in and all plug-ins required by it, which do not appear in the Eclipse RCP feature</li>
<li><code>de.techjava.foobar.feature.standalone</code> This is the top level feature, which is used for the product configuration. <strong>It includes the two features above and the Eclipse RCP feature </strong>(and optional other features used, like e.G. org.eclipse.help). <strong>It also includes exactly one plug-in</strong>, which is not included anywhere else: <code>de.techjava.foobar.standalone.product</code></li>
</ul>
<h2>The product definition plug-in</h2>
<p>The definition of the product is spread among several files. First of all the plug-in.xml of the <code>de.techjava.foobar.standalone.product</code> plug-in makes uses of two extensions:</p>
<ul>
<li><code>org.eclipse.core.runtime.applications</code></li>
<li><code>org.eclipse.core.runtime.products</code></li>
</ul>
<p>The application extension point is used to point to the Java class implementing the interface <code>org.eclipse.equinox.app.IApplication</code>. Along with this implementation, other classes needed to start up the RCP (like Advisors, etcâ€¦) are placed into the source directory of the plug-in. The product extension point is used for the association of the application with a product id. The previously-defined top-level feature includes all required features and the product definition plug-in. Finally, the <code>.product</code> file is the place, where all things are bound together: product id, application id, launcher parameters, and the one top level feature: <code>de.techjava.foobar.feature.standalone</code>. Other customization of the RCP is possible from the <code>plugin-customization.ini</code>, which is placed together with the <code>.product</code> file into the plug-in root directory.</p>
<p><img class="alignnone size-full" style="margin:10px;" title="Product configuration" src="http://www.techjava.de/wp-content/uploads/product_feature_plugin1.png" alt="Product configuration" width="385" height="499" /><br />
As a result the following configuration should be achieved after the packaging is finished. The product references the product-id and the application, defined in the plugin.xml of the plug-in project it is contained in. The product configuration is feature-based and includes one top-level feature. The top-level feature includes all other features (functional, framework, Eclipse RCP, other optional) and the one plugin, in which the product file resides.</p>
<p>The simple example provided in this articles is available as sourcecode for download (
<a  href="http://www.techjava.de/download/examples/rcp-packaging.zip" onclick="javascript:pageTracker._trackPageview('/downloads/download/examples/rcp-packaging.zip');" >rcp-packaging.zip</a>).</p>
<h2>The framework hooks</h2>
<p>In the introduced scenario, the packaging is not specific to the in-house framework. It just includes the feature containing the framework plug-in. This approach works fine, if the framework is used in a white-box manner, which means that the framework provides ready-to-use components to be plugged-in to the application (like e.G. a component for the master data management). The other type of frameworks is the so-called black-box framework, which provides components that have to be configured and integrated into the application components. In this case, the framework components can not be plugged-in using some declarative extension points, but need to be called from the application code. In the latter case, the dependencies appear between the plug-in launching the application (<code>de.techjava.foobar.standalone.product</code>) and the framework plug-ins. This requires a modification in the previous setup and the violation of one of the rules posted above. The plug-in has to define the dependency to the framework plug-in, but the top-level feature does not include the required plug-in directly, but imports the whole framework feature.</p>
<p></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px">Technorati-Tags: 
<a rel="tag"  href="http://technorati.com/tags/eclipse" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/eclipse');" >eclipse</a>,
<a rel="tag"  href="http://technorati.com/tags/java" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/java');" >java</a>,
<a rel="tag"  href="http://technorati.com/tags/rcp" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/rcp');" >rcp</a>,
<a rel="tag"  href="http://technorati.com/tags/packaging" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/packaging');" >packaging</a>,
<a rel="tag"  href="http://technorati.com/tags/plugin" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/plugin');" >plugin</a>,
<a rel="tag"  href="http://technorati.com/tags/feature" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/feature');" >feature</a>,
<a rel="tag"  href="http://technorati.com/tags/product" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/product');" >product</a>,
<a rel="tag"  href="http://technorati.com/tags/enterprise+systems" onclick="javascript:pageTracker._trackPageview('/external/technorati.com/tags/enterprise+systems');" >enterprise systems</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2009/07/packaging-eclipse-based-rcp-for-the-use-in-enterprise-context/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>RCP Help System</title>
		<link>http://www.techjava.de/topics/2009/04/rcp-help-system/</link>
		<comments>http://www.techjava.de/topics/2009/04/rcp-help-system/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 22:04:23 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rcp]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=241</guid>
		<description><![CDATA[Eclipse Platform provides a help system that can be used during creation of the help content for your application. It is very convenient while used inside of the IDE, but needs a special approach if used in the RCP. This article tries to gather the information which may be useful.
Adding Help Support
Basic preparations
As discussed in [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 10px; float:right" title="Eclipse help" src="http://www.techjava.de/wp-content/uploads/help-150x150.jpg" alt="help" width="150" height="150" />Eclipse Platform provides a help system that can be used during creation of the help content for your application. It is very convenient while used inside of the IDE, but needs a special approach if used in the RCP. This article tries to gather the information which may be useful.</p>
<h2>Adding Help Support</h2>
<h3>Basic preparations</h3>
<p>As discussed in Eclipse RCP Book and RCP Articles, the help system is not a part of the RCP-Runtime and should be added separately. The question arises where to add at to? If you follow the best practices for packaging of RCP applications, you should have at least one product and the top level feature defined (See Rule 1 of Chapter 23 of Eclipse Rich Client Platform). The top level feature includes the branding plug-in (containing the product definition) and refer to other features (like <code>org.eclipse.rcp</code>, and your functional features). In order to add the help system, you need to add the <code>org.eclipse.help</code> feature in this list.</p>
<h3>Platform help buttons</h3>
<p>There are several predefined buttons (actions) you can use for calling the help system. These are:</p>
<ul>
<li>Help Contents</li>
<li>Help Search</li>
<li>Dynamic Help</li>
</ul>
<p>In order to activate them from your <code>ApplicationActionBarAdvisor</code> just call:</p>
<pre class="brush: java;">
private IWorkbenchAction helpContentsAction;
private IWorkbenchAction helpSearchAction;
private IWorkbenchAction dynamicHelpAction;

protected void makeActions(IWorkbenchWindow window)
{
helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
register(helpContentsAction);
register(helpSearchAction);
register(dynamicHelpAction);
}
</pre>
<p>If you want to do the same declarative, you have to create commands that use the following <code>actionDefinitionId</code>s:</p>
<ul>
<li>org.eclipse.ui.help.helpContents</li>
<li>org.eclipse.ui.help.helpSearch</li>
<li>org.eclipse.ui.help.dynamicHelp</li>
</ul>
<p>The same ids are required for registration of key bindings (e.G. Ctrl + F1, Shift + F1, F1 on Win32). Apparently, since these actions adjust their status depending on the state of the system and the plug-ins installed, I could not figure out how to force them to be enabled, when installed in a declarative way. Since they are still provided as <code>ActionFactory</code> (which is legacy due to the changes introduced by new Command Framework), they should be further activated from the <code>ApplicationActionBarAdvisor</code>.</p>
<h2>Context-Sensitive Help UI Integration</h2>
<p>The Eclipse platform provides not only the help system, but also support the so-called Context-Sensitive Help (a very confusing name, because the context is only the widget, and not the data). In the following, it is shown, how the connection between the widgets and the help system can be established.</p>
<h3>The big picture</h3>
<p>The content already defined in the help system can be pointed at from various places in the your application using the so-called help contexts, which on one hand point to the places in the documentation and on the other hand can be assigned to widgets in the application UI.</p>
<h3>Establishing contexts</h3>
<p>In order to assign the help context to a widget the invocation of the method <code>PlatformUI.getWorkbench().getHelpSystem().setHelp(Control control, String contextId);</code> is used. The contextId is a <strong>full-qualified string constructed from the pluginId and the local context name</strong>. The context name should be unique for this plug-in (usage of non-unique ids leads to a merge of different subjects, which is a nice feature, but may be not desired). I prefer to create the convenience method for this invocation:</p>
<pre class="brush: java;">
public class HelpUtil
{
public static void setHelp(Control control, String localContextId)
{
if (localContext == null || control == null) return;
PlatformUI.getWorkbench().getHelpSystem().setHelp(control,
Activator.PLUGIN_ID + &quot;.&quot; + localContextId);
}
}
</pre>
<p>There are also methods for registration of other SWT widgets (Control, IAction, Menu, or MenuItem) in the help system, which can be handled by the overloaded version of the method. The invocation of the convenenience method usually looks like: <code>HelpUtil.setHelp(composite, "newWizardPage")</code> and should be invoked from the createControls() of the correponding element. Please note, that the &#8220;newWizardPage&#8221; is a local name, and the pluginId is added to it inside of the conveninece method. Widgets that do not get focus should not be assigned context ids, since they will never trigger a context-sensitive help</p>
<h3>The declarative part</h3>
<p>As usual in Eclipse, there is a declarative part, that connects the context ids, set up in the code with the help pages. The connection is established by a special XML file. In order for the platform to know, where to find the file, there is an extension point (<strong>org.eclipse.help.contexts</strong>), that you need to contribute to:</p>
<pre class="brush: xml;">
&lt;extension point=&quot;org.eclipse.help.contexts&quot;&gt;
&lt;contexts file=&quot;contexts.xml&quot; plugin=&quot;de.techjava.rcp.ui&quot; /&gt;
&lt;/extension&gt;
</pre>
<p>The <strong>file</strong> attribute specifies the full path to the XML file containing the context definition. The <strong>plugin</strong> attribute is optional and declares for which plugin the context definition applies. Please note, that if the plugin attribute is ommited, the context names used in the context definition file will be seen as local to the plugin they are declared in. For example, if you want to support the context-sensitive help in plug-in <code>de.techjava.rcp.xyz</code> then your in-code definition of the context should define full qualified context names like <code>de.techjava.rcp.xyz.context1</code>. Either you use the extension point (org.eclipse.help.contexts) in the plugin.xml of the de.techjava.rcp.xyz plugin.xml, or if you put the usage of the extension point into some other plugin (e.G. central for all help), you must provide the plugin attribute with value &#8220;de.techjava.rcp.xyz&#8221;.  This issue is badly discussed in the help guide and is a little confusing. In the context definition file the contexts are defined as follows:</p>
<pre class="brush: xml;">
&lt;contexts&gt;
&lt;context id=&quot;context1&quot; title=&quot;My first context&quot;&gt;
&lt;description&gt;This is a test context&lt;/description&gt;
&lt;topic href=&quot;path/context1.htm&quot; label=&quot;Context1&quot;/&gt;
&lt;/context&gt;
...
&lt;/contexts&gt;
</pre>
<h3>Wizards and Dialogs</h3>
<p>Wizards are used with or without dialog.</p>
<p>The call of the <code>Wizard#setHelpAvailable(true)</code> shows the Help button.<br />
The call of the <code>WizardDialog.setHelpAvailable(true);</code> shows the small sexy round Question button.</p>
<h2>References</h2>
<ul>
<li>
<a  href="http://www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612/ref=sr_1_2?ie=UTF8&amp;qid=1235103097&amp;sr=8-2" onclick="javascript:pageTracker._trackPageview('/external/www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612/ref=sr_1_2');" >Eclipse Rich Client Platform: Designing, Coding, and Packaging Java(TM) Applications (Eclipse Series)</a></li>
<li>
<a  href="http://www.eclipse.org/articles/article.php?file=Article-DynamicCSH/index.html" onclick="javascript:pageTracker._trackPageview('/external/www.eclipse.org/articles/article.php');" >Dynamic User Assistance in Eclipse-Based Applications (Eclipse Article)</a></li>
<li>
<a  href="http://www.eclipse.org/articles/article.php?file=Article-AddingHelpToRCP/index.html" onclick="javascript:pageTracker._trackPageview('/external/www.eclipse.org/articles/article.php');" >Adding Help Support to a Rich Client Platform (RCP) Application (Eclipse Article)</a></li>
<li>
<a  href="http://www.eclipse.org/articles/Article-Online%20Help%20for%202_0/help1.htm" onclick="javascript:pageTracker._trackPageview('/external/www.eclipse.org/articles/Article-Online%20Help%20for%202_0/help1.htm');" >Contributing a little help (Eclipse Article)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2009/04/rcp-help-system/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Eclipse Ganymede and WSCompile incompatibility?</title>
		<link>http://www.techjava.de/topics/2009/02/ganymede-wscompile/</link>
		<comments>http://www.techjava.de/topics/2009/02/ganymede-wscompile/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 17:49:04 +0000</pubDate>
		<dc:creator>shuron</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[ganymede]]></category>
		<category><![CDATA[wscompile]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=270</guid>
		<description><![CDATA[I found strange problem running wscompile (from Sun&#8217;s Java Web Service Developer Pack 1.6) inside Ganymede (Eclipse Version 3.4.1). The run of the wscompile Ant task produce a problem. The build script execution freezes on the wscompile task. It prints the following message on console but then nothing happens.

[wscompile] wscompile ...\env\java\1.4.2_03\jre\bin\classpath-classpath D:\workspaces\general\lib\bla.bo-0.0.1.jar; ... D:\workspaces\general\lib\... jar.0.5.5

In [...]]]></description>
			<content:encoded><![CDATA[<p>I found strange problem running wscompile (from Sun&#8217;s Java Web Service Developer Pack 1.6) inside Ganymede (Eclipse Version 3.4.1). The run of the wscompile Ant task produce a problem. The build script execution freezes on the wscompile task. It prints the following message on console but then nothing happens.</p>
<pre class="brush: xml;">
[wscompile] wscompile ...\env\java\1.4.2_03\jre\bin\classpath-classpath D:\workspaces\general\lib\bla.bo-0.0.1.jar; ... D:\workspaces\general\lib\... jar.0.5.5
</pre>
<p>In this line, the classpath of wscompile is printed.</p>
<p>The build script uses configured Apache Ant in version 1.6.5. I tried to start it with Java in versions 1.4.2 und 1.6.0.10. Both works in Europa (Eclipse 3.3.x) but don&#8217;t work in Ganymede (Eclipse 3.4.x), except for the first run. It seems that Ganymede provides a different handling for Ant scripts. Every first start of an Ant build script produces new &#8220;External Tool Configuration&#8221; (if not already there). <strong>If this configuration already exists, wscompile task doesn&#8217;t work!</strong></p>
<p>This means my build script with wscompile task works only once, every first time after deleting the &#8220;External Tool Configuration&#8221;. I could live with that if I wouldn&#8217;t need that configuration. But I need that configuration to use different java version that is the workspace default.</p>
<p><strong>Do anyone know how to fix that?</strong><br />
Here is my task definiton.</p>
<pre class="brush: xml;">
&lt;taskdef name=&quot;wscompile&quot;
		classname=&quot;com.sun.xml.rpc.tools.ant.Wscompile&quot;
		classpathref=&quot;class.path.jwsdp&quot;
		/&gt;
</pre>
<p>and also task usage in the script</p>
<pre class="brush: xml;">
&lt;wscompile fork=&quot;true&quot; import=&quot;true&quot; base=&quot;java/class&quot; sourceBase=&quot;java/generated&quot; verbose=&quot;true&quot; features=&quot;documentliteral, wsi, searchschema, serializeinterfaces, explicitcontext&quot; mapping=&quot;java/generated/META-INF/jaxrpc-mapping.xml&quot; config=&quot;metadata/wsdl-config.xml&quot; xSerializable=&quot;true&quot;&gt;
	&lt;classpath&gt;
		&lt;path refid=&quot;class.path.local&quot; /&gt;
		&lt;path refid=&quot;class.path.ant&quot; /&gt;
		&lt;pathelement path=&quot;${java.class.path}&quot; /&gt;
	&lt;/classpath&gt;
&lt;/wscompile&gt;
</pre>
<p>Comments are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2009/02/ganymede-wscompile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hacking, Progmatic, Productive</title>
		<link>http://www.techjava.de/topics/2008/09/hacking-progmatic-productive/</link>
		<comments>http://www.techjava.de/topics/2008/09/hacking-progmatic-productive/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 14:12:49 +0000</pubDate>
		<dc:creator>Simon Zambrovski</dc:creator>
				<category><![CDATA[enterprise systems]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[adam bien]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[jughh]]></category>
		<category><![CDATA[lehmanns]]></category>

		<guid isPermaLink="false">http://www.techjava.de/?p=149</guid>
		<description><![CDATA[
Yesterday, 
the second 
Adam Bien event in 
Lehmanns Bookstore took place. Again, the event was a full success. I arrived half-an-hour earlier and got a seat only in the tenth row.
Adam spoke about new features of EJB 3.1 and Glassfish. He showed examples running on a developer build of Glassfish V3, promising that the features [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border: 1px solid black; margin: 5px;" title="AdamJUGHH" src="http://farm4.static.flickr.com/3275/2865301242_8935cb9ea7_m.jpg" alt="_MG_6980" width="120" height="180" /><img style="border: 1px solid black; margin: 5px;" src="http://farm4.static.flickr.com/3099/2865298698_0cb54c9bb2_m.jpg" alt="_MG_6978" width="120" height="180" /></p>
<p>Yesterday, 
<a  href="http://www.techjava.de/topics/2008/05/progmatic-java-ee-5-hacking/">the second</a> 
<a  href="http://www.techjava.de/topics/2008/09/productive-java-ee-6/">Adam Bien event</a> in 
<a  href="http://www.lob.de/cgi-bin/work/framesetneu?flag=new&amp;frame=yes&amp;id=48d1116c4905c" onclick="javascript:pageTracker._trackPageview('/external/www.lob.de/cgi-bin/work/framesetneu');" >Lehmanns Bookstore</a> took place. Again, the event was a full success. I arrived half-an-hour earlier and got a seat only in the tenth row.<br />
Adam spoke about new features of EJB 3.1 and Glassfish. He showed examples running on a developer build of Glassfish V3, promising that the features will work without exceptions&#8230;<br />
Here are some topics, I remember:</p>
<ul>
<li>Singleton Beans: usefull a s a central point of the application, e.G. central cache etc&#8230;</li>
<li>Async Methods: allows asynchronous execution of time-consuming methods. Especially, it is possible to abort the execution</li>
<li>Deploying Beans in WARs: could be helpful for small applications</li>
<li>Global JNDI-Namespace</li>
<li>No interface view: simplifies the access to beans, if needed</li>
<li>EJBCOntainer.getEJBContainer().getContext(): allows external initialization of bean context, which is nice for testing</li>
</ul>
<p>Later, 
<a  href="http://www.adam-bien.com/roller/abien/" onclick="javascript:pageTracker._trackPageview('/external/www.adam-bien.com/roller/abien/');" >Adam</a> discussed some 
<a  href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html" onclick="javascript:pageTracker._trackPageview('/external/java.sun.com/blueprints/corej2eepatterns/Patterns/index.html');" >Core J2EE patters</a>, that become absolete with EJB 3.1 and others which are still valid.</p>
<p>After the talk, I spoke with Adam about the 
<a  href="http://www.techjava.de/topics/2008/09/osgi-why-modularity-is-important/">OSGi</a> as a module architecture inside JEE application, which seems interesting to me.</p>
<p>The pictures are as usual available in my 
<a  href="http://flickr.com/photos/sza/sets/72157607337631878/" onclick="javascript:pageTracker._trackPageview('/external/flickr.com/photos/sza/sets/72157607337631878/');" >FlickR Gallery</a>.</p>
<p>Marco published a 
<a  href="http://www.loroma.com/loroma/movie.faces?movie=15503#Productive-Java-EE-6-1221891286879" onclick="javascript:pageTracker._trackPageview('/external/www.loroma.com/loroma/movie.faces');" >video on Loroma</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techjava.de/topics/2008/09/hacking-progmatic-productive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
