[JAVAEETUTORIAL-128] File paths wrong in Java EE 6 Tutorial from the UpdaterTool Created: 03/Aug/12  Updated: 16/Aug/12  Resolved: 03/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-5

Type: Bug Priority: Blocker
Reporter: shazlett Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS 10.8, JVM 1.7_5, Java EE 6 SDK Update 4



 Description   

"To Obtain the Tutorial Component Using the Update Tool" on page 73 does not work properly on a Mac, at least not with the OS version I am running. The reason being is the update tool has the paths all wrong. If I look at the Files view of the Java EE 6 Tutorial version 6.0.7-4 they look like the example I have pasted below:

glassfish/docs/javaee-tutorial\doc\bnaac.html
glassfish/docs/javaee-tutorial\doc\bnaan.html
glassfish/docs/javaee-tutorial\doc\bnaaw.html
glassfish/docs/javaee-tutorial\doc\bnaax.html
glassfish/docs/javaee-tutorial\doc\bnaay.html
glassfish/docs/javaee-tutorial\doc\bnabo.html
glassfish/docs/javaee-tutorial\doc\bnabs.html

Everywhere there is a backslash () the folder structure is not created, you just get a file with the name "javaee-tutorial\doc\bnaay.html". As a result the file structure is completely missing on Mac OS and it is necessary to copy the tutorial from a Windows computer where either slash appears to work.



 Comments   
Comment by Ian Evans [ 03/Aug/12 ]

Looking into this right now. I don't know why the Update Center toolkit wouldn't handle Windows paths correctly when creating packages, but that's what this appears to be.

Comment by Ian Evans [ 03/Aug/12 ]

Changing priority to P1, as this package is broken on non-Windows platforms.

Comment by Ian Evans [ 03/Aug/12 ]

Created package 6.0.7-5 with correct file layout for Unix platforms. Release engineering will push it to the external repository soon.





[JAVAEETUTORIAL-134] information directory not included in IPS package Created: 24/Aug/12  Updated: 24/Aug/12  Due: 04/Oct/12  Resolved: 24/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-6

Type: Bug Priority: Critical
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

The information directory isn't copied to the package root, so the FAQ and Download links don't work in the IPS package.



 Comments   
Comment by Ian Evans [ 24/Aug/12 ]

Revision: 993
Author: ievans
Date: 2012-08-24 11:38
Message: Updated targets to add information to the package root.
Issue #JAVAEETUTORIAL-134 - information directory not included in IPS package





[JAVAEETUTORIAL-17] Some build.xml files need to be revised for Ant Created: 03/Jan/11  Updated: 16/Aug/12  Resolved: 11/Apr/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.6

Type: Task Priority: Major
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The following projects have build.xml files that were created by NetBeans IDE and that have not yet been revised to use the bp-project files.

ejb/async
ejb/counter
ejb/interceptor
ejb/standalone
jaxrs/rsvp
jaxrs/HelloWorldApplication (is this used in the tutorial?)
persistence/address-book



 Comments   
Comment by Ian Evans [ 11/Apr/11 ]

Resolved in latest release.





[JAVAEETUTORIAL-15] how to fix 3 JMS projects Created: 24/Oct/10  Updated: 16/Aug/12  Resolved: 11/Apr/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.6

Type: Bug Priority: Major
Reporter: emiddio Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 15

 Description   

with nb dev201010190000, and gfv3.1b24, to build all the JMS examples,

i had to edit project.properties for synchconsumer, clientsessionmdb-ejb,
and clientsessionmdb-app-client,

and change
endorsed.classpath=
to
endorsed.classpath=$

{libs.javaee-endorsed-api-6.0.classpath}

i was working with javaeetutorial sources check out earlier today;

any code resembling the following fails without the change;
@Resource(lookup = "jms/ConnectionFactory")
private static ConnectionFactory connectionFactory;



 Comments   
Comment by Kim Haase [ 19/Jan/11 ]

I think you can mark this resolved, Ian.

All JMS projects that need the endorsed.classpath property set now have it.

It turns out that this property seems to be needed for the main project and the EJB project in clientsessionmdb, but not for the app client project. This example runs in both NB and Ant without it. You might want to test this on your system. I'm using netbeans-dev-201101140000 with GF b37.

Comment by Ian Evans [ 11/Apr/11 ]

Fixed in latest version, per Kim.





[JAVAEETUTORIAL-13] Typos in First Cup Created: 30/Sep/10  Updated: 16/Aug/12  Resolved: 30/Sep/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.5

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 13

 Description   

Reported to the Java EE Documentation mailing list from a user.

Hi,

On page http://download-llnw.oracle.com/javaee/6/firstcup/doc/gcrkm.html there
is a small typo in the source of “Implement the getText Method� section:

Calendar now = GregorialCalendar.getInstance();

should be

Calendar now = GregorianCalendar.getInstance();

-------

This should be fixed.



 Comments   
Comment by Kim Haase [ 30/Sep/10 ]

The same user noted some additional typos:

1. a. In section “Add a Named Query to the FirstcupUser Entity�:

@NamedQuery(name="findAverageAgeDifferenceOfAllFirstcupUsers",

query="SELECT AVG(u.ageDifference) FROM FirstcupUser u)

should be

@NamedQuery(name="findAverageAgeDifferenceOfAllFirstcupUsers",

query="SELECT AVG(u.ageDifference) FROM FirstcupUser u")

(Closing quotation mark missing).

1. b. Also Fix imports required after adding this text.

2. „Creating the DukesBDay Managed Bean Class� – „Adding an Enterprise Bean
Reference� - Step 1:
Right-click in the editor window, select „Insert code…� and select Call
Enterprise Bean.
4. Logger declarations should be private static final everywhere instead of
private static

He also noted the ordering problem with the birthday bean tasks, but we have
fixed that for the next docarch push.

Comment by Ian Evans [ 30/Sep/10 ]

Closing this issue, and opening up a new one in the firstcup issue tracker:
https://firstcup.dev.java.net/issues/show_bug.cgi?id=2

Comment by jendrock [ 27/Apr/11 ]

Removed the name of the user that reported the issue.





[JAVAEETUTORIAL-11] Incorrect server name in NetBeans task in Chapter 2 Created: 30/Sep/10  Updated: 16/Aug/12  Resolved: 06/Dec/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.5

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 11

 Description   

Reported to the Java EE 6 Documentation mailing list.

Regarding "The Java EE 6 Tutorial", 4'th Edition...

Section...
"To Add GlassFish Server as a Server in NetBeans IDE"
http://download.oracle.com/javaee/6/tutorial/doc/gexaj.html#giqzl
To Add GlassFish Server as a Server in NetBeans IDE
To run the tutorial examples in NetBeans IDE, you must add your GlassFish Server
as a server in NetBeans IDE. Follow these instructions to add the GlassFish
Server to NetBeans IDE.

1. Select Tools â†' Servers to open the Servers dialog.
2. Click Add Server.
3. Under Choose Server, select GlassFish v3 and click Next.

....................................
"GlassFish v3" is NOT one of the options on NetBeans 6.9.1 !

The GlassFish options are...
"GlassFish Server 3"
or
"GlassFish v3 Prelude"

I believe the correct choice is "GlassFish Server 3"

====

This is correct, so we will fix this.



 Comments   
Comment by Kim Haase [ 30/Sep/10 ]

Will fix in next docarch update.

Comment by Ian Evans [ 06/Dec/10 ]

Fixed in current update:
http://download.oracle.com/javaee/6/tutorial/doc/gexaj.html#giqzl

Comment by jendrock [ 27/Apr/11 ]

removed name of user that reported the issue.





[JAVAEETUTORIAL-10] Misleading link to AS download in Java EE 5 Tutorial Created: 30/Sep/10  Updated: 16/Aug/12  Resolved: 06/Dec/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7-5

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 10

 Description   

Reported to the Java EE Documentation mailing list from a user.

ON this page:
http://download.oracle.com/javaee/5/tutorial/doc/gexaj.html#gexab

You refer to “Sun Java System Application Server 9.1� and “download the
Application Server from�
Followed by a link to
http://www.oracle.com/technetwork/java/javaee/downloads/index.html.

The resulting page does not show any tag or text for “Sun Java System
Application Server 9.1�.

What are we supposed to download?

I am trying to follow the “Java EE 5 Tutorial�.

Do not put my email address on any list!!!!

We are clarifying this point in the Java EE 5 tutorial, pointing to the correct
download page for AS 9.1



 Comments   
Comment by Kim Haase [ 30/Sep/10 ]

Will fix in next docarch update.

Comment by Ian Evans [ 06/Dec/10 ]

Fixed in current update:
http://download.oracle.com/javaee/5/tutorial/doc/gexaj.html#gexab

Comment by jendrock [ 27/Apr/11 ]

Removed the name of the user that reported the issue.





[JAVAEETUTORIAL-6] http://java.sun.com/javaee/6/docs/tutorial/doc/gjiup.html Logical error : @ManyToOne Created: 23/Mar/10  Updated: 16/Aug/12  Resolved: 23/Mar/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.5

Type: Bug Priority: Major
Reporter: rjdkolb Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive javadocissue5.zip    
Issuezilla Id: 6

 Description   

This issue has been separated from issue 5.
A sample Maven project is attached to prove that the code in the tutorial is
wrong. The zip has a EJB JAR in the target directory

Another syntax error. This causes deploy time issues
In the Pet class owners has an annotation @ManyToOne, this should be @OneToMany

-> { "7250", "[

{0}

] uses a non-entity [

{1}

] as target entity in the relationship
attribute [

{2}

]."}
@Entity
public class Pet {
@Id
protected Long id;
protected String name;
protected String color;
@ManyToOne
protected Set<Person> owners;
...
}

Should be
@Entity
public class Pet {
@Id
protected Long id;
protected String name;
protected String color;
@OneToMany
protected Set<Person> owners;
...
}



 Comments   
Comment by rjdkolb [ 23/Mar/10 ]

Created an attachment (id=1)
Maven app with @ManyToOne instead of @OneToMany Example 22-2

Comment by rjdkolb [ 23/Mar/10 ]

add cc of ievans

Comment by Ian Evans [ 23/Mar/10 ]

Fixing in SGML source.

Comment by Ian Evans [ 23/Mar/10 ]

Fixed in source. Will be available in next update.

Comment by Ian Evans [ 23/Mar/10 ]

Updating target milestone.





[JAVAEETUTORIAL-9] Redundant line in JAX-RS chapter Created: 30/Sep/10  Updated: 16/Aug/12  Resolved: 06/Dec/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7-5

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 9

 Description   

Reported to the Java EE Documentation mailing list from a user.

Hello!
On page http://download.oracle.com/javaee/6/tutorial/doc/gilik.html in the
'Extracting Request Parameters' section describing the acceptable Java types for
@QueryParam and @PathParam one of these two lines is redundant:

  • Any class with a constructor that accepts a single String argument
  • Any class with a constructor that takes a single String as a parameter
    Keep up the good work,
    Laszlo

This is in the JAX-RS chapter. we will fix it.



 Comments   
Comment by Kim Haase [ 30/Sep/10 ]

Will fix in next docarch update.

Comment by Ian Evans [ 06/Dec/10 ]

Fixed in the latest update:
http://download.oracle.com/javaee/6/tutorial/doc/gilik.html#gipyw

Comment by jendrock [ 27/Apr/11 ]

Removed the name of the user that reported the issue.





[JAVAEETUTORIAL-7] http://java.sun.com/javaee/6/docs/tutorial/doc/gjivm.html Syntax errors Created: 23/Mar/10  Updated: 16/Aug/12  Resolved: 14/May/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.5

Type: Bug Priority: Major
Reporter: rjdkolb Assignee: Ian Evans
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive javadocissue5.zip    
Issuezilla Id: 7

 Description   

This was originally from issue 5 and now split up (Example 22-10 Joining a
Query) A Maven project with sample code that does not compile is attached.

Another syntax error, Please confirm this one.
The following code does not compile:
CriteriaQuery<String> cq = cb.createQuery(String.class);
Metamodel m = em.getMetamodel();
EntityType<Pet> Pet_ = m.entity(Pet.class);

Root<Pet> pet = cq.from(Pet.class);
cq.select(pet.get(Pet_.name));

It should be : EntityType<Pet> pet_ = m.entity(Pet.class);//was Pet_
Pet_ is a class defined previously in the tutorial



 Comments   
Comment by rjdkolb [ 23/Mar/10 ]

Created an attachment (id=2)
Maven sample with code that does not compile

Comment by rjdkolb [ 23/Mar/10 ]

added cc

Comment by Ian Evans [ 23/Mar/10 ]

Reassigning to me.

Comment by rjdkolb [ 24/Mar/10 ]

Example 22-8, 22-11 ,22-12 , 22-13 , 22-14, 22-15 ,22-16 ,22-17 ,22-18, 22-19
suffers from the same problem
It calls : EntityType<Pet> Pet_ = m.entity(Pet.class);
It should be EntityType<Pet> pet_ = m.entity(Pet.class);

The class Pet_ is defined in :
http://java.sun.com/javaee/6/docs/tutorial/doc/gjiup.html

Comment by Ian Evans [ 24/Mar/10 ]

The error you see in the attached project is actually unrelated to the name of
the Pet_ metamodel class. If you already have a statically generated metamodel
class za.co.enerweb.javadocissue5.Pet_, you can't dynamically obtain
za.co.enerweb.javadocissue5.Pet_ using Metamodel.entity().

If you're using statically generated metamodel classes, there's no need to
obtain it dynamically using:
EntityType<Pet> Pet_ = m.entity(Pet.class);
You can simply import the static metamodel classes and use them.

Your test project works when you instead have:
EntityType<Pet> pet_ = m.entity(Pet.class);
because za.co.enerweb.javadocissue5.pet_ is a dynamically generated metamodel
class with a different name than the statically generated class
za.co.enerweb.javadocissue5.Pet_, which has already been instantiated.

If you want to use dynamically generated metamodel classes, you can't also use
statically generated classes packaged in the same project.

Does that make sense?

Comment by rjdkolb [ 25/Mar/10 ]

Thanks for the explanation.
But the following does not work either (dynamically generated metamodel class)
private void brokenExample()

{ CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<Pet> cq = cb.createQuery(Pet.class); Metamodel m = em.getMetamodel(); EntityType<Pet> pet_ = m.entity(Pet.class); Root<Pet> pet = cq.from(Pet.class); Join<Pet, Person> owner = pet.join(pet_.person);//Owner does not exist. I assume this is Person }

Comment by rjdkolb [ 31/Mar/10 ]

I've been digging around about this one and I don't think this is a doc issue.
From Pro JPA 2 : Page 270 I see each vendor needs to implement this

From Eclipse Link -> It show how to set it up in Eclipse
http://wiki.eclipse.org/UserGuide/JPA/Using_the_Canonical_Model_Generator_%28ELUG%29

I am going to close this issue, as I don't think it is a docs issue.

Comment by rjdkolb [ 03/May/10 ]

FYI : http://netbeans.org/bugzilla/show_bug.cgi?id=178108&GoAheadAndLogIn=1

Although this issue is invalid, perhaps a note that it won't just work out the
box is in order. It may save some head scratching and wondring why it does not
work as advertised in the tutorial.

I have personally used the Maven plugin as described by 'Petr Jiricka' and it
works well. There is also a Ant script that does the same there.

Perhaps this is a case of the IDE's lagging behind the technology.

Comment by pjiricka [ 14/May/10 ]

Yes, metamodel generation is tricky and setting it up correctly in your build is not easy. Bugs in Maven,
EclipseLink and java are preventing this from working well - the IDE is just trying to coordinate and
orchestrate all these tools and runtimes. The following comment describes how to set up metamodel
generation with Maven: https://netbeans.org/bugzilla/show_bug.cgi?id=181861#c8





[JAVAEETUTORIAL-8] Need to add web.xml before you can add a context parameter Created: 17/Sep/10  Updated: 16/Aug/12  Resolved: 06/Dec/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7-5

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All
URL: http://download.oracle.com/javaee/6/tutorial/doc/bnaeo.html#gjsfj


Issuezilla Id: 8

 Description   

The instructions for adding a context parameter need an additional step to
create a web.xml file, as there isn't one by default now in Java EE 6.

These steps should come after step 1 above:
2. Highlight the project in the Project Pane and select File -> New File.
3. Select the Web category, then Standard Deployment Descriptor under File
Types, click Next, then Finish.

This will create an empty web.xml file in web/WEB-INF/.



 Comments   
Comment by Kim Haase [ 21/Sep/10 ]

I was inclined just to put in a statement that the steps apply generically and
not specifically, but maybe we also need a separate task on creating a web.xml
file to which the following tasks would point:

To Add a Context Parameter Using NetBeans IDE
To Add an Initialization Parameter Using NetBeans IDE
To Set Up Error Mapping Using NetBeans IDE

I'll check something in to the tutorial workspace and you can see what you think.

Comment by Kim Haase [ 30/Sep/10 ]

We will fix this in the next docarch update.

Comment by Ian Evans [ 06/Dec/10 ]

Fixed in current update:
http://download.oracle.com/javaee/6/tutorial/doc/bnaeo.html#gjsfj





[JAVAEETUTORIAL-5] Syntax errors in code, Java 6 tutorial, Criteria API chapter Created: 17/Mar/10  Updated: 23/Mar/10  Resolved: 23/Mar/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.5

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Macintosh
URL: http://java.sun.com/javaee/6/docs/tutorial/doc/gjivm.html


Issuezilla Id: 5

 Description   

These are very small issues:
There are code syntax errors on this page :
http://java.sun.com/javaee/6/docs/tutorial/doc/gjivm.html


Example 22-14 Using the Expression.in Method

CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Metamodel m = em.getMetamodel();
EntityType<Pet> Pet_ = m.entity(Pet.class);
Root<Pet> pet = cq.from(Pet.class);
cq.where(pet.get(Pet_.color).in("brown", "black");

– > should be
cq.where(pet.get(Pet_.color).in("brown", "black"));

Another example :
cq.orderBy(cb.desc(pet.get(Pet_.birthday));

– > should be
cq.orderBy(cb.desc(pet.get(Pet_.birthday)));

Another example :
cq.orderBy(cb.asc(address.get(Address_.postalCode));

– > should be
cq.orderBy(cb.asc(address.get(Address_.postalCode)));



 Comments   
Comment by Ian Evans [ 17/Mar/10 ]

Another syntax error :
in Example 22–2

@Static Metamodel(Pet.class) should be @StaticMetamodel(Pet.class)

Comment by Ian Evans [ 17/Mar/10 ]

Another syntax error. This causes run time issues
-> { "7250", "[

{0}

] uses a non-entity [

{1}

] as target entity in the relationship
attribute [

{2}

]."}
@Entity
public class Pet

{ @Id protected Long id; protected String name; protected String color; @ManyToOne protected Set<Person> owners; ... }

Should be
@Entity
public class Pet

{ @Id protected Long id; protected String name; protected String color; @OneToMany protected Set<Person> owners; ... }
Comment by Ian Evans [ 17/Mar/10 ]

Another syntax error, Please confirm this one.
The following code does not compile:
CriteriaQuery<String> cq = cb.createQuery(String.class);
Metamodel m = em.getMetamodel();
EntityType<Pet> Pet_ = m.entity(Pet.class);

Root<Pet> pet = cq.from(Pet.class);
cq.select(pet.get(Pet_.name));

It should be : EntityType<Pet> pet_ = m.entity(Pet.class);//was Pet_
Pet_ is a class defined previously in the tutorial

Comment by Ian Evans [ 17/Mar/10 ]

Looking into these code sample errors, closing GlassFish Looking into these code sample errors, closing GlassFish bug 11676 as Won't Fix
so we can track it here. as Won't Fix
so we can track it here.

Comment by Ian Evans [ 17/Mar/10 ]

I'm going to check with Linda DeMichiel (JPA spec lead), but this code should
compile:
CriteriaQuery<String> cq = cb.createQuery(String.class);
Metamodel m = em.getMetamodel();
EntityType<Pet> Pet_ = m.entity(Pet.class);

What is the exact error you get?

Comment by rjdkolb [ 17/Mar/10 ]

> I'm going to check with Linda DeMichiel (JPA spec lead), but this code should
> compile:
> CriteriaQuery<String> cq = cb.createQuery(String.class);
> Metamodel m = em.getMetamodel();
> EntityType<Pet> Pet_ = m.entity(Pet.class);
>
> Root<Pet> pet = cq.from(Pet.class);
> cq.select(pet.get(Pet_.name));
>
> What is the exact error you get?

thanks.
I get a error saying name is not a member pf Pet_
Actually it is a member, but the class Pet_ is instantiated, but it should be
instantiated pet_

Comment by Ian Evans [ 22/Mar/10 ]

I think that error must come from using Pet_ in some other part of your code.
The following code compiles without errors:
public void test()

{ CriteriaQuery<String> cq = cb.createQuery(String.class); Metamodel m = em.getMetamodel(); EntityType<Address> Address_ = m.entity(Address.class); }
Comment by rjdkolb [ 23/Mar/10 ]

Issues 6 and 7 have now been created to explain myself better.
A few lines of code can mean a thousand words.

Comment by Ian Evans [ 23/Mar/10 ]

Fixed typo in SGML source for static metamodel class Pet_. This fix will be in
the next update.





[JAVAEETUTORIAL-3] loginform.html missing body tags Created: 22/Feb/10  Updated: 16/Aug/12  Resolved: 19/Jan/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7-5

Type: Bug Priority: Major
Reporter: emiddio Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 3

 Description   

javaee6 tutorial bundle – examples/web/hello2_formauth project

loginform.html file needs to be fixed to not have html syntax errors.

easy fix – just add <body> </body> tags



 Comments   
Comment by Ian Evans [ 22/Feb/10 ]

Reassigning to Kim.

Comment by Kim Haase [ 19/Jan/11 ]

We no longer ship hello2_formauth; instead we provide hello1_formauth, which uses Facelets.





[JAVAEETUTORIAL-4] examples\jaxrs\HelloWorld3 will not work Created: 22/Feb/10  Updated: 16/Aug/12  Resolved: 23/Feb/10

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.5

Type: Bug Priority: Major
Reporter: emiddio Assignee: Ian Evans
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 4

 Description   

copied from email to glassfish users list – before realized separate java.net
project.

i have gotten all but 1 project – to successfully work with Netbeans.

there are 21 top-level projects – some are EAR which are really 3 projects.

1 or 2 had html structure errors which i fixed – perhaps would have run in a
browser if not fixed ?

examples/jaxws/webclient – had a netbeans issue which i worked around, and a
requirement (netbeans said)
to add jaxws-2.2 api's via Endorsed mechanism – which i did. using jdk1.6.0_17
64bit, win 7.

the only project not able to get working so far is javaee-
tutorial/examples/jaxrs/HelloWorld3.

with netbeans 6.9dev builds it always gets the following error on a rebuild
after deployment:
init:
undeploy-clean:
deps-clean:
do-clean:
Deleting directory G:\Sun\sges-v3\glassfish\docs\javaee-
tutorial\examples\jaxrs\HelloWorld3\build
G:\Sun\sges-v3\glassfish\docs\javaee-
tutorial\examples\jaxrs\HelloWorld3\nbproject\build-impl.xml:844: Unable to
delete file G:\Sun\sges-v3\glassfish\docs\javaee-
tutorial\examples\jaxrs\HelloWorld3\build\web\WEB-INF\lib\jersey-server-
1.1.4.jar
BUILD FAILED (total time: 2 seconds)

i have to restart gvf3 to do a clean,build

also when it runs i get the following error from gfv3 log,
-------------------------------------------------------
INFO: Loading application webclient at /webclient
INFO: webclient was successfully deployed in 197 milliseconds.
INFO: Loading application webclient at /webclient
INFO: webclient was successfully deployed in 212 milliseconds.
INFO: Scanning for root resource and provider classes in the Web app resource
paths:
/WEB-INF/lib
/WEB-INF/classes
INFO: Root resource classes found:
class com.sun.rest.HelloGreetingService
INFO: No provider classes found.
INFO: Initiating Jersey application, version 'Jersey: 1.1.5 01/20/2010 04:04 PM'
INFO: Adding the following classes declared in META-INF/services/jersey-server-
components to the resource configuration:
class com.sun.jersey.multipart.impl.FormDataMultiPartDispatchProvider
class com.sun.jersey.multipart.impl.MultiPartConfigProvider
class com.sun.jersey.multipart.impl.MultiPartReader
class com.sun.jersey.multipart.impl.MultiPartWriter
INFO: Loading application HelloWorld3 at /HelloWorld3
INFO: HelloWorld3 was successfully deployed in 2,992 milliseconds.
SEVERE: A message body writer for Java type, class com.sun.rest.RESTGreeting,
and MIME media type, text/html, was not found
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException
at
com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:268)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebAppl
icationImpl.java:1029)
------------------------------------------

the following appears on the web page.
------------------------------------------

javax.ws.rs.WebApplicationException
at
com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:268)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebAppl
icationImpl.java:1029)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebAppli
cationImpl.java:941)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebAppli
cationImpl.java:932)
at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.j
ava:451)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.j
ava:632)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
79)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
88)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingS
tandardPipeline.java:85)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java
:239)
at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at
com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:473)
at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:341)
at
com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
at
com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java
:161)
at
com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137
)
at
com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:33
0)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
-----------------------------------
how to fix ?
thanks
gary



 Comments   
