FAQ

The J2EE 1.4 Tutorial FAQ

 

Here's a list of the questions, by category, that are posed and answered in this FAQ:

About the 1.4 Tutorial

What is The J2EE 1.4 Tutorial?

The J2EE 1.4 Tutorial is a programmer's guide for the J2EE platform and Sun Java System Application Server Platform Edition 8.2. This tutorial is intended for programmers interested in developing and deploying J2EE applications on the J2EE 1.4 SDK. The current version is online and documents the J2EE 1.4 SDK.


How does The J2EE 1.4 Tutorial relate to The J2EE Tutorial for the J2EE 1.3 platform?

In addition to web services technologies, The J2EE 1.4 Tutorial also includes new chapters that cover JavaServer Faces and major upgrades (JSP 2.0, EJB 2.1, JMS 1.1, and Connector 1.5) to existing J2EE technologies.


Where can I get The J2EE 1.4 Tutorial?

You can read The J2EE 1.4 Tutorial on-line. Start here. If you prefer to view it on your own system, you can download The J2EE 1.4 Tutorial. The J2EE 1.4 Tutorial is available in HTML and PDF.


What version of the J2EE SDK does The J2EE 1.4 Tutorial reflect?

The J2EE 1.4 Tutorial reflects the J2EE 1.4 SDK that contains the Sun Java System Application Server Platform Edition 8.2.


Do The J2EE 1.4 Tutorial examples run on Windows 98?

No. The J2EE 1.4 Tutorial depends on the Sun Java System Application Server Platform Edition 8.2, which is not supported on Windows 98.


What topics are covered by The J2EE 1.4 Tutorial?

Check out the home page for a list of the chapters in The J2EE 1.4 Tutorial.


Where is the source code for the examples?

To get the source code, you need to download The J2EE 1.4 Tutorial bundle, install it, and go to the <INSTALL>/j2eetutorial14/examples directory.


What is asant?

In The J2EE 1.4 Tutorial chapter About This Tutorial, see the section, "Building the Examples."


I have problems compiling the examples using asant.
  • You get the error message:

    BUILD FAILED
    file:C:/j2eetutorial14/examples//common/targets.xml:8: C:\lib not found.
    

    You need to set the j2ee.home property in C:/j2eetutorial14/examples/common/build.properties to the location of your Sun Java System Application Server Platform Edition 8.2 installation. See the About This Tutorial chapter for information about building the examples.

    Note: Beginning with Update 5, the build system checks if j2ee.home is properly set. If not, it outputs an error message with information on how to set j2ee.home.

  • The build.xml seems to be missing:

    % asant converter
    Buildfile: build.xml does not exist!
    Build failed
    

    The build.xml file is in the directory for each technology. Make sure you are in that directory when you run asant. Alternatively, run asant with the flag -f <INSTALL>/j2eetutorial14/examples/<technology>/build.xml.

  • The directory structure for the examples is different from the structure described in the text. As a result, the asant converter command fails to compile the source code.

    The versions of the tutorial and the J2EE SDK software do not match. For example, you might be reading The J2EE Tutorial for the J2EE 1.3 SDK but running the J2EE 1.4 SDK software.

  • You get a Syntax Error when running asant on Windows 2000.

    There is a bug in asant.bat that results in a Syntax Error in Windows 2000's command prompt. The line that sets the classpath is too long.

    There is a workaround. Open <J2EE_HOME>/bin/asant.bat (e.g. c:/Sun/AppServer/bin/asant.bat) in a text editor and remove the following lines:

    "-Dcom.sun.aas.instanceName=server"
    "-Djava.endorsed.dirs=%AS_INSTALL%\lib\endorsed"
    			

I'm having a problem running the hello3 example.

