<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>English &#8211; Jiří Kratochvíl</title>
	<atom:link href="https://jiri.kratochvil.eu/tag/english/feed/" rel="self" type="application/rss+xml" />
	<link>https://jiri.kratochvil.eu</link>
	<description>Kráťovo občasník</description>
	<lastBuildDate>Mon, 21 Feb 2011 18:03:23 +0000</lastBuildDate>
	<language>cs</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7</generator>

<image>
	<url>https://jiri.kratochvil.eu/wp-content/uploads/2018/10/kratochvil-logo-100x100.png</url>
	<title>English &#8211; Jiří Kratochvíl</title>
	<link>https://jiri.kratochvil.eu</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">10187198</site>	<item>
		<title>Generated sources by JAXB and problem with encoding</title>
		<link>https://jiri.kratochvil.eu/generated-sources-by-jaxb-and-problem-with-encoding/</link>
					<comments>https://jiri.kratochvil.eu/generated-sources-by-jaxb-and-problem-with-encoding/#comments</comments>
		
		<dc:creator><![CDATA[Jiří Kratochvíl]]></dc:creator>
		<pubDate>Mon, 21 Feb 2011 18:03:23 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Návody]]></category>
		<category><![CDATA[Programování]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[linkedin]]></category>
		<guid isPermaLink="false">http://jiri.kratochvil.eu/?p=359</guid>

					<description><![CDATA[I recently had to solve the problem with JAXB to generate bad source from XSD. The problem was basically that the XSD source from which [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I recently had to solve the problem with JAXB to generate bad source from XSD. The problem was basically that the XSD source from which they were subsequently generated Java code contained in the tag <xs:documentation> Czech diacritics characters, and unfortunately, the output files were not generated in the UTF-8, but the native format of operating system of my laptop, which is MacCentralEurope.<br />
<span id="more-359"></span><br />
What hapened when I then started building my code with Maven, I obviously &#8211; I had got exception that the generated files contain non-UTF characters. So I started investigation how to force the JAXB to generate source code in UTF-8 instead of using platform specific encoding.</p>
<p>A quick look into the source code JAXB again assured me that JAXB is not (politely spoken) the best written piece of software because there is something like this:</p>
<pre lang="java">
private final CharsetEncoder encoder = EncoderFactory.createEncoder(bw.getEncoding());
</pre>
<p>This piece of code always returns encoder by platform depend encoding and there is no way, how to force different encoding and only one way is to tell JVM wat encoding is the right one.</p>
<p>Fortunately, the solution is easy. Just set the system variable MAVEN_OPTS like this:</p>
<pre lang="Bash">
export MAVEN_OPTS="$MAVEN_OPTS -Dfile.encoding=UTF-8"
</pre>
<p>What surprised me that this issue is not documented, and even Google could not help me. So I hope these few lines will help to someone.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jiri.kratochvil.eu/generated-sources-by-jaxb-and-problem-with-encoding/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">359</post-id>	</item>
		<item>
		<title>SSL in Jetty plug-in</title>
		<link>https://jiri.kratochvil.eu/ssl-in-jetty-plug-in/</link>
					<comments>https://jiri.kratochvil.eu/ssl-in-jetty-plug-in/#respond</comments>
		
		<dc:creator><![CDATA[Jiří Kratochvíl]]></dc:creator>
		<pubDate>Wed, 20 Oct 2010 06:00:11 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Návody]]></category>
		<category><![CDATA[Programování]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Tipy]]></category>
		<guid isPermaLink="false">http://jiri.kratochvil.eu/?p=342</guid>

					<description><![CDATA[Yesterday I had a chat with my colleague. We talked about how the Maven Jetty plug-ins enable SSL. In my last article I described how [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Yesterday I had a chat with my colleague. We talked about how the Maven Jetty plug-ins enable SSL. In my last article I described how to enable SSL in Tomcat, so now let&#8217;s see how to achieve the same result in the Jetty plugin.<br />
<span id="more-342"></span><br />
It is a few simple steps.</p>
<p>At first we have to create a keystore with a server certificate:</p>
<pre lang="bash">
keytool-genkey-alias-jetty6 keyalg RSA-keystore target / jetty-ssl.keystore-storepass changeit-keypass changeit-DNAME "CN = Your Domain Name"
</pre>
<p>Then modify the configuration of the Maven pom.xml:</p>
<pre lang="xml">
<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <configuration>
        <contextPath>/context</contextPath>
        <scanIntervalSeconds>5</scanIntervalSeconds>
        <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                <port>8080</port>
                <maxIdleTime>60000</maxIdleTime>
            </connector>
            <connector implementation="org.mortbay.jetty.security.SslSocketConnector">
                <port>8443</port>
                <maxIdleTime>60000</maxIdleTime>
                <keystore>${project.build.directory}/jetty-ssl.keystore</keystore>
                <password>changeit</password>
                <keyPassword>changeit</keyPassword>
            </connector>
        </connectors>
    </configuration>
</plugin>
</pre>
<p>In the previous configuration, we defined the connection on port 8080 and port 8443 for SSL connections.</p>
<p>If we did not want to manually generate a server certificate, you can use other Maven plugin as shown below.</p>
<pre lang="xml">
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>keytool-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <id>clean</id>
            <goals>
                <goal>clean</goal>
            </goals>
        </execution>
        <execution>
            <phase>generate-resources</phase>
            <id>genkey</id>
            <goals>
                <goal>genkey</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <keystore>${project.build.directory}/jetty-ssl.keystore</keystore>
        <dname>cn=localhost</dname>
        <keypass>changeit</keypass>
        <storepass>changeit</storepass>
        <alias>jetty6</alias>
        <keyalg>RSA</keyalg>
    </configuration>
</plugin>
</pre>
<p>Now, when we invoke <code>mvn jetty: run</code> command, plug-in automatically creates a certificate that is then used in Jetty.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jiri.kratochvil.eu/ssl-in-jetty-plug-in/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">342</post-id>	</item>
		<item>
		<title>How to enable HTTPS on Tomcat</title>
		<link>https://jiri.kratochvil.eu/https-on-tomcat/</link>
					<comments>https://jiri.kratochvil.eu/https-on-tomcat/#respond</comments>
		
		<dc:creator><![CDATA[Jiří Kratochvíl]]></dc:creator>
		<pubDate>Mon, 11 Oct 2010 09:12:41 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Návody]]></category>
		<category><![CDATA[Programování]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tomcat]]></category>
		<guid isPermaLink="false">http://jiri.kratochvil.eu/?p=332</guid>

					<description><![CDATA[In this article I would like to describe how to enable SSL support in Tomcat. Basically it is a few steps, but there will be [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article I would like to describe how to enable SSL support in Tomcat. Basically it is a few steps, but there will be recorded for cases when some of my colleague asked me <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
<span id="more-332"></span><br />
The first step is  creating a server certificate. It is possible to create in two different ways. Either you can create &#8222;self-signed certificate&#8220; or you can import certificate issued by some certification authority.</p>
<p>In this article we will create a self-signed certificate and then configure Tomcat to use the certificate. This configuration is enough for development.</p>
<p>For creating a server certificate, we will use <code>keytool</code> utility  of the JDK.</p>
<p>On Windows</p>
<pre lang="bash">%JAVA_HOME%binkeytool-genkey-alias tomcat-keyalg RSA</pre>
<p>On Linux</p>
<pre lang="bash">$JAVA_HOME/bin/keytool-genkey-alias tomcat-keyalg RSA</pre>
<p>Then uncomment the file server. (XML configuration file of Tomcat) this section:</p>
<pre lang="xml">
<!-- Define a SSL HTTP/1.1 Connector on port 8443          
        This connector uses the JSSE configuration, when using APR, the           
        connector should be using the OpenSSL style configuration           
       described in the APR documentation -->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
</pre>
<p>And thats all. Your server supports both in SLL and non-SSL connections.</p>
<h2>Forcing SSL</h2>
<p>In case you need to make all connections to your application has been secured with SSL, and even when a user enters the address only as <strong>http</strong> you can use the following. </p>
<p>Edit the web.xml file of your application by adding the following element:</p>
<pre lang="xml">
<security-constraint>
        <display-name>AppOverSSL</display-name>
        <web-resource-collection>
            <web-resource-name>
                ResourceName
            </web-resource-name>
            <url-pattern>/</url-pattern>
            <http-method>POST</http-method>
            <http-method>GET</http-method>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
</pre>
<p>Don&#8217;t forget to define right port number for SSL in your server.xml file in attribute <strong>redirectPort</strong> of element that is defined your unsecured connection:</p>
<pre lang="xml">
    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
</pre>
<p>Now when users use non-secured connection is redirected on HTTPS connection.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jiri.kratochvil.eu/https-on-tomcat/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">332</post-id>	</item>
		<item>
		<title>Problem with Java Server Faces on JDK 1.6</title>
		<link>https://jiri.kratochvil.eu/problem-with-java-server-faces-on-jdk-1-6/</link>
					<comments>https://jiri.kratochvil.eu/problem-with-java-server-faces-on-jdk-1-6/#respond</comments>
		
		<dc:creator><![CDATA[Jiří Kratochvíl]]></dc:creator>
		<pubDate>Tue, 21 Sep 2010 08:34:36 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Návody]]></category>
		<category><![CDATA[Programování]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Tipy]]></category>
		<guid isPermaLink="false">http://jiri.kratochvil.eu/?p=325</guid>

					<description><![CDATA[On my new project, I had a problem with the web application deployment, which consisted of the classic combination of Java Server Faces, Spring Framework, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>On my new project, I had a problem with the web application deployment, which consisted of the classic combination of Java Server Faces, Spring Framework, iBatis. I guess it was because I asked Google&#8217;s bad, but I spent it, how to solve this problem, some time, so they deserve an entry in my blog.</p>
<p>So what was the problem? Once I tried to deploy to Tomcat, I got this error message:</p>
<pre lang="inifile">
java.lang.ClassNotFoundException: [Ljava.lang.String;
at org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java: 1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java: 1491)
at com.sun.faces.config.ConfigureListener.configure (ConfigureListener.java: 635)
at com.sun.faces.config.ConfigureListener.configure (ConfigureListener.java: 422)
        ...
</pre>
<p>I tried various queries, but I was not successful. When I lost hope, I found the following link, which is described <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434149"> bug in JDK </a>.</p>
<p>Before I come across this error, because the last one was a web application to JDK 1.5, where everything works fine. So if anybody knows this bug, I offer the &#8222;official workaround.</p>
<p>Just pass the JVM startup parameter:</p>
<pre lang="shell">-Dsun.lang.ClassLoader.allowArraySyntax = true</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jiri.kratochvil.eu/problem-with-java-server-faces-on-jdk-1-6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">325</post-id>	</item>
	</channel>
</rss>