Comment by emiddio [ 22/Feb/10 ]

make an error in the report

Comment by Ian Evans [ 22/Feb/10 ]

The issue regarding the Jersey JAR file not being deleted when the project is
cleaned is a Windows issue. NetBeans uses in-place deployment of web projects,
and sometimes Windows won't release resources of the application even after it
is undeployed. From a forum posting by Tim Quinn, GlassFish engineer:

"Quite a few entries in this forum and numerous blog postings discuss locked
files on Windows.

Probably the underlying problem is that the process in which GlassFish is
running has the JAR files open. Windows prevents opened JAR files from being
deleted, and if GlassFish has the files open then NetBeans will not be able to
delete them. You can confirm this by either restarting the server and seeing if
that allows the JARs to be deleted or use some tool such as "handle" that shows
which processes have which files open. You can read about and download handle
from
http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Handle.mspx if
you are interested.

Assuming that it is the GlassFish process does have the files open you can get a
good idea what code has opened them but not closed them by using the tool I
describe here
http://blogs.sun.com/quinn/entry/tool_for_diagnosing_failed_glassfish and then
posting the results as an attachment to this topic and I'll take a look. Be sure
to follow the directions in the blog carefully to get the best-quality output."

The workaround is to not package the Jersey libraries with the WAR. They
shouldn't have been packaged to begin with.

To do this:
1. In NetBeans, right-click on the HelloWorld3 project and select Properties.
2. Click Libraries.
3. Uncheck JAX-RS 1.1 and Jersey 1.1 under Package.
4. Click OK.

Restart GlassFish, redeploy the app, and you'll be able to redeploy and clean it
on Windows without errors.

Comment by Ian Evans [ 22/Feb/10 ]

The main issue is that this example is wrong, and redundant. It shouldn't have
been shipped. Ooops.

I'm taking over the JAX-RS examples and chapters now, and will be removing
HelloWorld3, HelloWorldApplication, and JAXRSHelloWorld. I've checked into
Subversion a new application (rsvp) that demonstrates a more complicated JAX-RS
app. I'm also going to create a new hello world-type simple application similar
to JAXRSHelloWorld.

Both of these examples will be shipped with the next update to the Tutorial,
available through the Update Center.

Changing to WONTFIX since this example will be removed.

Comment by emiddio [ 23/Feb/10 ]

should i file a bug with netbeans --regarding the clean issue?

could this be a glassfish bug? – since clean works when gfv3 not running.

also – i do not set netbeans "deploy on save" – i always turn feature off;

netbeans support does not allow me to do a non-in-place deployment with gfv3;

i suppose i could if its not an EAR with app-client; i could then use admin
console to deploy the war manually.

even if the example is "bad" – i like any/all example to learn from –
so if not already stated – how about fixing it or telling me how to fix it?

since the netbeans project with the project packaged jersey jar files is
configured to ship the jars – its a problem with the shipped example/tutorial
project. should be fixed there – unless its also a netbeans bug – that wants
to always package the jersey jars ??? – is it?

thanks

Comment by Ian Evans [ 23/Feb/10 ]

It's not exactly a GlassFish or NetBeans bug. Tomcat has similar problems.

More about the problem here:
http://wiki.glassfish.java.net/Wiki.jsp?page=TSG_CommonProblems#section-TSG_CommonProblems-CannotUndeployOrRedeployApplicationWithOpenStreamsToJarFilesWindowsOnly

Tim Quinn's blog post has a tool that can help track down exactly what code is
keeping the JAR file handle open. You may want to run that tool and submit a bug
report with the results.

I believe a WAR file is created when you do a regular Build in NetBeans. That
WAR file can be deployed through asadmin or the Admin Console.

The problem with this example is that it creates XML (in the RESTGreeting class)
to send back, but responds to HTTP requests that are supposed to produce HTML
(the @Produces("text/html") annotations in HelloGreetingService). I'm guessing
the previous writer was adapting some code written by one of the Jersey
engineers, but didn't clean it up or test it.

You can try modifying the methods in HelloGreetingService to have
@Produces("application/xml") annotations and see if that works, although I
haven't tested this.

I'm removing this example because a) it is too similar to the other JAX-RS hello
world examples and b) doesn't work. I recommend looking at the Jersey samples at
https://jersey.dev.java.net for better examples until I get this worked out.





[JAVAEETUTORIAL-2] In persistence/order, NetBeans opens browser to non-existent index.xhtml Created: 22/Feb/10  Updated: 16/Aug/12  Resolved: 22/Feb/10

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.4
Fix Version/s: 6.0.5

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All
URL: https://glassfish.dev.java.net/issues/show_bug.cgi?id=11598


Issuezilla Id: 2

 Description   

From glassfish issue 11598:
my report – regarding gfv3 examples downloaded yesterday;

INFO: order was successfully deployed in 10,521 milliseconds.
WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service()
for servlet Faces Servlet threw exception
java.io.FileNotFoundException: /index.xhtml Not Found in ExternalContext
as a Resource

this is project order located at
G:\Sun\sges-v3\glassfish\docs\javaee-tutorial\examples\persistence\order

project wants to access index.xhtml

there is not any index.xhtml within the project.



 Comments   
Comment by Ian Evans [ 22/Feb/10 ]

The problem is that NetBeans opens the configured browser to /index.xhtml, which
overrides the welcome file list in web.xml.

The example works from Ant on the command-line.

Updating the project properties in NetBeans to open the browser to /order.xhtml
is a workaround.

Comment by Ian Evans [ 22/Feb/10 ]

Checked in changes to project.properties.

This will be integrated when we refresh the Tutorial via the Update Center.





[JAVAEETUTORIAL-1] Getting Started with Enterprise Beans has incorrect description of EJB converter example Created: 22/Jan/10  Updated: 16/Aug/12  Resolved: 06/Dec/10

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7-5

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 1

 Description   

In the intro to Ch 15, Getting Started with Enterprise Beans, it says the
converter example contains both a web client and an application client, but the
description is just of the web client.



 Comments   
Comment by Ian Evans [ 01/Oct/10 ]

Fixed in source for chapter.

Comment by Ian Evans [ 06/Dec/10 ]

Fixed in latest update.
http://download.oracle.com/javaee/6/tutorial/doc/gijre.html





[JAVAEETUTORIAL-50] Refactor Duke's Forest to use JSF relocatable resource libraries for CSS, graphics, localized strings, JavaScript Created: 24/Aug/11  Updated: 15/Feb/12  Resolved: 15/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7
Fix Version/s: None

Type: Task Priority: Major
Reporter: Ian Evans Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVAEETUTORIAL-49 Relocatable resources aren't document... Resolved

 Description   

Create a common JAR for Duke's Forest that contains events, localized strings, and resources. The resources should be packaged according to the rules in the JSF 2.0 spec, section 2.6.1. See issue JAVAEETUTORIAL-49 for details.



 Comments   
Comment by Ian Evans [ 24/Aug/11 ]

Linking issues about JSF relocatable resources.

Comment by William Markito [ 15/Feb/12 ]

All resources were moved to an external project and it's being referenced through JSF resource APIs.





[JAVAEETUTORIAL-49] Relocatable resources aren't documented in the JSF chapters Created: 24/Aug/11  Updated: 27/Feb/12  Resolved: 27/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7
Fix Version/s: 6.0.7

Type: Task Priority: Major
Reporter: Ian Evans Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVAEETUTORIAL-50 Refactor Duke's Forest to use JSF rel... Resolved

 Description   

JSF 2.0 has the ability to package resources into reusable libraries, and refer to resources in these libraries using a resource identifier syntax. This feature isn't documented in the JSF chapters of the Tutorial.

See section 2.6.1, "Packaging Resources," of the JSF 2.0 spec.

In addition to resources in the web app root's resources directory, e.g.:
web/resources/css/local.css

You can package a JAR file within the WAR that contains the following structure:
META-INF/resources/css/external.css

You can then refer to the CSS files as follows:
<h:head>
<h:outputStylesheet name="#

{resource['css/local.css']}

" />
<h:outputStylesheet name="#

{resource['css/external.css']}

" />
</h:head>



 Comments   
Comment by Kim Haase [ 17/Oct/11 ]

My understanding is that strictly speaking, the term "relocatable resource" refers to the fact that you can include a resource reference in one place on the page (say, the body) and specify another location for it, like the head, using the target attribute. This is described in Section 2.6.2.1 of the JSF 2.1 spec.

The section http://download.oracle.com/javaee/6/tutorial/doc/bnarf.html#gjgep discusses this subject, including specifying the target as "#

{param.location}

" to make the resource dynamically relocatable.

Packaging resources into libraries does need further documentation beyond what is in http://download.oracle.com/javaee/6/tutorial/doc/girgm.html, but that's not the same thing as relocatable resources. Should the issue be retitled, say to "Packaging resource libraries isn't documented ...."?

Another issue: I have trouble getting this syntax to work:

<h:outputStylesheet name="#

{resource['css/local.css']}

" />

According to the spec, you have to say

<h:outputStylesheet name="#

{resource['css:local.css']}

" />

However, neither seems to work, at least for stylesheets. With both, the generated HTML has

<link type="text/css" rel="stylesheet" href="RES_NOT_FOUND" />

The server has the following warning for both:

WARNING: JSF1091: No mime type could be found for file /guessnumber/faces/javax.faces.resource/default.css?ln=css. To resolve this, add a mime-type mapping to the applications web.xml.

The library/name attributes work fine, though:

<h:outputStylesheet library="css" name="local.css" />

Comment by Kim Haase [ 18/Oct/11 ]

It may be that the reason you can use the square-bracket resource identifier syntax with a graphicImage tag but not with outputStylesheet or outputScript may be that the square-bracket syntax is a ValueExpression that evaluates to an Object, the required argument for the graphicImage tag's value attribute. The required name attribute of outputStylesheet and outputScript takes a ValueExpression that evaluates to a String.

Comment by Kim Haase [ 18/Oct/11 ]

I have added much of this information to the "Facelets" and "Using JavaServer Faces Technology in Web Pages" chapters but am planning to save the information about packaging resources in JAR files for the chapter on the Duke's Forest example. There is no logical place to put it in the existing advanced JSF chapters, I think.

Comment by Kim Haase [ 16/Feb/12 ]

In the Facelets chapter, added an additional sentence and a forward reference (combined tutorial only) to the Duke's Forest chapter.

Comment by Kim Haase [ 27/Feb/12 ]

Documented feature in Facelets chapter, checked in to workspace. If more is needed, please let me know.





[JAVAEETUTORIAL-48] Dukes Forest - Issues Created: 21/Aug/11  Updated: 16/Aug/12  Resolved: 15/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.4
Fix Version/s: None

Type: Task Priority: Major
Reporter: William Markito Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All


Tags: case-study

 Description   

List of on-going issues with Dukes Forest case study.

https://spreadsheets.google.com/spreadsheet/ccc?key=0AizX72mdV_8AdFA3YzFLMGU4dk9NNEYtSFZrOXdHZkE&hl=en_US



 Comments   
Comment by Kim Haase [ 25/Aug/11 ]

Eric and I noticed a couple of other items you can add to the spreadsheet.

1) On the Create.xhtml page there is a message, "CreateUsernameMessage", that is not in Bundle.properties yet. (It shows up on the page as ?CreateUsernameMessage?.) We are not sure what the contents of the message are meant to be. If it is meant to tell the user that the username was created successfully, you might need to change the outputText component to an outputFormat one and specify an f:param in it to pass the username on to the bundle, then use

{0}

to indicate where the parameter belongs in the string. See the web/dukes-bookstore example for some examples of this. (The message bundle for dukes-bookstore is in src/java/web/messages.)

2) When I try to log in as the administrator (admin@example.com, password 1234), or as any of the pre-created users, the login fails, though I specify the values shown in the database. I think the problem is that the original passwords were not set using the digest algorithm. When I create a new user with the password 1234, it is stored in the database as a long encrypted string, but "1234" now works when I enter it as a password.

I think you'll have to store the administrator's long encrypted password in the database, and we'll have to document it. There may be no point in creating any other existing users besides that one, since the passwords won't be user-readable anyway.

Comment by Kim Haase [ 25/Aug/11 ]

One more item related to login. After I log in successfully as the user I created, I am back at the home page, with the message "If you are a new customer, please sign up". Since I'm logged in already, this message should not appear. Is there any way you can emit the "If you are a new customer" message if the user is not logged in, and something like "Click Products to start shopping, or click Orders to view your orders" if the user is logged in?

You might be able to use the "rendered" attribute to do this, or else (maybe better) create a new page for those who have successfully logged in.

Comment by Kim Haase [ 26/Aug/11 ]

With regard to the admin login problem – I found that putting the encrypted password in the database works (that is, it allows me to log in as admin using the password 1234). I'll check in that change to enable testing of the administration feature.

Comment by Kim Haase [ 26/Aug/11 ]

I started testing the administrative tasks and ran into the following problem.

As admin, I create a product, save it, and get the message "Product was successfully created."

On the "Step 2 - Upload the product image" page, I click Next without uploading an image. In the database, the image is an optional field, so I figure this is okay.

