PlanetJava

February 06, 2012

Javable

JUG.RU meeting

JUG.RU will held a scheduled meeting on Feb 23d. Read on for details.

February 06, 2012 07:01 AM

Javable

Happy New Year!

We wish a Happy New Year to all our readers and contributers. Hope to see you all in 2008.

February 06, 2012 07:01 AM

Javable

Ruby on Rails 2.0 released

Ruby on Rails 2.0 has been released. "Rails 2.0 is finally finished

February 06, 2012 07:01 AM

Javable

NetBeans 6.0 released

New version of pure Java IDE has been released, with support for many new

February 06, 2012 07:01 AM

Javable

JUG.RU meeting on November 24th

JUG.RU will be hosting its meeting in Saint Petersburg, Russia, on November 24th. More details in our

February 06, 2012 07:01 AM

Javable

Javable

Google Android SDK is available

The development kit and API for Google mobile platform, Android, has been released.

February 06, 2012 07:01 AM

Javable

Sun phases out mobile Java

Sun will gradually phase out mobile Java (Java Micro Edition) and move respective services to Standard Edition. "We're trying to converge

February 06, 2012 07:01 AM

Javable

Consumer JRE Early Access

Sun has started an early access program to Java SE 6 Update N (formerly known as the "Consumer

February 06, 2012 07:01 AM

Javable

YourKit Java Profiler 7.0 released

The major update to YourKit Java Profiler has been released. Version 7.0 includes

February 06, 2012 07:01 AM

February 04, 2012

Planet Eclipse

Stephan Herrmann: Help the JDT Compiler helping you! - 2: Resource leaks - continued

In my previous post I showed the basics of a new analysis that I originally introduced in the JDT compiler as of 3.8 M3 and improved for M5. This post will give yet more insight into this analysis, which should help you in writing code that the compiler can understand.

Flow analysis - power and limitation

An advantage of implementing leak analysis in the compiler lies in the synergy with the existing flow analysis. We can precisely report whether a resource allocation is definitely followed by a close() or if some execution paths exist, where the close() call is by-passed or an early exit is taken (return or due to an exception). This is pretty cool, because it shows exactly those corner cases in your implementation, that are so easy to miss otherwise.

However, this flow analysis is only precise if each resource is uniquely bound to one local variable. Think of declaring all resource variables as final. If that is possible, our analysis is excellent, if you have multiple assignments to the same variable, if assignments happen only on some path etc, then our analysis can only do a best-effort attempt at keeping track of your resources. As a worst case consider this:

  Reader r = new FileReader(f);
  Reader r2 = null;
  while (goOn()) {
     if(hasMoreContent(r)) {
        readFrom(r);
     } else {
        r.close(); // close is nice, but which resource exactly is being closed??
     }
     if (maybe()) {
        r2 = r;
     }             // at this point: which resource is bound to r2??
     if (hasMoreFiles()) {
        r = new FileReader(getFile()); // wow, we can allocate plenty of resources in a loop
     }
  }
  if (r2 != null)
    r2.close();

This code may even be safe, but there’s no way our analysis can keep track of how many resources have been allocated in the loop, and which of these resources will be closed. Which one is the resource flowing into r2 to be closed at the end? We don’t know. So if you want the compiler to help you, pretty please, avoid writing this kind of code :)

So what rules should you follow to get on terms with the compiler? To understand the mentioned limitation it helps to realize that our analysis is mostly connected to local variables, keeping some status bits for each of them. However, when analyzing variables the analysis has no notion of values, i.e., in the example the compiler can only see one variable r where at runtime an arbitrary number of Reader instances will be allocated, bound and dropped again.

Still, there are three special situations which the analysis can detect:

1
2
3
4
5
6
7
  Reader r = new FileReader("someFile");
  r = new FileReader("otherFile");
  r = new BufferedReader(r);
  Reader r2 = getReader();
  if (r2 != null) {
     r2.close();
  }
  1. In line 2 we’re leaking the instance from line 1, because after the assignment we no longer have a reference to the first reader and thus we cannot close it.
  2. However, line 3 is safe, because the same reader that is being dropped from r is first wrapped into a new BufferedReader and indirectly via that wrapper it is still reachable.
  3. Finally at the end of the example snippet, the analysis can see that r2 is either null or closed, so all is safe.

You see the compiler understands actually a lot of the semantics.

My fundamental advice is:

If the compiler warns about leaking resources and if you think the warning is unnecessary, try to better explain why you think so, first of all by using exactly one local variable per resource.

Resource ownership

Still not every method lacking a close() call signifies a resource leak. For an exact and definite analysis we would need one more piece of information: who owns any given resource?

Consider a group of methods happily passing around some resources among themselves. For them the same happens as for groups of people: diffusion of responsibility:

Well, no, I really thought that you were going to close this thing?!!?”.

If we had a notion of ownership we’d simple require the unique owner of each resource to eventually close that resource. However, such advanced concepts, while thoroughly explored in academia, are lacking from Java. To mitigate this problem, I made the following approximations of an ownership model:

  1. If a method allocates a resource, it owns it - initially.
  2. If a method obtains a resource by calling another method, it may potentially be responsible, since we cannot distinguish ownership from lending
  3. If a method passes a resource as an argument to another method (or constructor), it may or may not transfer ownership by this call.
  4. If a method receives a resource as a parameter, it assumes the caller is probably still responsible
  5. If a method passes a resource as its return value back to the caller, it rejects any responsibility
  6. If a resource is ever stored in a field, no single method feels responsible.
  7. If a resource is wrapped in an array we can no longer track the resource, but maybe the current method is still responsible?

In this list, green means: the compiler is encouraged to report anything fishy as a bug. Blue means, we still do the reporting, but weaken the message by saying “Potential resource leak”. Red means, the compiler is told to shut up because this code could only be checked by whole system analysis (which is not feasible for an incremental compiler).

The advice that follows from this is straight-forward:

Keep the responsibility for any resource local.

Do not pass it around and don’t store it in fields.

Do not talk to any strangers about your valuable resources!

In this regard, unclean code will actually cancel the leak analysis. If ownership of a resource is unclear, the compiler will just be quiet. So, do you think we should add a warning to signal whenever this happens? Notably, a warning when a resource is stored in a field?

The art of being quiet

Contrary to naive thinking, the art of good static analysis is not in reporting many issues. The art is in making yourself heard. If the compiler just rattles on with lots of uninteresting findings, no one will listen, no one will have the capacity to listen to all that.

A significant part of the work on resource leak analysis has gone into making the compiler quieter. And of course this is not just a matter of turning down the volume, but a matter of much smarter judgment of what the user might be interested in hearing.

By way of two recently resolved bugs (358903 and 368546) we managed to reduce the number of resource leak warnings reported against the sources of the Eclipse SDK from almost 100 down to 8. Calling this a great success may sound strange at first, but that it is.

At the level we reached now, I can confidently encourage everybody to enable this analysis (my recommendation: resource leaks = error, potential resource leaks = warning). The “Resource leak” problems indeed deserve a closer look, and also the potential ones could give valuable hints.

For each issue reported by the compiler you have three options:

  1. Agree that this is a bug
  2. Explain to the compiler why you believe the code is safe (unique assignment to locals, less passing around)
  3. Add @SuppressWarnings("resource") to tell the compiler that you know what you are doing.

But remember the nature of responsibility: if you say you don’t want to here any criticism you’d better be really sure. If you say you take the responsibility the compiler will be the humble servant who quietly forgets all worries.

Finally, if you are in the lucky position to use Java 7 for your projects, do the final step: enable “Resource not managed with try-with-resource” analysis. This was actually the start of this long journey: to let the compiler give hints where this new syntax would help to make your code safer and to make better visible why it is safe - with respect to resource leaks.

Final note: one of the bugs mentioned above was only resolved today. So with M5 you will still see some avoidable false positives. The next build from now should be better :)

I’ll be back, soon, with more on our favorite exception: NPE.

February 04, 2012 08:11 PM

Java.net Weblogs

Night Dreams about NetBeans 7.1, etc.; Day Work Configuring CentOS Linux for JavaFX 2.1

Last night I dreamed seemingly all night about NetBeans 7.1, the JavaFX 2.1 Developer Preview, the JDK 6 and JDK 7 installations on my CentOS Linux system, Java threads, the JDK 7 Fork/Join framework, closures... and probably a few more things were in there too. That kind of thing happens to me sometimes after a late night of programming or development-related brainstorming.

Now, if these dreams happen when I have looming deadline, I usually consider it a nightmare -- because I'll often "work" all night "solving" some problem that doesn't exist in my day world. But I'm hoping last night's dreams will ultimately prove to have been at least a little bit productive. There were plenty of curious ideas mixed in there. I'll find out if any of it's useful over the next several days...

Day work: JavaFX 2.1 Developer Preview on Linux

