Friday, December 6, 2013

DbUnit WARN in logs "Extra columns on line 2. Those columns will be ignored."

WARN dbunit.dataset.xml.FlatXmlProducer - Extra columns on line 2.  Those columns will be ignored.
WARN dbunit.dataset.xml.FlatXmlProducer - Please add the extra columns to line 1, or use a DTD to make sure the value of those columns are populated or specify 'columnSensing=true' for your FlatXmlProducer.
WARN dbunit.dataset.xml.FlatXmlProducer - See FAQ for more details.

Problem was in XML file which defined data that should be loaded to database. Here is simplified version:

 <user id_user="1"/>

 <user id_user="2" login="john" />

Problem was in parameter columnSensing. During reading XML data with FlatXmlProducer parameter columnSensing was defined as false or wasn't defined which is treated as false. Let's look at meaning of columnSensing parameter.

This parameter define which columns will be inserted into tables. When parameter columnSensing is falseDbUnit reads xml elements defining data one by one. When new element is detected that all attribute are considered as column names. Next time when element with same name is found inserted into database table are just already columns. When columnSensing is true than columns will be inserted into database table even if they are not defined in first XML element.

Solution 1.

First solution of previous example is quite easy just set columnSensing parameter to true.

Solution 2.

It's also really straightforward reorder XML elements:

 <user id_user="2" login="john" />

 <user id_user="1"/>

Solution 3.

In more complex XML files previous solutions can't be used, so define in first XML element as null. So it should like this:

 <user id_user="1" login ="[NULL]"/>

 <user id_user="2" login="john" />

DbUnit doesn't understand null value as null value. There have to be piece of code that learn DbUnit [NULL] value:

IDataSet dataSet = new FlatXmlDataSet(new FileInputStream("dataset.xml"));
ReplacementDataSet finalDataSet = new ReplacementDataSet(dataSet);
finalDataSet.addReplacementObject("[NULL]", null);

I don't know if it's DbUnit error or some misinterpretation of my XML file but DbUnit detect problem at line 1 or 2 even if real problem occurs many lines after.

Thursday, December 5, 2013

guava Files - unable to delete temporaly directory

I had strange problem on my Mac. Following code:
File indexBaseFile = com.google.common.io.Files.createTempDir();

... some creating of files inside directory

Files.deleteRecursively(indexBaseFile);
always ends with following exception:
java.io.IOException: Failed to delete /var/folders/c5/j25r9j1j1jx_t4wzrzmf53300000gn/T/1386264920188-0
 at com.google.common.io.Files.deleteRecursively(Files.java:537)
The trick is that guava library before deleting file check that deleted file is not a symbolic link. On Mac /var is pointing to /private/var. So now to fix this problem was easy:
File indexBaseFile = com.google.common.io.Files.createTempDir().getAbsolutePath();

... some creating of files inside directory

Files.deleteRecursively(indexBaseFile);
There is extra .getAbsolutePath() calling. This method return absolute path with resolved symbolic links.

Tapestry 5 Invalid configuration

I met following configuration exception in logs:
Caused by: java.lang.IllegalArgumentException: Service 'ChangeLogProcessor' is configured using 
org.apache.tapestry5.ioc.OrderedConfiguration, not org.apache.tapestry5.ioc.Configuration.
 at org.apache.tapestry5.ioc.internal.util.WrongConfigurationTypeGuard.findResource(WrongConfigurationTypeGuard.java:40)
 at org.apache.tapestry5.ioc.internal.util.DelegatingInjectionResources.findResource(DelegatingInjectionResources.java:36)
 at org.apache.tapestry5.ioc.internal.util.DelegatingInjectionResources.findResource(DelegatingInjectionResources.java:38)

Problem was related to Tapestry 5 chain of commands builder. It's Tapestry 5 build-in service that helps to implement that design pattern. My chain of commands definition was:
public static ChangeLogProcessor buildChangeLogProcessor(List<ChangeLogProcessor> commands,
    @InjectService("ChainBuilder") ChainBuilder chainBuilder) {
    return chainBuilder.build(ChangeLogProcessor.class, commands);
}

public static void contributeChangeLogProcessor(
    final Configuration<ChangeLogProcessor> configuration,
    final @Autobuild ChangeLogBoxProcessor changeLogBoxProcessor) {
    configuration.add(changeLogBoxProcessor);
}
After some time I found that problem was in contribute method, in build method is configuration defined as List which should be in contribute method defined as OrderedConfiguration not as Configuration. So following corrected code works fine:
public static void contributeChangeLogProcessor(
    final OrderedConfiguration<ChangeLogProcessor> configuration,
    final @Autobuild ChangeLogBoxProcessor changeLogBoxProcessor) {
    configuration.add("boxProcessor", changeLogBoxProcessor);
}