But then (http://localhost:8080/dukes-store/fileUpload?productID=4), I get an error 500:

java.lang.StringIndexOutOfBoundsException: String index out of range: -4

When I go back to the main page and list the products, the new product is there, in the category I created it in.

I click "Create New Product" again, but this puts me on the Step 2 page without my ever seeing step 1. Very strange.

Comment by Kim Haase [ 18/Oct/11 ]

The dukes-store/web/WEB-INF/wsdl directory has two subdirectories, anakin_8080 and localhost_8080. The first one appears to refer to a specific system and should be removed from the workspace. Thanks!

Comment by William Markito [ 15/Feb/12 ]

Issues fixed and already updated on SVN.
From now on, we'll try to put each issue on separate tasks since this was a "task force" type of issue.





[JAVAEETUTORIAL-47] Add a paragraph to the intro chapter of JPA on the different entity states Created: 19/Aug/11  Updated: 05/Oct/11  Resolved: 05/Oct/11

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 6.0.7
Fix Version/s: 6.0.7

Type: Task Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A lot of developers new to JPA don't understand the various entity states (detached, managed, etc.). Add a paragraph to the JPA intro chapter defining these states with examples of when an entity is in each state.



 Comments   
Comment by Ian Evans [ 05/Oct/11 ]

Changed the title of the following section:
http://download.oracle.com/javaee/6/tutorial/doc/bnbqw.html#bnbrc
from "Managing an Entity Instance's Lifecycle" to "Managing Entity State".

Expanded the description of the different states of an entity, including examples, and added a new section on detached entities.

Added a link from the main "Entities" section to "Managing Entities."

Comment by Ian Evans [ 05/Oct/11 ]

Updated content will be in the next release of the Tutorial.





[JAVAEETUTORIAL-53] Need to document that you can use EL resource references in JSF stylesheets and scripts Created: 22/Sep/11  Updated: 16/Aug/12  Resolved: 18/Oct/11

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7
Fix Version/s: 6.0.7-5

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If you are using <h:outputStylesheet> or <h:outputScript>, the referenced stylesheets/scripts can use the EL resource syntax. Developers may need to do this to make references to other resources in their stylesheets or scripts.

For example, if your resource library has a stylesheet that defines a background image, you can't refer to it by URL, since it's part of a resource library, and the image is also a resource. So you use a resource reference in the CSS:
background: #fff url(#

{resource['img:background.jpg']}

The JSF runtime will substitute the resource reference with the actual location in the application. E.g.:
background: #fff url(/dukes-shipment/javax.faces.resource/background.jpg.xhtml?ln=img)

Why background.jpg.xhtml? It's the extension specified by the JSF servlet in web.xml.

This section should be updated:
http://download.oracle.com/javaee/6/tutorial/doc/bnarf.html#gjgep

See section 2.6.1 of the JSF 2 spec for the resource reference syntax.



 Comments   
Comment by William Markito [ 22/Sep/11 ]

As an example, dukes-forest case study will use this feature.

When using the tags above, the whole stylesheet/javascript will be imported and processed by Faces Servlet through /javax.faces.resource/. Accessing the page source will show the complete url generated by JSF runtime.

The default pattern for resources usage is #

{resource['library:location']}

and JSF will replace with the right path.

Comment by Kim Haase [ 18/Oct/11 ]

Duke's Store uses this syntax in its default.css file. However, the actual location doesn't show up in the page source, only the reference to the CSS file. The images, of course, do appear.

Comment by Kim Haase [ 18/Oct/11 ]

I have added this information to the recommended section. Further suggestions welcome.





[JAVAEETUTORIAL-44] Portable JNDI Syntax is wrong in case of java:app module name optionality Created: 27/Jul/11  Updated: 05/Oct/11  Resolved: 05/Oct/11

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: manovotny Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

http://download.oracle.com/javaee/6/tutorial/doc/gipjf.html#girgn section Portable JNDI Syntax mentions:

<snip>
java:app[/module name]/enterprise bean name[/interface name]

The module name is optional. The interface name is required only if the enterprise bean implements more than one business interface.
</snip>

In reality The module name is required. See EJB 3.1 specification at http://download.oracle.com/auth/otn-pub/jcp/ejb-3.1-fr-eval-oth-JSpec/ejb-3_1-fr-spec.pdf?e=1311772950&h=a0872b78b5b94d887090450959a0547b

<blockquote>
4.4.1.1java:app
The java:app prefix allows a component executing within a Java EE application to access an application-specific namespace. The resulting syntax is :
java:app/<module-name>/<bean-name>[!<fully-qualified-interface-name>]

Note that <module-name> is a required part of the syntax, even for names based on session bean components packaged within a stand-alone module.

</blockquote>



 Comments   
Comment by Ian Evans [ 05/Oct/11 ]

Fixed in source. This fix will appear in the next update to the Tutorial.





[JAVAEETUTORIAL-74] Make MDB work in mailconnector example Created: 21/Mar/12  Updated: 24/May/12  Resolved: 24/May/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-2
Fix Version/s: 6.0.7-3

Type: Improvement Priority: Major
Reporter: jendrock Assignee: chinmayee_srivathsa
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The endpoint activation method is never called in the mailconnector example. The MDB needs to be fixed so it can perform its function as a listener. This can be done by examining (and possibly reusing) the code in the original GlassFish Samples. An explanation of endpoint activation can be found on page 16 of the white paper by Alejandro Murillo and Binod P.G. entitled "Creating Resource Adapters with J2EE Connector Architecture 1.5" circa 2004.



 Comments   
Comment by Kim Haase [ 24/May/12 ]

Since the application now retrieves the messages synchronously through the managed bean rather than receiving them asynchronously through the MDB, the MDB exists only to activate the resource adapter.





[JAVAEETUTORIAL-73] Streamline NetBeans-generated navigation strings used by controllers in Duke's Forest Created: 21/Mar/12  Updated: 16/Aug/12  Resolved: 03/Apr/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-2
Fix Version/s: 6.0.7-5

Type: Improvement Priority: Major
Reporter: jendrock Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: case-study

 Description   

Remove all unnecessary navigation strings and replace with one bean that holds all navigation destinations of the application, thereby avoiding the duplicated strings that we have today in several places in the application. Now, all controllers have the same navigation cases: Create, Edit, List, Update). There should be one simple enum or class with final string objects (Create/Edit/List) instead of having "List", for example, in 4 different places in the same controller. Essentially rewrite this part of code that was generated by NetBeans wizards.



 Comments   
Comment by William Markito [ 03/Apr/12 ]

Solved by last commit.





[JAVAEETUTORIAL-72] Improve thread model in Duke's Forest Created: 21/Mar/12  Updated: 04/Apr/12  Due: 06/Apr/12  Resolved: 04/Apr/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-2
Fix Version/s: 6.0.7-3

Type: Improvement Priority: Major
Reporter: jendrock Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: case-study, cdi, ejb

 Description   

Use asynchronous EJBs to enhance Duke's Forest events. Calls made from web pages directly to an EJB (without using async) holds two threads, one from the HTTP pool and one from the EJB pool. These threads are held until they complete. If you decouple that with an asynchronous call, you can free up the HTTP thread earlier.



 Comments   
Comment by William Markito [ 04/Apr/12 ]

Fixes implemented and on the codebase, but we still need to discuss the changes on the documentation.





[JAVAEETUTORIAL-70] Improve exception handling in Duke's Forest Created: 21/Mar/12  Updated: 06/Jun/12  Due: 06/Apr/12  Resolved: 06/Jun/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-2
Fix Version/s: 6.0.7-3

Type: Improvement Priority: Major
Reporter: jendrock Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Complete the following items:

1. Move all error messages to the appropriate message bundles.
2. Create a common page for errors and redirect to this page when general exceptions occur in the case study.
3. Remove all catch (Exception) and do appropriate exception handling in the case study.



 Comments   
Comment by William Markito [ 06/Jun/12 ]

This was implemented using through ExceptionHandlerFactory of JSF 2.x and a CustomerExceptionHandler. The code was already inluded in the last respin of the tutorial.





[JAVAEETUTORIAL-69] Improve usability of Order Status function in Duke's Forest Created: 21/Mar/12  Updated: 23/Mar/12  Due: 06/Apr/12  Resolved: 23/Mar/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-2
Fix Version/s: 6.0.7-3

Type: Improvement Priority: Major
Reporter: jendrock Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The existing Order Status reporting mechanism does not make it clear what the status of your order is. Recommend that a message be generated that directs all users to check the Orders page each time a shopping cart is checked out. Then, on that page, add a Description column (in the database) that details the status of the order. That way I will know why my $1400 dollar was cancelled (over the limit of $1000) or if it was manually cancelled by the administrator, etc.



 Comments   
Comment by jendrock [ 23/Mar/12 ]

The Order Status page now reflects a more informative description of the status of the order. A Description column has been added to the page and to the database in the back end. All changes have been put back to the repository. They will appear in the respin, v6.0.7-3. This issue has been resolved.





[JAVAEETUTORIAL-60] Can't log in to Administration Interface for Dukes Tutoring Created: 24/Feb/12  Updated: 24/Feb/12  Resolved: 24/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jendrock Assignee: Ian Evans
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

JDK 7 Update 3, NB 7.1.1 RC1, GF 3.1.2 b23, Win XP SP3



 Description   

Created multiple users in file realm, all in "admins" group. None can log in with Admin interface for Duke's Tutoring. Server log divulges the following clues after logging in as tutu, a member of the admins group:

WARNING: JSF1090: Navigation case not resolved for component j_idt17.
WARNING: Unable to find component with ID usernameInput in view.
WARNING: Unable to find component with ID passwordInput in view.
WARNING: WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Security Exception
WARNING: JSF1090: Navigation case not resolved for component j_idt17.

The loginError.xhtml page is displayed, saying the following, including the unresolved tags:

Invalid name or password.

Please enter a user name or password that is authorized to access this application. For this application, this means a user that has been created in the <code>file</code> realm and has been assigned to the <em>group</em> of <code>admins</code>.

A dump of the page source reveals this:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Duke's Tutoring</title><link type="text/css" rel="stylesheet" href="/dukes-tutoring/javax.faces.resource/default.css.xhtml?ln=css" /><link type="text/css" rel="stylesheet" href="/dukes-tutoring/javax.faces.resource/cssLayout.css.xhtml?ln=css" /></head><body>
<form id="j_idt7" name="j_idt7" method="post" action="/dukes-tutoring/loginError.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt7" value="j_idt7" />
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-6107512106494868627:-8616247973545914725" autocomplete="off" />
</form>

<div id="top" class="top"><html xmlns="http://www.w3.org/1999/xhtml">

<h1>Duke's Tutoring: Administration Panel</h1>

</html>
</div>
<div>
<div id="left"><html xmlns="http://www.w3.org/1999/xhtml">
<form id="j_idt14" name="j_idt14" method="post" action="/dukes-tutoring/loginError.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt14" value="j_idt14" />
<a href="/dukes-tutoring/admin/index.xhtml">Administration main page</a>
<br /><span>Create new student</span>
<br /><a href="/dukes-tutoring/admin/student/activateStudent.xhtml">Activate student</a>

<br /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-6107512106494868627:-8616247973545914725" autocomplete="off" />
</form>
</html>
</div>
<div id="content" class="left_content">
<p>Invalid name or password.</p>

<p>Please enter a user name or password that is authorized to access this application. For this application, this means a user that has been created in the <code>file</code> realm and has been assigned to the <em>group</em> of <code>admins</code>.</p>

<form id="j_idt25" name="j_idt25" method="post" action="/dukes-tutoring/loginError.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt25" value="j_idt25" />

<script type="text/javascript" src="/dukes-tutoring/javax.faces.resource/jsf.js.xhtml?ln=javax.faces"></script>
<a href="#" onclick="mojarra.jsfcljs(document.getElementById('j_idt25'),

{'j_idt25:j_idt26':'j_idt25:j_idt26'}

,'');return false">Login page</a><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-6107512106494868627:-8616247973545914725" autocomplete="off" />
</form>
</div>
</div></body>

</html>



 Comments   
Comment by jendrock [ 24/Feb/12 ]

By the way, we always get these warning messages with all of the JSF + HTML hybrid login forms:

WARNING: Unable to find component with ID usernameInput in view.
WARNING: Unable to find component with ID passwordInput in view.

The ID may vary from form to form, but we always see the same warning.

The warnings we were more concerned about were the other ones.

Comment by Ian Evans [ 24/Feb/12 ]

The current version of the app doesn't use file realm users, it uses a JDBC realm. The admin@example.com user is created in ConfigBean (password "javaee").





[JAVAEETUTORIAL-59] Can't build dukes-tutoring in NetBeans Created: 24/Feb/12  Updated: 07/Mar/12  Resolved: 07/Mar/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7
Fix Version/s: 6.0.7-3

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

I just did an svn update on Windows, ran "ant create-tutoring-realm" with no problems, opened dukes-tutoring-war and dukes-tutoring-common in NB 7.1.1 RC1 with b23 of the SDK, and right-clicked and chose "Run", following the instructions in the chapter.

I got the following error:

In-place deployment at C:\tut-ws\trunk\examples\case-studies\dukes-tutoring\dukes-tutoring-war\build\web
deploy?DEFAULT=C:\tut-ws\trunk\examples\case-studies\dukes-tutoring\dukes-tutoring-war\build\web&name=dukes-tutoring-war&contextroot=/dukes-tutoring&force=true failed on GlassFish Server 3+
Error occurred during deployment: Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [dukestutoring.ejb.AdminBean/em] in the scope of the module called [dukes-tutoring-war]. Please verify your application.. Please see server.log for more details.
C:\tut-ws\trunk\examples\case-studies\dukes-tutoring\dukes-tutoring-war\nbproject\build-impl.xml:733: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 8 seconds)

There seem to be identical persistence.xml files in both dukes-tutoring-war and dukes-tutoring-common. So I'm stumped.



 Comments   
Comment by Kim Haase [ 24/Feb/12 ]

(I would try on Solaris, not that it matters, but I can't download junit on Solaris, because there isn't a plugin available. I might be able to for a released version of NB – not sure. Is junit essential to this project?)

Comment by Kim Haase [ 24/Feb/12 ]

The instructions to create a user in the group "admins" are no longer in the chapter, but following them makes no difference.

Strangely, Eric can build and deploy on Windows, but he gets errors trying to log in. The only difference we can find is that I am using JDK 6 and he is using JDK 7. That shouldn't make any difference.

Comment by Ian Evans [ 24/Feb/12 ]

The instructions for creating an admin user in the file realm are no longer necessary, because I'm using a JDBC realm now, with a default admin user: admin@example.com, password: javaee.

Could you attach your server.log file? I've removed the persistence.xml file from dukes-tutoring-war, so there's only one. I'm guessing there was some deployment error that is reported in server.log that is causing that ultimate error message.

Comment by Kim Haase [ 24/Feb/12 ]

This is the relevant output from the server log. I didn't include it before because it seemed singularly unhelpful, but maybe you can find some illumination:

SEVERE: Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [dukestutoring.ejb.RequestBean/em] in the scope of the module called [dukes-tutoring-war]. Please verify your application.
SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
SEVERE: Exception while preparing the app
SEVERE: Could not resolve a persistence unit corresponding to the persistence-context-ref-name [dukestutoring.ejb.RequestBean/em] in the scope of the module called [dukes-tutoring-war]. Please verify your application.
java.lang.RuntimeException: Could not resolve a persistence unit corresponding to the persistence-context-ref-name [dukestutoring.ejb.RequestBean/em] in the scope of the module called [dukes-tutoring-war]. Please verify your application.
at com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUViaEMRef(BundleDescriptor.java:694)
at com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUsViaPCRefs(BundleDescriptor.java:682)
at com.sun.enterprise.deployment.WebBundleDescriptor.findReferencedPUs(WebBundleDescriptor.java:1056)
at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:186)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:871)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)

SEVERE: Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [dukestutoring.ejb.RequestBean/em] in the scope of the module called [dukes-tutoring-war]. Please verify your application.

Comment by Ian Evans [ 25/Feb/12 ]

Other users have gotten this error when there are multiple persistence.xml files in the archive. But this shouldn't be the case, as I removed persistence.xml from dukes-tutoring-war. It should only be in dukes-tutoring-common/META-INF.

Make sure there are no stray persistence.xml files in dukes-tutoring-war.

Comment by Kim Haase [ 25/Feb/12 ]

Actually, I think there were two persistence.xml files in spite of numerous svn updates. I will try again Monday.

Comment by Ian Evans [ 07/Mar/12 ]

You can see here:
http://java.net/projects/javaeetutorial/sources/svn/show/trunk/examples/case-studies/dukes-tutoring/dukes-tutoring-war/web/WEB-INF?rev=883
that persistence.xml is not part of the latest commit.

Could you double-check that the app deploys in a clean workspace?

Comment by Kim Haase [ 07/Mar/12 ]

There is only one persistence.xml file. However, the app fails to deploy if I use the command line only, and not NetBeans. It appears that a JDBC resource is not created? I did the following:

asadmin start-database
asadmin start-domain --verbose

cd dukes-tutoring/dukes-tutoring-war

ant create-tutoring-realm

ant all

deploy:
[exec] Command deploy failed.
[exec] remote failure: Error occurred during deployment: Exception while preparing the app : Invalid resource : jdbc/tutoring__pm. Please see server.log for more details.

BUILD FAILED
/export/home/chaase/tut-ws/javaeetutorial/trunk/examples/bp-project/command-line-ant-tasks.xml:211: The following error occurred while executing this line:
/export/home/chaase/tut-ws/javaeetutorial/trunk/examples/bp-project/app-server-ant.xml:434: exec returned: 1

In my experience, if you want Ant to run the setup/glassfish-resources.xml file to create the resources, you need the following target in build.xml:

<target name="-pre-deploy" unless="netbeans.home" depends="init">
<antcall target="add-resources"/>
</target>

I'll try with NetBeans. I seem to remember it worked that way last week.

Comment by Ian Evans [ 07/Mar/12 ]

Revision: 884
Author: ievans
Date: 2012-03-07 14:14
Message: Added -pre-deploy target to create resources and realm for ant users.
Issue #JAVAEETUTORIAL-59 - Can't build dukes-tutoring in NetBeans

Comment by Kim Haase [ 07/Mar/12 ]

I confirmed that it works fine in Netbeans, since NB creates the resources. (Even on Solaris, now that NB 7.1.1 is released and the plugins are downloadable.)





[JAVAEETUTORIAL-120] chapter refers to HTML tags instead of JSF tags Created: 07/Jul/12  Updated: 27/Feb/13  Resolved: 27/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Type: Bug Priority: Major
Reporter: Brant Gurganus Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The page at http://docs.oracle.com/javaee/6/tutorial/doc/bnarf.html titled "Adding Components to a Page Using HTML Tags" describes JSF tags, not HTML tags. Consequently, the page should probably be retitled something like "Adding Components to a Page Using JSF Tags".



 Comments   
Comment by Kim Haase [ 09/Jul/12 ]

We definitely abbreviated that title too much. The section is about adding components to a page using the JavaServer Faces HTML standard tag library tags (those with the h: prefix). I'll have to add enough back to clarify the meaning.

Comment by Kim Haase [ 27/Feb/13 ]

Fixed in tutorial source.





[JAVAEETUTORIAL-65] Consider create examples also using Maven Created: 07/Mar/12  Updated: 12/Jun/13  Resolved: 15/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 6.0.4
Fix Version/s: 7.0.0

Type: Improvement Priority: Major
Reporter: Manfred Riem Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Dependency
blocks JAVAEETUTORIAL-45 Move resource creation/deletion Ant t... Closed

 Description   

Rationale a lot of large organizations use Maven instead of Ant.



 Comments   
Comment by Ian Evans [ 02/Apr/12 ]

We're looking into moving to Maven for Java EE 7. It would certainly be easier to support other IDEs and not have to maintain Ant build files.

I'll update this issue as we discuss the impact of changing our infrastructure to Maven.

Comment by Brant Gurganus [ 28/Jun/12 ]

I think the build system would be outside the scope of the information a tutorial on Java2 Enterprise Edition should cover. As is, the tutorial seems cluttered with: "Here's how to do it in Netbeans. Here's how to do it in Ant." I see merit in "Here's how to get up and running with Netbeans, Ant, Maven, Eclipse, etc." but having instructions for everything everywhere distracts from learning J2EE. This isn't a Maven tutorial, it's a J2EE tutorial.

An alternative approach that I think works is J2EE tutorial for Ant, J2EE tutorial for Netbeans, J2EE tutorial for Maven. Gentoo Linux used to do something along those lines generating architecture-specific installation guides so that the instructions for one architecture didn't distract from instructions for a different architecture. I don't know how the source for the tutorial is processed though to know how feasible such an idea might be.

Comment by Ian Evans [ 28/Jun/12 ]

Producing parallel tutorials is basically too much of a strain on our resources. We're looking at reducing the number of alternate build/deploy/run instructions by moving to a single build system in Maven that could be run within NetBeans (or any other Maven-aware IDE) and the mvn command line tool.

While technically the development and build environment is outside the scope of the Java EE platform, for the sake of our novice users we need explicit instructions on how to build and run our example applications. We get a lot of user feedback supporting this. We also get feedback from expert users like you that feel the build instructions get in the way. So we try to strike a balance between these two groups. We attempt to make our example applications runnable out of the box to the extent that it is possible, with as few steps as possible, and to do that we need to provide instructions for a common build environment.

We don't provide step-by-step instructions for creating Java EE applications using NetBeans, as that is (or should be) covered by the NetBeans documentation and our First Cup tutorial. We wouldn't provide instructions on, e.g. generating Java EE projects using Maven archetypes. Rather, the instructions would be similar to what we currently do with Ant: a set of steps to get the raw project deployed and running on the Java EE RI server.

Comment by Brant Gurganus [ 29/Jun/12 ]

I think you're on the right track then. It was sounding like Maven in addition to the existing Ant and Netbeans, and that'd definitely be a bit much. Glad you regard me as an expert user, haha. I'm actually pretty much a novice with J2EE, hence why I'm reading through the tutorial.

Comment by Ian Evans [ 15/Aug/12 ]

We will migrate our examples to use Maven for Java EE 7. Following the 6.0.7-6 release, we will branch the workspace for continuing Java EE 6 work, and migrate the examples in the trunk to Maven.

Comment by Ian Evans [ 15/Aug/12 ]

This improvement will be implemented in the Java EE 7 Tutorial and the Java EE 7 version of First Cup.

Comment by Ian Evans [ 12/Jun/13 ]

Java EE 7 was released today, as was the first Mavenized releases of the Java EE 7 Tutorial and First Cup tutorial examples:
https://blogs.oracle.com/thejavatutorials/entry/java_ee_7_tutorial_released





[JAVAEETUTORIAL-63] Entity and metamodel example classes in Criteria chapter don't match example queries Created: 06/Mar/12  Updated: 06/Mar/12  Resolved: 06/Mar/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-2
Fix Version/s: 6.0.7-3

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Entity & metamodel class shown here:
http://docs.oracle.com/javaee/6/tutorial/doc/gjiup.html
should use Owner, not Person, for relationships to match the criteria queries examples that follow in the chapter.



 Comments   
Comment by Ian Evans [ 06/Mar/12 ]

Fixed in source, and it will appear in the next release.





[JAVAEETUTORIAL-80] Error in Creating Custom UI Components Created: 05/Apr/12  Updated: 16/Aug/12  Resolved: 05/Apr/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.4

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A reader points out that in Chapter 13, "Creating Custom UI Components and Other Custom Objects," the FacesValidator annotation is placed on a method instead of on a validator class. The example and the following paragraph need to be corrected.



 Comments   
Comment by Kim Haase [ 05/Apr/12 ]