It's daytime now, so I'll get down to some practical work. First, there's some good news for developers who want to try out JavaFX 2.1 Developer Preview on Linux: Linux Release Notes and installation instructions are now available (that wasn't the case when I wrote my Getting Started (Very Preliminarily)... blog post a couple weeks ago). Also, the 2.1 Developer Preview is has advanced to build b11 (I originally downloaded build b9).

The instructions for JavaFX 2.1 on Linux identify the following system requirements:

  • Ubuntu Linux 10.4 or higher (32 or 64 bit)
  • JDK 6 update 26 or higher
  • gtk2 2.18+
  • libavcodec (for media)

I'm running CentOS 5.5, not Ubuntu; my current JDK 6 is prior to update 26; and rpm -q gtk2 tells me that I have gtk2 Version 2.10.4-20.el5. Not the perfect starting point... But, my guess is that likely I'll be able to get a proper configuration in place.

The latest GTK2 that's available via yum for CentOS 5.5 is still in the Version 2.10 sequence. So, I downloaded the last stable GTK2 (Version 2.24.9), and tried installing it. The result of ./configure was a bunch of missing dependencies (too old a version of GLib, and missing atk, pango, cairo, and gdk-pixbuf-2.0). Using yum to see what prepackaged versions of these are available for my CentOS system, I found that in all cases the available packages predate the required versions.

Stepping back to GTK+ 2.18 would help some, but still the dependencies could not be met by simply using the yum package manager.

So, it's a dilemma. I'd like to try out the JavaFX 2.1 Developer Preview on my CentOS system, but there's a pretty big gulf between the CentOS 5.5 packages and what's required for JavaFX 2.1. Attempting big jumps in package versions can break a stable Linux system, in my experience. And the idea of upgrading to a newer operating system isn't all that appealing (that means downtime, and I do have development deadlines to meet). In addition, there are other things I'd like to be working on as well (such as experimenting with the performance differences between various strategies for efficiently utilizing multicore computers -- all that non-JavaFX stuff I was dreaming about last night).

I'll have to think about this for a while... Or, perhaps another night of Java-centric dreaming will provide a solution!


Java.net Weblogs

Since my last blog post, several people have posted new java.net blogs:


Poll

Our current java.net poll asks Under JCP 2.8, EC members lose their voting rights if they miss two consecutive meetings. Your view on this?. Voting will be open until Friday, February 17.


Articles

Our latest Java.net article is Michael Bar-Sinai's PanelMatic 101.


Java News

Here are the stories we've recently featured in our Java news section:


Spotlights

Our latest java.net Spotlight is Heather Van Cura's JCP 2.8 Spec Lead Materials & Adopt-a-JSR update:

Following the upgrade to the JCP 2.8 Program, the Program Office has made available the following materials for Spec Leads on the Multimedia page of jcp.org: -Transparency (December 2011 call) -JCP 2.8 Overview (October 2011 call)...

Previously, we featured Jasper Potts' Curve fitting and styling AreaChart:

I was experimenting today with extending AreaChart to do curve fitting for some example code I was hacking on. It is also a example of what can be done with styling JavaFX charts with CSS. Here is the result...

Subscriptions and Archives: You can subscribe to this blog using the java.net Editor's Blog Feed. You can also subscribe to the Java Today RSS feed and the java.net blogs feed. You can find historical archives of what has appeared the front page of java.net in the java.net home page archive.

-- Kevin Farnham

Twitter: @kevin_farnham

by editor at February 04, 2012 06:28 PM

The Server Side

x += x++ * x++ * x++; Really? Just a little mock OCAJP exam question to get you thinking.

x += x++ * x++ * x++; Now that's a little annoying. You'd shoot a developer who worked that into a program, but it's they type of thing you'd see on a certification exam. Maybe it's a little too difficult for the OCAJP, the Associate exam from Oracle, but it's probably pretty good fodder for the new OCPJP exam for Java 7.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 04, 2012 02:13 PM

The Aquarium

Planet Eclipse

Gunnar Wagenknecht: Eclipse at FOSDOM 2012

It’s my first out of two days at FOSDEM 2012. It took us quite a ride to get from the hotel to the ULB. We tried to order a taxi but the people at the reception told us that it would take at least 1.5 hours till a taxi arrives. Luckily, Mike and Andrew know someone who has been at FOSDEM a couple of times before. He guided us safely to ULB using a combination of walking, metro, tram and more walking.

We quickly setup an Eclipse stand over there and Mike, Andrew and myself are showing demos and talking to people. BTW, thanks to the FOSDEM organizer to have it well prepared so that we just needed to setup our banner and our notebooks for the demos.

So far we have a great mixture of questions from developers using Eclipse for their day-to-day work, programming questions of Eclipse plug-in developers and people interested in Orion. There are also people stepping by that have no questions – they introduce themselves as happy Eclipse users and appreciate what the committers of the various projects have built over time. Thanks for those kind words folks!

3-IMG_1243 1-IMG_1241 2-IMG_1242 4-IMG_1246

 

February 04, 2012 01:35 PM

Planet Eclipse

Stephan Herrmann: Help the JDT Compiler helping you! - 1: Resource Leaks

During the Juno cycle a lot of work in the JDT has gone into more sophisticated static analysis, and some more is still in the pipe-line. I truly hope that once Juno is shipped this will help all JDT users to find more bugs immediately while still typing. However, early feedback regarding these features shows that users are starting to expect miracles from the analysis :)

On the one hand seeing this is flattering, but on the other hand it makes me think we should perhaps explain what exactly the analysis can see and what is beyond its vision. If you take a few minutes learning about the concepts behind the analysis you’ll not only understand its limitations, but more importantly you will learn how to write code that’s better readable - in this case for reading by the compiler. Saying: with only slightly rephrasing your programs you can help the compiler to better understand what’s going on, to the effect that the compiler can answer with much more useful error and warning messages.

Since there’s a lot of analysis in this JDT compiler I will address just one topic per blog post. This post goes to improvements in the detection of resource leaks.

Resource leaks - the basics

Right when everybody believed that Eclipse Indigo RC 4 was ready for the great release, another blocker bug was detected: a simple resource leak basically prevented Eclipse from launching on a typical Linux box if more than 1000 bundles are installed. Coincidentally, at the same time the JDT team was finishing up work on the new try-with-resources statement introduced in Java 7. So I was thinking: shouldn’t the compiler help users to migrate from notoriously brittle handling of resources to the new construct that was designed specifically to facilitate a safe style of working with resources?

What’s a resource?

So, how can the compiler know about resources? Following the try-with-resources concept, any instance of type java.lang.AutoCloseable is a resource. Simple, huh? In order to extend the analysis also to pre Java 7 code, we also consider java.io.Closeable (available since 1.5).

Resource life cycle

The expected life cycle of any resource is : allocate—use—close. Simple again.

From this we conclude the code pattern we have to look for: where does the code allocate a closeable and no call to close() is seen afterwards. Or perhaps a call is seen but not all execution paths will reach that call, etc.

Basic warnings

With Juno M3 we released a first analysis that could now tell you things like:

  • Resource leak: “input” is never closed
  • Resource leak: “input” is never closed at this location (if a method exit happens before reaching close())

If the problem occurs only on some execution paths the warnings are softened (saying “potential leak” etc.).

Good, but

Signal to noise - part 1

It turned out that the analysis was causing significant noise. How come? The concepts are so clear and all code that wouldn’t exhibit the simple allocate—use—close life cycle should indeed by revised, shouldn’t it?

In fact we found several patterns, where these warnings were indeed useless.

Resource-less resources

We learned that not every subtype of Closeable really represents a resource that needs leak prevention. How many times have you invoked close() on a StringWriter, e.g.? Just have a look at its implementation and you’ll see why this isn’t worth the effort. Are there more classes in this category?

Indeed we found a total of 7 classes in java.io that purely operate on Java objects without allocating any resources from the operating system:

  • StringReader
  • StringWriter
  • ByteArrayInputStream
  • ByteArrayOutputStream
  • CharArrayReader
  • CharArrayWriter
  • StringBufferInputStream

For none of these does it make sense to warn about missing close().

To account for these classes we simply added a white list: if a class is in the list suppress any warnings/errors. This white list consists of exactly those 7 classes listed above. Sub-classes of these classes are not considered.

Wrapper resources

Another group of classes implementing Closeable showed up, that are not strictly resources themselves. Think of BufferedInputStream! Does it need to be closed?

Well? What’s your answer? The correct answer is: it depends. A few examples:

1
2
3
4
5
6
7
8
	void wrappers(String content) throws IOException {
		Reader r1, r2, r3, r4;
		r1 = new BufferedReader(new FileReader("someFile"));
		r2 = new BufferedReader(new StringReader(content));
		r3 = new FileReader("somefile");
		r4 = new BufferedReader(r3);
		r3.close();
	}

