★ wanayoo — archive 1999 https://blogs.oracle.com/brunoborges/Nouvelle recherche | Portail wanayoo

Monday Dec 17, 2012

WebFX: Running JavaFX as web page

This weekend I wanted to learn JavaFX, so I decided to code an idea I had a few years ago when I first saw JavaFX Script. So I started coding a web browser that runs HTML with the awesome, HTML5 supported WebView. But this browser also offers one extra feature: it loads FXML files as if they were HTML. So instead of defining your web page with HTML and running with WebKit, you can define a web page with FXML+CSS+JS and run as a JavaFX application.

The project is called WebFX and already has a prototype on GitHub. I also uploaded a video on YouTube demonstrating the idea.

What do you think about using JavaFX in the future for web pages, instead of HTML?

Wednesday Dec 12, 2012

7 reasons you had to be at JavaOne Latin America 2012

Yesterday was 12/12/12, and everybody went crazy on Twitter with cool memes like this one. And maybe you are now wondering why I mentioned 7 (seven) on the blog title. Because I want to play numbers? Yes! Today is 7 days after JavaOne Latin America 2012 is over (... and I had to figure out an excuse for taking so long to blog about it...).

So unless you were at JavaOne Latin America this year, here are 7 things you missed:

  1. OTN Lounge mini-theatre
    There was a mini-theatre holding several lightning talks. We had people from SouJava JUG, GoJava JUG, Globalcode, and several other Java gurus and companies running demos, talks, and even more. For example, @drspockbr talked about the ScrumToys project, that demonstrates the power of JSF.



  2. Hands On Lab for JAX-RS and WebSockets
    One of the cool things to do during JavaOne is to come to these Hands On labs and really do something using new technologies with the help of experts. This one in particular, was covered by me, Arun Gupta, and Reza Rahman. The HOL had more people than laptops (and we had 48 laptops!) interested on understanding and learning about the new stuff that is coming within Java EE 7. Things like JAX-RS, Server-sent Events and WebSockets. Hey, if you want to try this HOL by yourself, it is available on Github, so go for it! If you have questions, just let me know!



  3. Java Community Keynote
    This keynote presented a lot of cool things like startups using Java in their projects, the Duke Awards, SouJava winning the JCP Outstanding Award, the Java Band, and even more! It was really a space where the Java community could present what they are doing and what they want to do. There's a lot of interest on the Adopt-a-JSR program and the Adopt-OpenJDK. There's also an Adopt-a-JavaEE-JSR program! Take a look if you want to participate and Make the Future Java.

    DSC_1572.JPG

  4. Java EE (JMS, JAX-RS) sessions from Reza Rahman, the HeavyMetal guy
    Reza is a well know professional and Java EE enthusiast from the communitty who just joined Oracle this year. His sessions were very well attended, perhaps because of a high interest on the new things coming to Java EE 7 like JMS 2.0 and JAX-RS 2.0. If you want to look at what he did at this JavaOne edition, read his blog post. By the way, if you like Java and heavymetal, you should follow him on Twitter as well! :-)

  5. Java EE (WebSockets, HTML5) sessions from Arun Gupta, the GlassFish guy
    If you don't know Arun Gupta, no worries. You will have time to know about him while you read his Java EE 6 Pocket Guide. Arun has been evangelizing Java EE for a long time, and is now spreading his word about the new upcoming version Java EE 7. He gave one talk about HTML5 Productivity on the Java EE 7 platform, and another one on building web apps with WebSockets. Pretty neat! Arun blogged about JavaOne Latin America as well. Read it here.

  6. Java Embedded and JavaFX
    If there are two things that are really trending in the Java World right now besides Java EE 7, certainly they are JavaFX and Java Embedded. There were 14 talks covering Java Embedded, from Java Cards to Raspberry.pi, from Java ME to Java on your TV with Ginga-J. The Internet of Things is becoming true, and Java is the only platform today that can connect it all in an standardized and concise way. JavaFX gained a lot of attention too. There were 8 sessions covering what the platform has to offer in terms of Rich User Experience. The JavaFX Scene Builder is an awesome tool to start playing designing an UI, and coding for JavaFX is like coding Swing with 8 hands, one holding your coffee cup. You can achieve a lot, with your two hands (unless, you really have 8 hands, then you can achieve 4 times more :-). If you want to read more about JavaFX, go to Stephen Chin's blog post.

    DSC_1533.JPG

  7. GlassFish and Friends Party, 1st edition at JavaOne Lating America
    This is probably the thing that I'm most proud. We brought to Brasil the tradition of holding a happy hour for all GlassFish, Java EE friends. This party started almost 7 years ago in San Francisco, and it was about time to bring it to Brazil! The party happened on Tuesday night, right after JavaOne General Keynote, at the Tribeca Pub. We had about 80 attendees and met a lot of Java EE developers there! People from JUGs, Oracle, Locaweb and Red Hat showed up too, including some execs from Oracle that didn't resist and could not miss a party like this one.

    Lots of caipirinhas, beer and food to everyone, some cool music... even The Fish walking around the party with Juggy!



    You can see more photos from the party on an album I shared with the recently created GlassFish Brasil community on Google+ here (but you may be more interested in joining the GlassFish english community). There's also more pictures that Arun took and shared on this link.