Checked in fix to jsfcustom chapter.





[JAVAEETUTORIAL-117] incorrect en_US example instead of en-US and capitalized dir examples Created: 28/Jun/12  Updated: 27/Feb/13  Resolved: 27/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Type: Bug Priority: Major
Reporter: Brant Gurganus Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

This occurs in the "Table 7-4 Input Tag Attributes" table on http://docs.oracle.com/javaee/6/tutorial/doc/bnarf.html. HTML language codes are en-US, not en_US. This format is described at http://www.ietf.org/rfc/rfc1766.txt. Similarly, attributes are case sensitive in the XHTML world, so the dir attribute example values should be "ltr" and "rtl", not "LTR" and "RTL".



 Comments   
Comment by Kim Haase [ 09/Jul/12 ]

Actually, in Java the language codes do have underscores (see http://docs.oracle.com/javaee/6/tutorial/doc/bnaxv.html and the API documentation for the java.util.locale class). Underscores seem to be common on UNIX systems, while hyphens are used on Windows systems and in web browsers, but we're in the Java world here.

Also, the JSF input tag attributes do apparently take the attribute names in uppercase, according to the Facelets tag documentation at http://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/; see h:inputText, for example. Presumably this is converted to lowercase by the implementation.

Comment by Brant Gurganus [ 09/Jul/12 ]

I tested it out.
I put in a page:
<h:inputText lang="en_US"/>

This was in the output.
<input type="text" name="j_idt13" lang="en_US" />

It is correct from a JSF standpoint. JSF just puts the lang contents (after evaluation any EL expression) into the rendered lang attribute. So I can put lang="banana" in the JSF and get lang="banana" rendered even though that is clearly nonsense. It is not correct from an HTML standpoint where the valid language format comes from the RFC I mentioned. You can make up your own language tags, but those should be prefixed with an x- like x-gibberish.

Comment by Kim Haase [ 09/Jul/12 ]

I'll investigate this further. Thanks.

Comment by Ed Burns [ 27/Feb/13 ]

M jsf-api/doc/i18n-props.xml
M jsf-api/doc/standard-html-renderkit.xml

<description>
Direction indication for text that does not inherit directionality.
Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).
+ These attributes are case sensitive when rendering to XHTML, so
+ care must be taken to have the correct case.
</description>
Sending jsf-api/doc/i18n-props.xml
Sending jsf-api/doc/standard-html-renderkit.xml
Transmitting file data ..
Committed revision 11665.

Comment by Kim Haase [ 27/Feb/13 ]

Thanks very much again. Fixed in source.





[JAVAEETUTORIAL-127] mention timeouts and render complete handling Created: 12/Jul/12  Updated: 16/Aug/12  Resolved: 25/Jul/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Brant Gurganus Assignee: Kim Haase
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

These issues may not apply to this Ajax implementation, but they come up with the PrimeFaces implementation, and I don't see them addressed here yet so I wanted to mention them as something I'd like to know: How can an Ajax timeout be handled? How can the timeout duration be set? That is, if the server doesn't reply in 5 seconds, go into some timeout handling scenario instead of waiting indefinitely for a response that may never come. You can simulate this scenario by setting a breakpoint in the server while a backing bean method is called. The server connection is still open but no response is going to come. Network issues and server issues can cause these, and a robust application needs to handle those scenarios. The other issue we see is: We have races between the AJAX partial response being rendered and JavaScript that applies to what gets rendered. The way to handle that would be listening for an partial update rendered event or setting a callback to be called when the partial update is completed rendering. So are there mechanisms to do that?



 Comments   
Comment by Brant Gurganus [ 12/Jul/12 ]

This is prompted by the "Using Faces with Facelets" page at http://docs.oracle.com/javaee/6/tutorial/doc/gkabr.html

Comment by Brant Gurganus [ 12/Jul/12 ]

Looks like onevent might handle the timeout scenario, but I don't see a way to set the timeout duration yet.

Comment by Kim Haase [ 25/Jul/12 ]

I'm told by the JSF spec folks that there will be a "delay" attribute in the next release of JSF that should accomplish what you need. It'll be documented at that time.





[JAVAEETUTORIAL-131] Web Services | JAX-RS: Advanced Topics and Example | Runtime Content Negotiation is misleading and contains errors Created: 14/Aug/12  Updated: 14/Aug/12  Resolved: 14/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-6

Type: Bug Priority: Major
Reporter: kombatkuehn Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

http://docs.oracle.com/javaee/6/tutorial/doc/gkqbq.html



 Description   

The section on "Runtime Content Negotiation" contains an example where the resource class level @Produces annotation sets a default MIME type of text/plain. The method getEmployeeAddressXml has a @Produces annotation which makes the method listen to requests asking for a text/xml MIME type.
From my understanding, the subsequent sections make false statements:

The getEmployeeAddressText method is called for an HTTP request that looks as follows:

GET /employee
content-type: text/plain
500 Oracle Parkway, Redwood Shores, CA
The getEmployeeAddressXml method is called for an HTTP request that looks as follows:

GET /employee
content-type: text/xml
<address street="500 Oracle Parkway, Redwood Shores, CA" country="USA"/>

First, it is at least misleading to have a GET request containing a message body. Worse though, from my understanding, it should be the "Accept" header content that will be matched against the @Produces annotation value. The "Content-type" header should be matched against the @Consumes annotation.

If I should be wrong, the explanation of @Produces and @Consumes earlier in the chapter is very misleading.



 Comments   
Comment by Ian Evans [ 14/Aug/12 ]

You are right, the example HTTP request should use an Accept header, not Content-type.

The examples aren't intended to show a message body, although I agree that's what it looks like. It would be more clear to separate out the HTTP request fragment from the body of the response. E.g.
Request:

GET /employee
Accept: text/plain

Response:

500 Oracle Parkway, Redwood Shores, CA

Request:

GET /employee
Accept: text/xml

Response:

<address street="500 Oracle Parkway, Redwood Shores, CA" country="USA"/>
Comment by Ian Evans [ 14/Aug/12 ]

Fixed in source. Will be available in next published update.





[JAVAEETUTORIAL-130] Incorrect description in example of orphanRemoval in entity relationships Created: 13/Aug/12  Updated: 13/Aug/12  Resolved: 13/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-6

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

at the url below (Orphan Removal in Relationships):
http://docs.oracle.com/javaee/6/tutorial/doc/bnbqa.html#giqxy

i believe there may be a mistake in the tutorial text below. In the
below tutorial text, I believe the remove operation would be cascaded
to the orphaned order entity, not the customer entity.



 Comments   
Comment by Ian Evans [ 13/Aug/12 ]

Fixed in source. Will appear in the next published update.





[JAVAEETUTORIAL-129] mood example has incorrect URL Created: 10/Aug/12  Updated: 10/Aug/12  Resolved: 10/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

The web/mood example is documented to use the following URL:
http://localhost:8080/mood/report
according to:
http://docs.oracle.com/javaee/6/tutorial/doc/gkcpg.html

However, the NetBeans project is configured to open:
http://localhost:8080/mood/greeting

This results in a 404 error when running the project in NetBeans.



 Comments   
Comment by Ian Evans [ 10/Aug/12 ]

Revision: 979
Author: ievans
Date: 2012-08-10 13:06
Message: Updated Run properties.
Issue #JAVAEETUTORIAL-129 - mood example has incorrect URL





[JAVAEETUTORIAL-97] Incorrect currency symbol displayed in Duke's Forest after making I18N fixes Created: 08/Jun/12  Updated: 08/Jun/12  Due: 22/Jun/12  Resolved: 08/Jun/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7
Fix Version/s: 6.0.7-4

Type: Bug Priority: Major
Reporter: jendrock Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 2 weeks
Time Spent: Not Specified
Original Estimate: 2 weeks


 Description   

After making an I18N fix to Duke's Forest, the dollar symbol ($) was no longer displayed. An odd symbol (¤) was displayed in its place, throughout the case study. We internationalized the application, so I do not want to throw away that effort. I'd rather correct the necessary files listed below and replace this:

<f:convertNumber type="currency"/>

with this:

<f:convertNumber currencySymbol="$" type="currency"/>

so the dollar sign is once again displayed correctly. The affected files are:

./dukes-shipment/web/admin/index.xhtml
./dukes-shipment/web/admin/index.xhtml
./dukes-store/web/order/MyOrders.xhtml
./dukes-store/web/orderDetail/View_popup.xhtml
./dukes-store/web/admin/order/List.xhtml
./dukes-store/web/admin/orderDetail/View_popup.xhtml
./dukes-store/web/admin/product/List.xhtml
./dukes-resources/src/META-INF/resources/util/productProfile.xhtml
./dukes-resources/src/META-INF/resources/util/shoppingCart.xhtml
./dukes-resources/src/META-INF/resources/util/shoppingCart.xhtml



 Comments   
Comment by jendrock [ 08/Jun/12 ]

Made the fixes in all of the affected files. Should be fine now.





[JAVAEETUTORIAL-86] Explanation of contexts is confusing and unclear in JEE6 Tutorial Created: 25/Apr/12  Updated: 25/Jul/13  Resolved: 25/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.2

Type: Improvement Priority: Major
Reporter: billick Assignee: rcervera
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Here is the definition of 'context' given in the CDI section of the JEE6 Tutorial:

Overview of CDI

"Contexts: The ability to bind the lifecycle and interactions of stateful components to well-defined but extensible lifecycle contexts"

This is a circular definition. What is a context. How is it different from a 'lifecycle context'? If it isn't different then it really is a circular definition which isn't really a definition. If they are different things, why do they have the same name?

This is probably a good definition for someone who who knows the subject; but not for someone who really needs the tutorial.



 Comments   
Comment by jendrock [ 25/Apr/12 ]

This passage was not meant to be a definition of the term "contexts" but was intended to describe the services provided by the technology (CDI) in this area. This is indicated by the text that introduces the bullet list. In fact, the term isn't defined in the CDI specification or anywhere else that we could find! If you can find a valid definition, we would be glad to include it in the tutorial.

Comment by jendrock [ 30/May/12 ]

I suggest that you look at this issue and then use the definition provided by Paul Davies in the first section of Chapter 9, "Using Contexts and Dependency Injection for the Java EE Platform", in the Oracle Fusion Middleware Developing Applications for Oracle WebLogic Server 12c Release 1 book. The meaning is essentially the same, but the grammar is slightly improved.

Comment by Ian Evans [ 24/Jun/13 ]

Ricardo: reassigning Chinmayee's CDI issues to you. This may have been fixed in the Java EE 7 Tutorial.

Comment by rcervera [ 25/Jul/13 ]

Fixed this issue in the source using Eric's suggestion.





[JAVAEETUTORIAL-36] Issues with Ant instructions for persistence examples Created: 08/Jun/11  Updated: 27/Jul/11  Resolved: 27/Jul/11

Status: Resolved
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There are some problems running the persistence examples with Ant.

order:

The instructions say that an "all" target exists for this example, although there is none. Either the mention of the all target should be removed from the chapter, or the target should be added to build.xml.

Using "ant" and "ant deploy" works fine.

roster:

The javaee.home property is hardcoded in project.properties, so the deployment fails:

BUILD FAILED
/export/home/chaase/tut-ws/javaeetutorial/trunk/examples/persistence/roster/build.xml:28: The following error occurred while executing this line:
/export/home/chaase/tut-ws/javaeetutorial/trunk/examples/bp-project/app-server-ant.xml:145: The directory /export/home/chaase/tut-ws/javaeetutorial/trunk/examples/persistence/roster/c:/Sun/AppServerPE does not exist

Total time: 19 seconds
jdench 690 =>grep Sun /
nbproject/project.properties:javaee.home=c:/Sun/AppServerPE

address-book:

The chapter has instructions for using Ant, but the build.xml file still works only with NetBeans. The file needs to be modified.



 Comments   
Comment by Ian Evans [ 08/Jun/11 ]

roster actually does have an all task. order and address-book do not.

Comment by Kim Haase [ 08/Jun/11 ]

Oops, I'm sorry that I got mixed up.

There's an EJB example with a similar problem to address-book: ejb/interceptor, which has Ant instructions in the chapter but whose build.xml file is still NetBeans-only.

Comment by Ian Evans [ 27/Jul/11 ]

All tasks added to order and address-book.





[JAVAEETUTORIAL-33] Images in examples must have alt attribute Created: 03/Jun/11  Updated: 16/Aug/12  Resolved: 16/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.4
Fix Version/s: 6.0.4

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

To meet accessibility requirements, each image in a web app must have an ALT attribute. For an image that serves a meaningful function, the ALT text must be meaningful, too. For a purely decorative image, the ALT text can be empty:

alt=""

For example, in hello1 we could do the following:

<h:graphicImage url="duke.waving.gif" alt="Duke waving his hand"/>

Or we could decide that the image was just decorative and do

<h:graphicImage url="duke.waving.gif" alt=""/>

Other examples with no alt attributes are

web/guessnumber
web/ajaxguessnumber
web/mood



 Comments   
Comment by Kim Haase [ 16/Feb/12 ]

Fixes were committed in October.





[JAVAEETUTORIAL-32] html tags in examples must have lang attribute Created: 03/Jun/11  Updated: 21/Feb/13  Resolved: 21/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.4
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 day
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVAEETUTORIAL-40 Internationalize the dukes-forest cas... Closed

 Description   

All HTML tags in our examples must have the LANG attribute set.

It appears that for the simple case where the example is English-only, hardcoding the LANG attribute in the HTML tag may be the way to go:

<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
...

However, it appears that for the case studies, where the locale can change dynamically, we need to do some coding so that the current locale can be retrieved. I don't know how well something like this would actually work, but maybe one of you can try it out:

http://stackoverflow.com/questions/4830588/jsf-locale-is-set-per-request-not-for-session

Our apps are different in that they get the locale from the browser setting instead of having the user set it in the app; that might simplify things.

I can check in fixes for the simple cases and then un-assign myself so the case study authors can work on those.



 Comments   
Comment by Kim Haase [ 09/Jun/11 ]

I've completed this work for all but the case studies.

Comment by Kim Haase [ 09/Jun/11 ]

Unassigning so case study authors can do this work – though I can do it, if you prefer.

Comment by Kim Haase [ 08/Jul/11 ]

Ian, thanks for picking this up. While you are fixing this for dukes-tutoring you might also add a summary attribute to the h:dataTable element in any files that use one. Or would you rather I filed a separate issue for table summary problems?

Comment by Ian Evans [ 27/Jul/11 ]

Re-assigning to William for Duke's Forest.

Comment by Kim Haase [ 17/Aug/11 ]

This task is really part of the task of internationalizing dukes-forest. It will probably involve creating a locale bean like the one used by dukes-tutoring, and setting the lang attribute to the value of the locale bean's language property.

Comment by Kim Haase [ 05/Jun/12 ]

A couple of mailconnector pages are missing the lang attribute. Will fix.

Comment by William Markito [ 21/Feb/13 ]

This issue has been fixed on Duke's Forest since we've applied i18n. The templates pages (shipment & store) has the following syntax:
<html lang="#

{localeBean.language}

"...

Comment by William Markito [ 21/Feb/13 ]

This issue has been fixed on Duke's Forest since we've applied i18n. The templates pages (shipment & store) has the following syntax:
<html lang="#

{localeBean.language}

"...





[JAVAEETUTORIAL-34] Text in examples must have sufficient color contrast Created: 03/Jun/11  Updated: 16/Aug/12  Resolved: 05/Jun/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7-4

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

All text that uses color must have a certain level of contrast so that color-blind and low-vision users can see it. In addition, color must not be used as the sole means of conveying information.

Unfortunately, red text (#ff0000), which is also the default used by JSF for messages that indicate failure, does not have enough contrast.

(The blue that indicates success is just fine.)

The ejb/counter example uses a slightly darker red, coded #d20005, that has sufficient contrast. Perhaps it can be used for other examples that explicitly specify a text color (jaxrs/rsvp, case-studies/dukes-tutoring, and so on).

How to change the default color for JSF messages is a somewhat difficult problem. It may require using a stylesheet for all apps that might use these messages.

In addition, however, it is necessary to make changes in our text messages so that the text says "Success" or "Error" where that is relevant. For example, in hello1, instead of just

requiredMessage="A name is required."

we need something like

requiredMessage="Error: A name is required."

This will need to be a cooperative effort, though I'm assigning it to myself to fix the simple cases.



 Comments   
Comment by Kim Haase [ 08/Jul/11 ]

What I ended up doing was adding code similar to the following, or modifying what was there, for the simple examples that can have error messages. Note that the color is not red but #d20005, a slightly darker red that passes the color contrast analyzer.

<div class="messagecolor">
<h:messages showSummary="true"
showDetail="false"
errorStyle="color: #d20005"
infoStyle="color: blue"/>
</div>

Thanks to Ian for first using this color, for (I think) the rsvp example.

I believe I have made the fix for all the simple examples, so I will unassign myself so others can pick it up (dukes-tutoring and dukes-forest still use red, as does persistence/address-book).

Comment by jendrock [ 30/May/12 ]

In Duke's Forest, the green "X" at the top right corner of the popup messages box has insufficient color contrast. Need to make it darker. The error messages need to be a darker red. They fail with the same error.

Comment by jendrock [ 30/May/12 ]

Provided partial fix, that took care of the red error messages. Cannot find where green "" is defined. Need help on this to fix.

Comment by jendrock [ 30/May/12 ]

We figured it out. Changed "color:forestgreen" to "color:darkgreen" in C:\javaeetutorial\trunk\examples\case-studies\dukes-forest\dukes-store\web and in C:\javaeetutorial\trunk\examples\case-studies\dukes-forest\dukes-shipment\web. Everything passes now.

Comment by jendrock [ 30/May/12 ]

Fix will appear in 6.0.7-4.

Comment by Kim Haase [ 05/Jun/12 ]

The dukes-tutoring stylesheets and pages have not yet been fixed to use colors that pass the color-contrast tests.

I'm changing "red" and "FF0000" to D20005, a slightly darker red, and 7f7f7f to 6f6f6f, a slightly darker gray. These work.

Comment by Kim Haase [ 05/Jun/12 ]

Checked in fixes to 10 files at revision 928.





[JAVAEETUTORIAL-30] ejb/async example produces a runtime error related to lookup of Mail resource Created: 03/Jun/11  Updated: 03/Jun/11  Resolved: 03/Jun/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

The async app deploys, but when I try to send an email I get a runtime error.

The problem is that it can't find the javamail resource:

Lookup failed for 'java:comp/env/mail/myExampleSession'

The mail-resource element in glassfish-resources.xml doesn't seem to create the resource at deployment, as it should. This seems to be another issue with 3.1.1 – I'm sure this used to work. I think I edited it correctly (password is Xed out):

<mail-resource debug="false"
enabled="true"
from="username@example.com"
host="mail.example.com"
jndi-name="mail/myExampleSession"
object-type="user" store-protocol="imap"
store-protocol-class="com.sun.mail.imap.IMAPStore"
transport-protocol="smtps"
transport-protocol-class="com.sun.mail.smtp.SMTPSSLTransport"
user="username@example.com">
<description/>
<property name="mail-smtps-auth" value="true"/>
<property name="mail-smtps-password" value="xxxxxxxxxxxx"/>



 Comments   
Comment by Ian Evans [ 03/Jun/11 ]

Needs this to work in Ant:
<target name="-pre-deploy" unless="netbeans.home" depends="init">
<antcall target="add-resources"/>
</target>

Comment by Ian Evans [ 03/Jun/11 ]

Revision: 553
Author: ievans
Date: 2011-06-03 11:12
Message: Added -pre-deploy target for Ant that will create the resource.
Issue #JAVAEETUTORIAL-30 - ejb/async example produces a runtime error related to lookup of Mail resource





[JAVAEETUTORIAL-29] Accessibility issues with jaxrs/rsvp application Created: 03/Jun/11  Updated: 03/Jun/11  Resolved: 03/Jun/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

All our web apps fail because the html element lacks a lang attribute. I guess we need to set it to "en" even when we provide localization messages?? I'm not sure how it could be reset dynamically. In this case, hard-coding it to "en" should be okay. (This will have to be done in ResponseBean and StatusBean too, of course.)

The rsvp app fails the color contrast analyzer – red type provides insufficient contrast unless the size is 18 pt or above, according to the error message. We can use Oracle red in images, but not in text. (We're going to have to fix our doc landing pages because of this, too.)

The data tables lack a summary. The h:dataTable element has a summary attribute that we'll need to use in index.xhtml; you can add the summary attribute directly in the bean code.

Every table gets errors about missing row headers. I think we need scope attributes like those in http://www.w3schools.com/tags/att_td_scope.asp, or alternatively we can use id and headers attributes.

The text field in the form must have a label with a for attribute. If you don't want the label visible on the page, you need to use css style attributes.



 Comments   
Comment by Ian Evans [ 03/Jun/11 ]

Revision: 554
Author: ievans
Date: 2011-06-03 11:21
Message: Fixed accessibility problems in rsvp.
Issue #JAVAEETUTORIAL-29 - Accessibility issues with jaxrs/rsvp application





[JAVAEETUTORIAL-26] Errors in description of roster application components Created: 16/May/11  Updated: 16/May/11  Resolved: 16/May/11

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Some errors have been found while running the Java Persistence roster application (Chapter 33):

1- Pag. 575 - Documentation errors identified:

a) The roster application uses Criteria API queries, as opposed to the JPQL queries used in order. Criteria queries are Java programming language, typesafe queries defined in the business tier of roster, in the RequestBean stateless (In the source code, the session bean RequestBean is stateful) session bean.

b) There have been mentions to an entity Person and its Metamodel class Person_ which do not exist. I think the correct class would be Player and its Metamodel Player_.