How many leaks? With same added smartness the compiler will signal only one resource leak: on r1. All others are safe:

  • r2 is a wrapper for a resource-less closeable: no OS resources are ever allocated here.
  • r3 is explicitly closed
  • r4 is just a wrapper around r3 and since that is properly closed, r4 does not hold onto any OS resources at the end.
  • returning to r1, why is that a leak? It’s a wrapper, too, but now the underlying resource (a FileReader) is not directly closed so it’s the responsibility of the wrapper and can only be triggered by calling close() on the wrapper r1.

EDIT: We are not recommending to close a wrapped resource directly as done with r3, closing the wrapper (r4) is definitely cleaner, and when wrapping a FileOutputStream with a BufferedOutputStream closing the former is actually wrong, because it may lose buffered content that hasn’t been flushed. However, the analysis is strictly focused on resource leaks and for analysing wrappers we narrow that notion to leaks of OS resources. For the given example, reporting a warning against r4 would be pure noise.

Summarizing: wrappers don’t directly hold an OS resource, but delegate to a next closeable. Depending on the nature and state of the nested closeable the wrapper may or may not be responsible for closing. In arbitrary chains of wrappers with a relevant resource at the bottom, closing any closeable in the chain (including the bottom) will suffice to release the single resource. If a wrapper chain is not properly closed the problem will be flagged against the outer-most wrapper, since calling close() at the wrapper will be delegated along all elements of the chain, which is the cleanest way of closing.

Also for wrappers the question arises: how does the compiler know? Again we set up a white list with all wrapper classes we found in the JRE: 20 classes in java.io, 12 in java.util.zip and 5 in other packages (the full lists are in TypeConstants.java, search for “_CLOSEABLES”).

Status and outlook

Yes, a leak can be a stop-ship problem.

Starting with Juno M3 we have basic analysis of resource leaks; starting with Juno M5 the analysis uses the two white lists mentioned above: resource-less closeables and resource wrappers. In real code this significantly reduces the number of false positives, which means: for the remaining warnings the signal-to-noise ratio is significantly better.

M5 will actually bring more improvements in this analysis, but that will be subject of a next post.

February 04, 2012 11:11 AM

Planet Eclipse

Roy Ganor: How My Wife Drives the Technology World

ok, maybe a better name would be "My Cloud-based-Social-enabled-Service-oriented Mobile Apps Experience", but that's a long name for a post :)



It started last week as a small-talk between my wife and me about sheattending so many shifts and medical sessions. According to my wife, she usuallytakes 4-5 shifts a month where the actual number is doubled (!). At that momentI had no tools to prove my point and here comes the requirements to build asmall mobile app for her to report shifts and sessions while being able towrite short notes about it (ok, she was asking this a longtime ago). In addition she usually posts some info on Facebook during her shifts so I had to connectthese reports somehow to her Facebook account. By the end of the month she hand a report about her shifts to the managers so this if the app could also print a summary it will be a big value for her.



Before sharing thoughts about my experience with this app development, here is how this app looks like on Android and iOS:





Mobile App

jQueryMobile (version 1.0) is really handy for creating cross-platform mobile interface, it provides easy to use APIs and is really covered well with lots of great examples. I had to use several other libraries like jQueryUrl, Moment.jsMustache, requireJS and jsPDF. With so many "out-of-the-box" libraries it is super easy to build robust solution for client side in minutes(!!!)



Social-enabled:

Facebook JavaScript SDK helped me with giving a more "social look and feel" after creating  a  Facebook application. I also used Facebook's OAth service authentication and Open Graph integration so users notify their friends about their activities with the "My Doctor Shifts" application. That's super important to engage the application users to your application!



Service-oriented (and Data-centric)

Zend Framework provides nice (lightweight) models representation and the MVC was useful to create the HTML view and services.



Cloud-based

Using  phpCloud was easy as always with plenty of slick workflows helping me to easily deploy my application and push updates to staging and testing targets. This way I always kept two versions that represent my Work in Progress and Done apps. I also got packages ready for deployed in case I want to deploy it to another Zend Application Fabric instance.



The application is available on github.



by Roy Ganor (noreply@blogger.com) at February 04, 2012 06:55 AM

DevX - Java

Using Hibernate to Implement Multi-tenant Cloud Architecture

Hibernate is an excellent Java ORM tool but it lacks the features required to implement a multi-tenant cloud architecture. Don't let that stop you.

by Manoj Debnath at February 04, 2012 03:21 AM

February 03, 2012

Planet Eclipse

Doug Schaefer: Eclipse C/C++ IDE reaches 750,000 downloads for Indigo-SR1

by Doug Schaefer (noreply@blogger.com) at February 03, 2012 06:29 PM

Planet Eclipse

Max Rydahl Andersen: m2e(clipse)-wtp 0.15.0 : New & Noteworthy

Maven Integration for Eclipse WTP 0.15.0, a.k.a m2eclipse-wtp, a.k.a m2e-wtp is available.

This release contains mostly bug fixes, but a few improvements managed to slip in. The complete release notes are available here.

 

m2e-wtp 0.15.0 is compatible with the JavaEE distributions of Eclipse Helios and Indigo, requires at least m2e 1.0 (works with 1.1) and mavenarchiver plugin >= 0.14.0 (0.15.0 should be automatically installed).

As usual, m2e-wtp can be installed from :



 

So let's see what are the highlights of this new release :

 

Packaging inclusion/exclusion support improvements

For war project, previous m2e-wtp versions used to use <packagingIncludes> and <packagingExcludes> attributes from the maven-war-plugin config to enable (or not) the deployment of project dependencies to WTP servers. In 0.15.0, the same level of support has been added to EAR projects using maven-ear-plugin 2.7+. However, the problem with this approach is, other resources (web pages, classes ...) are not properly excluded (using the <*SourceInclude> and <*SourceExclude> attributes).

 

In order to address this problem, Rob Stryker, committer on WTP and lead of JBoss AS tooling in JBoss Tools, provided an implementation for JBoss AS servers that might be generalized to other WTP server adapters (if they decide to do so). Basically, some new metadata is added to the project's .settings/org.eclipse.wst.common.component like :

 

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="webOrEar">
         ...
        <property name="component.inclusion.patterns" value="pattern1,pattern2"/>
        <property name="component.exclusion.patterns" value="pattern3,pattern4"/>
    </wb-module>
</project-modules>

 

The patterns are separated with a comma and exclusions take precedence over inclusions : resources matching one of the exclusion patterns are not deployed, even if they match one of the inclusion patterns. That solution is not maven-bound so any other kind of project can benefit from it.

Now all m2e-wtp 0.15.0 does is map the maven patterns to their equivalent component metadata. This gives :

component_patterns.png

In the example above, a warning is displayed as both <warSourceIncludes> and <packagingIncludes> are defined. Since both patterns could overlap, it might lead to some weird behavior where WTP would actually deploy more files than a maven CLI build. In order to minimize (we can not totally solve) that potential discrepancy we only keep the packaging patterns in the component files and recommend using <packagingIncludes> only.

 