Monday, November 4, 2013

Apache HTTPD and Tomcat configuration

I run some application at linux server. It's quite simple installation but sometimes it's difficult for me to remember why it's configure in such way. This post helps me to understand current state. Hopefully it will be useful for someone else.
Server is just one linux box with CentOS. There are no dependencies to other nodes or services. It's really simple.
On server is installed Apache HTTPD service. Service could be started stopped via commands /etc/init.d/https {stop|start| ...}. Among others apache contains module mod_jk which is responsible for communication with AJP protocol load balancing and other stuff. Closer description of mod_jk could be found at http://tomcat.apache.org/connectors-doc/. The reason why I need Apache HTTPS in front of Tomcat server is that I need more tomcats for different hosted domains and Apache HTTPD server is used also for PHP. Connection between Apache HTTPD server and Tomcat servers is at following image.
Applications are also split between few linux system accounts. It's because of security.
Now let's look at configuration of Apache HTTPD:

<VirtualHost *:80>
   ServerName www.domain2.com 
   ServerAlias *.domain2.com
   ServerAlias *.domain3.com
   ErrorLog /var/log/httpd/domain2.com.err.log
   CustomLog /var/log/httpd/domain2.com.log combined

   <Proxy *>
     AddDefaultCharset Off
     Order deny,allow
     Allow from all
   </Proxy>
 
   ProxyPass / ajp://localhost:7001/
   ProxyPassReverse / ajp://localhost:7001/
</VirtualHost>


<VirtualHost *:80>
   ServerName www.domain1.com
   ServerAlias *domain1.com
   ErrorLog /var/log/httpd/domain1.com.err.log
   CustomLog /var/log/httpd/domain1.com.log combined

   <Proxy *>
     AddDefaultCharset Off
     Order deny,allow
     Allow from all
   </Proxy>
 
   ProxyPass / ajp://localhost:7005/
   ProxyPassReverse / ajp://localhost:7005/
</VirtualHost>
Finally there have to be some configuration at Tomcats side. Here is configuration from tomcat2 ./conf/server.xml file:
<Connector port="7001" protocol="AJP/1.3" redirectPort="8443" />

<Engine name="Catalina" defaultHost="www.domain2.com">

<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>

    <Host name="repo.domain2" appBase="domain/repo.domain2.com"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
    </Host>

    <Host name="www.domain2.com" appBase="domain/www.domain2.com"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
        <Alias>domain2.com</Alias>
    </Host>

    <Host name="www.domain3.com" appBase="domain/www.domain3.com"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
        <Alias>domain2.com</Alias>
    </Host>

</Engine>

curl - GET single file

Curl is simple yet powerful tool for creating HTTP and FTP requests of all kind. I have permanent problem with simple getting file with curl and storing in to file system. This little post should remember it to me. Basically works like this:
curl -v --location --max-redirs 10 \
 --output install_1.3.0.sql \
 http://somesite.com/somefile.sql
One trick is to use --location which tell to curl to follow redirects until number of redirect reach value specified in --max-redirs. Second trick is to specify output file in --output. When output file is not specified retrieved data are send to console (STDOUT).

Monday, October 14, 2013

Compile maven project for Java 1.4

I had problem with configuring maven. I want to compile some project to Java 1.4. After some I found following configuration which is really working:

<!--
  Strictly speaking, we did not need to generate this for you from
  the prototype, but we use it to illustrate how you can get
  the JDK 6 Java compiler to accept 1.5 or 1.6 targeted source code
  but produce class files that are compatible with JRE 1.4. As
  Michael Caine might not say, "Not a lot of people know that!"
  -->
<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.0.2</version>
    <configuration>
        <source>1.6</source>
        <target>jsr14</target>
        <sourceDirectory>src</sourceDirectory>
    </configuration>
</plugin>

It's not my idea. I wrote down this example long time ago. Now I can't found place where I originally found it. Sorry.

Wednesday, October 2, 2013

Linux server response times