The above refers to:
http://download.oracle.com/javaee/6/tutorial/doc/giqsq.html



 Comments   
Comment by Ian Evans [ 16/May/11 ]

Fixed in documentation source. Corrections will appear in the next update to the Tutorial.





[JAVAEETUTORIAL-27] roster's RequestBean.getPlayersByHigherSalary method doesn't return the correct information Created: 16/May/11  Updated: 16/May/11  Resolved: 16/May/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

From the feedback list:
In your application client there is a file called RosterClient.java (package roster.client) which has a request.getPlayersByHigherSalary("Ian Carlyle") method invocation. According to its description, this method should list all players making a HIGHER salary than 'Ian Carlyle'. However, the output from the application client shows Ian Carlyle description.

The problem I found is inside the method: public List<PlayerDetails> getPlayersByHigherSalary(String name) - RequestBean.java

The method CriteriaBuilder.greaterThan() always checks whether the first argument is greater than the second. Consequently, when creating the Predicate equalPredicate, the attribute that should have been declared is player2 instead of player1. The following CriteriaQuery.select remains with player1.
After this correction, the list is correctly shown.



 Comments   
Comment by Ian Evans [ 16/May/11 ]

Revision: 534
Author: ievans
Date: 2011-05-16 10:56
Message: Modified the Criteria query to compare player2's salary to player1's salary. Now RequestBean.getPlayersByHigherSalary returns the correct list.
Issue #JAVAEETUTORIAL-27 - roster's RequestBean.getPlayersByHigherSalary method doesn't return the correct information





[JAVAEETUTORIAL-25] <f:param> tag missing id attribute in order example's order.xhtml file Created: 13/May/11  Updated: 13/May/11  Resolved: 13/May/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

From feedback alias:
An insignificant but at the same time vital error may have been found inside the file order.xhtml which belongs to "The order application" - Chapter 33 Running Persistence Examples.

Old code:

<h:form>

<h:commandLink value="Delete" actionListener="#

{orderManager.removeOrder}" action="order">

<f:param name="deleteOrderId" value="#{order.orderId}" />

</h:commandLink>

</h:form>



Corrected code:

<h:form>

<h:commandLink value="Delete" actionListener="#{orderManager.removeOrder}

" action="order">

<f:param name="deleteOrderId" id="deleteOrderId" value="#

{order.orderId}

" />

</h:commandLink>

</h:form>

Without this change, my application was unable to capture the param "deleteOrderId" in removeOrder(ActionEvent event) method (order.web.OrderManager.java file). Thus, no order was being removed in my database tables persistence_order_order and persistence_order_lineitem due to the fact that an exception was being catched when trying to capture the param value.



 Comments   
Comment by Ian Evans [ 13/May/11 ]

Revision: 533
Author: ievans
Date: 2011-05-13 11:32
Message: Added missing ID attribute to <f:param> tag in order.xhtml, made Logger instance static and final.
Issue #JAVAEETUTORIAL-25 - <f:param> tag missing id attribute in order example's order.xhtml file





[JAVAEETUTORIAL-21] Defining the Custom Component Tag in a Tag Library Descriptor section needs enhancement Created: 20/Apr/11  Updated: 27/Feb/12  Resolved: 27/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: jendrock Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

Reported to the Java EE Documentation mailing list from a user.

The section "Defining the Custom Component Tag in a Tag Library Descriptor" in the Java EE 6 Tutorial is very poorly documented. Using the information provided, I have been quite unsuccessful in making my own tag libraries.

I need the following information, which is absent from the section in question, before I can define my own custom component tag in a tag library descriptor:

  • A pointer to where I can find complete reference and definition of tag libraries.
  • A working/correct example (included snippet seems/is wrong, namespace in particular)
  • Instructions that tell me where I need to put the final tag library, how I can later use the tag library, and how I get to use my custom tag.

For my custom tag I've been implementing the new "video"-tag for html5. I think this is a good example, that also gives the possibility of adding resources into the example.



 Comments   
Comment by jendrock [ 27/Apr/11 ]

Removed name of user who reported the issue.

Comment by Kim Haase [ 11/Jan/12 ]

We are putting a full working example that uses a custom component and tag library into the tutorial for the next version. This will include adding some information about this example to "Defining the Custom Component Tag in a Tag Library Descriptor" as well as many other sections.

Comment by Kim Haase [ 27/Feb/12 ]

Documentation fixes checked into workspace.





[JAVAEETUTORIAL-24] Need simple username/token (password) Web Service Policy to authenticate a user against the JDBCRealm Created: 28/Apr/11  Updated: 16/Aug/12  Resolved: 15/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jendrock Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

For Duke's Forest case study, how can we employ a simple username/token (password) Web Service Policy that will authenticate the user against the JDBCRealm that is being used for the web application? The JDBCRealm is already set up in the GlassFish server.

GlassFish Configuration for Message Security:

  • Under Security -> Message Security -> SOAP
  • Select Default Provider "ServerProvider"
  • Default client Provider "ClientProvider"
  • Save.

Server Code:
Straight-forward JAX-WS service. Nothing special at code level.

Server Configuration:

  • Right-click on Web Service
  • Edit Web Service Attributes
  • Mark "Secure Web Service" checkbox and select "Username Authentication with Password Derived Key" as security mechanism (I've tried with few other options too)
  • Ok/Apply actions and deploy the Web Service.
  • Use development defaults checked.

Client Configuration:

  • Right-click on Web Service References
  • Edit Web Service Attributes
  • Mark "Use development defaults" checkbox

Client code:
......

Payment port = service.getPaymentPort();

// password info
((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john@example.com");
((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "1234");

return port.processPayment(order);

  • Use development defaults checked.

Exceptions thrown:

WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.el.EvaluationException: javax.xml.ws.WebServiceException: Cannot secure request for

{com.forest.payment.services}PaymentPort
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:228)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.xml.ws.WebServiceException: Cannot secure request for {com.forest.payment.services}

PaymentPort
at com.sun.enterprise.security.webservices.ClientSecurityPipe.process(ClientSecurityPipe.java:169)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:641)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482)
at com.sun.xml.ws.client.Stub.process(Stub.java:323)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:161)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:113)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:144)
at $Proxy383.processPayment(Unknown Source)
at com.forest.handlers.PaymentHandler.processPayment(PaymentHandler.java:61)
at com.forest.handlers.PaymentHandler.onNewOrder(PaymentHandler.java:39)
at com.forest.handlers.org$jboss$weld$bean-web-ManagedBean-class_com$forest$handlers$PaymentHandler_$$WeldClientProxy.onNewOrder(org$jboss$weld$bean-web-ManagedBean-class_com$forest$handlers$PaymentHandler$$_WeldClientProxy.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:613)
at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:625)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:75)
at com.forest.ejb.ShoppingCart.checkout(ShoppingCart.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:613)
at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
... 33 more
Caused by: com.sun.enterprise.security.jauth.AuthException: javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException: Element ns2:processPayment has a relative namespace: ns2="com.forest.payment.services"
at com.sun.xml.wss.provider.ClientSecurityAuthModule.secureRequest(ClientSecurityAuthModule.java:128)
at com.sun.enterprise.security.jmac.config.GFServerConfigProvider$GFClientAuthContext.secureRequest(GFServerConfigProvider.java:1261)
at com.sun.enterprise.security.webservices.ClientSecurityPipe.process(ClientSecurityPipe.java:162)
... 75 more



 Comments   
Comment by William Markito [ 15/Feb/12 ]

The solution was to create a simple JAX-WS service and block the access using traditional Java security constraints on web.xml. On the client side needed to assign to the BindingProvider the username/password for authentication.

