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.MODULES, new File("C:\\Users\\Tim\\Documents\\NetBeansProjects\\HelloWorld\\build\\web\\WEB-INF\\classes"));
X HelloBean instance = (HelloBean)javax.ejb.embeddable.EJBContainer.createEJBContainer(properties).getContext().lookup("java:global/classes/HelloBean");
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* :)
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.
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?
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
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().setAttribute("count", ++count); out.println("Accessed: " + request.getSession().getAttribute("count"));
@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).
I keep getting this
description The requested resource (/servletName) is not available.
Labyrinthman 1 month ago
Hey duda, it was a good tuttorial i hope you put some more.
thanks in advance...
zaikatan 2 months ago
Comment removed
hawkiing 3 months ago
thanks man , that was good
hawkiing 3 months ago
Arun, I hope you can record your videos with a louder and clearer voice next time. Otherwise nice video
shazwari 6 months ago
How would I access the Session bean directly from a JSP? From servlet it works just fine as shown in the video.
Thanks
jkommu 10 months ago
The Servlet is not a POJO because extend another class
pepemark 11 months ago
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.MODULES, new File("C:\\Users\\Tim\\Documents\\NetBeansProjects\\HelloWorld\\build\\web\\WEB-INF\\classes"));
X HelloBean instance = (HelloBean)javax.ejb.embeddable.EJBContainer.createEJBContainer(properties).getContext().lookup("java:global/classes/HelloBean");
timothybraxton 1 year ago
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.EJBContainer;
X import java.util.HashMap;
X import java.util.Map;
timothybraxton 1 year ago
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* :)
beegentoo1 1 year ago
org.apache.jasper.JasperException: 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 1 year ago
@maimac08 Is JAVA_HOME set to JDK or JRE ?
GlassFishVideos 1 year ago
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 1 year ago
@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
daniloF16 1 year ago
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 1 year ago
@soyfantomas Tomcat is not Java EE 6 Web Profile so these projects will not run there.
arungupta 1 year ago
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/server/NewServlet (wrong name: server/NewServlet)
13-Oct-2010 09:01:54 org.glassfish.api.ActionReport failure
SEVERE: Exception while deploying the app
java.lang.IllegalArgumentException: Invalid ejb jar [WebApplication1.jar]: it contains zero ejb.
stuartflewis 1 year ago
@stuartflewis
I got the same Error too. Has anybody an idea how to fix it? :(
HerrMolch 1 year ago
@stuartflewis What GlassFish and NetBeans version are you using ?
arungupta 1 year ago
Really helpful. Thanks a lot
sostupidyoutude 1 year ago
thx. I like this thing!
But one: you should slow down, when inserting some code....
erneb 1 year ago
@erneb thanks, will take that into consideration for the next release.
arungupta 1 year ago
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 1 year ago
@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 1 year ago
@harpreetkhakh : Thanks very much for this tip :)
korean08 1 year ago
@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().setAttribute("count", ++count); out.println("Accessed: " + request.getSession().getAttribute("count"));
works the same with fewer lines.
regards,
Glenn
insolex1 1 year ago
@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 1 year ago
@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 10 months ago
@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.
harpreetkhakh 10 months ago
Excellent work... explained in a very simple Cheers dude...
uksanjay 1 year ago