Before few days I had problem with response times on linux server. I use CentOS. There is apache HTTPD covering about 5 tomcat instances. Inside tomcat instances are 7 different application. Main problem was incredibly slow responses from all pages. When I logged in I seen this:
top - 22:37:01 up 104 days,  7:59,  1 user,  load average: 3.59, 5.09, 3.33
Tasks: 103 total,   1 running, 102 sleeping,   0 stopped,   0 zombie
Cpu(s): 15.7%us,  0.1%sy,  0.0%ni, 84.1%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1018236k total,   988976k used,    29260k free,     1012k buffers
Swap:  2064344k total,  1031440k used,  1032904k free,    20592k cached

meaning of wa is waiting for I/O to complete. I also tried to order processes in top command by used memory "shift + f" and press n and than Enter. After that I run following:

ps axf show among other following problem:

 5627 ?        Ss     0:03 /usr/sbin/httpd
...
10289 ?        D      0:00  \_ /usr/sbin/httpd

It says that HTTPD is waiting for finishing disk IO operation. After checking memory consumption 988976k + 1031440k was clear that all tomcats eat about 2 Gb of memory and there is only 1 Gb of physical memory.

Than it was simple I just reconfigured all tomcats, so now I have just two. One is for critical application and second one contains all resting applications. And after restart response times are again good.

Sunday, September 1, 2013

maven site-deploy - [ERROR] Unsupported protocol: 'scp'

During executing
mvn site-deploy
I met strange error.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:2.4:deploy (default-deploy) on project 
cubiculus-interface: Unsupported protocol: 'scp': Cannot find wagon which supports the requested protocol: scp: java.util.NoSuchElementException
I didn't found anything about this problem on net. So hopefully it will by useful for someone. My problem was in maven-site-plugin which was in version 2.4. This works fine with maven 2.* but not with maven 3.*. Solution is to remove plugin explicit versioning or use version 3.2 like this:

 maven-site-plugin
 3.2

Friday, August 30, 2013

svn: E160005: Invalid control character '0x08' in path 'dist.xml'

When following errors appears during SVN committing:
svn: E160005: Invalid control character '0x08' in path 'dist.xml'
than problem is 'dist.xml' file name. File name contains some invisible character that cause this problem. Solution is to rename file.

Saturday, June 1, 2013

BLOB/TEXT column 'description' used in key specification without a key length

This post is not about solving some problem. Sadly I don't know hot to solve following problem. There are just work arounds. I have following configuration:
MySQL: 5.5.27
hibernate dialect: org.hibernate.dialect.MySQLInnoDBDialect
hibernate: 3.6.9
In my model I have entity with following attribute:
@Entity
@Table(name = "site")
public class Site extends AbstractEntity {
    
    ...
     
    @Column(unique = true, nullable = true, length = 1024 * 100)
    private String description;
    
    ...
     
}
When I run program follow error appears in logs and table site is not created.
2013-06-01 12:15:24 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - 
Unsuccessful: create table site (id_site integer not null auto_increment, description longtext unique, name varchar(250) unique, url_pattern longtext not null unique, id_image integer, primary key (id_site)) ENGINE=InnoDB
2013-06-01 12:15:24 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - 
BLOB/TEXT column 'description' used in key specification without a key length
Problem is that column 'description' is marked as unique. In InnoDB maximum length of key could be just 767 characters for a single-byte charset like LATIN1 and only 255 characters for UTF8. Look at possible workarounds:
  1. avoid indexes, don't use unique = true
  2. make column length smaller (255) characters for UTF8
  3. compute hash from long column store in in another column and create index on hash column


If you'll have some other possible solution than please let me know.

Wednesday, May 22, 2013

Useful MySQL commands

This is not MySQL tutorial. It's just list of useful SQL statements that I don't remember and I don't want to google them anymore. SQL commanda are also in basic form. For more detail see original MySQL documentation.

Create new user with login name 'userName' with password 'passwd'. Created use have access to all tables in database 'testDb'.

GRANT ALL PRIVILEGES ON testDb.* TO 'userName'@'host' IDENTIFIED BY 'passwd';

Create new database with default text columns encoding.

CREATE SCHEMA `testDb` DEFAULT CHARACTER SET utf8 ;

Set password for user 'sa' accessing from localhost to 'be'.

SET PASSWORD FOR sa@localhost = PASSWORD('be');

Create SQL file containing all data form database. It's useful for creating backups and for copying data from one db into another one.

mysqldump --add-drop-table -u sa -psa bl > bl.sql

Tuesday, May 21, 2013

jetty-maven-plugin - ERROR: Cannot override read-only parameter: contextPath in goal: jetty:run

