<?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>Java Blog</title>
	<atom:link href="https://www.javablog.be/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.javablog.be</link>
	<description>Java tutorials and tips</description>
	<lastBuildDate>Mon, 23 Feb 2015 11:17:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.2</generator>
	<item>
		<title>request header field DNT not allowed by access-control-allow-headers</title>
		<link>https://www.javablog.be/request-header-field-dnt-allowed-access-control-allow-headers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=request-header-field-dnt-allowed-access-control-allow-headers</link>
				<comments>https://www.javablog.be/request-header-field-dnt-allowed-access-control-allow-headers/#respond</comments>
				<pubDate>Mon, 23 Feb 2015 11:17:18 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.javablog.be/?p=148</guid>
				<description><![CDATA[<p>On the Mobile Safari browser you can come across the error &#8216;Request header field DNT is not allowed by access-control-allow-headers&#8217; . We&#8217;ll explain how to fix this easily. When you&#8217;re doing an AJAX call to a different server (eg. api.javablog.be) then where the original page was loaded (eg. www.javablog.be); you&#8217;re essentially doing a cross domain AJAX &#8230; <a href="https://www.javablog.be/request-header-field-dnt-allowed-access-control-allow-headers/" class="more-link">Continue reading <span class="screen-reader-text">request header field DNT not allowed by access-control-allow-headers</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/request-header-field-dnt-allowed-access-control-allow-headers/">request header field DNT not allowed by access-control-allow-headers</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>On the Mobile Safari browser you can come across the error <em>&#8216;Request header field DNT is not allowed by access-control-allow-headers&#8217; . </em>We&#8217;ll explain how to fix this easily.</p>
<p>When you&#8217;re doing an AJAX call to a different server (eg. api.javablog.be) then where the original page was loaded (eg. www.javablog.be); you&#8217;re essentially doing a cross domain AJAX call. This is blocked by browser due to security reasons.</p>
<p>To support mashup style websites,  you can include a response header in the HTTP answer the server is sending:</p>
<pre style="color: #a9b7c6;"><span style="color: #6a8759;">Access-Control-Allow-Origin"</span><span style="color: #cc7832;">, </span><span style="color: #6a8759;">"*"</span></pre>
<p>The * means that any domain can send the AJAX call. It&#8217;s better to limit it to those domains which are allowed access.</p>
<p>Setting only this parameter is not enough to fix <em>Request header field DNT is not allowed by access-control-allow-headers. </em></p>
<p>You&#8217;ll also need to set the following headers on the server side HTTP response object:</p>
<pre style="color: #a9b7c6;"><span style="color: #6a8759;">Access-Control-Allow-Methods = </span><span style="color: #6a8759;">GET, POST, OPTIONS, DELETE
</span><span style="color: #6a8759;">Access-Control-Allow-Headers = </span><span style="color: #6a8759;">DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type, Accept-Language, Origin, Accept-Encoding
</span></pre>
<p>How you should set the HTTP response parameters depends on your server side technology; here are some helpful links for <a href="http://php.net/manual/en/function.header.php">PHP </a>and <a href="https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html">JAVA</a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/request-header-field-dnt-allowed-access-control-allow-headers/">request header field DNT not allowed by access-control-allow-headers</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/request-header-field-dnt-allowed-access-control-allow-headers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>svn: Error setting property svn ignore</title>
		<link>https://www.javablog.be/error-setting-property-svn-ignore/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=error-setting-property-svn-ignore</link>
				<comments>https://www.javablog.be/error-setting-property-svn-ignore/#respond</comments>
				<pubDate>Wed, 02 Oct 2013 19:02:19 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=131</guid>
				<description><![CDATA[<p>When using SVN you can come across the following error when committing your changes: org.tigris.subversio​n.javahl.ClientExcep​tion: Failed to execute WebDAV PROPPATCH svn: Commit failed (details follow): svn: At least one property change failed; repository is unchanged RA layer request failed svn: Error setting property 'ignore': Could not execute PROPPATCH. With TortoiseSVN you can fix this error &#8230; <a href="https://www.javablog.be/error-setting-property-svn-ignore/" class="more-link">Continue reading <span class="screen-reader-text">svn: Error setting property svn ignore</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/error-setting-property-svn-ignore/">svn: Error setting property svn ignore</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p><a href="http://javablog.be/wp-content/uploads/2013/10/subversion.png"><img class="alignleft size-full wp-image-132" alt="Solving svn ignore problems" src="http://javablog.be/wp-content/uploads/2013/10/subversion.png" width="468" height="64" srcset="https://www.javablog.be/wp-content/uploads/2013/10/subversion.png 468w, https://www.javablog.be/wp-content/uploads/2013/10/subversion-300x41.png 300w" sizes="(max-width: 468px) 100vw, 468px" /></a></p>
<p>When using SVN you can come across the following error when committing your changes:</p>
<p><code><br />
org.tigris.subversio​n.javahl.ClientExcep​tion: Failed to execute WebDAV PROPPATCH<br />
svn: Commit failed (details follow):<br />
svn: At least one property change failed; repository is unchanged<br />
RA layer request failed<br />
svn: Error setting property 'ignore':<br />
Could not execute PROPPATCH.<br />
</code></p>
<p>With <a href="http://tortoisesvn.net/">TortoiseSVN</a> you can fix this error by recreating the SVN ignore file.</p>
<p>Here is a detailed list:</p>
<ol>
<li>Go to your root SVN Repo folder</li>
<li>Choose TortoiseSVN -&gt; Properties</li>
<li>Delete the SVN .ignore file</li>
<li>When you now want to commit the SVN Repo root folder with TortoiseSVN, you&#8217;ll see all the directories which you have previously ignored. Here you can add them back to SVN ignore file if needed.</li>
</ol>
<p>Committing your work to SVN will now work again!</p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/error-setting-property-svn-ignore/">svn: Error setting property svn ignore</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/error-setting-property-svn-ignore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Debugging Weblogic Classloader issues with wls-cat</title>
		<link>https://www.javablog.be/weblogic-classloader-wls-cat/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=weblogic-classloader-wls-cat</link>
				<comments>https://www.javablog.be/weblogic-classloader-wls-cat/#respond</comments>
				<pubDate>Tue, 03 Sep 2013 18:50:14 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[classloader]]></category>
		<category><![CDATA[weblogic]]></category>
		<category><![CDATA[wls-cat]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=111</guid>
				<description><![CDATA[<p>One of the problems you come across when using Weblogic are Weblogic classloader issues. These can regularly happen because Weblogic itself uses a lot of frameworks, some of which you&#8217;re also using in your application EAR/WAR file. Sometimes you want to use a newer version of the library then the one in Weblogic and that&#8217;s &#8230; <a href="https://www.javablog.be/weblogic-classloader-wls-cat/" class="more-link">Continue reading <span class="screen-reader-text">Debugging Weblogic Classloader issues with wls-cat</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/weblogic-classloader-wls-cat/">Debugging Weblogic Classloader issues with wls-cat</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>One of the problems you come across when using Weblogic are Weblogic classloader issues. These can regularly happen because Weblogic itself uses a lot of frameworks, some of which you&#8217;re also using in your application EAR/WAR file. Sometimes you want to use a newer version of the library then the one in Weblogic and that&#8217;s when the problems start because your library comes later on the classpath.</p>
<h2>WLS CAT (Class Loader Analysis Tool)</h2>
<p>Fortunately there is a Web app wls-cat available by default in Weblogic (you don&#8217;t see it deployed in the Weblogic console though).</p>
<p>Below you can find a screenshot of wls-cat in action. When you analyze conflicts, the tool will spit-out all classes which are in conflict &#8211; eg. more then one version is on the classpath (EAR/WAR classpath + Weblogic classpath), but only one can be loaded in the JVM.</p>
<p><a href="http://javablog.be/wp-content/uploads/2013/08/wls-cat.png"><img class="alignleft size-full wp-image-112" alt="Solve Weblogic classloader issues with wls-cat" src="http://javablog.be/wp-content/uploads/2013/08/wls-cat.png" width="976" height="698" srcset="https://www.javablog.be/wp-content/uploads/2013/08/wls-cat.png 976w, https://www.javablog.be/wp-content/uploads/2013/08/wls-cat-300x214.png 300w" sizes="(max-width: 976px) 100vw, 976px" /></a></p>
<p>Once you have a list of the packages/classes in conflict, you have two options: either you can remove the duplicate jar from your EAR application, or you can instruct Weblogic to choose your version over the one bundled in Weblogic.</p>
<p>The latter option is configured via the META-INF/weblogic-application.xml file in your EAR file:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;prefer-application-packages&gt;
        &lt;package-name&gt;com.google.common.*&lt;/package-name&gt;
&lt;/prefer-application-packages&gt;
</pre>
<p>Configuring the options happens on package level. Now the nice thing about wls-cat is, that it also generates a ready-to-use prefer-application-packages xml element so you don&#8217;t need to create this list fully by hand by inspecting all the packages inside a conflicting library jar</p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/weblogic-classloader-wls-cat/">Debugging Weblogic Classloader issues with wls-cat</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/weblogic-classloader-wls-cat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>How to setup Eclipse WLST plugin</title>
		<link>https://www.javablog.be/how-to-setup-eclipse-wlst/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-setup-eclipse-wlst</link>
				<comments>https://www.javablog.be/how-to-setup-eclipse-wlst/#respond</comments>
				<pubDate>Mon, 02 Sep 2013 19:03:48 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[weblogic]]></category>
		<category><![CDATA[wlst]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=118</guid>
				<description><![CDATA[<p>The WebLogic Scripting Tool or in short WLST, is a command-line tool that you can use to automate Weblogic server installs and configuration of domains. This post will explain how to setup your Eclipse WLST development environment so you can write the scripts with code completion. WLST scripting environment The WLST scripting environment is based &#8230; <a href="https://www.javablog.be/how-to-setup-eclipse-wlst/" class="more-link">Continue reading <span class="screen-reader-text">How to setup Eclipse WLST plugin</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/how-to-setup-eclipse-wlst/">How to setup Eclipse WLST plugin</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>The WebLogic Scripting Tool or in short WLST, is a command-line tool that you can use to automate Weblogic server installs and configuration of domains. This post will explain how to setup your Eclipse WLST development environment so you can write the scripts with code completion.</p>
<h2>WLST scripting environment</h2>
<p>The WLST scripting environment is based on the Java scripting interpreter, <a href="http://www.jython.org">Jython</a>. To get access to the WebLogic scripting functions from your Eclipse IDE you&#8217;ll have to install the plugins Oracle has made available.</p>
<h2>What Does WLST Do?</h2>
<p>WLST lets you perform the following tasks:</p>
<ul>
<li>Retrieve and edit domain configuration and runtime information.</li>
<li>Automate domain configuration tasks and application deployment.</li>
<li>Control and manage the server life cycle.</li>
<li>Access the Node Manager and start, stop, and suspend server instances remotely or locally</li>
</ul>
<h2>Eclipse WLST configuration</h2>
<ol>
<li>Install Eclipse Kepler release with the Oracle Enterprise Pack for Eclipse (WTP) from <a href="http://download.oracle.com/otn_software/oepe/kepler/wtp/">http://download.oracle.com/otn_software/oepe/kepler/wtp/</a></li>
<li>Create a Weblogic Server runtime via Window -&gt; Show View -&gt; Servers</li>
<li>Click this link to create a new Server</li>
<li>Choose Oracle WebLogic Server 12c (12.1.2)</li>
<li>Enter the following parameters:
<ul>
<li>Weblogic Home: &lt;BEA_HOME&gt;\wlserver</li>
<li>Java Home: &lt;JAVA_HOME&gt;</li>
<li>Domain: &lt;WEBLOGIC_DOMAIN_DIR&gt;</li>
</ul>
</li>
</ol>
<h2>Verifying Eclipse WLST installation</h2>
<ol>
<li>Create a new Facet Project in Eclipse</li>
<li>Add the Facet Weblogic Scripting Tools (WLST)</li>
<li>Click on Further configuration required, click OK</li>
<li>If you go to Window -&gt; Preferences -&gt; PyDev -&gt; Interpreter Jython, you should now see something similar as below:</li>
</ol>
<p><a href="http://javablog.be/wp-content/uploads/2013/09/weblogic-wlst-interpreter.png"><img class="alignleft size-full wp-image-120" alt="weblogic-wlst-interpreter" src="http://javablog.be/wp-content/uploads/2013/09/weblogic-wlst-interpreter.png" width="712" height="225" srcset="https://www.javablog.be/wp-content/uploads/2013/09/weblogic-wlst-interpreter.png 712w, https://www.javablog.be/wp-content/uploads/2013/09/weblogic-wlst-interpreter-300x94.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/how-to-setup-eclipse-wlst/">How to setup Eclipse WLST plugin</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/how-to-setup-eclipse-wlst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Solving @inject null pointer exception</title>
		<link>https://www.javablog.be/inject-nullpointerexception/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=inject-nullpointerexception</link>
				<comments>https://www.javablog.be/inject-nullpointerexception/#comments</comments>
				<pubDate>Mon, 26 Aug 2013 19:16:49 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[cdi]]></category>
		<category><![CDATA[inject]]></category>
		<category><![CDATA[NullPointerException]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=108</guid>
				<description><![CDATA[<p>Getting a NullPointerException on @Inject ? In this post we&#8217;ll post a few possible solutions and things to check, that could explain the @inject null pointer exception. Make sure your archive (jar, war, &#8230;) has a beans.xml file defined The beans.xml file is known as the bean archive descriptor. Below you can find the most &#8230; <a href="https://www.javablog.be/inject-nullpointerexception/" class="more-link">Continue reading <span class="screen-reader-text">Solving @inject null pointer exception</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/inject-nullpointerexception/">Solving @inject null pointer exception</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>Getting a NullPointerException on @Inject ? In this post we&#8217;ll post a few possible solutions and things to check, that could explain the @inject null pointer exception.</p>
<h2>Make sure your archive (jar, war, &#8230;) has a beans.xml file defined</h2>
<p>The beans.xml file is known as the bean archive descriptor. Below you can find the most simple example with just a root beans xml element:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans 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/beans_1_0.xsd&quot;&gt;
&lt;/beans&gt;
</pre>
<p>This file should be placed into META-INF/beans.xml or WEB-INF/beans.xml.<br />
If you don&#8217;t include this file in your module archive, CDI injection will not be active for this archive as the container will not scan the archive.</p>
<p>There are a few reasons why the spec was done this way:</p>
<ul>
<li>Performance: The container only has to scan the modules where you&#8217;ve added the beans.xml</li>
<li>The beans.xml also lets you <a href="http://www.seamframework.org/Documentation/WhatIsBeansxmlAndWhyDoINeedIt">define interceptors and decorators</a> that have to be executed when the injection takes place.</li>
</ul>
<h2>When using CDI in some places, you have to use it everywhere</h2>
<p>In CDI, the container manages the lifecycle of the objects it creates via the @Inject. What this means is that if you bundle a bean with an injected dependency into another object, the other object also has to be managed by CDI. Doing a new OtherObject() will not work; at least the @Inject will not be done.</p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/inject-nullpointerexception/">Solving @inject null pointer exception</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/inject-nullpointerexception/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
							</item>
		<item>
		<title>How to enable Java Web Start log</title>
		<link>https://www.javablog.be/enable-java-web-start-log/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enable-java-web-start-log</link>
				<comments>https://www.javablog.be/enable-java-web-start-log/#respond</comments>
				<pubDate>Wed, 14 Aug 2013 07:16:11 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[java web start]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=105</guid>
				<description><![CDATA[<p>When you&#8217;re debugging a Java Web Start client, it can be useful to get the Java Web Start Log. This is actually quite easy to accomplish: Go to your Java Control Panel (on Windows: Control Panel -> Java) Click on the tab Advanced Under the debugging heading, enable Enable Tracing and Enable Logging Under Java &#8230; <a href="https://www.javablog.be/enable-java-web-start-log/" class="more-link">Continue reading <span class="screen-reader-text">How to enable Java Web Start log</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/enable-java-web-start-log/">How to enable Java Web Start log</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>When you&#8217;re debugging a <a href="http://docs.oracle.com/javase/tutorial/deployment/webstart/">Java Web Start</a> client, it can be useful to get the Java Web Start Log.</p>
<p>This is actually quite easy to accomplish:</p>
<ol>
<li>Go to your Java Control Panel (on Windows: Control Panel -> Java)</li>
<li>Click on the tab <em>Advanced</em></li>
<li>Under the debugging heading, enable <em>Enable Tracing</em> and <em>Enable Logging</em></li>
<li>Under Java console, choose <em>Show Console</em></li>
</ol>
<p>Now you can launch your Java webstart application again by clicking on the JNLP file, and you&#8217;ll get the logging in the Java console.</p>
<p><a href="http://javablog.be/wp-content/uploads/2013/08/java-web-start-log.png"><img src="http://javablog.be/wp-content/uploads/2013/08/java-web-start-log.png" alt="java-web-start-log" width="439" height="476" class="size-full wp-image-106" srcset="https://www.javablog.be/wp-content/uploads/2013/08/java-web-start-log.png 439w, https://www.javablog.be/wp-content/uploads/2013/08/java-web-start-log-276x300.png 276w" sizes="(max-width: 439px) 100vw, 439px" /></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/enable-java-web-start-log/">How to enable Java Web Start log</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/enable-java-web-start-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Maven version contains expression but should be a constant</title>
		<link>https://www.javablog.be/maven-version-contains-expression/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=maven-version-contains-expression</link>
				<comments>https://www.javablog.be/maven-version-contains-expression/#comments</comments>
				<pubDate>Wed, 14 Aug 2013 06:57:21 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=103</guid>
				<description><![CDATA[<p>In the following example Maven 3 will output a warning Maven version contains expression but should be a constant. This is because we use the expression ${project.parent.version} in the version tag of this Maven module. So why is Maven complaining about Maven version contains an expression ? It doesn&#8217;t make much sense to make this &#8230; <a href="https://www.javablog.be/maven-version-contains-expression/" class="more-link">Continue reading <span class="screen-reader-text">Maven version contains expression but should be a constant</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/maven-version-contains-expression/">Maven version contains expression but should be a constant</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>In the following example <a href="http://maven.apache.org/">Maven 3</a> will output a warning <strong>Maven version contains expression but should be a constant</strong>. This is because we use the expression ${project.parent.version} in the version tag of this Maven module.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;parent&gt;
   &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
   &lt;artifactId&gt;myapp&lt;/artifactId&gt;
   &lt;version&gt;5.0.0-SNAPSHOT&lt;/version&gt;
&lt;/parent&gt;

&lt;groupId&gt;com.mycompany&lt;/groupId&gt;
&lt;artifactId&gt;myAppEar&lt;/artifactId&gt;
&lt;version&gt;${project.parent.version}&lt;/version&gt;
</pre>
<h2>So why is Maven complaining about <strong>Maven version contains an expression ?</strong></h2>
<p><a href="http://javablog.be/wp-content/uploads/2013/08/maven-logo.png"><img class="alignleft size-full wp-image-104" alt="Maven version contains an expression" src="http://javablog.be/wp-content/uploads/2013/08/maven-logo-e1376463069666.png" width="150" height="37" /></a> It doesn&#8217;t make much sense to make this version non-static, because the maven-release-plugin will automatically update it when doing a release. (eg. when it will change). Make the pom.xml the master of the version tag, not some other file; this will make your life easier when you start eg. using the maven-release-plugin (no need for special configuration)</p>
<p>If you want to use the parent pom version in sub-modules, you can remove it, because the sub-module will automatically inherit the version of the parent if it is ommitted.</p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/maven-version-contains-expression/">Maven version contains expression but should be a constant</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/maven-version-contains-expression/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
		<item>
		<title>Unsupported IClasspathEntry kind=4 when Updating Maven project</title>
		<link>https://www.javablog.be/unsupported-iclasspathentry-kind4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unsupported-iclasspathentry-kind4</link>
				<comments>https://www.javablog.be/unsupported-iclasspathentry-kind4/#respond</comments>
				<pubDate>Mon, 12 Aug 2013 13:22:27 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=101</guid>
				<description><![CDATA[<p>When updating a Maven project you can come accross the error Unsupported IClasspathEntry kind=4. This is due to a bug in m2e, which can manifest itself when using the m2e plugin on a project that has generated Eclipse project settings via the Maven maven-eclipse-plugin Solving Unsupported IClasspathEntry kind=4 Install the latest version of the m2e &#8230; <a href="https://www.javablog.be/unsupported-iclasspathentry-kind4/" class="more-link">Continue reading <span class="screen-reader-text">Unsupported IClasspathEntry kind=4 when Updating Maven project</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/unsupported-iclasspathentry-kind4/">Unsupported IClasspathEntry kind=4 when Updating Maven project</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>When updating a Maven project you can come accross the error <strong>Unsupported IClasspathEntry kind=4</strong>. This is due to <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=394042">a bug in m2e</a>, which can manifest itself when using the m2e plugin on a project that has generated Eclipse project settings via the <a href="http://maven.apache.org/plugins/maven-eclipse-plugin/">Maven maven-eclipse-plugin</a></p>
<h2>Solving Unsupported IClasspathEntry kind=4</h2>
<p><a href="http://javablog.be/wp-content/uploads/2013/08/m2e.png"><img class="size-full wp-image-102 alignnone" alt="Unsupported IClasspathEntry kind=4" src="http://javablog.be/wp-content/uploads/2013/08/m2e.png" width="120" height="64" /></a></p>
<ol>
<li>Install the latest version of the <a href="http://eclipse.org/m2e/download/">m2e plugin</a> &#8211; which adds Maven functionality into Eclipse.</li>
<li>Disable the maven nature of the project (right-click on the project)</li>
<li>Run mvn eclipse:clean (right click on the project -&gt; Run As -&gt; Maven build .. -&gt; Goals: eclipse:clean)</li>
<li>Re-enable the maven nature by right-clicking on the project and choosing <em>Configure</em>-&gt; <em>Convert to Maven Project</em></li>
<li>Don&#8217;t run maven-eclipse-plugin</li>
</ol>
<p>The post <a rel="nofollow" href="https://www.javablog.be/unsupported-iclasspathentry-kind4/">Unsupported IClasspathEntry kind=4 when Updating Maven project</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/unsupported-iclasspathentry-kind4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>How to unit test EJB3 without a container</title>
		<link>https://www.javablog.be/unit-test-ejb3-without-container/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unit-test-ejb3-without-container</link>
				<comments>https://www.javablog.be/unit-test-ejb3-without-container/#respond</comments>
				<pubDate>Mon, 12 Aug 2013 09:06:59 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[tomee]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=89</guid>
				<description><![CDATA[<p>Unit test EJB3 without a container has become much easier since the EJB 3.1 spec with the introduction of the embeddable EJBContainer concept. An embeddable EJBContainer is a container for enterprise beans that does not require a Java EE server to run. Interesting usage scenarios are: EJB unit testing: you don&#8217;t need to install a &#8230; <a href="https://www.javablog.be/unit-test-ejb3-without-container/" class="more-link">Continue reading <span class="screen-reader-text">How to unit test EJB3 without a container</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/unit-test-ejb3-without-container/">How to unit test EJB3 without a container</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>Unit test EJB3 without a container has become much easier since the EJB 3.1 spec with the introduction of the embeddable EJBContainer concept. An embeddable EJBContainer is a container for enterprise beans that does not require a Java EE server to run.</p>
<p>Interesting usage scenarios are:</p>
<ul>
<li>EJB unit testing: you don&#8217;t need to install a JavaEE server for EJB development, unit testing and deployment to the container</li>
<li>Lightweight: the embeddable container has a much smaller footprint</li>
<li>Fast: starts faster than the full server, because it only initializes EJB-related components</li>
</ul>
<h2>Sample code</h2>
<p>Below you can find a simple setup method for a JUnit test that configures the Embeddable EJBContainer.</p>
<pre class="brush: java; title: ; notranslate">
@Before
public void setup() {
	Properties properties = new Properties();
	properties.setProperty(EJBContainer.MODULES, &quot;myModule&quot;);
	properties.put(EJBContainer.PROVIDER, &quot;tomee-embedded&quot;);
	Context context = EJBContainer.createEJBContainer().getContext();
}

@After
public void tearDown() throws NamingException {
	ejbContainer.close();
}
</pre>
<p>Here myModule is the module-name defined in ejb-jar.xml file</p>
<p>So how does the EJBContainer start an embedded EJB container? You&#8217;ll need to provide an embedded EJB container on the classpath. Normally all Application servers supporting JavaEE6 have to provide such an embedded EJB container.</p>
<p><a href="http://javablog.be/wp-content/uploads/2013/08/apache-tomee-e1376298562632.png"><img src="http://javablog.be/wp-content/uploads/2013/08/apache-tomee-e1376298951614.png" alt="Apache TomEE container" width="150" height="45" class="alignleft size-full wp-image-99" /></a> This example uses <a href="http://tomee.apache.org/apache-tomee.html">Apache TomEE</a> as it provides an easy way to specify the correct dependencies via Maven.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;dependency&gt;
	&lt;groupId&gt;org.apache.openejb&lt;/groupId&gt;
	&lt;artifactId&gt;tomee-embedded&lt;/artifactId&gt;
	&lt;version&gt;1.5.2&lt;/version&gt;
&lt;/dependency&gt;            
</pre>
<pre class="brush: xml; title: ; notranslate">
&lt;dependency&gt;
	&lt;groupId&gt;javax&lt;/groupId&gt;
	&lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
	&lt;version&gt;6.0&lt;/version&gt;
	&lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;
</pre>
<p>The properties.put(EJBContainer.PROVIDER, &#8220;tomee-embedded&#8221;) makes sure that we will use Apache TomEE when running the test. (even if there is another provider on the classpath)</p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/unit-test-ejb3-without-container/">How to unit test EJB3 without a container</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/unit-test-ejb3-without-container/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Ambiguous dependencies for type problem fix</title>
		<link>https://www.javablog.be/ambiguous-dependencies-for-type-fix/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ambiguous-dependencies-for-type-fix</link>
				<comments>https://www.javablog.be/ambiguous-dependencies-for-type-fix/#respond</comments>
				<pubDate>Fri, 09 Aug 2013 07:58:43 +0000</pubDate>
		<dc:creator><![CDATA[Wim Bervoets]]></dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[cdi]]></category>
		<category><![CDATA[weblogic]]></category>
		<category><![CDATA[weld]]></category>

		<guid isPermaLink="false">http://javablog.be/?p=94</guid>
				<description><![CDATA[<p>When trying to @Inject an EJB inside a bean, it is possible that you&#8217;ll get an exception about ambiguous dependencies for type on Weblogic: Substituted for the exception org.jboss.weld.exceptions.DeploymentException which lacks a String contructor, original message - Exception List with 2 exceptions: Exception 0 : org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ABC] with qualifiers [@Default] at &#8230; <a href="https://www.javablog.be/ambiguous-dependencies-for-type-fix/" class="more-link">Continue reading <span class="screen-reader-text">Ambiguous dependencies for type problem fix</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/ambiguous-dependencies-for-type-fix/">Ambiguous dependencies for type problem fix</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></description>
								<content:encoded><![CDATA[<p>When trying to @Inject an EJB inside a bean, it is possible that you&#8217;ll get an exception about <strong>ambiguous dependencies for type</strong> on Weblogic:</p>
<p><a href="http://javablog.be/wp-content/uploads/2013/08/Oracle-WebLogic-e1376032392215.png"><img class=" wp-image-95 alignleft" alt="Oracle WebLogic Logo" src="http://javablog.be/wp-content/uploads/2013/08/Oracle-WebLogic-300x300.png" width="210" height="210" /></a></p>
<p><code>Substituted for the exception org.jboss.weld.exceptions.DeploymentException which lacks a String contructor, original message - Exception List with 2 exceptions: Exception 0 : org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ABC] with qualifiers [@Default] at injection point [[field] @Inject private ABCField]. Possible dependencies [[Session bean [class ABCImpl with qualifiers [@Any @Default]; local interfaces are [ABC], Managed Bean [class ABCImpl_7pbnr4_Impl] with qualifiers [@Any @Default]]]\<br />
</code></p>
<h2>Solving the Ambiguous dependencies for type problem</h2>
<p>The problem is that there are two possible implementations to inject and the CDI container doesn&#8217;t know which one to choose. You can also see that there seems to be a proxied/generated class to be listed (in our example ABCImpl_7pbnr4_Impl).</p>
<p>In our case this generated class was created by the Weblogic appc tool which was run on our EAR file. This ear file includes a JAR with EJB 2.x beans and another one with EJB 3.x beans&lt;.</p>
<p>We solved this problem by not letting Weblogic appc being run on our EJB3.x jar. You can do this by running the Weblogic appc on individual jar files instead of the ear file. As you probably know EJB3 style beans don&#8217;t need an ejb compiler anymore to generate the remote and local interfaces as everything can be done with annotations.</p>
<p>PS: Weblogic uses <a href=" http://www.seamframework.org/Weld">Weld</a>, the reference implementation of  Contexts and Dependency Injection in JavaEE.</p>
<p>The post <a rel="nofollow" href="https://www.javablog.be/ambiguous-dependencies-for-type-fix/">Ambiguous dependencies for type problem fix</a> appeared first on <a rel="nofollow" href="https://www.javablog.be">Java Blog</a>.</p>
]]></content:encoded>
							<wfw:commentRss>https://www.javablog.be/ambiguous-dependencies-for-type-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