So now you may want to consider coming to Brazil next year! Java EE 7 is on its way, and Brazil is happily and patiently waiting for it, with a lot of enthusiasm.

By the way, GlassFish and Java EE 6 just celebrated a Happy Birthday!

Wednesday Nov 28, 2012

GlassFish and Friends Party, 1st Edition at JavaOne Brasil

Estamos muito contentes em anunciar que iremos realizar a primeira edição da tradicional  GlassFish and Friends Party neste JavaOne in Brasil.  
O problema é que os ingressos já esgotaram!

Então decidimos realizar um concurso para dar mais 5 ingressos para a comunidade! Aqui estão as regras:

  1. Escreva um post no seu blog sobre o GlassFish
  2.  Poste no Twitter o título e o link do seu post com a hashtag #GlassFish para que possamos saber do seu post
  3. Os 5 melhores posts serão selecionados e anunciados aqui no dia 3 de Dezembro às 19:00 (GMT-3)
  4. Selecionaremos um post de cada autor
  5. Cada autor receberá um ingresso para a festa

Agora corre para a sua plataforma de blog e escreva sobre o GlassFish!

------------- en_US --------------- 

We are very happy to announce that we are going to host the first edition of the traditional GlassFish and Friends Party at this JavaOne in Brasil. 

The problem is: tickets are already SOLD OUT! 

So we decided to run a simple contest to give away 5 more tickets to the community! Here are the rules:

  1. Blog about GlassFish
  2. Tweet the title and link of your blog post with the hashtag #GlassFish so we can know about your blog post
  3. The best 5 blog posts will be selected and announced here on December 3th at 7pm (GMT-3)
  4. We will select one blog post per author
  5. Each author will get one ticket
Now run to your blog platform and write about GlassFish!

Sunday Nov 04, 2012

First steps with Oracle ADF Mobile for iOS and Android

Oracle announced recently its new Mobile development platform, called Oracle ADF Mobile. With it, you can build truly Java applications, deploy and run real Java code on both Android and iOS with its self-contained Java runtime.

It also comes with PhoneGap. which allows you to use any feature your phone offers, like sensors and camera. It's probably the most complete solution for mobile development out there, simply because with Oracle ADF Mobile, you can write Native, Hybrid or Web applications for your smartphone and tablet.

Do you want to take a quick look on what can be done with it? Check out this video! 

Now, to start with Oracle ADF Mobile, here are the first steps you will have to go through.

  1. Download Oracle JDeveloper
    Go to this link and download the install file for your environment (Windows, Linux-32bit or Generic)
  2. Install JDeveloper (of course)
    If you need help on this, look at the documentation (if you've downloaded 11gR2, click here)
  3. Download Oracle ADF Mobile Bundle
    This is the download page for Oracle ADF Mobile. Accept the license as usual at the top, and follow with the Download button. It will take you to another page, where you will see a table containing a download link. Click on it and it will start downloading a ZIP file.
  4. Start JDeveloper
    Start Oracle JDev. It may self update. Restart the IDE if you are asked to.
  5. Go to Help > Check for updates
  6. Click Next and make sure you are at the "Source" tab
  7. Select "Install From Local File"
  8. Select the Oracle ADF Mobile ZIP you downloaded on step 3
  9. Finish the process

 

Now you have JDeveloper with Oracle ADF Mobile sucessfully installed!

There are two great tutorials to start coding with ADF Mobile. Just choose your platform!

And have fun! :-) 

Tuesday Oct 23, 2012

Using Coherence API to get POF bytes

Someone raised the question on how to use the Coherence API to get the bytes of an object in POF (Portable Object Format) programatically. So I came up with this small code that shows the very cool API simple usage :-)

   SimplePofContext spc = new SimplePofContext();
   spc.registerUserType(0, User.class, new UserSerializer()); 
   // consider UserSerializer as an implementation of PofSerializer
            
   User u = new User();
   u.setId(21);
   u.setName("Some Name");
   u.setEmail("some.name@domain.com");
            
   ByteArrayOutputStream baos = new ByteArrayOutputStream();
   DataOutput dataOutput = new DataOutputStream(baos);
   BufferOutput bufferOutput = new WrapperBufferOutput(dataOutput);
   spc.serialize(bufferOutput, u);
            
   byte[] byteArray = baos.toByteArray();
   System.out.println(Arrays.toString(byteArray));

 Easy, isn't?