Currently, this feature only works in combination with the JBoss AS Tools from JBoss Tools 3.3.0.Beta1 (nightly builds available from http://download.jboss.org/jbosstools/updates/nightly/trunk/), but we'll try to make other WTP Server adapter vendors support it in the future (as part of WTP core API).

 

Warnings added when unsupported dependency types are detected

As of today, if a project depends on another workspace project of type ejb-client or test-jar,  that specific dependency will not be packaged properly by WTP, as Maven would do in command line. Moreover, you'll experience some class leakage on the compilation and test classpaths in Eclipse (ex: non client classes being visible). The only known workarounds to this issue are to disable workspace resolution, or close the dependent project and rely on the dependencies from the local maven repository.

Ideally, in order to make the deployment part work, we would need to introduce new WTP components, but the current WTP API doesn't support it, yet. So, until this is fixed, warning markers are added whenever a project depends on such "unsupported" types. That should hopefully give users an idea of the problem and how to circumvent it.

unsupported-dependency-type.png

Better handling of dependencies in war projects

Previous m2e-wtp versions had, in some use cases, some outstanding issues with regard to dependency management of war projects. In particular,

  • when 2 dependencies of the same artifact, but having a different classifier were added to a web project, only one would show up on the classpath. This has been properly fixed.
  • in some cases, the timestamped version of a SNAPSHOT dependencies from the local repository, would be copied under the target/ folder, causing some jar locking issues in windows. The rationale behind this behavior is, maven-war-plugin packages snapshot dependencies using the timestamp identifier. Since the name of file in the maven classpath library needs to match the one deployed by WTP, a copy was performed. To fix this problem, the default file pattern matching used for dependency deployment has been changed to @{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@. This means that, by default in m2e-wtp, SNAPSHOT dependencies are now deployed using the SNAPSHOT suffix instead of the timestamp. If you need to force the use of timestamped artifacts, then you need to explicitely decalre the following in your pom.xml :

 

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
  </configuration>
</plugin>

 

Removal of conflicting facets on packaging change

If you had a java utility project, that you wanted to upgrade to an EJB project for example, a constraint violation would be raised upon project configuration update (EJB and Utility facets can't be both installed).

This has been fixed by removing all conflicting facets when you change the packaging of a Java EE project, making that conversion completely transparent.

 

What's next?

m2e 1.1 introduces a new Eclipse to Maven project conversion API. It means that, in m2e-wtp.next, we will be able to automatically convert existing WTP project configuration to maven's. Dependencies will still need to be set/translated manually but that's a pretty good start IMHO.



Finally ...

I would like to thank the m2e-wtp community at large for their support and contributions, that's what make this project move forward and make it one of the most popular projects on the eclipse marketplace.

Contributions can take the form of :

 

Keep it up.

 

 

Fred.

https://twitter.com/#!/fbricon

by Fred Bricon (do-not-reply@jboss.com) at February 03, 2012 06:01 PM

Planet Eclipse

Markus Knauer: Eclipse Juno M5 and Indigo SR2 RC2

Two releases of the Eclipse EPP packages today:

The packages for Indigo SR2 RC2 (the second release candidate for the second service release of the Indigo release, based on Eclipse Platform 3.7.2) and the packages for this year’s Simultaneous Release Juno M5 (the 5th milestone based on Eclipse Platform 4.2) are available:

http://www.eclipse.org/downloads/index-developer.php

Please test and report any issues in Bugzilla. Especially the Eclipse 4.x team needs your help! The sooner bugs are found, the sooner they can be fixed!

One of the changes is the addition of Eclipse Code Recommenders to the Eclipse for RCP and RAP Developers package.

February 03, 2012 05:54 PM

The Server Side

TheServerSide Java Symposium hits the road and the Web in 2012

This year, TheServerSide Java Symposium -- North America's longest-running, vendor-neutral Java conference -- is being reinvented to make it accessible to more Java professionals. So, get ready for the new format’s first outing on April 10, and set your GPS for San Francisco.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 03, 2012 03:08 PM

The Server Side

Tiggzi: Cloud-based HTML5 And Hybrid Mobile App Builder Is Now Free!

Tiggzi is cloud-based mobile app builder. It makes it super easy and fast to build HTML5 and hybrid (with PhoneGap) mobile apps entirely in the cloud. With a new Free plan, anyone can now build a mobile app.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 03, 2012 03:07 PM

The Server Side

Spring 3, Spring Web Services 2 &#38; LDAP Security

Creating and securing a Spring 3 , Spring WS 2 web service using multiple XSDs and LDAP security.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 03, 2012 03:06 PM

The Aquarium

GlassFish 3.1.2 Release Candidate builds are here!

GlassFish 3.1.2 has never been so close to a GA/FCS release with promoted build b19 now available as Release Candidate (RC) 1. In fact you might as well go straight to RC2 (build 20), also now available from the promoted builds page.

ALT_DESCR

If you're not sure which archive to use, try this one. Another RC build (RC3) is planned in the next few days. Hopefully it'll be the last one before the product ships.

So make sure you test your applications work properly with the latest promoted build and check out recent blog posts on 3.1.2 if you're wondering what to expect from this release. See you in a short while for a stable public release!

Now you know what to do over the week-end! :)

by alexismp at February 03, 2012 01:29 PM

February 02, 2012

The Server Side

Apache JMeter 2.6 released

Apache JMeter, the Open Source Load Test tool reference, which recently became a Top Level Apache project has released a new version 2.6



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 02, 2012 10:01 PM

The Aquarium

Cumulogic, yet another PaaS platform for GlassFish

Cumulogic is another PaaS provider offering Java as a platform and specifically GlassFish 3.1.1 as of their December 2011 release.

ALT_DESCR

CumuLogic PaaS has a dual public and private cloud strategy and support for Amazon EC2, OpenStack, Citrix-CloudStack, Eucalyptus, and VMware vSphere. It also offers RESTful APIs to manage the application lifecycle, and PaaS administration APIs to manage and monitor the platform.

For more details, you can read their data sheet, one where you'll learn that James Gosling is one of the company's advisors.

by alexismp at February 02, 2012 10:00 PM

Planet Eclipse

Java.net Weblogs

SwingX 1.6.3 Released

I am very pleased to announce the release of SwingX 1.6.3.  While the release notes contain many fixes, I wanted to take a minute to highlight some of the major changes.

First and foremost, we have more fully adopted Maven.  The project is now a collection of smaller modules. This will make it easier for clients to use only the pieces of SwingX that they need or want.  To enable us to break SwingX into smaller modules, some classes have been moved or reorganized.  Don't worry, we've left a deprecated copy in the original location in all instance but one (I'm looking at you JXBusyLabel.Direction).

Secondly for Maven, we needed to rename our groupId.  Per discussions with the maven.java.net folks, we are now using org.swinglabs.swingx as the groupId.  This is a change from org.swinglabs.  Doing so allows us to use the maven.java.net facitilities for automatically updating Maven Central with our releases.  Future releases should be a lot easier for us in that regard.

The third Maven-related change is that swingx-core no longer contains a copy or dependency on all SwingX classes.  The swingx-graphics package is not used by any of our components.  To suppliment the need to have an all-in-one jar, we have created the swingx-all module which provides all SwingX content as a single JAR file.

To highlight some non-Maven changes, we have:

  • Improved our serialization support.
  • Improved our beaninfo support.
  • Rearchitected our plaf support to allow third party L&F support in the future.
  • Fixed a ton of bugs.
  • Improved our testing style and code coverage.

If anyone is experiencing any issues with out latest release, please let us know over in the forums.  Any feedback, especially about how we divided the code into modules, is always welcomed.

Thanks and enjoy!

by kschaefe at February 02, 2012 07:10 PM

Planet Eclipse

Planet Eclipse

Jonas Helming: Modeling Symposium Submission Deadline

Hi,

Ed and I are organizing the Modeling Symposium for EclipseCon North America (see here). Thank you for all the interesting submissions so far. To notify people early enough about the acceptance of their submission, we need to set a final deadline to February 8th. Please make sure to send me your submission before this deadline.

Looking forward to your submissions!

Jonas

February 02, 2012 09:49 AM

Planet Eclipse

Blaise Doughan: JAXB and Inheritance - Using XmlAdapter

In previous posts I have covered how to map inheritance relationships in JAXB. This can be done by element name (via @XmlElementRef), by the xsi:type attribute, or in EclipseLink MOXy using another XML attribute (via @XmlDescriminatorNode/@XmlDescriminatorValue).  In this post the type indicator will be an XML attribute/element unique to that type, and we will leverage an XmlAdapter to implement this behaviour.



Read more »

by Blaise Doughan (noreply@blogger.com) at February 02, 2012 09:46 AM

The Server Side

Do you need to monitor your Mobile App?

Mobile applications are more and more becoming part of a company’s online services. This leads to the question whether we need to monitor like other parts of our IT infrastructure. As they are part of our shipped application services we need to ensure they are working properly. However, not every application must be monitored the same way. Additionally monitoring always comes at a certain cost. We need people to take care of the monitoring, we have to prepare our applications to be ready for monitoring and we potentially also have to buy or at least integrate new monitoring tools. So is it worth the investment?



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 02, 2012 08:18 AM

Planet Eclipse

Jordi Böhme López: Accessing a very large data set with mobile devices

A few months ago my colleague, Ralf Sternberg, wrote an article on “how to access a huge dataset with the web browser“.  Now, if it’s possible to access very large datasets with a browser, wouldn’t it be really cool to access it in the same way with mobile devices?

As you may have heard, we launched RAP mobile two days ago. And, we did just that. With RAP mobile you can access exactly the same dataset with exactly the same code as in Ralf’s post. The dataset contains over 500,000 emails totaling over 2GB of space. Check out the screencast below and the source code on github.

What I find intriguing about this framework is that it is fast. There is no data on the phone. The information displayed in the UI is retrieved asynchronously from the server while the user is scrolling through this enormous set of data. The native iOS client takes care of the proper preloading, caching and memory management.

 

February 02, 2012 06:58 AM

February 01, 2012

DevX - Java

Java.net Weblogs

Persist document in Cassandra

font:http://www.gerenciandoblog.com.br/2009/08/onde-hospedar-arquivos-para-seu-blog.html



 
 
Nowadays the Enterprise applications beyond persist String and number also can save file. Persist this information is very interesting, for example, a civil process there are information about the process (name of author, date, number of protocol) and the document which represents, or a twett with an image. In Apache Cassandra, you can save file, but for large file you should use a NOSQL Document Store.
 
For demonstrated this resource will made a little program, an album of photography, The picture will show from name. If I use “Paris” will show a picture was related to that name.
 
 
 
 
The program was made with java SE 7 platform, with Swing like GUI, and Easy-Cassandra framework, for this it's necessary download of Easy-Cassandra and its dependencies.
 
The object has two field:
The name of the photo, how this field must be unique it also will the key
The file of the photo
 
The table 1 show the object made.
 
 
@ColumnFamilyValue
public class Photo {
@KeyValue
private String name;
 
@ColumnValue
private File picture;
//getter and setter
}
Table 1: The Object made
 
 
public class PhotoDao {
private Persistence persistence;
public PhotoDao() {
persistence = EasyCassandraManager.getPersistence("exemplo", "localhost", 9160);
}
public void criar(Photo bean) {
persistence.insert(bean);
}
 
@SuppressWarnings("unchecked")
public List<Photo> listarTodos() {
return persistence.findAll(Photo.class,ConsistencyLevelCQL.ALL);
}
}
Table 2: The DAO
 
When the Cassandra is running the next step is create the KeyStore and Family Column, in Cassandra's Client mode execute the command in the table 3.
 
 

create keyspace exemplo; use exemplo;

create column family Photo

with comparator = UTF8Type;

Table 3; Command for run

 
 
 
 
 
This post presented the persistence of an document or file with a simple example. This resource is useful and easy of use. The Easy-Cassandra has support with java.io.File and all classes who implement java.nio.file.Path.
 
 

Reference:

Easy-Cassandra: https://github.com/otaviojava/Easy-Cassandra/

 Example program with Eclipse and Netbeans: https://github.com/otaviojava/Easy-Cassandra/downloads

 

 

by otaviojava at February 01, 2012 07:32 PM

Java.net Weblogs

Bundling Gems in Jars/Wars for Jruby

 

As part of Virgil's ability to deploy ruby scripts to a remote Hadoop cluster, we needed to package gems' into that Hadoop jar.  After a bit of monkeying around, we got it.

This is the key piece of information:

"Because the operation of Java's classpath and Ruby's load path are so similar, especially under JRuby, they are unified in JRuby 1.1. This results in a number of unified capabilities:...

 

  • Everything in the Java classpath is considered to be a load path entry, so .rb scripts, for example, contained in JAR files, are loadable."

First thing you need is to actually get your hands on the gem.  To do this, you can run jruby to grab the gem.

 

java -jar jruby-complete-1.6.0.jar -S gem install -i rest-client rest-client --no-rdoc --no-ri



This will fetch the gems and install them into the current directory under the directory "rest-client".  In that subdirectory you'll find: bin, cache, doc, gems and specifications.  The actual code for the gems is found in the gems directory.  In the case of rest-client, you'll find two directories that contain the code: mime-types-1.17.2 and rest-client-1.6.7.

 

This is what you need to bundle into the jar.  We copied those two directories into our java project under src/main/resources/gems/.

 

One approach would be to simply include those directories on your classpath.  Another approach is to programmatically adjust the loadpath to include those directories.   You can do this with the following lines:

 

List paths = new ArrayList(); 

paths.add("gems/rest-client-1.6.7/lib/"); 

paths.add("gems/mime-types-1.17.2/lib/"); 

this.rubyContainer = new ScriptingContainer(LocalContextScope.CONCURRENT); this.rubyContainer.setLoadPaths(paths);

 

Then, when using this.rubyContainer you'll be able to run ruby files that require the rest-client.

 

Since the ruby scripts are actually loaded via the classpath (from the loadpath), jruby is happy loading them from within a jar.  In our case, we built the jar using maven and the gems were included in the jar because we put them under src/main/resources/gems.

 

 

 

 

by boneill42 at February 01, 2012 04:15 PM

The Aquarium

Java EE 6 samples delivered to your door step

Arun has a blog reminding folks about the Java EE 6 samples that ship with the SDK.

The list of code samples is pretty long and a good complement to the Java EE 6 Tutorial.

ALT_DESCR

Note you can also access these samples from any GlassFish install (not just from the SDK) by adding the missing repository using :

% <install-dir>/bin/pkg set-authority -O http://pkg.sun.com/javaeesdk/6/release/ JavaEE6SDK

% <install-dir>/bin/pkg list -a | grep samples

javaee-samples-build (JavaEE6SDK)   1.0-4 known ----

javaee-samples-full (JavaEE6SDK)    1.0-4 known ----

javaee-samples-web (JavaEE6SDK)     1.0-4 known ----

by alexismp at February 01, 2012 04:00 PM

Planet Eclipse

Orion: Orion Features in Firefox 10 and 11

Firefox 10 was released yesterday, and the release announcement highlighted developer tools such as the Orion-based Scratchpad as key features in the release. At the same time, Firefox 11 moved into their Beta channel. The Mozilla developer tools team released a cool video last week showing upcoming features in Firefox 11, such as a 3D Page Inspector, and a new Orion-based Style Editor. Scratchpad and Style Editor are the result of many months of close collaboration between the Mozilla dev tools team and the Orion Editor team. Congrats to Mihai, Kevin, and the rest of the Firefox team on another great release!

February 01, 2012 02:58 PM

The Aquarium

Quick note - possible short outage on java.net

As we constantly improve the java.net infrastructure you might experience some downtime on Wed, Feb 1, 2012 @ 6-8pm PT. Hopefully, this one should only really be a short one.

ALT_DESCR

by alexismp at February 01, 2012 02:00 PM

The Server Side

Vowels don't cost $500: Pontificating on Java variable naming

Every variable you declare in Java must be associated with a type, and it must also be given a unique name. When naming your variables, put a little bit of thought into it and name them well. Well thought out variable names make Java programs both easier to read and easier to maintain. Good names can even make Java programming fun.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 01, 2012 12:52 PM

The Server Side

Hibernate Query Cache in Action

One of the common problems of people that start using Hibernate is performance, if you don't have much experience in Hibernate you will find how quickly your application becomes slow. If you enable sql traces, you would see how many queries are sent to database that can be avoided with little Hibernate knowledge. In current post I am going to explain how to use Hibernate Query Cache to avoid amount of traffic between your application and database.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 01, 2012 12:50 PM

The Server Side

"Java Sucks" revisited

Is Java well-matured over the past 10 years? Read what a C developer thought about Java 10 years ago and compare it with how things are today!



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

February 01, 2012 12:49 PM

Planet Eclipse

Jens von Pilgrim: Dreaming of an Eclipse Plugin-Store...

or how to sell little tools for little money...



A while ago, I wrote a little tool for exporting UML-like diagrams for Java classes and packages to OmniGraffle. I blogged about that tool and, from my statistics, it got downloaded over 100 times. I also announced that the tool will stop working in 2012, which it actually did. As I wrote in the announcement of the tool, based on the feedback I wanted to decide whether to continue developing the tool or not.



So, what is the feedback after almost six months? There were a few comments, and about 150 downloads according to my logs. Although I installed a donate and Flatter button on my blog, I received no money at all. The natural consequence would be to stop developing (and providing) the tool.



Today, someone posted a comment as the tool has stopped working (just as announced). The commenter also wrote that he needs the tool to create some diagrams for him. Hmm... As I'm trying to be a good guy, I published an update of the tool working until June 2012.



I won't complain about people not giving any feedback or money voluntary. Instead I'm wondering how to make the tool available for a small amount of money. Actually, I don't know about any Eclipse tools to be sold for a couple of dollars/euros, except Log4E. Most tools are either freely available, or they are really expensive. Log4E comes in two versions: A free community edition and a so called "Pro" version for only €7,50. I have purchased that tool a long time ago, rather to support the author than urgently needing the additional features of the Pro version. However, due to the lack of Eclipse supporting this kind of "business model", it is rather complicated to install the license key (and keep it up to date with new Eclipse installations), and I figure managing licenses and payments to be time-consuming for the author as well.



Apple, and also Google, have successfully created systems enabling authors of software to make (little) money by selling there products very easily. Although I don't like the Apple way of approving software, I'm wondering if some kind of "Eclipse PluginStore" would be a good idea. People spend a lot of money on "apps", including a lot of small games. If buying a commercial Eclipse plugin would be as simple as purchasing an iPhone/Android app, would people do that? And how many programmers would publish their tools then? Maybe combining that kind of store with a BugStore (see "Should We Pay for Eclipse Bug Fixes?" for a summary of a discussion taken place in April 2010) would be a good idea as well...



As long as there is no Eclipse PluginStore available: How do you sell your tools?

by Jens v.P. (noreply@blogger.com) at February 01, 2012 11:29 AM

The Aquarium

Another look at GlassFish clustering and performance

With this new "Glassfish – Vertical clustering with multiple domains" blog by Alexandru, there seems to be no shortage of GlassFish configuration posts.

Surely, that must say something about the popularity of GlassFish for highly-available apps.

ALT_DESCR

While it uses mod_jk like most others, this one is multi-domain, uses JMS topics and spends some time looking at different JVM settings and their impact on response time and GC activity.

by alexismp at February 01, 2012 07:00 AM

January 31, 2012

The Aquarium

Transactional interceptors - request for feedback

The Java EE 7 expert group has been defining transactional interceptors and there are a few issues it came across for which your developer feedback would be useful.

ALT_DESCR

Bill Shannon has described the issues of :

how to handle exceptions that are thrown out of a transactional method and

how the new JTA transactional interceptor should interact with EJBs.

... and offers possible solutions.

If you care about these, please take a little bit of time to read through the above descriptions before you provide feedback. The best place for feedback would be the mailing list (subscription required first) but we'll also consider comments posted to this entry.

by alexismp at January 31, 2012 08:08 PM

Planet Eclipse

Andrew Overholt: Eclipse at FOSDEM

This coming weekend is FOSDEM in Brussels, Belgium. It will be my first FOSDEM and I’m really looking forward to it. Lots of my fellow Red Hat, JBoss, and Fedora colleagues will be there, too (list of talks by Red Hatters as a PDF and as HTML). Eclipse content this year includes:

“FOSDEM is the biggest free and non-commercial event organized by and for the community.” There’s no registration required, so if you’re in the area, swing by! There are a lot of people that I’m looking forward to seeing and having a beer with this weekend but I’m especially looking forward to seeing the ever-awesome Alex Kurtakov again and to meeting my new teammate Krzysztof Daniel in person for the first time.

Safe travels and see you in Brussels!

I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

Update: Gregoire de Hemptinne pointed out his talk on an EMF-based declaritive UI system, Wazaabi.

January 31, 2012 07:59 PM

Planet Eclipse

Tom Schindl: e(fx)clipse 0.0.12 released

A little bit later than scheduled here’s the next release. This time the number of new features is smaller than in previous releases but there still some small nice additions. Let’s look into it.

Update to latest upstream modules

The new release comes with Eclipse 4.2M5. I also looked into up-dating the subclipse integration but at the moment the newest version is only provided for win32/64 and so I’m waiting until I can consume it from upstream. All other components (xtext, egit and mercurial) are unchanged.

Linux Support

As promised since the beginning. At the very moment the JavaFX 2.0 team provides builds for Linux e(fx)clipse will provide all in one downloads (one was able to install from the p2-site since the beginning). The JavaFX 2.0 Linux build provided is for 32bit and so is the e(fx)clipse all in one version you can download.

The linux support though is still a bit limited – the live preview (JavaFX-SWT-Integration) crashed my Eclipse instance.

CSS

Support for CSS 3 Selectors

I’ve added support for CSS 3 selectors as the screenshot below shows:

Support for LCD Text

I’ve added support for the newly introduced LCD Text support which is done in CSS using “-fx-font-smoothing-type”

It’s not really easy to follow which CSS-Attributes are added and sometimes the docs are not correct so if you encounter an attribute you definately know is working but the CSS-Editor marks it as an error file me a ticket.

Colors in CSS

I’ve added 2 things when it comes to colors inside the CSS-Editor. You can use a color picker instead of entering the rgb-value manually:



Thanks to Sebastian Zarnekow’s blog this was a piece of cake.

And for already existing colors the hover will display it:

FXGraph

Support for @DefaultProperty

Elements who mark one for their properties as the @DefaultProperty are now respected and you can omit the attribute-name for them making your the file more readable in many situations – whether you make use of this feature is up to you.

Support for Script-Value references

The syntax has been expanded to allow referencing of script values:

FXML

In this release it only received bugfixes. If you want to help with it file bugs, send me patches, … .

Converters

I’ve started working on SVG and FXG to FXML-Converters as I already outline in one my last posts my plan was to add them to e(fx)clipse to allow you converting those external formats to JavaFX 2.0 representations. You should not expect a lot for it as of now because they are in a very very early stage and as outlined in the above post JavaFX 2.0/2.1 (at least for SVG which I looked a bit closer) won’t provide enough API to implement a fully compliant convert as of now.

The main purpose to add them already today into e(fx)clipse is to receive feedback from you on problems you encounter. I hope you share the source SVG and FXG drawings with me or even provide a patch?

An interesting sidenote on this is that technically I’m transforming the source formats into an EMF-Model (there’s a specific one for SVG and one for FXG) and then do the conversion using xtend (a Eclipse and Java-Developer should get started with xtend within 30 minutes because the tooling feels so similar to your JDT-Editor).

Just one final sentence on FXG: Adobe if this is really the spec of a format I’m happy I never had work with your stuff – take a look at SVG-Spec on how I expect someone to define a (graphic) format.

Community Support

I’ve been receiving more and more mails to my private account and I’m always grateful to help but to not only put the burden on me I decided to open a google-group where people can ask questions, others can help too, … . I’ll try to update the fxgraph-reference as well but you know I’m doing this in my spare time and so things take time.

If e.g. you mastered the first steps in fxgraph and want to share your findings, don’t hesitate to send a message to above group. I’ll plan to add an extra page to http://efxclipse.org so that people have a central place to find informations. I’m happy for reviews in blogs (even if there are things you don’t like about e(fx)clipse I want to know them).

You can find the new group at: http://groups.google.com/group/efxclipse. Come, join and bring up ideas to make e(fx)clipse a success.

What’s cooking for the next releases

  • Bugfixes
  • Code improvements (make FXML and FXGraph use the same code base e.g. for content proposals)
  • EclipseCon preperation – If you haven’t seen this. We are going to demonstrate a JavaFX-e4-Application which live snycs with an SWT-e4-Application
  • SVG-Path-Editor based on Xtext naturally (the grammer is already in the git-repo)


January 31, 2012 07:37 PM

Planet Eclipse

Orion: Orion 0.4 M2 – New and Noteworthy

It has been another blockbuster milestone for the Orion project. This milestone brings extensive tooling improvements, including global search and replace, content assist for HTML, template completion for JavaScript, and CSS outline and error checking. The user interface has also had a major facelift with an eye toward giving more pixels to the most important content, and optimizing for mobile devices and touch displays. There is also a brand new user settings page, and a completely redesigned Git user interface. As always, you can give it a spin on OrionHub (sign up), or download your own copy. Read on below for more details.

Replace across multiple files

You can now replace matches across multiple files from the Search Results page. After performing a search, click Replace to open a slideout where the replacement text is entered. After entering the text, click Preview Changes to open a preview of all the matches to be replaced. From this page you can check or uncheck individual files or matches, and use next/previous diff buttons in the compare editor to cycle through your changes. Finally, click Commit to perform the replace.

Search results improvements

You can now navigate through search results using the Up and Down arrow keys on your keyboard. Push Right arrow to open a popup showing additional lines surrounding the search result, and Left arrow to close the popup.

Find File dialog improvements

There have been several improvements to the Find File dialog, accessed via Ctrl+Shift+R in the editor or by pressing ‘t’ on other pages:

  • When multiple matching files have the same name, the full path of each file is now shown to help you tell them apart.
  • Matching favorites now appear at the top of the list
  • You can navigate between search results using the Up and Down arrow keys
  • Matches are now sorted alphabetically

JavaScript content assist templates

JavaScript content assist in Orion now provides templates for common control structures. Simply invoke content assist with Ctrl+Space, and select from among the available templates that match your current cursor position. Templates have been added for:

  • for...in iteration over object properties
  • for loop over an array
  • while and do/while loops
  • if and if/else blocks
  • try/catch and try/catch/finally blocks
  • switch blocks

Some templates require you to fill in certain variables such as conditions or other values. Use Tab to iterate through the fields to be completed, and Enter to finish the template.

JavaScript content assist variable and argument completion

JavaScript content assist will now propose matching local variables and function arguments from all enclosing functions in the current script.

HTML content assist

Content assist has been added for HTML files. Invoking content assist in an empty file will produce a basic well-formed HTML 5 document. Completion is offered for all elements supported in HTML 5. Closing element tags are inserted where appropriate.

For lists and tables, completion will also insert the first list item or table row for you:

CSS Lint plug-in

Orion CSS Lint integration, previously available as a separate plugin, is now included by default in the set of plug-ins distributed with Orion. In addition, this plug-in now provides an outline view for CSS files.

New settings page

A new Settings page has been introduced. The JavaScript Editor tab allows customization of fonts and colors in the JavaScript editor. Note that changes take effect immediately across all editors you currently have open in the current browser.

The Plugins tab shows the set of installed plugins, and supports adding and removing plugins. This page will evolve to show further details about each plugin as well.

Navigator “Go up” command

A new command has been added to the Navigator page, allowing you to quickly navigate up to the parent of the current folder. Simply click Go Up, or use Alt+Up on your keyboard.

Background progress reporting

Orion can now report progress on multiple background operations at once, and even report progress on operations occurring in other frames and pages. This sounds simple, but anyone who has tried to do this on the web will realize how amazing this is. Click the progress button in the top right corner of the page to drop down a list of current and recent operations. From this list you can also visit a separate page showing a longer operation history.

A new Related Pages menu has been added to the page header. This allows you to quickly navigate between multiple pages that deal with the same file or folder you are currently viewing. For example, from the editor page you can now quickly jump to the Git Log page showing commits involving that file.

Revamped Orion header

The header at the top of each Orion page has been overhauled and cleaned up. Highlights include:

  1. More static information has been moved to the top of the header, and dynamic information has moved down to be closer to the content.
  2. The logo has been moved and shrunk to make more room for the header information you really care about.
  3. More room has been created for additional navigation features such as the new Related pages menu.
  4. Toolbars have been moved down out of the header into the most appropriate page area. For example the Save button and current line/column information is now in a bar directly above the editor rather than in the global header. One result of this change is that toolbars are still available when the header/footer are collapsed via Ctrl+Shift+M

For more information on the Orion UI design philosophy and direction, see the Orion Page Layout wiki page.

Customized tablet/mobile presentation

Orion styling has been tweaked to work much better on mobile devices. When using a display of 1024 pixels or less, we now pad the checkbox and twistie icons with more hittable breathing room.It is now much easier to check/uncheck boxes and invoke commands on a small touch screen. In addition, an editor problem with automatic uppercasing introduced with a recent iOS update has been addressed. The Orion editor now functions well again on iPad.

Fork me on Orion

Orion now uses URI templates to invoke commands on an Orion page using a URI. These commands are limited to altering the page layout such as opening input fields and dialogs. For example, you can now create a URL to initiate a clone operation on a particular repository. To see this in action, click Fork me on OrionHub to clone the Orion client code in your OrionHub account. Note you still need to manually click “Submit” after visiting the URL before the clone operation actually starts.

New git repository page

A completely new Git Repositories page has been introduced in this milestone. This replaces the previous deep tree structure with a flatter, more web-like presentation. Most basic commands are available at a glance without having to drill down, making the page much easier to use on touch and mobile devices. The Working Directory section shows at a glance what changes you have made that require staging or committing. The Commits sections shows all incoming commits that require merging, and all outgoing commits that have not been pushed to the current branch’s remote repository. There are further sections listing all branches, tags, and remotes for the current repository.

New git commit details page

A new Git Commit page has been introduced to accompany the new repositories page. Simply click on any commit from either the Repositories or Git Log page to open the commit details page. From here you can see all information about the commit, including author/committer, link to parent commit, associated tags, and diffs of all files modified by the commit. You can also tag or cherry-picka commit from this page.

Save and apply Git patches

You can now save unstaged changes as a patch to be reapplied later. From the Git Status page, simply select the files to be saved, and click Save Patch.

Saved patches can be applied later, or by another user, by clicking Apply Patch on the Git Repositories page. A patch can be applied either from an uploaded file, or from a URL (such as a bugzilla attachment).

Remove git tags

Git tags can now be removed. From the Git Repositories page, find the tag you want to remove and click Delete. Tag deletions can be pushed to a remote repository using the Push All command on the same page.

Automatic password reset

You can now associate an email address with your Orion account from your Profile page. Once the address is confirmed, it can be used to automatically reset your Orion password if you forget it in the future.

Server running Jetty 8

We have upgraded the neolithic Jetty version we previously shipped with the Orion Server. We are now running and delivering the most recent Jetty 8.1 from eclipse.org.

Enjoy!

January 31, 2012 04:13 PM

Java.net Weblogs

Guest Post: Is Java the best language to meet my needs?

This email came into our site feedback alias this morning, and I thought this would be a great topic to ask the community.  I'm a big believer in using the right tool for the job, even if it's not Java at the moment.  I asked his permission to post it here, so please meet Mike: 

To whom it may concern,

I need your advice.  Back in 2000 I was a post-doctor at the University of Caledonia in Berkeley.  While there, I became ill with a type of brain cancer called a medulloblastoma, and was forced out of research.



After release from the hospital, I started programming rehabilitation games similar to the ones used in brain injury rehabilitation.  I decided to do this because these types of games, although a medical tool, are quite expensive.  I wanted to produce my own version of these games that were free.  The results of my efforts can be seen at http://www.msty-neurotraining.com and are registered at the Brain Injury Association of America (http://www.biausa.org/) as a rehabilitation tool.



However, I have a serious problem.  These programs were made using Microsoft’s Visual Basic 6, and the programs made with it will soon become obsolete and no longer run modern versions of Windows computers. Therefore, I am looking for an alternative.  Preferably one which is open source (like Java) to keep in spirit that the games are a free medical tool.   Do you have any suggestions as to what open source programming language would be appropriate for my needs? I need something that can produce programs capable to manipulate 2D graphics, save and retrieve files and use a joystick.  I am not restricted to using a programming similar to Visual Basic; I can also program in C++ (the programming language we predominantly used at Berkeley).



Would Java be a good alternative to Microsoft’s Visual Basic?  If not, what other programming tool would you advise using?



Also, how do I go about starting an Open Source project to create a rehabilitation tool like the one the I created with VB6?  Starting such a project would be preferable to working alone, because I feel that a team working together always gets better results than an individual working alone.



Sincerely,



Michael Tarsitano (PhD)

Bruchsal, Germany

 

by sonyabarry at January 31, 2012 03:08 PM

Planet Eclipse

Mickael Istria: Goodbye PetalsLink, hello JBoss|Red Hat !

Today is my last day working for PetalsLink.

Working for PetalsLink was a quite interesting experience:

On the technical side, I enjoyed moving all the XML-based tooling of PetalsStudio to a more powerful EMF-based approach for Petals JBI editor – for those who don’t know JBI, it is a standard that allows to define SOA artifacts in your ESB. Moving to EMF allowed us to provide better tooling faster, because most of the complexity in manipulating JBI can be removed with very few efforts leveraging EMF ExtendedMetaData. That was the first time I faced this part of EMF, and I got pretty impressed of how well it works (working with EMF always gives this impression of “being well”). I also improved the ability to plug new JBI components into the Studio, which is a critical point when you have to deal with connectors for almost everything – Mail, SFTP, Talend, XSLT…. So that was an interesting challenge in term of conception and development.

Petals Studio was also the pretext to start using Git, GitHub and Sonar. I am pretty happy to have learnt these 3 tools that clearly improved the way I work.

Also, I had the great opportunity to work closely to several Eclipse projects:

  • I could contribute the Tycho build of GMF Tooling, put it on Hudson, get source moved to Git/mirrored to GitHub, improve wiki… GMF Tooling is a project I’ve used for 3 years now and I often saw in it some critical organization points to improve to make it more dynamic in term of development. Working at PetalsLink gave me the opportunity to do what I think was necessary to keep the project healthy. With the help of Michael Golubev, I now think this was an real success.
  • I could contribute to Nebula the TreeMapper widget, which will probably have some very interesting use-cases soon. As I became a committer, I also helped in improving Tycho build and CI, nad it seems like the project liked it if we look at the new p2 update-sites.
  • I contributed some small improvements to Eclipse BPEL designer, tried (unsuccessfully) to make SWTBot use Tycho, and developed a useful extension for Draw2d.

The only thing I wish I would be able to do here is to push ahead the usage of Sonar at Eclipse, at least for GMF Tooling and Nebula.

But I probably learnt even more things from PetalsLink by discovering another company organisation that is very different from what I could experiment before (OpenWide and BonitaSoft): PetalsLink is focused on the Research about SOA and agility of Systems of Information. It is a wide topic! Petals products are quite good compared to other alternatives in the SOA landscape, but they don’t meet the success they deserve, it was a bit frustrating for a developer.

I enjoyed working for PetalsLink, all the expectations are fulfilled, so it is time for me to go ahead, to find a new experience, a new team, new challenges, new issues… I love discovering new things!

That’s why I’ll start working for JBoss|Red Hat tomorrow, as part of the team developing JBoss Tools and JBoss Developer Studio.

I’ll have the opportunity to work with a great team! My main occupation for the next monthes will be to assist Nick Boldt in making JBoss Tools CI and build infrastructure better and better. I’d also like to open the road towards efficient QA for JBoss Tools, including -among other- usage of Jacoco and Sonar. Then I’ll also work on developing nice stuff for some JBoss Tools modules, most probably on the SOA/BPM part.

That’s gonna be a lot of fun! I’m eager to be tomorrow and actually get started for this new team/employer/project/product/users.

Let’s keep in touch via this blog and twitter ;)



January 31, 2012 02:54 PM

The Server Side

Using the Tomcat 7 JDBC Connection Pool in Production

Using the Tomcat 7 JDBC Connection Pool in Production



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

January 31, 2012 02:40 PM

The Server Side

About the Performance of Map Reduce Jobs

Most tutorials and blogs around map/reduce performance talk about the various hadoop options. Instead I want to look directly at the source of the problem, the performance of the map/reduce job itself and how the framework impacts it. When you know what happens underneath, you can improve the job performance a lot with less hardware.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

January 31, 2012 02:40 PM

The Server Side

Thymeleaf Spring-MVC Maven Archetype 1.0.0 Released

This week I have released first version of Thymeleaf-Spring Maven Archetype. Thymeleaf Spring-MVC Maven Archetype aims to create a web application that uses Thymeleaf template engine and Spring Framework. The main goal of Thymeleaf is to provide an elegant and well-formed way of creating HTML 5 templates.



Add to digg Add to StumbleUpon Add to del.icio.us Add to Google

January 31, 2012 02:40 PM

Planet Eclipse

David Bosschaert: Backing up through FTP on a Mac

It's been a little over half a year now that I made the transition to mac. I was more or less forced into it by Dell because they didn't make the 1920x1200 high-res laptops any more that I like working with.

But I have to say, the Apple hardware is second to none - I haven't experienced any mysterious crashes since.



However I had to find Mac alternatives for all the software that I was using, and I managed to find most of what I was looking for quite quickly...

  • For viewing zip archives I currently use Zipeg, it only does extraction but that's good enough more most cases.
  • I really like Breeze for keyboard-based window alignment, similar to what Windows 7 has.
  • And I started using BetterTouchTool to map a keystroke the mousebuttons (saves me from having to press the touchpad all the time, which I don't really like).
  • I'm still undecided about iTunes, I don't really like it (e.g. it's missing a feature that shows what you're playing in the dock or something like that) but it kinda does what it needs to do and there doesn't seem to be anything better on the Mac, strangely enough...
  • Most other applications that I had been using before have Mac versions, except for...
... a backup solution! I was always using Areca in the past which works great and had both Windows and Linux versions available. I guess everybody on Mac simply buys a Time Machine but I wanted to use my existing network storage drive for my backups.


I found iBackup and used it for about half a year. It was seemingly able to do the work over a Samba mount to my network drive, although I did notice that I was getting many failure runs, in fact over half of the runs were failures. It might have been caused by the SMB implementation on my NAS drive, I don't really know but I noticed that it was having issues with relatively large files (over a couple of megs).
I started looking at using FTP to do the backups instead (my NAS drive supports FTP) but iBackup doesn't support that.


After looking around for a while I couldn't find any freely available backup option for Mac that uses FTP. I might have missed one or two, but in the end I started writing a little shell script to do the job. One of the things that I was worried about was the backup speed. My script logs in and out for every directory recursively so I was concerned that it would take much longer to complete than the SMB option. I was very surprised that for my data it took 9 minutes to complete, where the SMB-based option took several hours if it completed at all.


So here it is, a simple little bash script to backup any directory on your mac using FTP, I invoke it like this
example..
ftp-bku.sh ~/bin ~/docs ~/etc ~/utils
Note that I have my FTP credential in my ~/.netrc file so that I don't need to provide them in the script itself...


For those who are interested, you can find the script below (btw one thing that isn't completely reliable yet is the return code of the ftp program. It's 0 in some cases when there actually is a problem. Not sure if this can be fixed, although I could grep the output for error messages...)



FTPURL=ftp://User@192.168.1.24:2121

FTPBASEDIR=MyDir

TIMESTAMP=$(date +"%d%m%y-%H%M%S")

BACKUPDIR=backup_`hostname`_$TIMESTAMP

# Perform the actual FTP backup

function backup {

    PNAME="$1"

    DNAME="$2"

    ftp -i -V $FTPURL<<EOF

    bin

    cd "$FTPBASEDIR"

    mkdir "$BACKUPDIR"

    cd "$BACKUPDIR"

    lcd "$PNAME"

    mkdir "$DNAME"

    cd "$DNAME"

    mput *

    quit

EOF

    if [ "$?" == "0" ]; then

        echo Backup succeeded: "$BACKUPDIR"

    else

        echo Backup failed: "$BACKUPDIR"

    fi

}

# Backup the directory specified as $2 recursively where the base directory is $1

# So to backup /Users/david/etc/tmp as etc/tmp you pass in 

#  /Users/david/etc/tmp etc/tmp
function backup-dir {

    cd "$1"

    if [ -d "$2" ]; then

        BASE="$1"

        DIR="$2"

        BASELEN="${#BASE}"

        SUBDIR="${DIR:BASELEN}"

        TARGET="`basename "$1"`$SUBDIR"

        backup "$2" "$TARGET"

    fi

    cd "$2"

    for dir in *

    do

        if [ -d "$2/$dir" ]; then

            backup-dir "$1" "$2/$dir"

        fi

    done

}

# Staring point, backup all directories specified on the command line

for directory in "$@"

do

    backup-dir "$directory" "$directory"

done

by davidb (noreply@blogger.com) at January 31, 2012 11:59 AM

DevX - Java

Oracle WebCenter Quick Start for the Uninitiated Java Developer

A quick start guide to get WebCenter up and running in JDeveloper for portal developers more familiar with other environments like Eclipse.

by Ryan Munro at January 31, 2012 11:36 AM

Planet Eclipse

Hendrik Eeckhaut: Xtext resource caching: loading resources 5 times faster

Those who cannot remember the past are condemned to repeat it (George Santayana). I've always felt ambivalent about that quote. History never ever repeats itself exactly. In computer science on the other hand, it applies very well. In all our collective software applications, we recalculate the same results time and time again and are therefore faced with constant question to remember or not to remember. In this blog series, I'm going to talk about a cache for Xtext resources that we've developed over the past year.

read more

January 31, 2012 09:54 AM

Planet Eclipse

Philip Wenig: More than 500 OpenChrom downloads this month!

OpenChrom breaks the 500 download mark today! It’s the first time that OpenChrom has been downloaded more than 500 times in a month since its start in April 2010. Jippie!



January 31, 2012 07:25 AM

Planet Eclipse

Doug Schaefer: Change, sometimes it just happens.

Well, it's been almost two weeks since my previous employer decided it was time for me to make a career change. Of course there's more to it than that but that's all I'm going to say about that. "It is what it is," and I'm actually pretty excited to see where my career takes me next.



While I'm an independent developer (which sounds much better than unemployed, no?), I have a few things I want to work on. Writing again in this blog is definitely one of them. It's been way too long and I've gotten used to spewing things in Twitter which is very handy but doesn't stay around long enough and isn't long enough to capture my thoughts in time. I have lots of opinions on things and it's good therapy for me to write them down.



The main technical area I continue to be very interested is, of course, Eclipse and the CDT. I've spent a lot of time over the last few months learning and thinking about usability and the importance of design and user experience. Pretending to be a newbie CDT user and walking through normal day-to-day activities shows me a few areas that need to be addressed. And since I'm still a CDT committer, I have the power to fix them.



I continue to be fixated with mobile and the new world that mobile UI and application architectures brings us. There's a reason these devices are flying off the shelves at your local phone and electronic store. They're so easy for the regular consumers to learn and use, and so powerful. It's that kind of user experience I'd like to see brought over to the desktop as well. I continue to follow the progress of Qt 5, which I believe can be a great framework not just for new desktop paradigms, but for mobile as well. It still seems to have a ways to go before it's stable, but I'm going to start experimenting with it as soon as I can get a build that works on my laptop.



The third area is a new one for me that I started chewing on in my spare time over the last few months, and that's web app development. Node.js has caught my eye as it has with numerous other developers. It's asynchronous programming model is very similar to the way we often program in embedded to produce scalable systems that react to events in the real world. While JavaScript is the cool thing in the web world these days, I have wondered whether we could provide similar APIs in a type-safe world, say using Java. People use Java on servers, no? And the convergence of server-side apps and mobile clients and embedded devices is a natural. It's the "Internet of Things".



So stay tuned for more over the upcoming days. As I mentioned, writing is good therapy, whether it be text in a blog or code in the exciting new world of mobile/web.

by Doug Schaefer (noreply@blogger.com) at January 31, 2012 07:03 AM

The Aquarium

Java EE getting social with DaliCore

DaliCore is a new project announced by Johan Vos on java.net to offer users and social networks on top of Java EE.

It is the open-sourcing of LodgON's technology developed for the past few years and used in a number of social websites.

ALT_DESCR

You can think of this as twitter, Facebook, or social network-enabling your applications using Content, User, Group, and Authorization APIs. DaliCore is a logical extension to the the Java Enterprise specification (specifically to Java EE 6).

As with any Java.net project, you can start playing with the source code, engage on mailing lists, file bugs, but also get further details in this short presentation.

Good luck to Johan and team on this project!

by alexismp at January 31, 2012 06:54 AM

A