X
  • General |
    Tuesday, January 29, 2013

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. href="http://bertram2.netbeans.org:8080/job/web-main-javaee7/">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 href="http://bertram2.netbeans.org:8080/job/web-main-javaee7/">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


src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/9eab31608500f616a14d511ad9cbf933/totd199_glassfish4_server.png"
height="243" width="431">



Creating a WebSocket endpoint

src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/70787582112cf4337eb26f3171f0eae8/totd199_websocket_endpoint.png"
height="195" width="427">





Wizard for creating WebSocket endpoint

src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/93e1b323aaee03f3aa612cce3c8dc472/totd199_websocket_endpoint_new.png"
height="319" width="523">



The generated code looks like:


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

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

}


Creating a JAX-RS 2 Filter

src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/5bcb6dfea88aa8f0029465aa0b68fd07/totd199_jaxrs2_filter.png"
height="221" width="475">



Wizard for creating a JAX-RS 2 Filter

src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/4a1ec7e1f19acebcd8f1b9b23a1dcda3/totd199_jaxrs2_filter_new.png"
height="444" width="517">



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



Wizard for creating a JAX-RS 2 Interceptor

src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/3da479fc7d38b5598136952b716afcfb/totd199_jaxrs2_interceptor_new.png"
height="438" width="513">





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

src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/73c8cd303a3106d8f6e543154088175e/totd199_restful_java_client.png"
height="320" width="483">





Wizard for creating a JAX-RS 2 Client

src="//cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/f4a5b21d-66fa-4885-92bf-c4e81c06d916/Image/cb04394b2a922d4ec03ff6c09d603b46/totd199_restful_java_client_new.png"
height="507" width="515">



This is a very early work-in-progress so any href="mailto:nbusers@netbeans.org">feedback is welcome.



Download href="http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/">GlassFish
4.0 promoted build, register it with NetBeans IDE and take it
for a test drive!


Join the discussion

Comments ( 16 )
  • Sebastián Roberto Garcia Tuesday, January 29, 2013

    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!


  • guest Tuesday, January 29, 2013

    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!


  • Petr Jiricka Wednesday, January 30, 2013

    @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.


  • Arun Gupta Thursday, January 31, 2013
  • guest Monday, February 11, 2013

    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


  • Arun Gupta Tuesday, February 12, 2013

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

    Arun


  • sarad Tuesday, February 12, 2013

    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.


  • Arun Gupta Friday, February 15, 2013

    Glad it worked for you again!


  • Vimal Thursday, March 7, 2013

    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


  • Petr Jiricka Thursday, March 7, 2013

    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.


  • Vimal Thursday, March 7, 2013

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

    Thx

    Vimal


  • guest Sunday, May 12, 2013
  • Petr Jiricka Monday, May 13, 2013

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


  • guest Thursday, August 29, 2013

    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.


  • guest Saturday, August 31, 2013

    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


  • Arun Gupta Monday, September 2, 2013

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


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha