Eclipse Galileo 3.5 : problèmes de connexion à travers un proxy…

juillet 1st, 2009

En installant Eclipse Galileo, sur un poste de travail en entreprise (donc utilisant derrière un proxy pour l’accès à internet) j’ai rencontré quelques problèmes pour me connecter aux update sites (via Help -> install new software…).
En fait, même en ayant bien régler les coordonnées du proxy dans Window -> Preferences -> general->network connections , dès que j’essayais d’installer des plugins via l’update manager, j’avais l’erreur suivante : (à peu près) :
!ENTRY org.eclipse.core.net 1 0 2009-04-16 18:12:18.427
!MESSAGE System property socksProxyPort is not set but should be .

Pas génial…
EN fait, le bug est référencé sur cette page :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=281472#c7

et en particulier, le moyen de contournement, à savoir ne pas utiliser Apache HTTPClient pour se connecter au réseau se trouve sur cette page :

http://wiki.eclipse.org/ECF_Filetransfer_Support_for_NTLMv2_Proxies

Il suffit de modifier son eclipse.ini et rajouter les valeurs suivantes :

-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=myproxy
-Dhttp.proxyUser=mydomain\myusername
-Dhttp.proxyPassword=mypassword
-Dhttp.nonProxyHosts=localhost|127.0.0.1

Vous n’etes pas obligés de rajouter un utilisateur/mot de passe si votre proxy n’en a pas besoin.
Ainsi, au prochain redémarrage, vous aurez accès aux update sites eclipse à travers votre proxy (malgré 1 message d’erreur la première fois !)

Jazoon 09 : third and last day, Thursday 25th of June

juin 25th, 2009

Vous pouvez lire cet article en français sur le blog de valtech.

The Changing Nature of Enterprise Java Application Development, 9:00 – 9:45 by Adrian Colyer

During his talk, the speaker described the audience the future of a Java platform, because it is actually going to be there for a long time now.
He mentioned the dynamic languages compatible with the JVM : Groovy, JRuby, Scala, and Clojure.
He mainly focused on Groovy (which belongs to SpringSource by the way), even if he was not sure if whether JRuby or Groovy would win the “war of dynamic languages”.
For the web platform, he mentioned Grails, built on top of Groovy, Rails running on top of Ruby, and Lift built on top of Scala.
He finished his talk introducing OSGi and Spring DM; the future of enterpise is application may be in the cloud : easily to deploy and scale applications are to come.

The android runtime environment, 10:30 – 11:20, by Joerg Pleumann

The speaker first made an introduction to the Android system, as a platform competing windows mobile and palm.
More technically speaking, it is based on a Linux kernel (along with necessary drivers : display, camera, sound, etc…).
On top of it come the Android Runtime and libraries; the talk is about the Android Runtime and its Dalvik VM.
Dalvik VM : CPU between 250 and 500 MHz, RAM >=64 (equivalent to a 1999 PC), but low power consumption is critical.
The Dalvik VM is really efficient, using explicit registers to keep temporary values: the immediate benefit is the number of lines of the bytecode resulting from the DalvikVM compilation : nearly 30% less than a standard VM compilation.
A dex file (Dalvik Executable) contains several files, and is not compressed.
JNI is ready, a sdk for using JNI is about to come out in the next days; also an Android Debug Bridge is available from the beginning.
The core libraries
dalvik vm specific libraries : dalvik.*
java compatibility libraries : java.* and javax.*
and some apache libraries(mainly for http) : org.apache.*
The core libraries are partly taken from Apache Harmony (a JDK implementation by Apache), partly written from scratch; and some of them have been optimized (using JNI)
The core libraries are mostly compatible to a subset of J2SE 5.0.
JDBC 2.0 is supported, but the SQLite driver is limited., but one can use the alternative in android.database.sqlite which are better integrated.
To conclude with, with Android you can reuse your java knowledge and tools.

Android Application Model, 11:30 – 12:20, by Dominik Gruntz

4 main components :activities, services, content providers and broadcast receivers.
A single class, uses intents to communicate with the other activities; when you launch an activity, you can (or not) expect a result; if this is the case, the method onIntentResult will be called.
You can also define intent filters to describe the intents an activity can handle.
An intent specification is on its way : http://www.openintents.org
An application is packaged using an APK (Android package).
Every activity has a lifecycle containing 4 steps : new, running, paused, stopped, killed and the corresponding methods (onCreate, onStop etc..)
For each activity a new process (with a single thread) is created.
The Looper.loop() dispathes the actions to a queue.
If an activity does not conume events in 5sec, the system issue a warning message.
A service is running background and can communicate with an activity (in process if it’s the same application (APK)) or via AIDL.
Finally, a content provider is the only way to share date between Android applications; it can using SQLite, a file, or a remote storage.

Scalable Agile Web Development: REST meets JCR meets OSGI, by Michael Marth

JCR : JSR 270 for accessing content repository : located on a file or database; can be versioned; node ahave read/write group properties, etc…
Apache Sling is a web framework, on top of REST/Scripting (Ruby, Groovy, etc…)/OSGi(in this case Apache Felix Container, to switch on/off part of the frameework live)/JCR.
So basically Apache Sling allows the user to create/edit/read/update content in a restful manner (http methods), the data being created is then stored on the JCR repository, organized in a very similar WebUrlFriendly way (and then you can manipulate the data through rest or webdav and so on, thanks to JCR)
The demo was really smooth and interesting !

The charm of Mockito: Test Spies in action, 14:30 – 15:20, by Szczepan Faber

The speaker begins asking who uses JMock : 2 or 3 people among an audience of 60 people, half of the audience using EasyMock.
So let’s start with EasyMock : coding in TDD a dictionnary, (and its history) depending on a translator : the translator is mocked.
With easymock the speaker keeps it old fadhioned : createMock/expect/replay/assert/verify , (his test extends Assert) and then refactor a bit in the @Before and @After test methods, nothing special here.
Then Mockito : mock/when/assert/verify : it’s a lighter syntax indeeed!
Szczepan insisted on the fact that usually developers using easymock create replayAll and verifyAll methods called in the @After method; which make Easymok fail when many behaviours are attached.
The speaker uses BDD style template (given/when/then) in eclipse, when creating a test.
Mockito eases the use of a given/when/then syntax when writing a test.
Has good point of failure ?
The failure trace in mockito is linked to the source code and more explicit about the error, it does not whow internal classes exceptions
Mockito or mockito-like for python, flex, javascript, C++; there are mockito extensions
He concluded with : “Do TDD and write great tests with whatever tools that work for you”
May the force be with you !

Eclipse Galileo and JBoss Tools, 16:30 – 16:50, by Max Andersen

Galileo (3.5) is a huge release.
Must-sees : Eclipse Memory Analyser (to see which plugin consumes all the memory for example), using jmap
XML and XSL editor is really better.
P2 (eclipse update manager) works for real; you shouldn’t use dropins anymore (single zip files to unpackage in /plugins and /features), for offline installation plugins providers should suggest copies of the update site, then you may use P2 to explore these files, as if you were online).

Jazoon 09, second day : 24th of June 2009

juin 24th, 2009

The following sessions were given during Jazoon 09, on Wednesdaythe 24th of Ju ne 2009, vous pouvez lire la traduction en français sur le blog de Valtech

Danny Coward Keynote, 9:00 – 10:00

Java 7

Description of the new features in Java SE 7 : modularity, ?. operator, new API for java.io (Path, Asynchronous FileVisitor), http://openjdk.java.net/projects/jdk7

Java FX

The new version is 1.2, running on all OSes (even Linux and Solaris, a TV, some phones to come out), more UI components (skinnable with CSS) , new layouts, better performance; then Danny showed the audience some JavaFX applications : a pacman application, a video player, with some nice visual effects …

OSGi and Java Modularity, 10:30 – 11:20, by Peter Kriens

If you think your application is modular only by using the VM, well, think again…
You can’t hide interfaces in the classsloader, and if there are no enforcements of rules at runtime, it’s uselesse to try to make these interfaces secrets…
In OSGi, you can set secret interfaces (not exported) and also use MANIFESTs to explicitely specify exports.
With an OSGi bundle (a jar actually, with its MANIFEST), you can dynamically specify which others bundles it can depend on, if one of the bundle you depend on is no more available, OSGi will remove the dependency; then it will put it back when the bundle is available again.
The problem is : many implementations of modularity exist and JSR 294 do not specify a particular one … From a programmer point of view, you will have to choose between OSGi, Jigsaw, guice, the modularity implementation you want to use …

Next generation Wikis: Mixing Content-Oriented Applications with Wikis, 11:30 – 12:20, by Vincent Massol

Wiki 1.0 : just used for text
Wiki 2.0 : you can add everything : images, videos, comments, notes, etc.., the datas can be structured, unstructured or mashups (datas coming from everywhere) the wiki 2.0 is the excell… of the web !
After presenting a demo showing us the possibility in Xwiki to define in 10 minutes (knowing velocity or groovy syntax) an application hosted on the wiki, Vincent listed the Xwiki features and the new features to come : real time collaboration, mobile skin, social features and … merge of CMS and wikis.

JavaFX Rich Internet Applications connected to GlassFish Java EE 5 services, 16:00-16:20, by Ludovic Champenois – Sun Microsystems

First of all, Ludovic showed us the GlassFish v3 admin console (looks good !) and reminded us with REST (standard HTTP methods, resources, etc…), and the REST annotations in Java EE6.
Why ? because the example given during his demonstration is communicating with a JAX-RS Java EE6 application, hosted by Glassfish V3.
To test the REST application, you can simply use : curl -HAccept:application/xml http://localhost/domain, or use your browser or use Glassfish v3 Admin Backend Tester.
And then, down to the JavaFx application code, using Netbeans, only 15 lines of code are necessary to consume the REST service.
TO finish with, Ludovic showed us some other JavaFX demo applications.

JavaFX / Android: Competing technologies or the ideal partnership? , 16:30 – 16:50 by Mike Mannion and Andreas Hölzl

Presented as a theater play : 2 guys talking about phone technologies around a coffee : one is a JavaFX supporter, the other is an Android supporter.
They then compared a similar application (using Flickr, Lastfm, youtube web services): developed both for JavaFx and the Android Platform.
*UI : JavaFX needs UI designed by designers, Android defines it in an extermal layout XML file
*UI (2) : Android provides a richer API, providing a photo gallery for example, JavaFX does not…
*language : you have to learn JavaFX script for JavaFX, Android uses Java 5 API (with some restrictions…, for example it does not use AWT or Swing for graphics)
They also told us that Sun is not clearly decided about supporting Android : they said that they were thinking about it… but since then (a year ago) nothing came out !


Jazoon'09 486x60 gif banner