For example:

  1. Snippet from web.xml:
    ...
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Secure payment service</web-resource-name>
    <description/>
    <url-pattern>/*</url-pattern>
    <http-method>POST</http-method>
    <http-method>HEAD</http-method>
    <http-method>PUT</http-method>
    <http-method>OPTIONS</http-method>
    <http-method>TRACE</http-method>
    <http-method>DELETE</http-method>
    <!-<http-method>GET</http-method>->
    </web-resource-collection>
    <auth-constraint>
    <role-name>USERS</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>jdbcRealm</realm-name>
    </login-config>
    <security-role>
    <role-name>USERS</role-name>
    </security-role>
    ...
  1. Snippet for web service client:
    ...
    Payment port = service.getPaymentPort();

((BindingProvider) port).getRequestContext().put(
BindingProvider.USERNAME_PROPERTY, USER);
((BindingProvider) port).getRequestContext().put(
BindingProvider.PASSWORD_PROPERTY, TOKEN);
return port.processPayment(order);
...





[JAVAEETUTORIAL-23] Clarify the enumerated types defined in javax.ejb.LockType in the Singleton chapter Created: 28/Apr/11  Updated: 11/May/11  Resolved: 11/May/11

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In:
http://download.oracle.com/javaee/6/tutorial/doc/gipvi.html
there are quite a few references to

@Lock(WRITE)
and
@Lock(READ)

should actually be something like this, for a clearer example:

@Lock(LockType.WRITE)
and
@Lock(LockType.READ)



 Comments   
Comment by Ian Evans [ 28/Apr/11 ]

The current code examples will work if you import javax.ejb.LockType.READ/WRITE, but this could be clarified by explicitly adding a sentence stating that the LockType enumerated types are READ and WRITE, with a code snippet showing @Lock(LockType.READ) and @Lock(LockType.WRITE).

Comment by Ian Evans [ 11/May/11 ]

Updated documentation source. Fix will be in 6.0.7.





[JAVAEETUTORIAL-22] @DependsOn code examples have incorrect syntax Created: 28/Apr/11  Updated: 11/May/11  Resolved: 11/May/11

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.6
Fix Version/s: 6.0.7

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The code examples in this guide are misleading:
http://download.oracle.com/javaee/6/tutorial/doc/gipvi.html

for example

@Singleton
@DependsOn("PrimaryBean", "SecondaryBean")
public class TertiaryBean

{ ... }

looks like an example of an accurate @DependsOn tag, however it actually must be:

@Singleton
@DependsOn({"PrimaryBean", "SecondaryBean"})
public class TertiaryBean { ... }

Same with the READ/ WRITE references further down.



 Comments   
Comment by Ian Evans [ 28/Apr/11 ]

Add missing curly braces to singleton snippets.

Comment by Ian Evans [ 11/May/11 ]

Updated documentation source. Fix will be in 6.0.7.





[JAVAEETUTORIAL-19] "XML declaration allowed only at the start of the document" error when using Safari or Chrome with Duke's Tutoring Created: 13/Apr/11  Updated: 13/Apr/11  Due: 15/Apr/11  Resolved: 13/Apr/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.6
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 1 hour
Time Spent: Not Specified
Original Estimate: 1 hour
Environment:

WebKit-based web browsers (Safari, Chrome)



 Description   

An error is displayed when attempting to view Duke's Tutoring's web interface in WebKit-based web browsers (Safari and Chrome):
"error on line 16 at column 26: XML declaration allowed only at the start of the document"

The error is triggered by a ui:include tag for the left navigation pane, which pulls in web/WEB-INF/includes/mainNav.xhtml.

WebKit is apparently much more strict about rendering XHTML fragments within a single page than Gecko or IE's rendering engine. Firefox and IE both display without errors.

The error goes away when removing the XML and DOCTYPE declarations at the beginning of the included files.



 Comments   
Comment by Ian Evans [ 13/Apr/11 ]

Revision: 500
Author: ievans
Date: 2011-04-13 12:57
Message: Fixed issue with navigation include causing errors in Safari and Chrome by removing the XML and DOCTYPE declarations.
Issue #JAVAEETUTORIAL-19 - "XML declaration allowed only at the start of the document" error when using Safari or Chrome with Duke's Tutoring





[JAVAEETUTORIAL-18] Incorrect error message for Duke's Tutoring login error Created: 11/Apr/11  Updated: 16/Aug/12  Resolved: 13/Apr/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 1 hour
Time Spent: Not Specified
Original Estimate: 1 hour


 Description   

The login.error.details message in Messages.properties incorrectly states that you must add a new file user with the group "TutorialUsers". The group must be "admins".

This likely means changes to the translated Messages bundles.



 Comments   
Comment by Ian Evans [ 13/Apr/11 ]

Revision: 501
Author: ievans
Date: 2011-04-13 12:58
Message: Fixed incorrect login error message for English locales.
Issue #JAVAEETUTORIAL-18 - Incorrect error message for Duke's Tutoring login error





[JAVAEETUTORIAL-147] Incorrect element for @AccessTimeout code snippet in singleton bean chapter Created: 18/Jan/13  Updated: 05/Feb/13  Resolved: 05/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

http://docs.oracle.com/javaee/6/tutorial/doc/gipvi.html

The code snippet shows:

@AccessTimeout(value=60, timeUnit=SECONDS)

instead of:

@AccessTimeout(value=60, unit = TimeUnit.SECONDS)


 Comments   
Comment by Ian Evans [ 05/Feb/13 ]

Fixed in source. If we do another update of the EE 6 branch, it will appear there. Otherwise, it will be fixed for the EE 7 tutorial.





[JAVAEETUTORIAL-146] Incorrect code snippet showing application-managed entity manager Created: 09/Jan/13  Updated: 05/Feb/13  Resolved: 05/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

From the email feedback alias:
On the page: http://docs.oracle.com/javaee/6/tutorial/doc/bnbqw.html
This fragment appears under the section "Application-Managed Entity Managers" :

----------------------------------------------------

The following example shows how to manage transactions in an application that uses an application-managed entity manager:

@PersistenceContext
EntityManagerFactory emf;
EntityManager em;
@Resource
UserTransaction utx;

---------------------------------

It seems to me from the other text that @PersistenceContext should actually be @PersistenceUnit,
but as I am just learning JPA, I may very well be wrong. Either I am correct, or the explanation is not clear.

The user is correct. It should be:

@PersistenceUnit
EntityManagerFactory emf;
EntityManager em;
@Resource
UserTransaction utx;


 Comments   
Comment by Ian Evans [ 05/Feb/13 ]

Fixed in source. If we update the EE 6 tutorial, the fix will appear there. Otherwise, the fix will appear in the EE 7 tutorial.





[JAVAEETUTORIAL-231] Replace the inboundconnector example as discussed with the JCA engineers Created: 01/Aug/13  Updated: 18/Sep/13  Resolved: 18/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: rcervera Assignee: rcervera
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Siva suggested to replace the inboundconnector example for a future tutorial release to showcase an asynchronous communication use case between the EIS and the MDB/RA.



 Comments   
Comment by Kim Haase [ 02/Aug/13 ]

When you redo this example, you may want to use the naming conventions (with hyphens) described in http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples006.htm#GEXAP. It's not very important, so no one mentioned it for the August release – it's great just to have the examples.

Comment by rcervera [ 18/Sep/13 ]

The example is now updated in the source tree and in the book.





[JAVAEETUTORIAL-229] Use EIS-specific API in the outboundconnector example Created: 01/Aug/13  Updated: 11/Sep/13  Resolved: 11/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: rcervera Assignee: rcervera
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Replace the CCI implementation by a custom EIS-specific interface and implementation to access the resource adapter from the web application, as recommended by Siva and Jagadish from JCA. Update the Connector Examples chapter accordingly.



 Comments   
Comment by Kim Haase [ 02/Aug/13 ]

When you redo this example, you may want to use the naming conventions (with hyphens) described in http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples006.htm#GEXAP. It's not very important, so no one mentioned it for the August release – it's great just to have the examples.

Comment by rcervera [ 02/Aug/13 ]

Thanks Kim, I'll fix that for the next release.

Comment by rcervera [ 11/Sep/13 ]

Replaced the Common Client Interface (CCI) by a simpler, EIS-specific, custom client interface.





[JAVAEETUTORIAL-223] Add section on standardized schema generation to Persistence chapter Created: 29/Jul/13  Updated: 16/Sep/13  Resolved: 16/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
JAVAEETUTORIAL-224 Add section on specifying schema gene... Sub-task Resolved Ian Evans  

 Description   

A new feature in JPA 2.1 is standardized schema generation on deployment. This replaces and standardizes the vendor-specific options used previously.

See section 9.4 of the JPA 2.1 spec for details.



 Comments   
Comment by Ian Evans [ 16/Sep/13 ]

Added new section on standardized database artifact creation/deletion and data-loading.





Add section on standardized schema generation to Persistence chapter (JAVAEETUTORIAL-223)

[JAVAEETUTORIAL-224] Add section on specifying schema generation scripts to advanced JPA chapter Created: 29/Jul/13  Updated: 16/Sep/13  Resolved: 16/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Sub-task Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

An advanced feature that is part of standardized schema generation in JPA 2.1 is the ability to either have the provider generated create/drop scripts, or to specify custom create/drop scripts within an archive.

Add a section on this feature to the advanced JPA chapter.



 Comments   
Comment by Ian Evans [ 16/Sep/13 ]

Added a section in the intro chapter, as it keeps the information together.





[JAVAEETUTORIAL-236] roster-ejb compile errors Created: 15/Aug/13  Updated: 15/Aug/13  Resolved: 15/Aug/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: DLambers Assignee: Ian Evans
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In the roster example (examples/persistence/roster), roster-ejb does not compile because of the absence of the classes javaeetutorial.roster.entity.League_ , javaeetutorial.roster.entity.Player_ and javaeetutorial.roster.entity.Team_ (note the underscores).



 Comments   
Comment by Ian Evans [ 15/Aug/13 ]

The files with trailing underscores are generated static metamodel classes, and they will be generated before the compile process when you build the application.

If you look in roster-ejb's pom.xml file, you'll see that it's set up to generate these files during the generate-sources phase by the maven-processor-plugin. This will occur in both NetBeans and when using mvn from the command-line.

Comment by DLambers [ 15/Aug/13 ]

I see it indeed in the pom.xml. But both building by Netbeans and Maven command line give errors related to the roster-ejb jar. There must be something else going wrong then. I'll continue the search. Thank you for your help.

Comment by Kim Haase [ 15/Aug/13 ]

One thing I've noticed is that the tutorial instructions for running the project – right-click the roster-ear project and select Run – result in a hang here:

NetBeans: Deploying on GlassFish Server
profile mode: false
debug mode: false
force redeploy: true
Distributing C:\tut-ws\trunk\examples\persistence\roster\roster-ear\target\roster-ear.ear to [GlassFish Server]
Initializing...

The way that works for running it is to right-click the parent project, roster, and select Build.





[JAVAEETUTORIAL-233] Describe Configuration instances in the WebSocket chapter Created: 09/Aug/13  Updated: 19/Aug/13  Resolved: 19/Aug/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: rcervera Assignee: rcervera
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: websocket

 Description   

Describe how to obtain a Configuration instance for WebSocket endpoints.

This is related to the question that Ian found here:
http://stackoverflow.com/questions/18097334/how-can-i-get-a-cookie-value-inside-websocket-end-point



 Comments   
Comment by rcervera [ 09/Aug/13 ]

Another relevant question that should be addressed:

http://stackoverflow.com/questions/17936440/accessing-httpsession-from-httpservletrequest-in-a-web-socket-socketendpoint

Thanks Ian for finding these.

Comment by rcervera [ 19/Aug/13 ]

Added a description and (tested) code snippets of endpoint configurator classes in websocket.fm.





Add section on method validation using Bean Validation (JAVAEETUTORIAL-218)

[JAVAEETUTORIAL-220] Add information on using method validation in a type hierarchy to Advanced Bean Validation chapter Created: 16/Jul/13  Updated: 16/Jul/13  Resolved: 16/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: None
Fix Version/s: 7.0.2

Type: Sub-task Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Add documentation on how to correctly apply validation constraints to a type hierarchy. This is, in my opinion, an advanced feature, and should be in the Bean Validation: Advanced Topics chapter.



 Comments   
Comment by Ian Evans [ 16/Jul/13 ]

Added section to advanced chapter.





[JAVAEETUTORIAL-218] Add section on method validation using Bean Validation Created: 16/Jul/13  Updated: 16/Sep/13  Resolved: 16/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
JAVAEETUTORIAL-220 Add information on using method valid... Sub-task Resolved Ian Evans  

 Description   

Section 12.4:

JavaBeans Validation (Bean Validation) is a new validation model available as part of Java EE 7 platform [sic]. The Bean Validation model is supported by constraints in the form of annotations placed on a field, method, or class of a JavaBeans component, such as a managed bean.

We need to fix the grammar of the first sentence, but this is the only mention of method validation in our chapters. We need to add a section here.

We can add it to chapter 12. But I think we might need to do some reorganization of the chapters so:

  • the Bean Validation material is more prominent
  • we clarify the relationship is between Bean Validation and JSF validators
  • we clarify that Bean Validation constraints can be applied to more than just JSF backing beans


 Comments   
Comment by Kim Haase [ 16/Jul/13 ]

You are quite right that Bean Validation needs to be more prominently showcased than it is. Right now the intro to the topic is buried in Chapter 12 (Developing with JSF Technology). Please move it to its own chapter or wherever seems appropriate.

Comment by Ian Evans [ 29/Jul/13 ]

Completely refactoring the Bean Validation information will take more work and review time than we can accomplish in the 7.0.2 time-frame. Deferring to 7.0.3.

Comment by Kim Haase [ 03/Sep/13 ]

I'm going to make a start on this by pulling Section 12.4 (Using Bean Validation) out of Chapter 12 and making it a separate chapter, probably right after Chapter 10. Bean Validation is mentioned in Chapter 11, so it'd be a good idea to introduce the topic ahead of time.

I'll mention that this is not just a JSF facility and put in a forward cross-reference to the Chapter 25 section. Then I will leave it to you (Ian) whether you want to put the advanced material into this chapter or leave it where it is.

Does this make sense?

Comment by Ian Evans [ 03/Sep/13 ]

Sounds good to me.

Comment by Kim Haase [ 03/Sep/13 ]

Thanks, Ian. I've been working on it.

Note to all: I'm going to have to check in all the files, since they are now renumbered. If you are working on a chapter you should probably copy it to a safe place before your next svn update.

Please holler if this is extremely inconvenient. I'll wait an hour or so before doing the commit. Then Ian, feel free to make any additional changes to the chapter.

Comment by Kim Haase [ 03/Sep/13 ]

I committed the book with the new chapter. All yours, Ian.

Comment by Ian Evans [ 16/Sep/13 ]

Added new section to bean-validation chapter.





[JAVAEETUTORIAL-214] Revise the Interceptors chapters with new features in Interceptors 1.2 Created: 10/Jul/13  Updated: 16/Jul/13  Resolved: 16/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Interceptors 1.2 has several new features, including:

  • @AroundConstruct interceptors
  • @Priority annotation for determining interceptor order
  • Rules for specifying interceptor order

Add sections on these to the Interceptors chapters.



 Comments   
Comment by Ian Evans [ 16/Jul/13 ]

Added material to Interceptors chapter.





[JAVAEETUTORIAL-241] Add section on URL mapping to JAX-RS chapter Created: 02/Sep/13  Updated: 16/Sep/13  Resolved: 16/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.2
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The JAX-RS chapter needs a section on mapping URLs to javax.ws.rs.core.Application, and alternately how to extend Application and use @ApplicationPath to set the URL mapping programmatically.



 Comments   
Comment by Ian Evans [ 16/Sep/13 ]

Added section on configuring JAX-RS resources with information on setting the mapping via annotations as well as in the deployment descriptor.





[JAVAEETUTORIAL-203] rsvp example's welcome-file and Faces servlet mapping not being respected Created: 26/Jun/13  Updated: 08/Jul/13  Resolved: 08/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In jaxrs/rsvp, we have the following web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

However, if you go to the context root (say, http://localhost:8080/rsvp/) you get a 404 error. The welcome-file setting isn't being respected.

If you change the Faces servlet mapping and welcome-file to:

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
...
    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>

You get nothing but 404 errors at any URL.

After investigating, Ed Burns suspects a bug in the GlassFish 4 web container.



 Comments   
Comment by Ian Evans [ 08/Jul/13 ]

The problem was a conflict between the JAX-RS application path in RsvpApplication ("/") and the FacesServlet mapping in web.xml. The 404 was being sent by the JAX-RS runtime. Evidently, if there is a conflict between a JAX-RS annotation and servlet mapping, the annotation wins.

I changed the application path in RsvpApplication to "/webapi" and the target URIs in the client code. Now everything works.





[JAVAEETUTORIAL-200] Use JDK 7 language features whenever we can Created: 24/Jun/13  Updated: 19/Sep/13  Resolved: 19/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
JAVAEETUTORIAL-174 Use try-with-resources (possibly othe... Sub-task Resolved  
JAVAEETUTORIAL-201 Use JDK 7 syntax for multiple exceptions Sub-task Resolved  
JAVAEETUTORIAL-202 Use type inference for generic instan... Sub-task Resolved rcervera  

 Description   

This is a general request to use JDK 7 language features in our examples. I will create subtasks for each language feature.



 Comments   
Comment by Ian Evans [ 19/Sep/13 ]

I think we've updated the example tree with these language features.





Use JDK 7 language features whenever we can (JAVAEETUTORIAL-200)

[JAVAEETUTORIAL-202] Use type inference for generic instantiation Created: 24/Jun/13  Updated: 25/Jul/13  Resolved: 25/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: None
Fix Version/s: 7.0.2

Type: Sub-task Priority: Major
Reporter: Ian Evans Assignee: rcervera
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Ian Evans [ 24/Jun/13 ]

See the following tech note:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html

Comment by Ian Evans [ 24/Jun/13 ]

According to the following grep regex:

grep -r "new\s[a-zA-Z0-9]*<[a-zA-Z0-9]." *

all the examples except for mailconnector are using the correct diamond operator per JDK 7. The above command will show matches in rsvp, but that is because the entity type for collections must be explicitly set.

Comment by rcervera [ 24/Jun/13 ]

I'm working on adapting the new mailconnector sample to our tree. I'll watch out for these instances and fix them.

Comment by rcervera [ 25/Jul/13 ]

I have removed the mailconnector example from the tree.





Use JDK 7 language features whenever we can (JAVAEETUTORIAL-200)

[JAVAEETUTORIAL-201] Use JDK 7 syntax for multiple exceptions Created: 24/Jun/13  Updated: 19/Sep/13  Resolved: 19/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: None
Fix Version/s: 7.0.3

Type: Sub-task Priority: Major
Reporter: Ian Evans Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Ian Evans [ 24/Jun/13 ]

See the following tech note:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html

Comment by Kim Haase [ 13/Aug/13 ]

The JMS, JSF (including dukes-bookstore), and CDI examples all use the new syntax where applicable. A couple of examples specify different handling for different exceptions, so they couldn't be updated.

Comment by Ian Evans [ 19/Sep/13 ]

I think we've updated the example tree with these language features.





Augment information on starting app server (JAVAEETUTORIAL-173)

[JAVAEETUTORIAL-199] Add links back to Starting and Stopping the GlassFish Server/Java DB Created: 24/Jun/13  Updated: 19/Sep/13  Resolved: 19/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Sub-task Priority: Major
Reporter: Ian Evans Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Our instructions assume that the server has been started, so a cross-reference back to section 2.2, "Starting and Stopping the GlassFish Server" would be helpful. Something like:

To build and deploy the blahblah example, make sure GlassFish Server is started (see Section 2.2, 2.2, "Starting and Stopping the GlassFish Server") then do the following:
...



 Comments   
Comment by Kim Haase [ 21/Aug/13 ]

Fixed for JSF and JMS chapters.

Comment by Kim Haase [ 21/Aug/13 ]

Fixed for dukes-bookstore chapter; also, with Eric's okay, for servlet and security chapters.

Comment by Ian Evans [ 19/Sep/13 ]

Links have been added.





[JAVAEETUTORIAL-198] Wrong usage of type in @Resource Created: 23/Jun/13  Updated: 24/Jun/13  Resolved: 24/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: jd3714att Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: annotations

 Description   

Examples to the use of @Resource are wrong.
Example, 6.5.3.1:

@Resources ({
    @Resource(name="myDB" type=javax.sql.DataSource),
    @Resource(name="myMQ" type=javax.jms.ConnectionFactory)
})

Just to be syntactically correct, the type value either has to be between double quotes, or .class needs to be appended to return the actual Class object. As per the specification, type is defined as "public abstract Class<?> type". Correction of above would look like:

@Resources ({
    @Resource(name="myDB" type=javax.sql.DataSource.class),
    @Resource(name="myMQ" type=javax.jms.ConnectionFactory.class)
})

I would suggest to extend this case by means of a regex search through the documentation.



 Comments   
Comment by Ian Evans [ 24/Jun/13 ]

Fixed in source. I did a grep through the documentation, and this was the only instance of a class-level @Resource with a type attribute.





[JAVAEETUTORIAL-197] Archetypes should generate stand-alone pom.xml files Created: 21/Jun/13  Updated: 21/Jun/13  Resolved: 21/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently the archetypes in First Cup and the Java EE 7 Tutorial have the parent set. This can cause errors if the parent pom hasn't been installed yet.

Since these archetypes are presumably going to be used by developers for their own applications, it's better to make the generated project's pom.xml standalone, with the necessary dependencies and configuration all in the pom.xml file, not inherited from our project's pom.xml file hierarchy.



 Comments   
Comment by Ian Evans [ 21/Jun/13 ]

Fixed in the source. Will appear in the 7.0.2 release.





[JAVAEETUTORIAL-195] Update Duke's Forest for Java EE 7 Created: 21/Jun/13  Updated: 19/Sep/13  Resolved: 19/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Update the Duke's Forest case-study example to use the Java EE 7 APIs. Convert it to Maven format.



 Comments   
Comment by Kim Haase [ 18/Sep/13 ]

This should also involve changing the namespace in Facelets files from java.sun.com to xmlns.jcp.org. For example,

xmlns:h="http://java.sun.com/jsf/html"

should be

xmlns:h="http://xmlns.jcp.org/jsf/html"

Comment by Kim Haase [ 18/Sep/13 ]

I can try working on this if you like, William, since there are bugs involving composite components and bookmarks (viewparams in f:metadata).

Comment by William Markito [ 18/Sep/13 ]

Thanks Kim! I'd appreciate that since this I'll be traveling next week..

Comment by Kim Haase [ 19/Sep/13 ]

Committed namespace fixes at revision 1633. I think we're okay on this now, so I'm resolving.





[JAVAEETUTORIAL-194] Update Duke's Tutoring for Java EE 7 Created: 21/Jun/13  Updated: 12/Sep/13  Resolved: 12/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Update the Duke's Tutoring case-study to use Java EE 7 APIs. Migrate the code-base to Maven format.



 Comments   
Comment by Ian Evans [ 12/Sep/13 ]

Updated chapter and example with Java EE 7 features.





[JAVAEETUTORIAL-193] Add section on entity graphs to Advanced JPA chapter Created: 21/Jun/13  Updated: 12/Sep/13  Resolved: 12/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.3

Type: Improvement Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Entity graphs is a new feature in JPA 2.1. Add a section describing it to the advanced JPA chapter.



 Comments   
Comment by Ian Evans [ 30/Jul/13 ]

Entity graph chapter needs more material, and needs to be reviewed. Changing target to 7.0.3.

Comment by Ian Evans [ 12/Sep/13 ]

New chapter added to book.





[JAVAEETUTORIAL-191] pom.xml generated by jaxrs-service-archetype use incorrect version Created: 14/Jun/13  Updated: 14/Jun/13  Resolved: 14/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The parent <version> string in the archetype-generated pom.xml file uses 7.0.1-SNAPSHOT. This should be 7.0.1.



 Comments   
Comment by Ian Evans [ 14/Jun/13 ]

The workaround is to edit the generated pom.xml and replace the parent definition with:

<parent>
    <artifactId>firstcup</artifactId>
    <groupId>org.glassfish.javaeetutorial.firstcup</groupId>
    <version>7.0.1</version>
</parent>

That is, delete -SNAPSHOT from <version> in the generated pom.xml.

Comment by Ian Evans [ 14/Jun/13 ]

Fixed the source in trunk. The fix will appear in the next update to the Tutorial package in the Update Center.





[JAVAEETUTORIAL-188] Minor error in code example in "Ordering Results" section of Criteria chapter Created: 12/Jun/13  Updated: 12/Jun/13  Resolved: 12/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There is a small error in the last code example at http://docs.oracle.com/javaee/6/tutorial/doc/gjivm.html#gjiwo

 
cq.orderBy(cb.asc(owner.get(Owner_.lastName), owner.get(Owner_.firstName)));

CriteriaBuilder.asc does not accept such arguments. It should probably be:

cq.orderBy(cb.asc(owner.get(Owner_.lastName)), cb.asc(owner.get(Owner_.firstName)));


 Comments   
Comment by Ian Evans [ 12/Jun/13 ]

Fixed in source, and it will appear in the next update of the Tutorial.





[JAVAEETUTORIAL-192] Bug in Tutorial PDF Created: 12/Jun/13  Updated: 24/Jun/13  Resolved: 24/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.1

Type: Bug Priority: Major
Reporter: arungupta Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Section 1.1 of Java EE 7 Tutorial PDF says:

New technologies, including the following:

  • Whatever gets in

Online version at http://docs.oracle.com/javaee/7/tutorial/doc/overview001.htm#GIQVH is correct.

Got the following comment from a community member "I wonder if somebody has done the QA of the tutorial?".



 Comments   
Comment by Ian Evans [ 24/Jun/13 ]

Fixed in 7.0.1-3 update.





[JAVAEETUTORIAL-187] Adapt the mailconnector sample project from the GF samples Created: 10/Jun/13  Updated: 25/Jul/13  Resolved: 25/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: 7.0.0
Fix Version/s: 7.0.2

Type: Improvement Priority: Major
Reporter: rcervera Assignee: rcervera
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: mailconnector

 Description   

The GF samples include a modified version of the mailconnector example used in the EE 6 tutorial. We need to change the following to incorporate it to the tutorial:

1. Replace JSP pages by Servlets.
2. Adapt the sample to our POM example tree.
3. Other changes we may want to make to this example.
4. Document the example.

1. is done and 2. is in progress.



 Comments   
Comment by rcervera [ 25/Jul/13 ]

We are replacing the mailconnector example by two separate new examples. See issues JAVAEETUTORIAL-212 and JAVAEETUTORIAL-213.





[JAVAEETUTORIAL-183] Chapter 2 section "2.6 Tutorial Example Directory Structure" needs fixes Created: 10/Jun/13  Updated: 24/Jun/13  Resolved: 24/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The first bullet list in this section needs to have the last two items corrected from "web" to "webapp".

The second bullet list should have "example-name-common" added to it, since several EAR examples have a common directory. How should this be described?



 Comments   
Comment by Ian Evans [ 24/Jun/13 ]

Fixed the web -> webapp issue, and added the following bullet:

example-name-common: library JAR containing components, classes, and files used by other modules

Comment by Ian Evans [ 24/Jun/13 ]

Fixed in source. Will appear in the next update of the Tutorial.





[JAVAEETUTORIAL-182] Material missing from overview chapter Created: 07/Jun/13  Updated: 24/Jun/13  Resolved: 24/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.1

Type: Bug Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The Platform Highlights section of the Overview is missing a list of new Java EE technologies, and the section on EJB technology that is cross-referenced from there has "TBA". New features for other technologies are missing (JMS should be mentioned).



 Comments   
Comment by Kim Haase [ 07/Jun/13 ]

Checked in some fixes to overview.fm. More may be needed. Please let me know.

Comment by Ian Evans [ 24/Jun/13 ]

Fixed in 7.0.1-3.





[JAVAEETUTORIAL-181] Multiple para elements inside a bullet point in an ItemizedList do not render properly in HTML (See 52.1.1) Created: 06/Jun/13  Updated: 10/Jun/13  Resolved: 10/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.0
Fix Version/s: 7.0.2

Type: Improvement Priority: Major
Reporter: rcervera Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File figureInListCssFix.png     PNG File ListPara.PNG     PNG File paragraphsInListsCssFix.png    
Tags: html, template

 Description   

They look fine on the PDF. In the HTML, the paragraphs and an image are not separated by any space. I don't know whether to reorganize the content or try to fix the template.



 Comments   
Comment by Ian Evans [ 07/Jun/13 ]

See the attachment for what it looks like if I add the following CSS to javaee-darb-fonts.css:

ul .figure {
    padding-top: 10px;
}
Comment by rcervera [ 07/Jun/13 ]

Thanks Ian, that fixes the figure in this case. I am unsure if that change would have unintended consequences elsewhere.

Still the paragraphs inside the same bullet list item do not render properly, there is no space between them (see attachment). The easiest thing may be for me to rewrite this part without multiple paragraphs inside a bullet point if there's no other solution...

Comment by rcervera [ 07/Jun/13 ]

Paragraphs inside a list item not rendered properly.

Comment by Kim Haase [ 07/Jun/13 ]

I wouldn't change anything in the source, Ricardo – lots of chapters have lists (numbered as well as ordered) with multiple paragraphs, and we should really have a fix if possible.

Comment by Kim Haase [ 07/Jun/13 ]

The fix for figures looks good!

Comment by Ian Evans [ 07/Jun/13 ]

See the paragraphsInListsCssFix.png attachment for a fix for these by altering the following CSS style:

.javaee #mainContent li p {
    line-height:1.5em;
    padding: 0em 0em .5em 0em;
    margin:auto;
}
Comment by rcervera [ 07/Jun/13 ]

That's a great solution - thank you!

Comment by jendrock [ 10/Jun/13 ]

Since the fix looks good, could you please check it in, Ian? And then can you close the issue, since the problem is no longer there? Kim propagated the fix to the online docs on docs.oracle.com. Thanks.

Comment by Ian Evans [ 10/Jun/13 ]

Fixed online, and will be included in 7.0.2.

I'm tracking our local changes to the post-processor template files in the project wiki here:
https://java.net/projects/javaeetutorial/pages/JavaEEPostProcessorBugFixes





[JAVAEETUTORIAL-173] Augment information on starting app server Created: 06/Jun/13  Updated: 24/Jun/13  Resolved: 24/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.1

Type: Improvement Priority: Major
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
JAVAEETUTORIAL-199 Add links back to Starting and Stoppi... Sub-task Resolved  

 Description   

The section "Starting and Stopping the GlassFish Server" in Chapter 2 currently describes how to start the server from the command line first, then describes starting it from NB.

However, if a user starts the server from the command line but then goes on to use NB for most examples, there can be some awkwardness attaching NB to an already running server.

It would be better to reorganize this section to have a brief intro to the effect that you can start and stop the server using either NB or the command line, and then have two subsections the way we do for running the examples, with the first one on NB and the second on the command line.

Also, the instructions on running the first couple of web examples (at least) should mention as the first step that the server needs to have been started (with an xref to the section). Some writers are already very conscientious about doing that, but I have not been.



 Comments   
Comment by Kim Haase [ 06/Jun/13 ]

Checked in fixes to usingexamples.fm and webapp.fm. Leaving open for additional modifications as needed. Suggestions welcome.

Comment by Ian Evans [ 24/Jun/13 ]

Augmented starting/stopping instructions added in 7.0.1-3. Created subtask for cross-references to this section from example instructions.





[JAVAEETUTORIAL-167] Modify JPA examples to use java:comp/DefaultDataSource instead of jdbc/__default Created: 03/Jun/13  Updated: 03/Jun/13  Resolved: 03/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.0
Fix Version/s: 7.0.1

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

From Java EE 7 Platform Spec section EE.5.19:

The Java EE Product Provider must make the default data source accessible to the application under the JNDI name java:comp/DefaultDataSource.

jdbc/__default is not portable.



 Comments   
Comment by Ian Evans [ 03/Jun/13 ]

Fixed in source. Will be available in 7.0.1.





[JAVAEETUTORIAL-244] Update Duke's Tutoring pages to use new namespaces Created: 18/Sep/13  Updated: 19/Sep/13  Resolved: 19/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.2
Fix Version/s: 7.0.3

Type: Task Priority: Major
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The namespace in the Facelets files should be changed from java.sun.com to xmlns.jcp.org. For example,

xmlns:h="http://java.sun.com/jsf/html"

should be

xmlns:h="http://xmlns.jcp.org/jsf/html"



 Comments   
Comment by Kim Haase [ 18/Sep/13 ]

I should add: there are bugs in some areas. You can't use the new namespace for composite components (http://java.sun.com/jsf/composite) or for pages that use f:metadata with viewparams. See the web/jsf/bookmarks example and web/jsf/compositecomponentexample. You can use the namespace for other kinds of components. Sorry.

Comment by Ian Evans [ 19/Sep/13 ]

Fixed in source.





[JAVAEETUTORIAL-139] Criteria query code snippets use untype-safe metamodel classes Created: 11/Oct/12  Updated: 11/Oct/12  Resolved: 11/Oct/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-6

Type: Bug Priority: Major
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

From the feedback alias:
I've got a question about an example on creating criteria queries in Part VI Chapter 35 of the Java EE 6 tutorial. Link: http://docs.oracle.com/javaee/6/tutorial/doc/gjivm.html
In the "Querying Relationships Using Joins" section of the chapter, there is an example code that doesn't work for me.

CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Metamodel m = em.getMetamodel();
EntityType<Pet> Pet_ = m.entity(Pet.class);

Root<Pet> pet = cq.from(Pet.class);
Join<Pet, Owner> owner = pet.join(Pet_.owners);

Since Pet_ is an instance of class EntityType, it doesn't define any attributes named "owners", which is why Pet_.owners gives an error. Is that a mistake?
Searching through forums I found a thread discussing this problem here http://stackoverflow.com/questions/3879743/jpa-metamodel-strange-inconsistent-example-in-sun-docs
If this is indeed a mistake, could you please correct the code.

The code snippets used dynamic metamodel classes for clarity on where, e.g., Pet_ comes from. But in practice, it gives the impression that this is a good practice for creating queries, which is not the case. The metamodel classes should be statically generated by an annotation processor at development time to make the code compilable and type-safe.



 Comments   
Comment by Ian Evans [ 11/Oct/12 ]

Fixed the code snippets to implicitly use static metamodel classes. The documentation will be updated in the next release of the Tutorial bundle.

Comment by Ian Evans [ 11/Oct/12 ]

And just for clarity, if you're using an annotation processor to statically generate your metamodel classes, the following type-safe query should compile:

CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Root<Pet> pet = cq.from(Pet.class);
Join<Pet, Owner> owner = pet.join(Pet_.owners);




[JAVAEETUTORIAL-138] HelloWorldApplication has unresolved dependencies in NB 7.2 w/ GF 3.1.2 Created: 10/Oct/12  Updated: 11/Oct/12  Resolved: 11/Oct/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-6

Type: Bug Priority: Major
Reporter: rcervera Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes
Environment:

NetBeans 7.2, Glassfish 3.1.2



 Description   

When you open the project on NetBeans, it shows unresolved dependencies (web service APIs). The project deploys fine if you go to the Properties page, then to the Libraries section, and you remove this library dependency.



 Comments   
Comment by Ian Evans [ 11/Oct/12 ]

Revision: 1022
Author: ievans
Date: 2012-10-10 17:31
Message: Removed outdated library reference.
Issue #JAVAEETUTORIAL-138 - HelloWorldApplication has unresolved dependencies in NB 7.2 w/ GF 3.1.2





[JAVAEETUTORIAL-14] bp-project properties issues Created: 24/Oct/10  Updated: 16/Aug/12  Resolved: 11/May/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.4, 6.0.5, 6.0.6, 6.0.7-5
Fix Version/s: 6.0.7

Type: Bug Priority: Minor
Reporter: emiddio Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes
Environment:

Operating System: All
Platform: All


Issuezilla Id: 14

 Description   

i just did a svn checkout of the javaee tutorial stuff.

Is there a goal to make the examples work with glassfish V3 with minimum
modifications?

regarding glassfishv3/glassfish/docs/javaee-tutorial/examples/bp-project config
files ...

glassfish v3 puts the glassfish dir under the top level glassfish installation
directory.

app-server.properties javaee.home issues –
As a result app-server.properties sets javaee.home to the glassfish install dir,
not the glassfish dir;

Then javaee.jar is not defined properly – because there is no lib dir under the
installation dir, only under glassfish dir in the installation dir.

javaee.domairdir is also defined wrong;

but db.home is correct --since javadb is now under the install dir vs the
glassfish dir.

There are also issues with jaxb-ant.xml, jaxws-ant.xml and appserver-ant.xml,
where the definition of javaee.home made to work for some files will not work
for others.

Because there is a bin dir under the glassfish install dir – the refereneces
to bin/asant may/might work – have not tested.

It seems there is in consistency for the config files in bp-project – and I
am unsure how it should be corrected. I could do trial and error – but can
someone clarify how it is intended to be???

thanks



 Comments   
Comment by Ian Evans [ 11/Apr/11 ]

The bp-project files should be fixed, it's true, but the properties defined in those files shouldn't actually affect the examples, as the build.properties file included in the javaee-tutorial IPS package (examples/bp-project/build.properties) should set all the necessary properties.

The other files in bp-project are basically override files. I'll leave this bug open as a reminder to update these override files for technical correctness.

examples/bp-project/build.properties is generated by the IPS package build. If you're using the examples out of SVN, you should create a build.properties file with the correct settings.

Comment by Ian Evans [ 11/Apr/11 ]

Reducing priority as these files settings should not be used in the normal course of the Tutorial, either when installed as an IPS package or from SVN.

Comment by Ian Evans [ 11/May/11 ]

Revision: 529
Author: ievans
Date: 2011-05-11 13:57
Message: Updated properties to match GlassFish 3.x.
Issue #JAVAEETUTORIAL-14 - bp-project properties issues





[JAVAEETUTORIAL-57] Note on changing timeout element needs fixing Created: 10/Jan/12  Updated: 16/Aug/12  Resolved: 24/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7

Type: Bug Priority: Minor
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There's a Note just above the instructions for running timersession:

http://docs.oracle.com/javaee/6/tutorial/doc/bnboy.html#bnbpf

It tells people to edit domain.xml, which is not something we normally advise – they ought to use the admin console.

It also tells them to change an element that doesn't seem to be in domain.xml any more, even. By default, all you see is

<ejb-timer-service></ejb-timer-service>

After I changed the default with the admin console, the following appears:

<ejb-timer-service minimum-delivery-interval-in-millis="500"></ejb-timer-service>

This indicates that minimum-delivery-interval-in-millis is an attribute of ejb-timer-service, not an element. I don't know how long this has been the case.

The note should be corrected.



 Comments   
Comment by Ian Evans [ 30/Jan/12 ]

There is some contradiction in the settings for minimum-delivery-interval-in-millis. According to glassfish/dtds/sun-domain_1_3.dtd the default value is 7,000 milliseconds:
<!ATTLIST ejb-timer-service
minimum-delivery-interval-in-millis CDATA "7000"
max-redeliveries CDATA "1"
timer-datasource CDATA #IMPLIED
redelivery-interval-internal-in-millis CDATA "5000">

But if you go to the Admin Console, in Configurations -> default-config -> EJB Container in the EJB Timer Service tab, the default Minimum Delivery Interval is 1,000 milliseconds.

I'm going to check with Marina to find out what the actual default is.

Comment by Ian Evans [ 30/Jan/12 ]

BTW, I think this Note was added before the Admin Console exposed the Timer Service's settings. I'll update the Note to tell users to use the Admin Console.

Comment by Ian Evans [ 31/Jan/12 ]

Marina confirmed that the value is now 1000. It's possible the DTD has the old value, and that's a bug against GlassFish.

Comment by Ian Evans [ 24/Feb/12 ]

Fixed in source, will appear in the next update, with GlassFish 3.1.2.





[JAVAEETUTORIAL-51] bp-project clean task should delete subdirectories of an ear Created: 24/Aug/11  Updated: 25/Aug/11  Resolved: 24/Aug/11

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

The examples/bp-project clean task used to delete all the component build/dist directories in an ear. It doesn't any more. If you have an ear, the clean-and-build process is no longer clean.

The glassfish/samples version works, but the javaeetutorial one doesn't. The targets in ear-ant.xml seem to be identical:

<target name="-pre-clean">
<iterate target="clean"/>
</target>

The difference, so far as I can see, is that the javaeetutorial version of command-line-ant-tasks.xml contains the following targets:

<target name="-pre-clean"/>
<target name="-post-clean"/>
<target name="clean" depends="-pre-clean,bpp-actual-clean,-post-clean"/>
<target name="bpp-actual-clean" depends="-pre-clean"
description="removes the generated directories like build and dist">
<delete dir="$

{build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${client.jar.dir}" />
</target>

Whereas the one in glassfish/samples contains only

<target name="clean" depends="-pre-clean"
description="removes the generated directories like build and dist">
<delete dir="${build.dir}

" />
<delete dir="$

{dist.dir}

" />
<delete dir="$

{client.jar.dir}

" />
</target>

Why that makes a difference I don't know, but I tried replacing our target with the old one and the subdirectories are again cleaned.

Is there a reason why we changed it to stop being iterative? Was that the intention? If not, it would be good to change it back if possible.



 Comments   
Comment by Ian Evans [ 24/Aug/11 ]

I traced the issue to the -pre-clean target in command-line-ant-tasks.xml. If -pre-clean is defined in command-line-ant-tasks.xml, the -pre-clean target defined in ear-ant.xml that iterates through the subprojects won't get called.

Removing -pre-clean from command-line-ant-tasks.xml fixes this.

Comment by Ian Evans [ 24/Aug/11 ]

Revision: 642
Author: ievans
Date: 2011-08-24 15:59
Message: Removed dummy -pre-clean target from command-line-ant-tasks.xml to fix issue with EAR sub-projects not cleaning.
Issue #JAVAEETUTORIAL-51 - bp-project clean task should delete subdirectories of an ear

Comment by Kim Haase [ 25/Aug/11 ]

Thanks very much, Ian, for figuring out the underlying reason for the problem.





[JAVAEETUTORIAL-79] Remove unneeded files in examples\common\sql\javadb Created: 21/Mar/12  Updated: 22/Mar/12  Resolved: 22/Mar/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-2
Fix Version/s: 6.0.7-3

Type: Improvement Priority: Minor
Reporter: rcervera Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There are two unneeded files in the examples\common\sql\javadb directory: delete.sql and tutorial.sql. These files contain information about examples that no longer exist. Should they be deleted or at least removed from the bundle?



 Comments   
Comment by Ian Evans [ 22/Mar/12 ]

They should be removed, as we no longer use a tutorial-wide create/delete SQL file.

Comment by Ian Evans [ 22/Mar/12 ]

Removed files and folders.





[JAVAEETUTORIAL-62] There is no "Servers" menu under "Tools"... Created: 26/Feb/12  Updated: 16/Aug/12  Resolved: 27/Feb/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: fredstluka Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File netBeans7.1ToolsMenu.png    

 Description   

On page: http://docs.oracle.com/javaee/6/tutorial/doc/gexaj.html
it says:

From the Tools menu, choose Servers.

The Servers wizard opens.
Click Add Server.

but there is no "Servers" menu under "Tools", so it should say:

From the Window menu, choose Services.

The Services wizard opens.
Right-click Servers.
Click Add Server.

--Fred Stluka



 Comments   
Comment by Ian Evans [ 27/Feb/12 ]

Which version of NetBeans are you using? In 7.1, I do have Tools > Servers.

Comment by fredstluka [ 27/Feb/12 ]

I'm using 7.1 on a Mac.

Under Tools, I see Plugins, but no Servers.

--Fred

Comment by Ian Evans [ 27/Feb/12 ]

Here's a screen shot of the NetBeans 7.1 Tools menu on OS X. Note that your NetBeans distribution either must be Java EE, or you must enable Java EE support through the NetBeans Plugins menu in order for Servers to show up.

Comment by Ian Evans [ 27/Feb/12 ]

Marking as Invalid, as I suspect the problem lies with the NetBeans distribution the reporter is using.

Comment by fredstluka [ 27/Feb/12 ]

Interesting....

I've been using Eclipse for years, but wanted to try NetBeans. I followed
your instructions to download and install it. Therefore, I did not yet have
any projects defined in NetBeans.

There was no Servers under the Tools menu, nor any of the other menu
items you show. Only Plugins all by itself.

Today, I finally used NetBeans to open a project. Now my Tools menu looks
more like the one in your PNG file. Looks like Servers and some other menu
items are only there if there are projects defined.

You should update the instructions to deal with the case of a user who
has just used your instructions to install NetBeans, and has not yet opened
or created a project.

Good instructions, anyhow. Thanks!
--Fred

Comment by Ian Evans [ 27/Feb/12 ]

This might be a good FAQ item, or a possible note in the instructions.

I don't know why NetBeans would depend on a project to be defined to fully populate the UI. That is very confusing. You might want to file a NetBeans bug on this.

Comment by fredstluka [ 03/Mar/12 ]

I agree. Please update the instructions, and perhaps add it to the FAQ.

I also agree that it seems like a NetBeans bug, so I reported it to them:

--Fred





[JAVAEETUTORIAL-67] Provide an ePub, single-page html or other easily convertable format Created: 14/Mar/12  Updated: 05/Mar/14  Resolved: 05/Mar/14

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.4

Type: Improvement Priority: Minor
Reporter: 8086 Assignee: jendrock
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: 3 hours
Time Spent: Not Specified
Original Estimate: 3 hours


 Description   

In this day and age, an increasing amount of people are reading technical literature on their ebookreaders (like Kindle or Nook), smartphones (iPhone, Android) or tablets. PDF, although great for printing, is not really suited for these formats (fixed layout, pagination, A4/US-letter, etc). These devices support a wide variety of formats like RTF, ePub, HTML or pure text, and often the easy way is to convert the pdf into one of these format.

This route has varying degrees of success (OCR, page breaks, ... lots of obstacles), and in this case, most software that I have tried (including Calibre) fails to convert this pdf into any format (parsing failures). Therefore it would make sense to provide another format in addition to pdf that is more easily read on electronic reading devices without a fixed format.

A simple solution could be just a single-page, downloadable html file (zipped with images and stylesheets). This would be the least amount of work and easily convertable to other forms. An ePub would also be nice (read on most ebookreaders, all Android devices, and easy to convert to Mobi format for Kindle).



 Comments   
Comment by Ian Evans [ 15/Aug/12 ]

We're at the mercy of our internal authoring and publication tools here. But my understanding is that we might have this capability for the Java EE 7 release.

Comment by jendrock [ 04/Jan/13 ]

We will not be fixing this issue for the Java EE 6 Tutorial. We plan on providing both ePub and Mobi format files for the Java EE 7 Tutorial.

In the meantime, the first volume of the tutorial (The Java EE 6 Tutorial: Basic Concepts) is available in Kindle format. See http://www.amazon.com/The-Java-EE-Tutorial-ebook/dp/B004323DTG/ref=sr_1_4?ie=UTF8&qid=1357337093&sr=8-4&keywords=java+ee+6+tutorial.

The second volume (The Java EE 6 Tutorial: Advanced Topics) is due to be released on January 20, 2013. A Kindle version will likely be released in that timeframe as well. See http://www.amazon.com/The-Java-EE-Tutorial-Advanced/dp/0137081863/ref=sr_1_2?ie=UTF8&qid=1357337093&sr=8-2&keywords=java+ee+6+tutorial.

Comment by Ian Evans [ 24/Jun/13 ]

Reopening for Java EE 7.

We are still at the mercy of our publishing tools, but our tools will support ePub formats in a future release of the Java EE 7 Tutorial.

Comment by jendrock [ 05/Mar/14 ]

Earlier, we indicated that Mobi and ePub formats of the tutorial would be available as soon as we switched production systems. Due to changing circumstances, that will not occur going forward. However, the tutorial will be published as a 2-volume set by Pearson Education and, we have been assured, will be available for purchase in print as well as in Mobi and ePub formats.

Here are the links to the prepublication pages for both volumes of the Java EE 7 Tutorial on amazon.com. Be sure to click the link on the right side of the page to have Amazon tell our publisher that you want to see the electronic version of the volume made available (even though we have been assured that that will be the case).

For Volume 1, see:

http://www.amazon.com/The-Java-EE-Tutorial-Edition/dp/0321994922/ref=pd_sim_sbs_b_1?ie=UTF8&refRID=140GAT6H8ZRJFTFERGR7

For Volume 2, see:

http://www.amazon.com/The-Java-EE-Tutorial-Edition/dp/0321980085/ref=pd_sim_sbs_b_1?ie=UTF8&refRID=0FP0CHGC662997762GDX





[JAVAEETUTORIAL-135] Circular definition of a persistent field Created: 29/Aug/12  Updated: 11/Oct/12  Resolved: 11/Oct/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-6

Type: Bug Priority: Minor
Reporter: Ian Evans Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

http://docs.oracle.com/javaee/6/tutorial/doc/bnbth.html



 Description   

The definition of a persistent field in the JPQL chapter is as follows:
Relationship field: A persistent relationship field of an entity whose type is the abstract schema type of the related entity.

It should read:
Relationship field: A persistent field of an entity whose type is the abstract schema type of the related entity.



 Comments   
Comment by Ian Evans [ 11/Oct/12 ]

Fixed in documentation source. Will appear in the next update to the EE 6 Tutorial.





[JAVAEETUTORIAL-132] Confusing concept in EJB introduction: 32-bit methods Created: 15/Aug/12  Updated: 16/Aug/12  Resolved: 15/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7-6

Type: Bug Priority: Minor
Reporter: kombatkuehn Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

http://docs.oracle.com/javaee/6/tutorial/doc/gipmb.html



 Description   

In [Part IV Enterprise Beans > 22. Enterprise Beans > What Is an Enterprise Bean?], I do not get the meaning of "32-bit methods" in the sentence "By invoking these 32-bit methods, clients can access the inventory services provided by the application."
There are methods returning 32-bit integers but this is probably not meant here and also irrelevant to a very basic introductory paragraph. I am sure the sentence would be more correct and easier to understand if "32-bit" was omitted.



 Comments   
Comment by Ian Evans [ 15/Aug/12 ]

I agree. There's no reason to include "32-bit" as a qualifier here, and 64-bit JVMs make this potentially inaccurate now, whatever the original motivation.

Comment by Ian Evans [ 15/Aug/12 ]

Fixed in source. Will appear in the next published update.





[JAVAEETUTORIAL-93] Tutoring example login error text needs fixing Created: 05/Jun/12  Updated: 16/Aug/12  Resolved: 05/Jun/12

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-4

Type: Bug Priority: Minor
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The loginError.xhtml page of Duke's Tutoring currently says the following (in the English version):

Please enter a user name or password that is authorized to access this application. For this application, this means a user that has been created in the <code>file</code> realm and has been assigned to the <em>group</em> of <code>admins</code>.

In actuality the user is created in the tutoringRealm realm and assigned to the group Administrator. The various messages files must be changed to reflect this. (The non-English ones currently say that the user must be in the TutorialUser group.)



 Comments   
Comment by Kim Haase [ 05/Jun/12 ]

Committed fix to trunk at revision 927.





[JAVAEETUTORIAL-91] Reviewer remarks in chapters should be resolved and/or removed Created: 25/May/12  Updated: 16/Aug/12  Resolved: 15/Aug/12

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 6.0.7-6

Type: Task Priority: Minor
Reporter: Kim Haase Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Several chapters still have substantive reviewer remarks – can these be resolved in some way?

ejb-intro.sgm
ejb-basicexamples.sgm
persistence-intro.sgm

ejb-async.sgm
interceptors.sgm
persistence-string-queries.sgm

I have some in a couple of JSF chapters that I need to fix, too.



 Comments   
Comment by Ian Evans [ 15/Aug/12 ]

Checked into source. This issue is not user-visible, but it's still fixed. 8^)





[JAVAEETUTORIAL-35] Incorrect statement in CDI chapter Created: 06/Jun/11  Updated: 16/Aug/12  Resolved: 06/Jun/11

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 6.0.4
Fix Version/s: 6.0.7

Type: Bug Priority: Minor
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Sivakumar Thyagarajan reports the following error that needs correcting:

n the title "The Java EE 6 Tutorial" Part No: 821-1841-12, March 2011, under the section "Configuring a CDI application" available at http://download.oracle.com/javaee/6/tutorial/doc/gjbnz.html, it is mentioned that beans.xml can be placed under WEB-INF or WEB-INF/classes/META-INF.

As per Section 12.1 of CDI 1.0 specification:
> • The WEB-INF/classes directory of a war is a bean archive if there is a file named beans.xml in the WEB-INF directory of the war.
> • A directory in the JVM classpath is a bean archive if it has a file named beans.xml in the META-INF directory.

So, the placement of beans.xml in WEB-INF/classes/META-INF/beans.xml is not portable. Could you please remove the "WEB-INF/classes/META-INF" choice in the "Configuring a CDI application" section?

For further information on this issue, please look at http://java.net/jira/browse/GLASSFISH-15009



 Comments   
Comment by Kim Haase [ 06/Jun/11 ]

Checked in fix to CDI chapter.





[JAVAEETUTORIAL-252] Incorrect instructions for Section 29.3.1, Creating A Simple RESTful Web Service Created: 27/Sep/13  Updated: 27/Sep/13  Resolved: 27/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.3
Fix Version/s: 7.0.4

Type: Bug Priority: Minor
Reporter: jendrock Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There are several issues that need to be address with regard to the documentation surrounding the simplest of the 3 JAX-RS examples.

The sentence that precedes 29.3.1.1 needs to be modified to say something to the effect that the prebuilt example is similar but not identical to the example that one can build from the archetype. There should also be links to new sections for running that prebuilt example with NetBeans IDE and Maven from the command line.

There needs to be a step 0 that says "Ensure that you have installed the tutorial archetypes as described in Section 2.7.1, Installing the Tutorial Archetypes.

Step 1d needs to be changed from "... and click Next." to "... and click Finish."

Step 1e needs to be deleted.

In step 2, delete "and the exception".

In step 2, move the Note so that it follows the code example.

In step 3, change "hello project" to "HelloWorldApplication project" and change "Build" to "Run".

In step 4, change the URL from "http://localhost:8080/hello" to "http://localhost:8080/HelloWorldApplication/HelloWorldApplication".

Add a new section - 29.3.1.2, To Run the hello Example with NetBeans IDE.

Add a new section - 29.3.1.3, To Run the hello Example with Maven.

Make sure the instructions match the prebuilt example. For example, the URL to open would be http://localhost:8080/hello/helloworld.



 Comments   
Comment by Ian Evans [ 27/Sep/13 ]

There is no need for separate "To Run the Example..." sub-sections because this step-by-step is only for NetBeans users. We don't document how to create new examples based on the archetypes on the command-line, although it is definitely possible to do so.

Comment by Ian Evans [ 27/Sep/13 ]

Fixed the instructions, except for the new sub-sections on running in NetBeans/with Maven.

Comment by jendrock [ 27/Sep/13 ]

So, the jaxrs/hello example that is is the workspace serves what purpose? Is it supposed to be run? If so, how? I just thought that if we provide an example, especially one that is different from the one that is built from the archetype, we would also have instructions for running it. In fact, that is how the whole issue came about. I was asked if we had a very simple JAX-RS example. I said we did. And then I was asked for directions for running it from the command line. That we did not have.

Comment by Ian Evans [ 27/Sep/13 ]

We've never had separate sections on running the pre-built example we documented in our step-by-step instructions before. The assumption has always been that the pre-built version is more of a reference for a working version of what you end up with rather than an example that is documented separately.

I'm fine putting in two new sections on running hello, but this is somewhat different than our previous practices.

Comment by jendrock [ 27/Sep/13 ]

I think this is the only example in the tutorial that users actually create. First Cup does the same thing but the example that is supplied matches (exactly) the example that users end up with after they follow the step-by-step instructions. The JAX-RS hello example is close, but definitely not identical to the resultant example users will build in this case. This is a different animal than we are used to.

I am surprised that no users have asked how to run hello, either by using Maven or NetBeans IDE. If hello matched the end result that the users built, no NB instructions would be needed. Would they ask how to run with Maven? Not to use Maven to build the example from the archetype but to run the prebuilt example.

Maybe I'm all wet. Maybe what is needed is to make the examples the same and simply say that the example is provided as a reference, as you said.





[JAVAEETUTORIAL-148] Incorrect package name javax.jws.WebMethod in Creating a Simple Web Service and Clients with JAX-WS Created: 30/Jan/13  Updated: 05/Feb/13  Resolved: 05/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-5
Fix Version/s: 7.0.0

Type: Bug Priority: Minor
Reporter: a.podkutin Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

http://docs.oracle.com/javaee/6/tutorial/doc/bnayn.html

Incorrect package name:

 
import javax.jws.webMethod;

instead of:

 
import javax.jws.WebMethod;


 Comments   
Comment by Kim Haase [ 31/Jan/13 ]

Thank you for noticing this error.

Comment by Kim Haase [ 05/Feb/13 ]

Fixed in source. Will appear in next version of the EE 6 tutorial (if any) and in the EE 7 tutorial.





[JAVAEETUTORIAL-154] unecessary "while(!mailStatus.isDone())" Created: 15/Feb/13  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.8
Fix Version/s: 7.0.0

Type: Improvement Priority: Minor
Reporter: swiss-chris Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 5 minutes
Time Spent: Not Specified
Original Estimate: 5 minutes


 Description   

In the async EJB example (doc: http://docs.oracle.com/javaee/6/tutorial/doc/gkiez.html) the async.web.MailerManagedBean's send() method contains the following code:

while (!mailStatus.isDone()) {       // line x+1
    this.setStatus("Processing..."); // line x+2
}                                    // line x+3

This seems problematic to me on various levels.

  1. We are unnecessarily setting the status to "Processing..." numerous times.
  2. We are unnecessarily occupying the processor until mailStatus.isDone().
  3. Immediately after this code, we call mailStatus.get(), which has the same effect as the while-loop (here too we wait for mailStatus.isDone())


My proposal would be to delete the first and last line from the three lines of code pasted above, leaving only the middle line (which never produces any visible result, by the way):

    this.setStatus("Processing..."); // line x+2

---------

Furthermore, in my local code I reworked the example a bit,

  • using @ManagedBean @SessionScoped instead of @Named @RequestScoped.
  • making Future<String> mailStatus a class member instead of a local variable.
  • removing the try-catch block containing this.setStatus(mailStatus.get() out of the send() method and into the getStatus() method, protected by an additional if (mailStatus.isDone()) check.
  • changing the response value of the send() method from "response" to "response?faces-redirect=true"

This allows me to actually see the "Processing..." status in the browser as well as to refresh the page manually until the status changes. Personally, I find this gives me more of a feeling for the asynchronous nature of the code underneath, rather than experiencing a simple long-running synchronous response in the browser.



 Comments   
Comment by swiss-chris [ 15/Feb/13 ]

I ran a quick test with the while-loop, counting the number of times it ran: 2,561,715,398 times !

Comment by Ian Evans [ 18/Feb/13 ]

If you email me a ZIP containing your code changes, I'll integrate them into the trunk for Java EE 7.0.
ian period evans at oracle period com

Comment by swiss-chris [ 18/Feb/13 ]

Great! I'll send you the ZIP tomorrow. Thanks.

Comment by Ian Evans [ 19/Feb/13 ]

I merged in Chris's changes. I kept MailerManagedBean as a CDI bean, but changed the scope to SessionScoped.





[JAVAEETUTORIAL-159] ajaxguessnumber: possible solutions without js-hack Created: 28/Feb/13  Updated: 24/Jun/13  Resolved: 24/Jun/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.8
Fix Version/s: 7.0.2

Type: Improvement Priority: Minor
Reporter: swiss-chris Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 30 minutes
Time Spent: Not Specified
Original Estimate: 30 minutes

Tags: jsf2, render, rendered, scope, tutorial, validation

 Description   

When reading the chapter on the ajaxguessnumber example app and analysing the code, I was surprised at the choice of writing a custom js-function "msg" to get rid of the stale result. Certainly, this allows the demonstration of the h:commandButton's onevent attribute, but:

  • it doesn't seem like a clean solution to me (it doesn't seem very refactoring-friendly because of the 2 getElementById("hard-coded HTML element ID") calls),
  • it doesn't explain the inclusion of the commented-out code <f:ajax execute="userNo" render="result errors1" /> within the code AND the tutorial chapter.

It looks more like a quick fix by one person (developer) that was later commented on by another person (who wrote the tutorial chapter).

If one were to want to rewrite the code as it was perhaps originally intended (as is perhaps still visible in the commented-out code aforementioned), I could think of the following two possibilities:

  1. Only render the outputText if there was no validation error.
  2. Change the scope of the ManagedBean from @SessionScoped to @RequestScoped


The first solution would look something like the following. For it to work with Ajax, the outputText would need to be wrapped in a container such as h:panelGroup and the f:ajax render attribute would need to refer to the panel's ID ("outputGrid"):

ajaxgreeting.xhtml
<h:commandButton id="submit" value="Submit" >
    <f:ajax execute="userNo" render="outputGrid" />
</h:commandButton>
<h:panelGroup layout="block" id="outputGroup">
    <h:outputText id="result" style="color:blue"
                  value="#{userNumberBean.response}" rendered="#{!facesContext.validationFailed}"/>
    <h:message id="errors1" showSummary="true" showDetail="false"
               style="color: #d20005;
               font-family: 'New Century Schoolbook', serif;
               font-style: oblique;
               text-decoration: overline" 
               for="userNo"/>
</h:panelGroup>

The second solution changes the design altogether. I'm not sure why you would want @SessionScoped for this example in the first place. @RequestScoped seems more appropriate and solves the problem of hiding the "stale output" of the "result" outputText element.



 Comments   
Comment by swiss-chris [ 28/Feb/13 ]

After posting my original proposals, I realized that simply changing the scope from @SessionScoped @RequestScoped wouldn't suffice. While the userNumber could be @RequestScoped, the randomInt needs to be @SessionScoped for the guessing game to give the user a second chance.

Off hand all I can think of to make this work as I had intended is to create a second dukesNumberBean, also a managed bean that contains the randomInt as well as the minimum and maximum values. I used @ManagedProperty(value="#

{dukesNumberBean}

") to inject it into userNumberBean

by the way, the value 10 was hardcoded into the userNumberBean constructor. Alternatively, randomInt could be created the following way:

long range = maximum-minimum+1;
randomInt = (int)(minimum + randomGR.nextDouble()*range);
Comment by Ian Evans [ 24/Jun/13 ]

UserNumberBean was changed to request-scoped, and a new session-scoped backing bean, DukesNumberBean, was added. A new panel group was added to display the results or the validation error. These changes eliminate the need for the separate ui.js Javascript file, as stale data should not be a problem.

These changes probably better reflect how we want users to use the f:ajax tag, but we no longer have an example that uses onevent or shows how to add custom Javascript. Perhaps we need an advanced example?

Comment by Ian Evans [ 24/Jun/13 ]

Fixed in source and rewrote doc source. The fixes will appear in the next Tutorial update.





[JAVAEETUTORIAL-158] dukesbookstore: Error in Messages_de.properties CartItemCount value Created: 27/Feb/13  Updated: 27/Feb/13  Resolved: 27/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.8
Fix Version/s: 7.0.1

Type: Bug Priority: Minor
Reporter: swiss-chris Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 5 minutes
Time Spent: Not Specified
Original Estimate: 5 minutes

Tags: properties

 Description   

Messages_de.properties contains the following line:

CartItemCount=Ihr Einkaufswagen enthält {0,choice,0#Ihr Einkaufswagen enthält keine Artikel|1#Ihr Einkaufswagen enthält einen Artikel|1< Ihr Einkaufswagen enthält

{0} Artikel}.

Output for a cart with exactly one element: "Ihr Einkaufswagen enthält Ihr Einkaufswagen enthält einen Artikel."

Proposed correction:

CartItemCount=Ihr Einkaufswagen enthält {0,choice,0#keine Artikel|1#einen Artikel|1<{0}

Artikel}.

Output for a cart with exactly one element: "Ihr Einkaufswagen enthält einen Artikel." (Correct also for 0 or 1< elements in cart).

p.s. I speak, read and write German perfectly (but I believe the correctness of my proposal can be deduced merely from understanding the Java MessageFormat syntax).



 Comments   
Comment by Kim Haase [ 27/Feb/13 ]

Thanks very much for catching this. If you find any more errors in those messages, please let us know.

Committed to EE 6 branch at revision 1182.

Committed to trunk at revision 1183.





[JAVAEETUTORIAL-150] Validation messages must get moved from dukes-resources to the default package of the main project Created: 05/Feb/13  Updated: 21/Feb/13  Resolved: 21/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: examples
Affects Version/s: 6.0.8
Fix Version/s: 7.0.2

Type: Bug Priority: Minor
Reporter: jendrock Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The validation messages (Spanish and English-language bundles) need to be moved from dukes-resources/src/java to the default package of the main project. The validation messages cannot be found when they are in the dukes-resources project.



 Comments   
Comment by jendrock [ 05/Feb/13 ]

This issue needs to be fixed when we update the tutorial case studies to EE 7. That won't happen until 7.0.2.

Comment by jendrock [ 05/Feb/13 ]

This issue is present in 6.0.8. We are not planning to release the case studies with 7.0.0 or 7.0.1, so we will defer fixing the issue until 7.0.2. The docs are not impacted, the source is.

Comment by William Markito [ 21/Feb/13 ]

Fixed by revision http://java.net/projects/javaeetutorial/sources/svn/revision/1179





[JAVAEETUTORIAL-153] Incomplete/incorrect ANT example and explanation. Created: 14/Feb/13  Updated: 16/Jul/13  Resolved: 16/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.8
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: swiss-chris Assignee: Ian Evans
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: 5 minutes
Time Spent: Not Specified
Original Estimate: 5 minutes


 Description   

In the EJB Tutorial "cart" project, we find the following passage:

------------------

3. Type the following command:
ant deploy
The cart.ear file is deployed to the GlassFish Server.

4. Type the following command:
ant run
This task retrieves the application client JAR, cartClient.jar, and runs the application client. The client JAR, cartClient.jar, contains the application client class, the helper class BookException, and the Cart business interface.

This task is equivalent to running the following command:

appclient -client cartClient.jar
When you run the client, the application client container injects any component references declared in the application client class, in this case the reference to the Cart enterprise bean.

------------------

There are two errors in the above text, afaik:
1. The text states that: "[the 'ant run'] task is equivalent to running [...] appclient -client cartClient.jar". This is not true. Running
'appclient -client cartClient.jar'
does not "retrieve the application client JAR, cartClient.jar,", hence the output will be "Error: Unable to access jarfile appClient.jar"
2. Even if the user knew to run 'ant client-jar' before the appclient task, the appclient task would need to be
'appclient -client client-jar\appClient.jar'
if the user doesn't cd into the client-jar directory beforehand.

My suggestion would be the following. Modify the text to read:
"This task is equivalent to running the following command:
ant client-jar
appclient -client client-jar\cartClient.jar"

This will help the user understand what's going on in the background, which was the main point missing for me in this tutorial in the first place. After following through on the cart exercise, my main question was: "How does the client-app know where to find the remote EJB on the glassfish server Unable to render embedded object: File (" Providing the 'ant client-jar' task and maybe explaining what's happening in the background (asadmin ...) would be a great help for anyone interested in how the remote EJB binding works in this example) not found. Hence my improvement suggestion to add this to the next revision of the tutorial.



 Comments   
Comment by Ian Evans [ 14/Feb/13 ]

The text could be clearer about exactly which steps ant run performs.

This issue affect the Java EE 6 Tutorial. At this point, we don't have any planned updates for the EE 6 Tutorial, and we have moved to Maven for Java EE 7.

If we have another EE 6 release, this issue should be fixed in the documentation source.

Comment by Ian Evans [ 16/Jul/13 ]

With no planned releases of the Java EE 6 Tutorial planned, and the Java EE 7 Tutorial released (which uses Maven), I'm closing this out.





[JAVAEETUTORIAL-151] Typo in "Declaring Resource References" in Chapter 3 Created: 13/Feb/13  Updated: 13/Feb/13  Resolved: 13/Feb/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.8
Fix Version/s: 7.0.0

Type: Bug Priority: Minor
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Considering a Jira issue would be overkill, I hereby inform you that a typo exists in:

  • the Java EE 6 Tutorial at
    http://docs.oracle.com/javaee/6/tutorial/doc/bnaeo.html
  • under the heading "Declaring a Reference to a Resource"
  • in the listing:
    @Resources ({
    @Resource (name="myDB" type=java.sql.DataSource),
    @Resource(name="myMQ" type=javax.jms.ConnectionFactory)
    })

line 2 says:
... type=java.sql.DataSource

should be
... type=javax.sql.DataSource



 Comments   
Comment by Kim Haase [ 13/Feb/13 ]

Fixed in source.





[JAVAEETUTORIAL-230] Use JSON messages in the Connector examples Created: 01/Aug/13  Updated: 11/Sep/13  Resolved: 11/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.3

Type: Improvement Priority: Minor
Reporter: rcervera Assignee: rcervera
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Use JSON messages in the inbound and outbound connector examples.



 Comments   
Comment by rcervera [ 11/Sep/13 ]

The connectors/traffic example uses JSON processing now.





[JAVAEETUTORIAL-227] Incorrect package name in "Using the Timer Service" Created: 30/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Minor
Reporter: Ian Evans Assignee: Ian Evans
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

http://docs.oracle.com/javaee/7/tutorial/doc/ejb-basicexamples004.htm#BNBOY



 Description   

From the feedback alias:

A quick one that freaked me out for a moment, under:

Part IV Enterprise Beans

24. Running the Enterprise Bean Examples

Using the Timer Service

In the second paragraph the package names for schedules and schedule are wrong, as I understand it is javax.ejb not java.ejb
I know it's pedantic, but it might throw a few new people, the error appears to be there for ee6 and ee7



 Comments   
Comment by Ian Evans [ 30/Jul/13 ]

Updated in source. Fix will appear in the next update to the Tutorial.





[JAVAEETUTORIAL-226] Error in code example in advanced security chapter Created: 30/Jul/13  Updated: 31/Jul/13  Due: 30/Jul/13  Resolved: 31/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Minor
Reporter: jendrock Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A user reports that there is an error in the code example in the advanced security chapter in this section: http://docs.oracle.com/javaee/7/tutorial/doc/security-advanced003.htm#BABIFJGI.

The corrections are indicated by the comments at the end of the lines that contain the errors.

@Stateless
@ManagedBean // add annotation
public class LoginBean {
private String username;
private String password;

public String getUsername()

{ return this.username; }

public void setUserName(String username)

{ this.username = username; }

public String getPassword()

{ return this.password; }

public void setPassword(String password)

{ //add String password this.password = password; }

 Comments   
Comment by Ian Evans [ 30/Jul/13 ]

I don't agree that it should be @ManagedBean in the code sample. Currently it is @Named, the replacement for JSF obsolete @ManagedBean annotation.

If the user had problems that were solved by replacing @Named with @ManagedBean I suspect there might be an issue with CDI scanning. But that's a different issue.

Comment by jendrock [ 31/Jul/13 ]

Ian's comment is correct. @Named should be used instead of @ManagedBean. The general recommendation is to use @Named regardless. Therefore, I will leave the existing annotation (@Named) as is.

I did, however, make the second correction in the source. The correction should be visible when we publish the next update, very soon.

Comment by jendrock [ 31/Jul/13 ]

The change has been made in the source and the correction will be visible at the next update.





[JAVAEETUTORIAL-225] Typos and syntax errors in the security chapters Created: 30/Jul/13  Updated: 30/Jul/13  Due: 31/Jul/13  Resolved: 30/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Minor
Reporter: jendrock Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A tutorial user points out 2 errors in http://docs.oracle.com/javaee/7/tutorial/doc/security-advanced003.htm#BABIFJGI.

1. Typo. The HttpServetRequest classes shown below should be HttpServletRequest.

public String login () {
FacesContext context = FacesContext.getCurrentInstance();
HttpServetRequest request = (HttpServletRequest)
context.getExternalContext().getRequest();
try

{ request.login(this.username, this.password); }

catch (ServletException e)

{ ... context.addMessage(null, new FacesMessage("Login failed.")); return "error"; }

return "admin/index";
}

public void logout() {
FacesContext context = FacesContext.getCurrentInstance();
HttpServetRequest request = (HttpServletRequest)
context.getExternalContext().getRequest();
try

{ request.logout(); }

catch (ServletException e)

{ ... context.addMessage(null, new FacesMessage("Logout failed.")); }

}

2. Syntax errors in XML due to missing single quotes (one occurrence) and curly closing braces (3 occurrences) are indicated with an asterisk per occurrence in the XML code below.

<h:form>
<h:outputLabel for="usernameInput">

  • # {bundle['login.username']}

    :
    </h:outputLabel>
    <h:inputText id="usernameInput" value="#

    {loginBean.username}

    "
    required="true" />
    <br />
    <h:outputLabel for="passwordInput">

  • # {bundle['login.password']}

    :
    </h:outputLabel>
    <h:inputSecret id="passwordInput" value="#

    {loginBean.password}

    "
    required="true" />
    <br />

  • <h:commandButton value="$ {bundle['login.submit']}

    "
    action="#

    {loginBean.login}

    " />
    </h:form>

Lines indicated with an asterisk include the corrections.



 Comments   
Comment by jendrock [ 30/Jul/13 ]

Both sets of errors have been fixed in source and will appear in the next tutorial update.





[JAVAEETUTORIAL-219] Formatting problem in Concurrency chapter Created: 16/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Minor
Reporter: Ian Evans Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified