Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (30)

Sign In or Sign Up now to post a comment!
  • I keep getting this

    description The requested resource (/servletName) is not available.

  • Hey duda, it was a good tuttorial i hope you put some more.

    thanks in advance...

  • Comment removed

  • thanks man , that was good

  • Arun, I hope you can record your videos with a louder and clearer voice next time. Otherwise nice video

  • How would I access the Session bean directly from a JSP? From servlet it works just fine as shown in the video.

    Thanks

  • The Servlet is not a POJO because extend another class

  • Add these replacing my file location with your file location (on the last X, you are only adding "properties" to the existing line:

    X Map properties = new HashMap();

    X properties.put(EJBContainer.MO­DULES, new File("C:\\Users\\Tim\\Document­s\\NetBeansProjects\\HelloWorl­d\\build\\web\\WEB-INF\\classe­s"));

    X HelloBean instance = (HelloBean)javax.ejb.embeddabl­e.EJBContainer.createEJBContai­ner(properties).getContext().l­ookup("java:global/classes/Hel­loBean");

  • In part 1 when you perform the tests, add the lines marked with a 'X' to your code..

    Add these under the package:

    X import java.io.File;

    X import javax.ejb.embeddable.EJBContai­ner;

    X import java.util.HashMap;

    X import java.util.Map;

  • Hey that Series is fantastic. Along with the JEE6-Tutorial Book this helped me getting the first few meters into Glassfish/Netbeans land coming from Tomcat/ Eclipse. I'd like to see some more in-depth screencasts about EJBs and JNDI. Keep up the good work *thumbsup* :)

  • org.apache.jasper.JasperExcept­ion: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required

    -this is the error mesg im getting when running the sample program..

    jdk/jre both are already installed..

    dont know what's wrong w/ it..

  • @maimac08 Is JAVA_HOME set to JDK or JRE ?

  • I had the same problem, but if you use the normal classes inclusion, servlet operate correctly or in alternative you can create a EJB project and call this as showed in this video.

  • @daniloF16

    I checked my old code and all goes well!

    But at the first time i used the automatic function that implements SessionBean with his remote interfaces and nothing was going well!

    But after this experiments, i made an EJB project that i have included into my web app and then was going well!

    I use glassfish 3.0.1 and Netbeans 6.9.1

  • Anyone knows if these projects (EJB with persistence unit) can be migrated to Tomcat? I finished one web application and now I would like to deploy it in Tomcat 5.5 but I am finding it difficult. The web.xml is not generated in netbeans either. Any help?

  • @soyfantomas Tomcat is not Java EE 6 Web Profile so these projects will not run there.

  • All works until I try to run the test then -

    13-Oct-2010 09:01:54 com.sun.enterprise.deployment.­archivist.Archivist readAnnotations

    WARNING: Error in annotation processing: java.lang.NoClassDefFoundError­: build/web/WEB-INF/classes/serv­er/NewServlet (wrong name: server/NewServlet)

    13-Oct-2010 09:01:54 org.glassfish.api.ActionReport failure

    SEVERE: Exception while deploying the app

    java.lang.IllegalArgumentExcep­tion: Invalid ejb jar [WebApplication1.jar]: it contains zero ejb.

  • @stuartflewis

    I got the same Error too. Has anybody an idea how to fix it? :(

  • @stuartflewis What GlassFish and NetBeans version are you using ?

  • Really helpful. Thanks a lot

  • thx. I like this thing!

    But one: you should slow down, when inserting some code....

  • @erneb thanks, will take that into consideration for the next release.

  • Hi Mr. Arun,

    Good Day! I would like to ask how were you able to automatically complete the code in HelloServlet.java simply by typing the "session"? Thanks very much

  • @korean08 : use code templates under Tools -> Options ->Editor (button) -> Code Templates (tab)

    Abbreviation on left is like shortcut text and in "Expand template on:" you can specify key that will complete the code, default I think is Tab.

    Enjoy.

  • @harpreetkhakh : Thanks very much for this tip :)

  • @korean08;

    of course there is no code template "session" using harpreetkhakh 's path. Arun is not very responsive and of course like most "how to's" critical information is left out.

    In this case I used teh "For" statement: for (int count = 0; count > 0; count++) { } request.getSession().setAttrib­ute("count", ++count); out.println("Accessed: "  + request.getSession().getAttrib­ute("count"));

    works the same with fewer lines.

    regards,

    Glenn

  • @insolex1 : you got to create your own templates. Upside with creating templates is that you don't have to type repetitive code. "session" was probably name of the code template that Arun created to facilitate the tutorial. There are some inbuilt templates like fori, forj, etc......

  • @harpreetkhakh......hey thnx for that tip......but whenever i type 'session' and press 'tab'......there used to be no command....i tried it many times but the command was not there....could u please help.....

  • @gideon5259 in my Netbeans (7.0), for language java, "session" is not predefined template abbreviation. You must define New template under Tools -> Options ->Editor (button) -> Code Templates (tab) .. (select appropriate languages for which template is intended). Also ensure "Expand template on:" is set to Tab (if you want template text to appear on hitting tab after template abbreviation).

    Hope that helps.

  • Excellent work... explained in a very simple Cheers dude...

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more