Wednesday Sep 26, 2012

JavaOne 2012: Camel, Twitter, Coherence, Wicket and GlassFish

Before joining Oracle as Product Manager for WebLogic and GlassFish for Latin America, at the beggining of this year I proposed two talks to JavaOne USA that I had been presenting in Brazil for quite a while. One of them I presented last year at ApacheCon in Vancouver, Canada as well in JavaOne Brazil. In June I got the news that they were accepted as Alternate Sessions. Surprisingly enough, few weeks later and at the same time I joined Oracle, I received the news that they were officially accepted and put on schedule.

Tomorrow I'll be flying to San Francisco, to my first JavaOne in the United States, and I wanted to share with you what I'm going to present there.
My two sessions are these ones:

  1. Wed, 10/03, 4:30pm - CON2989 Leverage Enterprise Integration Patterns with Apache Camel and Twitter

    On this one, you will be introducted to the Apache Camel framework that I had been talking about in Brazil at conferences, before joining Oracle, and to a component I contributed to integrate with Twitter. Also, you will have a preview of a new component I've been working on to integrate Camel with the Oracle Coherence distributed cache.

  2. Thu, 10/04, 3:30pm - CON3395 How Scala, Wicket, and Java EE Can Improve Web Development

    This one I've been working on for quite a while. It was based on an idea to have an architecture that could be as agile as frameworks and technologies such as Ruby on Rails, PHP or Python, for rapid web development. You will be introduced to the Apache Wicket framework, another Apache project I enjoy working with and gave lots of talks at Brazilian conferences, including JavaOne Brazil, JustJava, QCon SP, and The Developers Conference. You will also be introduced to the Scala language and how to create nice DSLs to boost productiveness. And last but not least, the Java EE 6 platform, that offers an awesome improvement from previous versions with its CDI, JPA, EJB3 and JAX-RS features for web development.

Other events I will be participating during my stay in SF:

  1. Geeks Bike Ride
  2. GlassFish Community Event
  3. GlassFish and Friends Party 

 

If you have any other event to suggest, please do suggest! It's my first JavaOne and I'm really looking forward to enjoying everything.

See you guys in a few days!!

Monday Sep 17, 2012

WebLogic Application Server: free for developers!

Great news! Oracle WebLogic Server is now free for developers! What does this mean for you? That you as a developer are permited to:

"[...] deploy the programs only on your single developer desktop computer (of any type, including physical, virtual or remote virtual), to be used and accessed by only (1) named developer."

But the most interesting part of the license change is this one:

"You may continue to develop, test, prototype and demonstrate your application with the programs under this license after you have deployed the application for any internal data processing, commercial or production purposes" (Read the full license agreement here)

If you want to take advantage of this licensing change and start developing Java EE applications with the #1 Application Server in the world, read now the previous post, How To Install WebLogic Zip on Linux!

Monday Sep 03, 2012

How to Install WebLogic 12c ZIP on Linux

I knew that WebLogic had this small ZIP distribution, of only 184M, but what I didn't know was that it is so easy to install it on Linux machines, specially for development purposes, that I thought I had to blog about it.

You may want to check this blog, where I found the missing part on this how to, but I'm blogging this again because I wanted to put it in a simpler way, straight to the point. And if you are looking for a how to for Mac, check Arun Gupta's post.

 So, here's the step-by-step:

1 - Download the ZIP distribution (don't worry if your system is x86_64)
Don't forget to accept the OTN Free Developer License Agreement!

2 - Choose where to install your WebLogic server and your domain, and set as your MW_HOME environment variable
I will use /opt/middleware/weblogic for this how to

export MW_HOME=/opt/middleware/weblogic
Make sure this path exists in your system. 'mydomains' will be used to keep your WebLogic domain.
mkdir -p $MW_HOME/mydomain

3 - If you don't have your JAVA_HOME environment variable still configured, do it. Point it to where your JDK is installed.

export JAVA_HOME=/usr/lib/jvm/default-java

4 - Unzip the downloaded file into MW_HOME

unzip wls1211_dev.zip -d $MW_HOME

5 - Go to that directory and run configure.sh

cd $MW_HOME
./configure.sh

6 - Call the setEnvs.sh script

. $MW_HOME/wlserver/server/bin/setWLSEnv.sh

7 - Create your development domain. It will ask you for username and password. I like to use weblogic / welcome1

cd $MW_HOME/mydomain $JAVA_HOME/bin/java $JAVA_OPTIONS -Xmx1024m \ -Dweblogic.management.allowPasswordEcho=true weblogic.Server

8 - Start WebLogic and access its web console

(sh startWebLogic.sh &); sleep 10; firefox http://localhost:7001/console

Usually, it takes only 10 seconds to start a domain, and 5 more to deploy the Administration Console (on my laptop). :-)

Enjoy!

Friday Aug 10, 2012

WebLogic 12c Overview - OTN Tour 2012

I had the pleasure to be part of the OTN Tour 2012 Latin America, that is going on right now (August 2012) and to know some folks from Oracle HQ, but more importantly, to present architects, administrators, DBAs and software developers a little bit of Oracle WebLogic 12c and its great integrations with other Oracle products, specially Oracle RAC with its Active GridLink, Coherence Data Grid and of course, Oracle Exalogic.

If you couldn't come to the OTN Tour in Buenos Aires and Montevideo, don't worry. The slides are right here! :-)

Hope you enjoy!

Friday Aug 03, 2012

Issue dev'ing RESTful JSON services on NetBeans

Here is a tricky issue that you may find if you are developing RESTful services with Java EE on NetBeans and GlassFish or WebLogic. If you want to support the JSON format but need to access some implementation classes like @JsonIgnore, you need to add the JAX-RS RI, Jersey, to your project's Libraries definition. How to add the RI? You will probably do this:

  1. Open project's Properties (right click on the project)
  2. Go to Libraries
  3. Click on 'Add Library'
  4. Select 'Jersey 1.8 (JAX-RS RI)

But you won't have your service running fine. You may find these exceptions: (added here so Google can help future users)

1 - If you try to access your RESTful service to get a JSON format of it, you will get this exception:

com.sun.jersey.spi.inject.Errors$ErrorMessagesException
  at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
  at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)

2 - If you try to access your RESTful service to get an XML format, you will get this exception:

java.lang.RuntimeException: javax.naming.NameNotFoundException: Unable to resolve 'com.sun.jersey.config.CDIExtension'. Resolved 'com.sun.jersey.config'; remaining name 'CDIExtension'
  at com.sun.jersey.server.impl.cdi.CDIExtension.getInitializedExtension(CDIExtension.java:177)
  at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactory.(CDIComponentProviderFactory.java:92)
  at com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer.initialize(CDIComponentProviderFactoryInitializer.java:75)
  at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:576)
  at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:311)

 If you look at your server's log, (in my case, I was using WebLogic 12c) you may find this message somewhere:

WARNING: 
**********
The application is using ServletContainerInitializer class com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer that is loaded from:file:/labs/wls1211/modules/com.sun.jersey.server_1.1.0.0_1-9.jar. This initializer overrides the one available in the system.
**********

When you added Jersey to your library, the "package" checkbox was checked by default. So the JAR ended up going into WEB-INF/lib of your project, conflicting to the already provided by the container. 

So, how to fix this issue? Follow these steps:

  1. Open project's Properties (right click on the project)
  2. Go to Libraries
  3. Uncheck the checkbox 'Package' for Jersey 1.8 (JAX-RS RI)
  4. Click on 'OK'
  5.  Clean & Build (right click on the project) ---> remember to clean and rebuild your project
  6. (re)Deploy application

Done! :_)

 

Thursday Aug 02, 2012

Enable WebLogic 12c FastSwap with NetBeans

Hey everyone, this is my first post, and although I have been working at Oracle since July 2nd, I wanted it to have valuable information, not just a "Hey look, I joined Oracle". So this is it, welcome to my blog!

 How to enable WebLogic 12c FastSwap when developing Java EE applications with NetBeans? Very simple!

  1. Open the file WEB-INF/weblogic.xml
    1. If your application is an EAR, open weblogic-application.xml
  2. Enable FastSwap
    <fast-swap>
        <enabled>true</enabled>
    </fast-swap>
  3. Now open the Properties dialog for your project
  4. Navigate to Run
  5. Disable the checkbox "Deploy on Save"
  6. Close the Properties dialog
  7. Re-deploy your application

Done! Now give it a try. Modify some Java code and refresh the web page that access that code. Remember you don't need to re-deploy your application anymore. NetBeans already deploys it as exploded WAR/EAR. Faster than the re-deploy feature!

Also, FastSwap is a feature that is built-in to WebLogic 12c and there's no need to install anything. For more information about FastSwap, follow this link (for WebLogic 12.1.1).

Was this a valuable information for you? Sure it was for me :-) 

About


Bruno has been having fun working with Java since 2000 and now helps Oracle on sharing the technology accross all Latin America. Also plays videogames, does trekking and loves beer.

Search

Archives
« January 2013
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today