I will make this quick, and summarize challenges faced while following JavaEE6 tutorial available on Oracle website. I was following all the steps mentioned in the tutorial, trying to use NetBeans with Glassfish as per the available instructions.
1) Update tool installed with NetBeans didn't work for me. I was trying to download the tutorial through updatetool, but consistently getting below exception.
I gave up after some trial and error, and thought of downloading the tutorial from SVN repositories. Thanks to the contributors of Stackoverflow.com, this URL contains all the tutorials. I switched to my old friend Eclipse and downloaded all the tutorials (you may need to set the proxy for subclipse to download the tutorials, configuration file is available at : C:\Users\<Windows user Id>\AppData\Roaming\Subversion in Windows7.
After downloading the tutorial, running 'ant' from command line for 'hello1' project failed with below error:
C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-project\command-line-ant-tasks.xml:112: c:\glassfish3\lib does not exist.
My glassfish installation was at 'C:\glassfishv3' and I'm lil surprised because this was default folder chosen by Glassfish installation. Anyways to get rid of this error I had to modify two files:
1) javaee-tutorial\examples\bp-project\app-server.properties (Modify javaee.home=c:\\glassfishv3) and
2) javaee-tutorial\examples\bp-project\app-server-ant.xml (change value of javaee.classpath.prefix property to ${javaee.home}/lib)
Original content
<condition property="javaee.classpath.prefix" value="${javaee.home}/lib">
<isfalse value="${is.glassfish.v3}"/>
</condition>
1) Update tool installed with NetBeans didn't work for me. I was trying to download the tutorial through updatetool, but consistently getting below exception.
I gave up after some trial and error, and thought of downloading the tutorial from SVN repositories. Thanks to the contributors of Stackoverflow.com, this URL contains all the tutorials. I switched to my old friend Eclipse and downloaded all the tutorials (you may need to set the proxy for subclipse to download the tutorials, configuration file is available at : C:\Users\<Windows user Id>\AppData\Roaming\Subversion in Windows7.
After downloading the tutorial, running 'ant' from command line for 'hello1' project failed with below error:
C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-project\command-line-ant-tasks.xml:112: c:\glassfish3\lib does not exist.
My glassfish installation was at 'C:\glassfishv3' and I'm lil surprised because this was default folder chosen by Glassfish installation. Anyways to get rid of this error I had to modify two files:
1) javaee-tutorial\examples\bp-project\app-server.properties (Modify javaee.home=c:\\glassfishv3) and
2) javaee-tutorial\examples\bp-project\app-server-ant.xml (change value of javaee.classpath.prefix property to ${javaee.home}/lib)
Original content
<condition property="javaee.classpath.prefix" value="${javaee.home}/lib">
<isfalse value="${is.glassfish.v3}"/>
</condition>
Modified content
<condition property="javaee.classpath.prefix" value="${javaee.home}/glassfish/lib">
<isfalse value="${is.glassfish.v3}"/>
</condition>
<condition property="javaee.classpath.prefix" value="${javaee.home}/glassfish/lib">
<isfalse value="${is.glassfish.v3}"/>
</condition>
After making these changes ... it seems build is working:
C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1>ant
Buildfile: C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build.xml
-pre-init:
init:
default-ear:
-pre-compile:
bpp-actual-compilation:
[echo] Compiling hello1
[echo] javaee.classpath.prefix is: c:\glassfishv3/glassfish/modules
[echo] is.glassfish.v3 is: true
[javac] Compiling 1 source file to C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\web\WEB-INF\classes
-post-compile:
compile:
package:
[mkdir] Created dir: C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\war
bp-copy-classes:
[mkdir] Created dir: C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\war\WEB-INF\classes
[copy] Copying 1 file to C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\war\WEB-INF\classes
[copy] Copying 5 files to C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\web
[copy] Copying 5 files to C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\war
bpp-package-persistence-unit-war:
[mkdir] Created dir: C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\war\WEB-INF\classes\META-INF
[copy] Warning: Could not find file C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\src\conf\persistence.xml to copy.
[copy] Warning: Could not find file C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\src\conf\persistence.xml to copy.
bpp-package-persistence-unit-ejb-jar:
package-persistence-unit:
copy-resource-file:
[jar] Building jar: C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\hello1.war
[delete] Deleting directory C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\build\war
bpp-copy-dist:
[mkdir] Created dir: C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\dist
[copy] Copying 1 file to C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\web\hello1\dist
default-not-ear:
default:
BUILD SUCCESSFUL
Drop a comment, if you've any question/suggestions.