JasperReport / SubReport not displayed

We are using the open source framework JasperReports to creating PDF reports.

One of my Team members wanted to create a MasterReport with a SubReport. The SubReport was nothing special, it included just static Text.The problem was, that the subreport was not rendered, it was always empty.

The problem was that the subreport need to have a data connection. Even you don’t need one. The solution is to include a empty DataSource like this:

<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>

The sub report definition in the master report looks like this:

<subreport>
 <reportElement x="0" y="246" width="504" height="100"/>
 <subreportParameter name="nameLabel"/>
 <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
 <subreportExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportExpression>
 </subreport>

scp resume

Do you know this problem. You are copying a large file via scp to a server and than the connection is lost. Actually you can resume the scp prozess for the file. This is for copying a file from a server to your machine.

rsync --partial --progress --rsh=ssh user@host:remote_file local_file

and this is for copying a file from your machine to a server:

rsync --partial --progress --rsh=ssh local_file user@host:remote_file

 

Xing is broken

It seems that Xing.com have technical problems in the last time. Today morning this was the lading page.

And this was my welcome page:

Seems that the CSS files are not loaded.

Could not open ServletContext resource [/WEB-INF/spring3Mvc-servlet.xml]

I got this error message today in a new SpringMVC project.

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring3Mvc-servlet.xml]
 at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
 ... 32 more

To fix this you have to tell the DispatcherServlet where your spring configuration is. This here solved my problem.

<servlet>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

Creating a brunch with git

Just go into the root directory of your project and type in:

git checkout -b brunch1

That’s all. Now your created a new brunch with the name “brunch1″. Your working directory is now the brunch.
You can commit your changes like this:

git add .
git -a -m "my changes"

After the commit you can switch to the master with this command:

git checkout master

Now you are again on the master branch. If you want to merge your two branches you can do it in this way:

git mege branch1