Following error started appear in logs:
[artifact:mvn] [INFO] [compiler:testCompile {execution: default-testCompile}]
[artifact:mvn] [INFO] No sources to compile
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [ERROR] BUILD ERROR
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] Error configuring: org.mortbay.jetty:jetty-maven-plugin. Reason: ERROR: Cannot override read-only parameter: contextPath in goal: jetty:run
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] For more information, run Maven with the -e switch
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] Total time: 10 seconds
[artifact:mvn] [INFO] Finished at: Tue May 21 14:00:42 CEST 2013
[artifact:mvn] [INFO] Final Memory: 44M/91M

Problem is in pom.xml in jetty-maven-plugin configuration. If there is:

    <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>8.1.5.v20120716</version>
        <configuration>
            <webAppSourceDirectory>${webappDirectory}</webAppSourceDirectory>
            <contextPath>/admin</contextPath>
            ...
        </configuration>
    </plugin>

Than problem is in maven jetty plugin configuration. According to current jetty configuration tag contextPath should be placed inside tag webAppConfig. See following example:

    <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>8.1.5.v20120716</version>
        <configuration>
            <webAppSourceDirectory>${webappDirectory}</webAppSourceDirectory>
            <webAppConfig>
                <contextPath>/admin</contextPath>
            </webAppConfig>
            ...
        </configuration>
    </plugin>

Also see original maven jetty plugin configuration documentation at http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin.

Friday, May 17, 2013

BRMS 5.3.1 Exception "Could not find work item handler for"

At the veri beginning of my trying BRMS I met following exception:
org.drools.WorkItemHandlerNotFoundException: Could not find work item handler for 
 at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.throwWorkItemNotFoundException(JPAWorkItemManager.java:62)
 at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:57)
 at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107)

This exception is raised when you created Task but you didn't define TaskType. In another words there is created task but is not specified what should be done.

Following image shows JBoss BRMS Process Designer where was process created.

On next image is Task property that have to be set to "Script" value. You can also fill property "Script" in section "Extra" with value "System.out.println("\nHello World!\n");" than Task will write message to JBoss console.

Wednesday, April 24, 2013

Post data with curl when you are behind proxy

I found that SoapUI 4.5.1 have so problems to access some web service endpoint when you are behind proxy. It seems that your authentications is not processed correctly, my proxy server always return HTTP error 407. So I started to play with 'curl' command. Let me show ho to do that:
curl -v --proxy proxy.something.com:8080 --proxy-user myname:password \
 --request POST \
 --header "Content-Type: text/xml;charset=UTF-8" \
 --header "SOAPAction: http://somesite.com:80/adistc/axis2/services/interaface/getAvailableNames" \
 --data @request.txt \
 http://somesite.com:80/adistc/axis2/services/interaface/
Most of parameters are self explaining. Note that @ in parameter --data means that posted data should be find in file 'request.txt'. Headers are not necessary. Obviously in request.xml is your soap XML request. Switch -v shows you request and response data.

Saturday, April 6, 2013

MySQL and Hibernate exception

Following exception made me some problem.
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/err


** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
MESSAGE: Communications link failure

Last packet sent to the server was 18788 ms ago.

STACKTRACE:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 18788 ms ago.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2985)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2871)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3414)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
        at org.hibernate.loader.Loader.doQuery(Loader.java:802)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
My environment was MySQL 5.0.77, Java 1.6.0_24-b07, Apache Tomcat 6.0.32, Hibernate 3.6.0.Final.
This exception never occurs at development or continues integration environment. This problem appears just in production after one day of running without application restart. After some time of testing JDBC connection handling, TCP/IP connection to MySQL database I found that problem is caused by incorrect hibernate dialect configuration
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
After correcting to:
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
everything works fine.

Thursday, March 28, 2013

Hibernate collection mapping - inverse="true"

Following image describe simple one to many bidirectional entity mapping
There is Entity Author that have collection of written books.
Relation ship attribute 'inverse' means direction of relation. 'true' say that relation begin at Author's object at collection or many side or relation. Otherwise default value 'false' say that relation starts at one side of relation.

inverse="true"

When inverse is set to 'true' following code will create and persist new book.
Book book = new Book();
author.getBooks().add(book);
save(author);

inverse="false"

Same code from previous example will lead to exception
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Author
 at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
 at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
If it should work there have to be extra call for saving of Book instance.
Inverse could appear in case on unidirectional and bidirectional relation. Inverse could be used for all types of collection mapping types.

Object and mapping example details

