28 Juli 2014

Include XML Schema Reference in XML to get IDE Code Completion

One thing that I find very often is the missing XML schema reference in XML files.
The advantage of including the reference is code completion in your IDE because with the xml schema the IDE knows about the structure of the XML document.

Example:
<?xml version="1.0" encoding="UTF-8"?>
<batch:job
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:batch='http://xmlns.jcp.org/xml/ns/javaee'
    xsi:schemaLocation='http://xmlns.jcp.org/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/jobXML_1_0.xsd'>

    <batch:step id="step1">
        <batch:chunk>
            <batch:reader ref="Reader" />
            <batch:processor ref="Processor" />
            <batch:writer ref="Writer" />
        </batch:chunk>
    </batch:step>
</batch:job>



An even worse pratice is using XML without a schema. But more about that in another post...

24 Juli 2014

Another reason for using NetBeans: JPQL code completion

Beside the superb support of Maven and JavaScript NetBeans has another very useful feature for developers using JPA. 
JPQL code completion inside a String when creating JPA queries:






Hint for Eclipse/JBoss Tools users: This works not only in @NameQuery!

14 Juli 2014

GlassFish 4 REST Resource and Status Code 500

If you get a error 500 without any additional information. when developing a REST service you probably have a class as parameter or return value that has no default constructor!

04 Juli 2014

Git behind Proxy

I had problems using Git behind a proxy. The solution took me some time so here is how I solved the problem:

First I had to set HTTP_PROXY and HTTPS_PROXY.

Then I encountered a problem with the SSL certificate. So I  had to set GIT_SSL_NO_VERIFY=1

That's all.