Thursday, May 9, 2013

Maven and Java 7 : Fatal error compiling: invalid target release: 1.7


 Problem

On a Maven Project I change Java version (1.6 to 1.7) in my pom.xml file and I have the following error :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project MetricViewer: Fatal error compiling: invalid target release: 1.7 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException



Solution

You have probably Java 1.6 in your classpath.
Do the following to check it :

mvn clean install --debug

  1 Apache Maven 3.0.3 (r1075438; 2011-02-28 11:31:09-0600)
  2 Maven home: /usr/share/maven
  3 Java version: 1.6.0_35, vendor: Apple Inc.
  4 Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home





I found this solution at http://stackoverflow.com/questions/14043042/compiling-java-7-code-via-maven

Wednesday, May 1, 2013

http://java.dzone.com/articles/java-ee-7-approved


If you want to see which JSR will be in Java 7, see that link : http://java.dzone.com/articles/java-ee-7-approved

Saturday, April 27, 2013

CRaSH 1.2.2 release

New version of CRaSH is available.

This version make minor improvement. More informations on https://groups.google.com/forum/?fromgroups=#!topic/crash-users/p06x34J_Uy8

You should see also  http://www.crashub.org/

Saturday, March 30, 2013

Friday, March 22, 2013

CRaSH : a good way to test it !


If you don't know CRaSH, it's time to test it !
You can test it online and discover all the potential of this wonderful tool !

http://try.crashub.org

Send a POST request on Google App Engine

To send a request, you need to use Url Fetch service.The URL Fetch service uses Google's network infrastructure for efficiency and scaling purposes.Here is the code to send a simple POST request on Google App Engine :

   public void send(String messageToSend, String date, String level, String servers) {

        try {
            String message = URLEncoder.encode(messageToSend, ENCODING);
            Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyUrl, Integer.parseInt(proxyPort)));

            URL url = new URL(urlDest);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection(proxy);
            connection.setDoOutput(true);
            connection.setRequestMethod("POST");

            OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
            writer.write("date=" + date);
            writer.write("&level=" + level);
            writer.write("&servers=" + servers);
            writer.write("&msg=" + message);
            writer.close();

            if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
                logger.info("OK ! message returned:" + connection.getResponseCode());
            } else {
                logger.info("KO ! message returned:" + connection.getResponseCode());
            }
        } catch (MalformedURLException e) {
            logger.error(e.getMessage());
        } catch (IOException e) {
            logger.error(e.getMessage());
        }
    }

I've made a small java project ( 2 class ;-) )that send a simple POST request : See https://github.com/drieu/Tools
More details on https://developers.google.com/appengine/docs/java/urlfetch/overview

Wednesday, March 20, 2013

Feedback about the creation of an application on Google App Engine


Goal : Create a small alert's application on Google App Engine and evaluate the easiest method.
Here is my small feedback :

Test 1 : Create a small project with GWT


Drawback


1) Installation
- Netbeans : Not working for me.Installation problem with plugin ...
- Intellij : I didn't find any plugin
- Eclipse : OK and it's easy

2) Create his own application

I want to made a small application but in my mind, GWt is too complex and not quick
Here is an example : see https://github.com/drieu/gwtalert).


Advantage


Quick deploy on Google App Engine facile.


- Test 2 : Create a project with Play 1.2.5 and GAE plugin.


Advantage 



Easy to develop because of framework Play.

Drawback

- I've some difficulties with my proxy
Here is the Play application with solution  https://github.com/drieu/PlayWithGoogleAppEngine

- Play 1.2.5 isn't maintain.See if Yalp will work ...