Author and Book Java object could look like:
public class Author {

    private Integer id;

    private String name;

    private Set<Book> books;

    /**
     * @return the books
     */
    public Set<Book> getBooks() {
        return books;
    }

    /**
     * @param books the books to set
     */
    public void setBooks(Set<Book> books) {
        this.books = books;
    }


   ...

}
Book object could look like:
public class Book {

    private Integer id;
    
    private String name;
    
    private String description;
    
    ...
}
And relation mapping between this two object in Author mapping file usually Author.hbm.xml:
 <set name="books" inverse="true">
  <key column="id_author" not-null="true" foreign-key="book_author"/>
  <one-to-many class="Book" />
 </set>
When it's mapped as bidirectional relation there should be in Book mapping file Book.hbm.xml:
<many-to-one name="author" class="Author" column="id_author" foreign-key="book_author" not-null="true"/>

Tuesday, January 22, 2013

How to get process id by port number at mac OSX

When some application listening on some port it could be problem to find out which application it is. On mac OSX is problem to get process id by port number because following command doesn't work:
netstat -p
Mac OSX 10.8 and earlier doesn't support switch '-p' in netstat command. However there is simple workaround. There is command 'lsof' which list open files and their process ids. You can list processes which are listening like this:
lsof -i | grep LISTEN
It's useful to see port number instead of service name running on such port. It's better to see :8080 instead of 'http-alt'. It could be done like this:
lsof -i -P | grep LISTEN

Friday, January 18, 2013

Hibernate inconsistent mapping problem

I met following exception during changing hibernate mapping. I'm using hibernate 3.2

Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: cz.koroptev.cubiculus.core.model.Brick column: id_shape (should be mapped with insert="false" update="false")
 at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:605)
 at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:627)
 at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:645)
 at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:420)
 at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
 at org.hibernate.cfg.Configuration.validate(Configuration.java:1026)
 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
 at cz.koroptev.cubiculus.core.services.impl.HibernateManagerServiceImpl.(HibernateManagerServiceImpl.java:28)
 ... 47 more
Problem was in inconsistent mapping of relations ship between objects 'Shape' and 'Brick'. Object 'Shape' contain set of bricks mapped as:
  <set name="bricks" lazy="true" order-by="id_brick" >
   <key column="id_shape" not-null="true" />
   <one-to-many class="Brick" />
  </set>
and 'Brick' contains mapping to 'Shape'
  <many-to-one name="shape" class="Shape" column="id_shape"
   foreign-key="brick_shape" not-null="false" />
Problem is that in first mapping is column 'id_shape' mapped as not-null="true" and in second is mapped as not-null="false". This lead to mentioned exception.

Tapestry 5 Exception - missing template

Following error appears in application production log:
TP-Processor19 2013.01.17.21.00.08 ERROR core.services.AppModule.extendedRequestExceptionHandler - Processing of request failed with uncaught exception: Embedded component(s) discussion, layout are defined within component class cz.koroptev.cubiculus.core.pages.buildinginstruction.BuildingInstructionLego (or a super-class of BuildingInstructionLego), but are not present in the component template (null).
org.apache.tapestry5.ioc.internal.OperationException: Embedded component(s) discussion, layout are defined within component class cz.koroptev.cubiculus.core.pages.buildinginstruction.BuildingInstructionLego (or a super-class of BuildingInstructionLego), but are not present in the component template (null).
 at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
 at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
 at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
 at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1121)
 at org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:221)
 at org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:211)
 at org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:183)
 at org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:178)
 at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
 at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
 at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1121)
 at org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:177)
 at $PageLoader_69b95d11058ab2.loadPage(Unknown Source)
 at org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:104)
 at $PageSource_69b95d11058aa7.getPage(Unknown Source)
 at org.apache.tapestry5.internal.services.NonPoolingRequestPageCacheImpl.get(NonPoolingRequestPageCacheImpl.java:82)
 at $RequestPageCache_69b95d11058aa6.get(Unknown Source)
 at $RequestPageCache_69b95d11058aa3.get(Unknown Source)

Strange exception in other words say that it's not possible to find application template for some component. This problem shows just at production server not at my development machine. I'm using Tapestry 5 version 5.3.2.

After some time I found that problem was in directory naming. Templates in maven project are in directory 'src/main/webapps/buildinInstruction'. Name 'buildinInstruction' contains upper case I. When I change it to lower case problem disappears. Problem can't be reproduced at my machine because my Mac OS X use case insensitive file system.