The hello3 example exposes a bug with welcome files, bug 6372570. When you run the example as described in the tutorial (http://localhost:8080/hello3/), you will see a list of files in the WAR file rather than the starting page of the application. The workaround is to add a servlet-mapping element to the example's web.xml file, as shown here:

 <servlet>
     <servlet-name>greeting</servlet-name>
     <servlet-class>greeting.jsp</servlet-class>
 </servlet>

 <servlet-mapping>
     <servlet-name>greeting</servlet-name>
     <url-pattern>/greeting/*</url-pattern>
 </servlet-mapping>

If you want to run the example without changing the web.xml file, you can simply run it as described in the tutorial and click on the link to the greeting.jsp page that appears in the list of files included in the WAR file.


Why do I get a javax.naming.NameNotFoundException error when I run the JMS example programs in "A Simple Example of Synchronous Message Receives" in Chapter 33?

You get the following error:

javax.naming.NameNotFoundException: JupiterConnectionFactory not found

because there is an error in each of the following source files:

  • <INSTALL>/j2eetutorial14/examples/jms/simple/src/SimpleProducer.java
  • <INSTALL>/j2eetutorial14/examples/jms/simple/src/SimpleSynchConsumer.java

To correct the error, open each of these source files in an editor and change the string "jms/JupiterConnectionFactory" to "jms/ConnectionFactory". There is one occurrence of this string in each file.

Recompile the programs using the command "asant build". Then, in deploytool, choose Tools->Update Module Files to add the recompiled source files to the SimpleProducer.jar and SimpleSynchConsumer.jar files. Save the changed JAR files, and run the programs again using the appclient command.


Why don't the SAAJ myuddiping example and the JAXR examples work?

These examples don't work because UDDI v2 registries no longer exist.

About Downloading The J2EE 1.4 Tutorial

How do I download The J2EE 1.4 Tutorial?

Download it here.

Note: If you download The J2EE 1.4 Tutorial, feel free to make it available locally at your site. Please do not publicly mirror it to the Web!. See the next question and answer to find out why.


May I mirror The J2EE 1.4 Tutorial publicly?

Anyone is permitted have a copy of The J2EE 1.4 Tutorial as long as it's visible only within their own institution (university, business, or whatever) and no one is profiting from the Tutorial's distribution.

We've taken this position because the many tutorial mirrors mean that search engines generally don't find the most up-to-date version of The J2EE 1.4 Tutorial. Instead, search engines find mirror sites, which invariably fall behind. We end up getting e-mail about problems that have been corrected in newer versions of The J2EE 1.4 Tutorial. Or perhaps worse, we don't get e-mail and the reputation of The J2EE 1.4 Tutorial suffers. We allow local copies because we realize that browsing java.sun.com isn't always practical.

When you tell us about a mirror, we send the offender a friendly e-mail asking them to please move their copy of The J2EE 1.4 Tutorial to a place that isn't visible from the outside world.


Where can I download the J2EE 1.4 Application Server?

See J2EE 1.4 SDK download.


When I unzip the download file, all of the files have a size of zero. What should I do?

The download did not complete successfully. Please perform the download again and make sure that the entire file was downloaded. The size of the file is listed at the top of the last page you encounter during the download sequence (the page with the buttons).

About Getting the J2EE 1.4 Tutorial in Other Formats

Can I get a PDF version of The J2EE 1.4 Tutorial?

The PDF version is located here.


How do I print The J2EE 1.4 Tutorial?

Open the PDF version in Adobe Acrobat (if you see a message that the file is damaged, ignore it). Choose Print from the File menu to print selected pages. The tutorial is over 1500 pages long, so it is not advisable to print the entire file.


How do I buy The J2EE 1.4 Tutorial?

This tutorial has been published in the Java Series by Addison-Wesley as The Java Tutorial, Second Edition. For information on the book and links to online booksellers, go to http://java.sun.com/docs/books/j2eetutorial/index.html#second.

About the Tutorial Team

Who are the members of the tutorial team?

For information about the authors, read our bios page.

Other Questions

Can you help me with my J2EE programming problem?

This question is actually a series of similar questions:

  • Here's my code. Can you help me debug it?
  • How do I set up my CLASSPATH?
  • When I try to run one of The J2EE 1.4 Tutorial examples it doesn't work at all. Help me.
  • I want to write a insert description of some program here. Where do I begin?
  • What's a compiler?

Unfortunately we are not staffed to provide answers to these types of questions at this address. Please consult the resources page to help you get an answer to your question.

By the way, we tested all of the examples in the book on Solaris systems and Windows PCs. The examples work for us. If you are having problems with the examples, then you are probably having configuration problems.


Where's the change history for The J2EE 1.4 Tutorial?

Read a complete change history of The J2EE 1.4 Tutorial.