Java EE 7 and NetBeans IDE - Early Support Available (TOTD #199)


NetBeans IDE provides the best out-of-the-box experience for Java EE development, deployment, and debugging. Early builds of NetBeans have already started providing support for Java EE 7 features such as
  • Registering GlassFish 4
  • Creating Java EE 7 application
  • Wizard for JAX-RS 2 Filters/Interceptors
  • Initial support for Faces Flow
  • Loading templates from a resource library
  • Non-persistent EJB timers in Web profile
  • Wizard for WebSocket endpoints
wiki.netbeans.org/JavaEE7 provide a complete list of features slated for the release and the builds can be downloaded from bertram2.netbeans.org:8080/job/web-main-javaee7. Here are some snapshots of the work completed so far.

Creating a Java EE 7 Web application and using GlassFish 4 server


Creating a WebSocket endpoint



Wizard for creating WebSocket endpoint


The generated code looks like:

@WebSocketEndpoint("/endpoint")
public class NewWSEndpoint {

@WebSocketMessage
public String onMessage(String message) {
return null;
}

}

Creating a JAX-RS 2 Filter


Wizard for creating a JAX-RS 2 Filter


By default it is a server-side filter but can be made client-side filter too.

Wizard for creating a JAX-RS 2 Interceptor



Creating a RESTful Java Client using JAX-RS 2 Client APIs



Wizard for creating a JAX-RS 2 Client


This is a very early work-in-progress so any feedback is welcome.

Download GlassFish 4.0 promoted build, register it with NetBeans IDE and take it for a test drive!

Comments:

It would be very nice if Netbeans comes with a visual facesFlow Editor like faces-config already have. Something like JDeveloper have for ADF-Task-Flows. With something like this you can see the flow very easy. Sorry for my english!

Posted by Sebastián Roberto Garcia on January 29, 2013 at 12:49 PM PST #

It would be very nice if Netbeans comes with a visual facesFlow Editor like faces-config already have. Something like JDeveloper have for ADF-Task-Flows. With something like this you can see the flow very easy. Sorry for my english!

Posted by guest on January 29, 2013 at 12:52 PM PST #

@Sebastián, thanks for the suggestion, it is an interesting one! This is not something we can do in the short term (next few months - we already have very many things on our todo list), but we'll keep it in mind so we can implement it in a future release.

Posted by Petr Jiricka on January 30, 2013 at 05:46 AM PST #

Filed http://netbeans.org/bugzilla/show_bug.cgi?id=225584 for tracking.

Posted by Arun Gupta on January 31, 2013 at 01:55 AM PST #

Hi Arun,
I downloaded the netbeans IDE Dev with JaveeEE 7 which comes with JSF 2.2 and tried to create a POC web application with facesFlow.
It didn't recognize "@FlowDefinition", so I added latest version of java-faces-api on the classpath. Also, I have the latest glassfish 4 as the backend server.
When I run the application, it gives "WELD-001303 No active contexts for scope type javax.faces.flow.FlowScoped" error . How to fix this?
BTW, I am using the same flow example you have presented in other maven project sample (https://blogs.oracle.com/arungupta/entry/jsf_2_2_faces_flow).
Also I can see a list of exceptions in gf console viz.
org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.sun.faces.scripting.groovy.GroovyHelperImpl$MojarraGroovyClassLoader

org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.sun.faces.vendor.GlassFishInjectionProvider

which ultimately leads to

Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.InjectionException not found by org.glassfish.javax.faces [95]

I thought probably the issue is with javax.faces.jar in the gf/module. So even replaced this with the latest javax.faces.jar from the repository. Still I am not able to fix the issue.

Any direction? Thanks

Posted by guest on February 11, 2013 at 02:30 PM PST #

Did you try using the GlassFish build specified in the sample ? Did you also replace the JARs as mentioned right after the screencast ?

Arun

Posted by Arun Gupta on February 11, 2013 at 04:59 PM PST #

Thanks Arun, I was using glassfish 4 build 74 . I switched back to build 72 and it worked. Looking forward for the beta version now.

Posted by sarad on February 12, 2013 at 10:51 AM PST #

Glad it worked for you again!

Posted by Arun Gupta on February 15, 2013 at 09:02 AM PST #

Hi Arun,

I have installed NetBeans-dev-web-main-javaee7-142-on-20130306-full.zip and glassfish-4.0-b78.zip. I have also registered GF 4 with Netbeans. I am trying to create a Maven web project to generate a web project. The trouble is during generation it tries to download a version of archetype that doesn't even exist in repo (webapp-javaee7:0.2-SNAPSHOT) and it fails.
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.codehaus.mojo.archetypes:webapp-javaee7:0.2-SNAPSHOT) -> [Help 1]

In your TOTD #201 (https://blogs.oracle.com/arungupta/entry/java_ee_7_maven_archetype) also you use a version which actually exists in the repo.

Is there any way to edit the Maven Web Project Template in Netbeans to force it to look for the correct version?

Thx

Vimal

Posted by Vimal on March 06, 2013 at 08:52 PM PST #

Hi Vimal,

sorry about this, the truth is that build 142 is flawed and this functionality is temporarily broken. We will fix within a day or so. In the meantime, please use build 136, that one works fine.

Posted by Petr Jiricka on March 07, 2013 at 01:52 AM PST #

Thx Petr. By any chance would you know which build will it be fixed in.

Thx

Vimal

Posted by Vimal on March 07, 2013 at 03:17 PM PST #

http://bertram2.netbeans.org:8080/job/web-main-javaee7/ gives 404 error.

Posted by guest on May 12, 2013 at 06:27 AM PDT #

Sorry about that, the link has changed to http://bertram2.netbeans.org:8080/job/javaee7/

Posted by Petr Jiricka on May 13, 2013 at 01:08 AM PDT #

while redeploying "hello1"; Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.2:redeploy (deploy) on project hello1: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.2:redeploy failed: Failed to create deployer with implementation class org.codehaus.cargo.container.glassfish.GlassFish4xInstalledLocalDeployer for the parameters (container [id = [glassfish4x]], deployer type [installed]). InvocationTargetException: The container configuration directory "c://glassfish4/glassfish/domains" does not exist. Please configure the container before attempting to perform any local deployment. Read more on: http://cargo.codehaus.org/Local+Configuration -> [Help 1]
NOTICE DIRECTORY USED "c://GLASSFISH4"; GLASSFISH IS ON "E:\...". Couldn't find where it is set.

Posted by guest on August 29, 2013 at 10:14 AM PDT #

NOTICE DIRECTORY USED "c://GLASSFISH4"; GLASSFISH IS ON "E:\...".
Couldn't find where it is set
===============================================================
More research;
"Hello1" (and Hello2) POM model,profiles;windows;Properties;glassfish.home.prefix:c:/[hard coded to "C" drive],using "E" drive. Redeploy fails, deploy works

Posted by guest on August 31, 2013 at 08:20 AM PDT #

Not sure if the error is related to this blog entry above ?

Posted by Arun Gupta on September 02, 2013 at 02:02 PM PDT #

Post a Comment:
Comments are closed for this entry.
About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« August 2015
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