[JAVAEETUTORIAL-294] Small problem in example code Created: 23/Feb/15  Updated: 23/Feb/15

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

Type: Bug Priority: Trivial
Reporter: fjwalraven Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: code, examples

 Description   

The variable someDate is not used in the exampel:

CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Root<Pet> pet = cq.from(Pet.class);
Date someDate = new Date(...);
cq.where(cb.gt(pet.get(Pet_.birthday), date));

should be:

CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Root<Pet> pet = cq.from(Pet.class);
Date someDate = new Date(...);
cq.where(cb.gt(pet.get(Pet_.birthday), someDate ));






[JAVAEETUTORIAL-293] Typo in code in 4.4.2.6 Add the Form to response.html Created: 30/Dec/14  Updated: 31/Dec/14

Status: In Progress
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: nancy.hildebrandt Assignee: nancy.hildebrandt
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There is a case error in Line 5 of the following code example:
<h:outputText value="#

{bundle.YouAre}

"/>
<h:outputText value="#

{bundle.SameAge}

"
rendered="#

{dukesBDay.ageDiff == 0}

"/>
<h:outputText value="#

{dukesBDay.absAgeDiff}

"
rendered="#

{DukesBDay.ageDiff lt 0}

"/>
<h:outputText value=" #

{bundle.Year}

DukesBDay should be dukesBDay

Reported by external customer.



 Comments   
Comment by nancy.hildebrandt [ 31/Dec/14 ]

Fixed in source and rebuilt. Waiting for next publishing event.





[JAVAEETUTORIAL-292] ResourceAdapter Serializable clarification required Created: 07/Nov/14  Updated: 07/Nov/14

Status: Open
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: jim_b_o Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The 'trading' example RA is NOT marked as Serializable.

The 'traffic' example RA is marked as Serializable although if invoked it would fail as the contained 'private Work tSubscriber' is a TrafficServiceSubscriber which is not Serializable.

The docs say RAs are JavaBeans and the JavaBean spec varies between 'should' and 'must' implement persistence/Serializable.

In practice most JEE servers I've used don't require the RA to be Serializable. I recall an old WLS did report a warning for JNDI reasons but deployed anyway. GS and JBoss don't seem to care.

It would be very helpful to have clarification of the Serialization requirements for RAs themselves and a clear example or best practice for the other components in respect to both Serialization and Referencable as may be needed for JNDI support. Ideally this example would deal with the case where the ultimate EIS connection code involved non Serializable classes (as could be the case in the real world using third party code).






[JAVAEETUTORIAL-291] Error in code sample for JPA compound predicates (40.3.5.2) Created: 28/Oct/14  Updated: 28/Oct/14

Status: Open
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Anthony Ve Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Location:
40 Using the Criteria API to Create Queries
40.3.5.2 Expression Methods in the CriteriaBuilder Interface
http://docs.oracle.com/javaee/7/tutorial/doc/persistence-criteria003.htm#GJIXA

Issue:
The code sample for compound predicates, at the end of the section, doesn't work: the "and" method is called on a Predicate, though it should be called on a CriteriaBuilder. So:
CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Root<Pet> pet = cq.from(Pet.class);
cq.where(cb.equal(pet.get(Pet_.name), "Fido")
.and(cb.equal(pet.get(Pet_.color), "brown")));

ought to be:
CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Root<Pet> pet = cq.from(Pet.class);
cq.where(cb.and(
cb.equal(pet.get(Pet_.name), "Fido"),
cb.equal(pet.get(Pet_.color), "brown")
));






[JAVAEETUTORIAL-290] Embed in online version links to easily download samples Created: 09/Oct/14  Updated: 09/Oct/14

Status: Open
Project: javaeetutorial
Component/s: www
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: David Delabassee Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

NA



 Description   

This RFE was discussed during the J1 GF BoF.
When people lands on a specific chapter (eg. Google), it would be nice if that chapter includes a link to easily download the sample it talks about.






[JAVAEETUTORIAL-289] 28.1.2 Coding the Service Endpoint Implementation Class Created: 06/Oct/14  Updated: 06/Oct/14

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

Type: Bug Priority: Minor
Reporter: donahuel Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

http://docs.oracle.com/javaee/7/tutorial/doc/jaxws001.htm#BNAYQ

"The implementation class also must define a default, public, no-argument constructor."

Is that really an example of a public constructor? It looks like a void method with the same name as the class.



 Comments   
Comment by Kim Haase [ 06/Oct/14 ]

Good catch. Needs to be fixed in both example source and documentation source.

Fixed in example source at revision 1783.





[JAVAEETUTORIAL-288] Relationship in diagram should reflect one-to-one Created: 22/Sep/14  Updated: 22/Sep/14

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

Type: Bug Priority: Minor
Reporter: fjwalraven Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: diagram, persistence, relationship

 Description   

The database diagram in the order Application (Part IV Persistence, 33) shows a one-to-many relationship between Part and VendorPart. Whereas the description talks about a one-to-one relationship: "Part has a field, vendorPart, that has a one-to-one relationship with VendorPart’s part field. That is, each part has exactly one vendor part, and vice versa."



 Comments   
Comment by Kim Haase [ 22/Sep/14 ]

Thank you for pointing out this error. The diagram (Figure 38-1) will need to be fixed in the next version of the tutorial.





[JAVAEETUTORIAL-287] JAX-WS example compilation error Created: 18/Sep/14  Updated: 19/Sep/14

Status: Open
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ch0pin0 Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

NetBeans IDE 8.0.1
Glassfish 4.1
Apache Maven 3.2.3



 Description   

When i try the example for JAX-WS the main web service compile end execute correctly, but when i try the appclient project, i receive an error on run lifecycle:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hello-appclient: Compilation failure: Compilation failure:
[ERROR] /tut-install/examples/jaxws/hello-appclient/src/main/java/javaeetutorial/hello/appclient/HelloAppClient.
java:[10,44] package javaeetutorial.helloservice.endpoint does not exist
[ERROR] /tut-install/examples/jaxws/hello-appclient/src/main/java/javaeetutorial/hello/appclient/HelloAppClient.java:[16,20] cannot find symbol
[ERROR] symbol: class HelloService

[ERROR] location: class javaeetutorial.hello.appclient.HelloAppClient

[ERROR] /tut-install/examples/jaxws/hello-appclient/src/main/java/javaeetutorial/hello/appclient/HelloAppClient.java:[26,45] package javaeetutorial.helloservice.endpoint does not exist



 Comments   
Comment by Kim Haase [ 18/Sep/14 ]

This compilation failure is puzzling, if the helloservice-war app is still deployed. Can you verify that it is still deployed on GlassFish Server when you build the appclient?

Thanks very much for your interest in the tutorial.

Comment by ch0pin0 [ 19/Sep/14 ]

I think the helloservice-war app is deployed, because after have tried to run the hello-appclient i've tried to deploy the hello-webclient and run fine. For the hello-applclient the problem seems dued to the wsimport goal that resolve to a failure, even with version 2.3 of jax-ws





[JAVAEETUTORIAL-286] 'trading' example, can't release connection correctly Created: 18/Sep/14  Updated: 19/Sep/14

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

Type: Bug Priority: Minor
Reporter: streetpoet Assignee: super_glassfish
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 1 day
Time Spent: Not Specified
Original Estimate: 1 day
Environment:

N/A



 Description   

In Trading example, It looks like an issue that does not send
events to container whenever a connection is closed via a
javax.resource.spi.ConnectionEventListener implementation.

Solution:

In TradeManagedConnection.java, the code should be modified something like:

private ConnectionEventListener innerListener;

public void disassociateConnection() {
this.connection = null;
if (innerListener != null)

{ innerListener.connectionClosed(new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED)); }

}

@Override
public void addConnectionEventListener(ConnectionEventListener listener)

{ innerListener = listener; }

In this way, the managed connection can notify application server to put connection back to the pool.



 Comments   
Comment by Kim Haase [ 18/Sep/14 ]

Thank you for raising this question.

Have you verified that connections do accumulate in the pool after this example is run? The developer of the app thought that closing the connection would release the resources. Can you view the pool using some tool? The GlassFish Admin Console does not show this. Thanks.

This should perhaps be implemented in the next release if some confirmation is provided that this is the best practice.

Should removeConnectionEventListener() also be implemented?

Comment by streetpoet [ 19/Sep/14 ]

yes, please see doc connector-1_7-spec-final.pdf, chapter 6.5.6
quote:
The connector architecture provides an event callback mechanism that enables an application server to receive notifications from a ManagedConnection instance. An application server uses these event notifications to manage its connection pool, to clean up invalid or terminated connections, and to manage local transactions.

this is the only way we do an interaction with app server pool by using ConnectionEventListener.
Though we haven't a tool to measure, we can do some test instead. Like this way:

We add a definition as 'maxPoolSize = 5' on '@ConnectionFactoryDefinition', and visit the page of trading example. when I refresh the page 6th, the browser hang up. And throw an exception later with message: Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.

In personally idea, we don't need implement removeConnectionEventListener() method. Since we just wanna send a notification to app server using connectionEventListener instance when we close connection. And we don't need send any message to app server when removeConnectionEventListener() method be invoked.





[JAVAEETUTORIAL-285] Encoder CDI example Created: 16/Sep/14  Updated: 16/Sep/14  Resolved: 16/Sep/14

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.5
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: ch0pin0 Assignee: Kim Haase
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: 5 minutes
Time Spent: Not Specified
Original Estimate: 5 minutes
Environment:

Tutorial version 7.0.5 and Glassfish 4.1


Tags: @Max, encoder

 Description   

In the encoder cdi, when the value of shifting char is equal 26 the encoded isn't performed. The @Max value of transVal in coderBean.java should be 25.



 Comments   
Comment by Kim Haase [ 16/Sep/14 ]

Specifying either 0 or 26 returns the original string. This is intentional.

Comment by ch0pin0 [ 16/Sep/14 ]

Thank you for explanation, but i think is necessary to mention this in the example explanation in tutorial.

Best regards





[JAVAEETUTORIAL-255] Invalid integer converter example in Java EE 7 tutorial chapter 11.1.1 Created: 20/Nov/13  Updated: 15/Sep/14  Resolved: 27/Nov/13

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.2
Fix Version/s: 7.0.3

Type: Bug Priority: Major
Reporter: balusc 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/7/tutorial/doc/jsf-page-core001.htm#JEETT00931

It mentions:

<h:inputText converter="javax.faces.convert.IntegerConverter" />

However, this is wrong, it should have been:

<h:inputText converter="javax.faces.Integer" />

See also http://stackoverflow.com/q/20081207



 Comments   
Comment by Kim Haase [ 27/Nov/13 ]

Thank you for pointing this out. The error has been corrected, and some additional fixes have been made in that section for the next respin.





[JAVAEETUTORIAL-257] JAX-WS tutorial chapter doesn't match what is in the code examples Created: 23/Dec/13  Updated: 15/Sep/14  Resolved: 23/Dec/13

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

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   

Actually this applies to both the doc and the examples; some fixes are needed to both.

The example source code for the JAX-WS web service, app client, and web client examples has been updated, but the code shown in the tutorial has not been updated to match it. Also, the WSDL URL in the source code is incorrect, so the clients do not run.



 Comments   
Comment by Kim Haase [ 23/Dec/13 ]

Checked in code fixes at revision 1713. Also checked in fixes in FrameMaker source.





[JAVAEETUTORIAL-268] Copyright header in XHTML files is sometimes inserted as the first line Created: 29/Apr/14  Updated: 15/Sep/14  Resolved: 15/Sep/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.4
Fix Version/s: 7.0.5

Type: Bug 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   

For whatever reason, the license plugin for Maven sometimes inserts the copyright notice above the <?xml ... ?> header, which breaks JSF pages. The XML header has to be the first line of the file. The template.xhtml files appear to be affected more than others for mysterious reasons.

See, e.g., examples/persistence/address-book/src/main/webapp/template.xhtml in the latest bundle:

<!--

    Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.

    You may not modify, use, reproduce, or distribute this software except in
    compliance with  the terms of the License at:
    http://java.net/projects/javaeetutorial/pages/BerkeleyLicense

-->
<?xml version='1.0' encoding='UTF-8' ?> 
<!--

    Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.

    You may not modify, use, reproduce, or distribute this software except in
    compliance with  the terms of the License at:
    http://java.net/projects/javaeetutorial/pages/BerkeleyLicense

-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...

Out of the box, you'll get runtime errors. Removing the first copyright header allows the app to run correctly.



 Comments   
Comment by Kim Haase [ 15/Sep/14 ]

We did a sweep and fixed these problems.





[JAVAEETUTORIAL-276] counter example has bad copyrights on Facelets pages Created: 25/Jun/14  Updated: 15/Sep/14  Resolved: 25/Jun/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.4
Fix Version/s: 7.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


 Description   

The EJB counter example fails because the xml directive is not the first line of the Facelets page (index.xhtml). Users need to remove the copyrights or move them below the xml directive to make the example work.



 Comments   
Comment by Kim Haase [ 25/Jun/14 ]

Fixed in source.





[JAVAEETUTORIAL-270] Document is not consistent with code (cdi/encoder) Created: 21/Jun/14  Updated: 15/Sep/14  Resolved: 23/Jun/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.4
Fix Version/s: 7.0.5

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

Mac, GF 4.0.1 b7



 Description   

The tutorial (26.1.3.2) says to uncomment beans.xml's <alternatives> to enable the alternative encoder.
By default, it's already uncommented (and thus the alternative encoder is used by default too).

-> correct beans.xml to disable <alternatives>



 Comments   
Comment by Kim Haase [ 23/Jun/14 ]

Thanks for catching this error.

Comment by Kim Haase [ 23/Jun/14 ]

Fix committed to trunk at version 1756. Will appear in next update release.





[JAVAEETUTORIAL-283] checkout-module issues warnings for some navigation paths Created: 08/Aug/14  Updated: 15/Sep/14  Resolved: 08/Aug/14

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

Type: Bug Priority: Minor
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A reader notes that warnings appear when you follow certain navigation paths in the checkout-module application.

These are only warnings, not errors, and the application is behaving correctly.

The specifics follow.

1. On page index.xhtml, at click on "Check Out" button, the following error message is displayed: "Kein übereinstimmendes navigation-case Element von View ID '/index.xhtml' für die Aktion 'checkoutFlow' mit dem Ergebnis 'checkoutFlow' gefunden.", i.e. no matching navigation-case element from index.xhtml for action checkoutFlow found. Adding an empty file 'checkoutFlow-flow.xml' to the checkoutFlow folder fixed that problem, although I am not sure if that's correct, either.

2. On page checkoutFlow4.xhtml, at click on "Join" button, an error message is displayed: "Kein übereinstimmendes navigation-case Element von View ID '/checkoutFlow/checkoutFlow4.xhtml' für die Aktion 'calljoin' mit dem Ergebnis 'calljoin' gefunden.", i.e. no matching navigation-case element from /checkoutFlow/checkoutFlow4.xhtml for action 'calljoin' found. I did not find a quick solution for this one, but it seems to me that either the way the flowCall is called in checkoutFlow.xhtml (action="calljoin" -> correct without expression syntax?) or the way the flow is assembled in CheckoutFlow.java is incorrect.

3. Same as 2, also on checkoutFlow4.xhtml, but at click on button "Exit Flow": "Kein übereinstimmendes navigation-case Element von View ID '/checkoutFlow/checkoutFlow4.xhtml' für die Aktion 'returnFromCheckoutFlow' mit dem Ergebnis 'returnFromCheckoutFlow' gefunden."

4. Depending on which flow is invoked first by clicking on one of the buttons on index.xhtml, the other flow may not be found, afterwards. I have tried this several times in different orders.

On the server console, I cannot see any error, neither during server startup nor at deployment of the application. The only warning I see occurs during deployment:

Warnung: JSF1063: WARNUNG! Der nicht serialisierbare Attributswert wird in HttpSession festgelegt (Schlüssel: 4db94dbe1d499374a273ca6cb7d7:0_flowStack, Wertklasse: com.sun.faces.flow.FlowHandlerImpl$FlowDeque).






[JAVAEETUTORIAL-284] dukeetf2 show wrong data Created: 12/Sep/14  Updated: 12/Sep/14  Resolved: 12/Sep/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.4
Fix Version/s: 7.0.5

Type: Bug Priority: Minor
Reporter: ch0pin0 Assignee: super_glassfish
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: 5 minutes
Time Spent: Not Specified
Original Estimate: 5 minutes
Environment:

Tested on Glassfish 4.0


Tags: dukeetf2, price-error

 Description   

In index.html page the javascript function split the arraypv by the ',', but in some locale that char is used to separate integer part from decimal part. And when you visualize the example the price field contain only the integer part of price, and the volume field contain the decimal part of price. I've resolved this mistake by change the char used to separate variable msg in ETFEndpoint.java file method send(). Instead of ',' i've used '|' and update the javascript function accordingly



 Comments   
Comment by Kim Haase [ 12/Sep/14 ]

This issue was raised as JAVAEETUTORIAL-282.

Comment by Kim Haase [ 12/Sep/14 ]

To obtain the tutorial version that contains the fix, install Java EE SDK Update 1, which includes GlassFish 4.1 and an updated version of the tutorial and examples.





[JAVAEETUTORIAL-267] Confusing paragraph in Section 30.1.1.3, "Setting Path Parameters in Targets" Created: 11/Apr/14  Updated: 07/Aug/14  Resolved: 07/Aug/14

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: None
Fix Version/s: 7.0.5

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


 Description   

A user sent this issue to the javaeetutorial-feedback mailing list. The issue concerns Section 30.1.1.3, "Setting Path Parameters in Targets," which can be found here:

http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs-client001.htm#sthref1526

Currently, the section reads as follows.

Path parameters in client requests can be specified as URI template
parameters, similar to the template parameters used when defining a
resource URI in a JAX-RS service. Template parameters are specified
by surrounding the template variable with curly brackets ({}). Call
the WebTarget.queryParam method on the target to set the parameters
by passing in the template parameter name and value or values.

WebTarget myResource = client.target("http://example.com/webapi/read")
.path("

{userName}");
Response response = myResource.queryParam("userName", "janedoe")
.request(...)
.get();

This implies that the call to queryParam will actually substitute the template variable with the value passed in. However, this implication is probably not what was intended. The .queryParam will actually append a query parameter-value to the URI. To substitute the template variable, .resolveTemplate(...) must be used.

It would be clearer if the passage recommended using the .resolveTemplate parameter to substitute the {username}, followed by the .queryParam parameter to add another variable.

For example,

WebTarget myResource = client.target("http://example.com/webapi/read")
.path("{userName}

")
.resolveTemplate("userName", "janedoe")
.queryParam("chapter", "1");

// http://example.com/webapi/read/janedoe?chapter=1

Response response = myResource.request(...)
.get();



 Comments   
Comment by Kim Haase [ 07/Aug/14 ]

Fixed in source for 7.0.5 release. Many thanks to the user who reported this issue.





[JAVAEETUTORIAL-271] No active contexts for scope type javax.transaction.TransactionScoped Created: 21/Jun/14  Updated: 07/Aug/14  Resolved: 07/Aug/14

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

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

GF 4.0.1 b7 (6/21/14 build)
Java SE build 1.8.0_05-b13 - Max OS X



 Description   

The jms/websimplemessage sample works fine on GF4.0 (b89) but throws the following exception on GF4.0.1 : WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped



 Comments   
Comment by Kim Haase [ 23/Jun/14 ]

This appears to be a problem with Weld, not with the example itself. I'm not sure why it was filed against the tutorial, but it cannot be considered a critical tutorial error.

Comment by Kim Haase [ 23/Jun/14 ]

Here is the stack trace. Initializing the messageText value makes no difference.

Severe: Error Rendering View[/sender.xhtml]
javax.el.ELException: /sender.xhtml @30,38 value="#

{senderBean.messageText}

": org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
at javax.faces.component.UIInput.getValue(UIInput.java:291)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:744)
Caused by: javax.el.ELException: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
at javax.el.BeanELResolver.getValue(BeanELResolver.java:368)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
... 49 more
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:687)
at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:825)
at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
at org.jboss.weld.injection.ConstructorInjectionPoint.getParameterValues(ConstructorInjectionPoint.java:141)
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:104)
at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:190)
at org.glassfish.jms.injection.JMSCDIExtension$LocalPassivationCapableBean.create(JMSCDIExtension.java:208)
at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:740)
at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:831)
at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:364)
at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:375)
at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:71)
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:68)
at org.jboss.weld.injection.producer.ResourceInjector.access$101(ResourceInjector.java:46)
at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:65)
at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:109)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150)
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78)
at org.jboss.weldeetutorial.websimplemessage.SenderBean$Proxy$_$$_WeldClientProxy.getMessageText(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
... 56 more

Warning: StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:687)
at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:825)
at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
at org.jboss.weld.injection.ConstructorInjectionPoint.getParameterValues(ConstructorInjectionPoint.java:141)
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:104)
at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:190)
at org.glassfish.jms.injection.JMSCDIExtension$LocalPassivationCapableBean.create(JMSCDIExtension.java:208)
at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:740)
at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:831)
at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:364)
at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:375)
at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:71)
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:68)
at org.jboss.weld.injection.producer.ResourceInjector.access$101(ResourceInjector.java:46)
at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:65)
at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:109)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150)
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78)
at org.jboss.weldeetutorial.websimplemessage.SenderBean$Proxy$_$$_WeldClientProxy.getMessageText(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
at javax.faces.component.UIInput.getValue(UIInput.java:291)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:744)

Comment by David Delabassee [ 24/Jun/14 ]

I have created https://java.net/jira/browse/GLASSFISH-21095 on GF/CDI

Comment by David Delabassee [ 30/Jun/14 ]

https://java.net/jira/browse/GLASSFISH-21095 has been fixed.
I've tested the sample on b208, it now works fine.

Comment by Kim Haase [ 07/Aug/14 ]

The problem turned out to be a GlassFish issue, not a tutorial issue. The GlassFish issue has been fixed.





[JAVAEETUTORIAL-269] Incorrect tutorial example for passing CacheStoreMode & CacheRetrieveMode Created: 15/May/14  Updated: 07/Aug/14  Resolved: 07/Aug/14

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

Type: Bug Priority: Major
Reporter: nkhattar Assignee: jendrock
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There is a link on Java EE6 tutorial named as 'Specifying the Cache Mode Settings to Improve Performance'. The url is : http://docs.oracle.com/javaee/6/tutorial/doc/gkjjj.html.
Here an example is mentioned under sub-heading 'Setting the Cache Retrieval or Store Mode'. The example is as follows -

EntityManager em = ...;
em.setProperty("javax.persistence.cache.storeMode", "BYPASS");

...............

EntityManager em = ...;
Map<String, Object> props = new HashMap<String, Object>();
props.put("javax.persistence.cache.retrieveMode", "BYPASS");
String personPK = ...;
Person person = em.find(Person.class, personPK, props);

This will fail with hibernate-entitymanager
In both above examples, setting string "BYPASS" against property "javax.persistence.cache.storeMode" will always throw Runtime Exception i.e ClassCastException stating String cannot be converted to Enum. This is due to the internal code of Hibernate class org.hibernate.ejb.AbstractEntityManagerImpl that directly casts object value to Enum without calling Enum.valueOf(String)

For Hibernate users, it should be CacheStoreMode.BYPASS insted of "BYPASS".



 Comments   
Comment by Kim Haase [ 07/Aug/14 ]

The problem does not exist with GlassFish, the supported application server for the tutorial. Users of Hibernate will need to modify source code for their platform.





[JAVAEETUTORIAL-266] Java EE tutorial 7 error.build the hello1 Web Module‏ Created: 04/Apr/14  Updated: 07/Aug/14  Resolved: 07/Aug/14

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: None
Fix Version/s: None

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

netbeans IDE 8.0



 Description   

Hi in the Java EE tutorial 7 at page:103
6.3.2.1 To Build and Package the hello1 Web Module Using NetBeans IDE.
1. Start the GlassFish Server as described in To Start the GlassFish Server Using
NetBeans IDE, if you have not already done so.
2. From the Filemenu, select Open Project.
3. In the Open Project dialog box, navigate to:
tut-install/examples/web/jsf
4. Select the hello1folder.
5. Click Open Project.
6. In the Projectstab, right-click the hello1project and select Build. This command
deploys the project to the server.

it is imposible to Build the hello1 example. If i click on the hello1 project and click Build an error is occured.

" Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) on project hello2: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy failed: Cannot find the GlassFish admin CLI JAR: admin-cli.jar -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException "
If i go at the webpage: http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
no solution is available at the page above.



 Comments   
Comment by jendrock [ 04/Apr/14 ]

The error message that you passed along indicates a problem with your environment, more specifically the location in which you installed GlassFish Server (as opposed to the Java EE 7 SDK).

If you followed the instructions in Chapter 2, "Using the Tutorial Examples," you installed the SDK, which includes GlassFish Server and the Java EE 7 Tutorial. If you did not follow the aforementioned instructions and installed GlassFish Server as part of your NetBeans 8.0 installation or if you installed GlassFish Server by itself, you would encounter path problems similar in nature to the one that you did encounter.

Please reread the instructions for setting everything up: http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples001.htm#GEXAB

Ensure that NetBeans IDE points to GlassFish Server in the SDK, not in the location that NetBeans installs GlassFish Server. If you still encounter the same issue, please use a comment to add more information to this issue. That information would include the location of your SDK, GlassFish Server, and tutorial examples. The tutorial (and its examples) should be in a location that is relative to GlassFish Server, as it is in the SDK.

Comment by pinostudente [ 04/Apr/14 ]

Thanks. Now it works! I just looked at the page like you said: http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples001.htm#GEXAB
and changed the installation directory from galssfish4 server and following step by step the description of the link you sent to me. Now it works perfectly!

Comment by saimir [ 07/Aug/14 ]

The response provided above works when the glassfish installation process is followed as per oracle documentation. However, the configuration can be adapted as per user preferences. The problem that one must know is where to change, create or update the admin password for the existing glassfish server. And it can be achieved by making changes to the configuration file, named 'password.properties' which is under the glassfish_root/glassfish/domains directory.





[JAVAEETUTORIAL-172] 4 examples in Java EE 7 SDK fail because zero-byte length beans.xml files are not zero bytes long Created: 05/Jun/13  Updated: 07/Aug/14  Resolved: 07/Aug/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.1
Fix Version/s: 7.0.5

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

Any


Attachments: Text File ErrorsInServerLog.txt    

 Description   

Four beans.xml files that should be zero bytes long were inadvertently modified to 1 KB (contain 2 empty lines) during the bundling process. This causes the examples that contain these files to fail. The four files are:

1. glassfish4/docs/javaee-tutorial/examples/concurrency/jobs/src/main/webapp/WEB-INF/beans.xml
2. glassfish4/docs/javaee-tutorial/examples/web/jsonp/jsonpmodel/src/main/webapp/WEB-INF/beans.xml
3. glassfish4/docs/javaee-tutorial/examples/web/jsonp/jsonpstreaming/src/main/webapp/WEB-INF/beans.xml
4. glassfish4/docs/javaee-tutorial/examples/web/jsf/checkout-module/src/main/webapp/WEB-INF/beans.xml

The beans.xml files in the concurrency/jobs, jsonp/jsonpmodel, and jsonp/jsonpstreaming projects can be deleted. The examples will then run as expected.

The beans.xml file in the jsf/checkout-module must be modified in a text editor. Open the file and add the following content, making sure to add an empty line at the end:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd">
</beans>

The jsf/checkout-module should now run as expected.



 Comments   
Comment by jendrock [ 05/Jun/13 ]

The workaround is to follow the instructions in the description, deleting the beans.xml files in the concurrency/jobs, jsonp/jsonpmodel, and jsonp/jsonpstreaming projects and editing the beans.xml file in the jsf/checkout-module project to add this content followed by a blank line:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd">
</beans>

Then, if you following the instructions in the documentation (bundled or online), all four examples should run with Maven/Cargo on the command line or with NetBeans IDE 7.3.1.

These issues will be fixed in the next tutorial update.

Comment by Ian Evans [ 05/Jun/13 ]

Eric, could you post the Weld error when you deploy with the 1 byte beans.xml descriptor? I'm sure some people will search for the error string.

It's also possible that we should file a bug against Weld. An empty file is an empty file, whether there is one carriage return or CF/LF.

Comment by jendrock [ 06/Jun/13 ]

The following message is displayed when you build the examples with the malformed beans.xml files. (This message is what was seen when the concurrency/jobs example was built.)

[INFO] — cargo-maven2-plugin:1.4.2:redeploy (deploy) @ jobs —
[INFO] [DeployerRedeployMojo] Resolved container artifact org.codehaus.cargo:car
go-core-container-glassfish:jar:1.4.2 for container glassfish4x
[INFO] [talledLocalContainer] Command deploy failed.
[INFO] [talledLocalContainer] remote failure: Error occurred during deployment:
Exception while loading the app : WELD-001202 Error parsing file:/C:/glassfish4/
glassfish/domains/domain1/applications/jobs/WEB-INF/beans.xml. Please see server
.log for more details.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

The ErrorsInServerLog.txt attachment provides the more detailed WELD error from the server.log file.

Comment by Ian Evans [ 24/Jun/13 ]

Fixed in 7.0.1-3 update.

Comment by Kim Haase [ 24/Jul/13 ]

The checkout-module example works if I use a CDI 1.0 beans.xml file (java.sun.com namespace) – it runs with no errors or warnings.

Comment by Kim Haase [ 25/Jun/14 ]

Same problem exists with simple-flow and checkout-module in 7.0.4 release of tutorial examples. They have a newline in the supposedly empty beans.xml file.

Comment by Kim Haase [ 25/Jun/14 ]

There is no problem with the two jsonp examples at 7.0.4, because they don't have beans.xml files.

Comment by Kim Haase [ 07/Aug/14 ]

Fixed for GF 4.1.





[JAVAEETUTORIAL-282] dukeetf example fails in locales that use a comma as a currency separator Created: 25/Jul/14  Updated: 28/Jul/14  Resolved: 28/Jul/14

Status: Closed
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: 7.0.4
Fix Version/s: 7.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


 Description   

We received the following report from a user:

I have found an issue with the example dukeetf

This is a sample of the ajax response.

109,54, 280995

This is parsed wrongly on the UI and shows 109 as the price and 54 as the volume.

The result should be 109.54 as the price and 280995 as volume

http://docs.oracle.com/javaee/7/tutorial/doc/servlets017.htm#BEIFAIFF

Rahul Mahindrakar



 Comments   
Comment by Kim Haase [ 25/Jul/14 ]

This seems to happen if a user is working in a locale that uses the comma as a currency separator (most locales do, actually).

The simplest fix is to use a separator other than a comma between the price and volume.

I don't think any locales use "/" as a currency separator.

So in the send() method of DukeETFServlet.java, we should change the line of code that calls String.format() to look like this:

String msg = String.format("%.2f / %d", price, volume);

And in the updatePage() JavaScript method on the main.xhtml page, we should then change the line that calls the split method to look like this:

var arraypv = ajaxRequest.responseText.split("/");

Comment by Kim Haase [ 28/Jul/14 ]

Rahul points out that the same problem exists with the dukeetf2 example at http://docs.oracle.com/javaee/7/tutorial/doc/websocket011.htm. The fix needs to be made there in both the example and the documentation.

Comment by Kim Haase [ 28/Jul/14 ]

Committed fixes for dukeetf and dukeetf2 at revisions 1773 and 1774.

Comment by jendrock [ 28/Jul/14 ]

The documentation has been updated to reflect the changes to both the dukeetf and dukeetf2 examples. The introduction to Section 17.17.1.1, "The Servlet," has also been rewritten, removing the example of what not to do. The rewritten section simply says what the snippet shows and what the init and send methods do. These fixes have been committed to our doc workspaces and should appear at the next update.





[JAVAEETUTORIAL-281] Wrong Title Created: 24/Jul/14  Updated: 25/Jul/14  Resolved: 25/Jul/14

Status: Closed
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: 7.0.4
Fix Version/s: 7.0.5

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


 Description   

Page: http://docs.oracle.com/javaee/7/tutorial/doc/webapp003.htm
Section: 6.3.5.2 To Undeploy the hello1 Web Module Using the asadmin Command

I think it should read :
6.3.5.2 To Undeploy the hello1 Web Module Using the "maven" Command

because of the following :
In a terminal window, go to:
tut-install/examples/web/jsf/hello1/
Enter the following command:
mvn cargo:undeploy
To delete the class files and other build artifacts, enter the following command:
mvn clean



 Comments   
Comment by Kim Haase [ 24/Jul/14 ]

Thanks for catching that mistake. I thought I had fixed all those, but I missed that one!

Comment by Kim Haase [ 25/Jul/14 ]

Fixed in source; will appear in next release of tutorial.





[JAVAEETUTORIAL-280] Use syntax highlighting for the code snippets Created: 14/Jul/14  Updated: 23/Jul/14  Resolved: 23/Jul/14

Status: Closed
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: 7.0.4
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Andras.Hatvani Assignee: super_glassfish
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The code snippets are plain black currently throughout the whole documentation. It would ease reading and therefore speed up learning if syntax highlighting would be applied to Java examples.



 Comments   
Comment by jendrock [ 23/Jul/14 ]

This issue is being closed because it is a duplicate of JAVAEETUTORIAL-189 (see https://java.net/jira/browse/JAVAEETUTORIAL-189), which was already closed.





[JAVAEETUTORIAL-279] Chapter 23 Coding the Enterprise Bean Class Created: 12/Jul/14  Updated: 23/Jul/14  Resolved: 23/Jul/14

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

Type: Bug Priority: Minor
Reporter: shapir Assignee: super_glassfish
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The @WebSerlet code snippet declares
@EJB
ConverterBean converterBean

but later on uses variable converter- which is not declared -, rather than converterBean:
BigDecimal yenAmount = converter.dollarToYen(d);

// call the ConverterBean.yenToEuro() method to get the amount
// in Euros
BigDecimal euroAmount = converter.yenToEuro(yenAmount);



 Comments   
Comment by jendrock [ 23/Jul/14 ]

This issue is logged against the Java EE 6 Tutorial. We recommend that you use the Java EE 7 Tutorial, in which the problem that you identified has been fixed. See http://docs.oracle.com/javaee/7/tutorial/doc/ejb-gettingstarted001.htm#GIPSI. In the corresponding section, the @WebServlet code snippet now declares:

@EJB
ConverterBean converter;

then later uses the variable converter, which now has been declared.

// call the ConverterBean.dollarToYen() method to get the amount
// in Yen
BigDecimal yenAmount = converter.dollarToYen(d);

// call the ConverterBean.yenToEuro() method to get the amount
// in Euros
BigDecimal euroAmount = converter.yenToEuro(yenAmount);

The Java EE 7 Tutorial is actively maintained; we correct all errors promptly in that version. We will make every effort to suppress the Java EE 6 and Java EE 5 tutorial entries in the search engine results so this problem is minimized in the future.

Comment by jendrock [ 23/Jul/14 ]

The content is correct in the Java EE 7 Tutorial. See http://docs.oracle.com/javaee/7/tutorial/doc/ejb-gettingstarted001.htm#GIPSI.





[JAVAEETUTORIAL-277] Duke Tutoring Admin user doesn't exist Created: 30/Jun/14  Updated: 30/Jun/14  Resolved: 30/Jun/14

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: None
Fix Version/s: 7.0.5

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

NA



 Description   

The Duke Tutoring doc suggest (58.4.1.3) to use the admin@example.com / javaee user for the Admin Interface. It would be useful to let the user that he needs to create that user (and how)

The error message is more useful:
--8<--
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 "tutoringRealm" realm and has been assigned to the group of "Administrator".
--8<--



 Comments   
Comment by jendrock [ 30/Jun/14 ]

The admin user is created as part of the process of creating the tutoringRealm. I saw this error as it was being created:

exec-maven-plugin:1.2.1:exec (create-tutoring-realm) @ dukes-tutoring-war —
remote failure: Creation of Authrealm tutoringRealm failed. com.sun.enterprise.security.auth.realm.BadRealmException: java.lang.ClassNotFoundException: com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found by org.glassfish.main.security [328]
com.sun.enterprise.security.auth.realm.BadRealmException: java.lang.ClassNotFoundException: com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found by org.glassfish.main.security [328]
Command create-auth-realm failed.

The realm and, consequently, the admin user were never created. I modified the POM file to specify the right package (com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm). After this, the realm and the admin user were created correctly. The security refactoring that occurred in GF 4.0.1 bit me again!





[JAVAEETUTORIAL-278] Change the sample to use a non privileged port. Created: 30/Jun/14  Updated: 30/Jun/14  Resolved: 30/Jun/14

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.4
Fix Version/s: 7.0.5

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

NA



 Description   

By default the EJB/Async sample comes with a SMTP Mock server (good thing!) to simulate a back-end SMTP server. But that server uses port 25 which is a privileged ports on Unix. If the user is not aware of that, the sample will fail (timeout). On some OS, it's tricky to get around this.

Since we provides both client (EJB) and server (SMTP), the sample could easily be changed to use a non privileged ports (eg. 1025) instead.

--8<--
Properties props = new Properties();
props.put("mail.smtp.port", "1025");
try {
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication()

{ return new PasswordAuthentication("test", "test"); }

});
...



 Comments   
Comment by jendrock [ 30/Jun/14 ]

I agree that we should be using a port other than port 25, the default SMTP port. I chose to use 3025, which should be safe.

I modified the Server.java file to reflect this change. Here are the changed lines:

ServerSocket server = new ServerSocket(3025);
System.out.println("[Test SMTP server listening on port 3025]");

Then I modified MailerBean.java to use the new port number. Here are the changed lines I added to the try statement:

try {
Properties properties = new Properties();
properties.put("mail.smtp.port", "3025");
session = Session.getInstance(properties);

Should work fine now. Will also make the appropriate changes to reflect the new port number in the documentation. All this will appear in the next release of the tutorial. Also caught a problem in the template.xhtml file that was introduced as a result of the copyright sweep and fixed that.





[JAVAEETUTORIAL-275] jsf/filesystemrlc throws a NPE Created: 25/Jun/14  Updated: 27/Jun/14  Resolved: 25/Jun/14

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

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

GF 4.0b89 (SE 1.7.0_51-b13) and GF 4.0.1b7 (SE 1.8.0_05-b13)
on OS X Mavericks



 Description   

Clicking in 'Blue' 'Red' will throws :
java.lang.NullPointerException
at filesystemrlc.FilesystemResourceHandler.createResource(FilesystemResourceHandler.java:77)
at com.sun.faces.renderkit.html_basic.StylesheetRenderer.encodeEnd(StylesheetRenderer.java:97)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at com.sun.faces.renderkit.html_basic.HeadRenderer.encodeHeadResources(HeadRenderer.java:113)
at com.sun.faces.renderkit.html_basic.HeadRenderer.encodeEnd(HeadRenderer.java:100)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:443)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:744)



 Comments   
Comment by Kim Haase [ 25/Jun/14 ]

The Java EE 7 Tutorial does not include an example called "filesystemrlc". It has one called "hello1-rlc" that appears to work fine in GF 4.0.1.

Comment by David Delabassee [ 27/Jun/14 ]

My bad. The broken sample is part of the GF samples not the Tutorial sample, sorry!

Comment by Kim Haase [ 27/Jun/14 ]

No problem. I think the glassfish-samples project has its own JIRA account if you want to file an issue there.

I did borrow from their RLC example for the tutorial one (hello1-rlc), but I cleaned it up a bit. I hope.

We appreciate your testing of our examples very much!





[JAVAEETUTORIAL-274] Unable to log in Duke Forest sample - auth-realm not configured? Created: 25/Jun/14  Updated: 25/Jun/14  Resolved: 25/Jun/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.4
Fix Version/s: 7.0.5

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

GF 4.0.1b7



 Description   

Unable to log in using the default users (jack@example.com, robert@example.com / 1234) or using a newly created user.

I am not sure if the jdbc auth realm creation works in https://svn.java.net/svn/javaeetutorial~svn/branches/javaee-tutorial-7.0.4/examples/case-studies/dukes-forest/entities/pom.xml
No issue while building but I don't see it in my Admin console.

--8<--
SEVERE: javax.servlet.ServletException: Login failed at org.apache.catalina.authenticator.AuthenticatorBase.doLogin(AuthenticatorBase.java:983) at org.apache.catalina.authenticator.AuthenticatorBase.login(AuthenticatorBase.java:963) at org.apache.catalina.connector.Request.login(Request.java:2250) at org.apache.catalina.connector.Request.login(Request.java:2229) at org.apache.catalina.connector.RequestFacade.login(RequestFacade.java:1113) at com.forest.web.UserController.login(UserController.java:62) at com.forest.web.UserController$Proxy$_$$_WeldClientProxy.login(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.sun.el.parser.AstValue.invoke(AstValue.java:289) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304) at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) 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:790) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) 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:198) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:412) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545) at java.lang.Thread.run(Thread.java:745)
WARNING: WEB9102: Web Login Failed: com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Failed file login for robert@example.com.
--8<--



 Comments   
Comment by jendrock [ 25/Jun/14 ]

When you follow the directions for building the example, the task completes but the following error occurs:

remote failure: Creation of Authrealm jdbcRealm failed. com.sun.enterprise.security.auth.realm.BadRealmException: java.lang.ClassNotFoundException: com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found by org.glassfish.main.security [328]
com.sun.enterprise.security.auth.realm.BadRealmException: java.lang.ClassNotFoundException: com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found by org.glassfish.main.security [328]
Command create-auth-realm failed.

Why? Because some bright soul (no names needed) decided to rename the package from this:

com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm

to this:

com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm

I can make a one-line change in the /entities/pom.xml file, which will allow the JDBCRealm to be created and be visible from the Admin Console, but the example will no longer work with GF 4.0; it will only work with GF 4.0.1. In other words, the application will no longer be backward compatible WITHIN a major version (i.e., compatibility across minor versions is broken). This is not a good thing at all. It makes using GF less inviting, that is for sure.

Comment by jendrock [ 25/Jun/14 ]

I filed an issue against GlassFish 4.0.1. See https://java.net/jira/browse/GLASSFISH-21105.

Comment by jendrock [ 25/Jun/14 ]

I committed the change to the trunk workspace, which means that it will be included in the tutorial update (7.0.5) that coincides with the release of GlassFish 4.0.1.





[JAVAEETUTORIAL-273] EJB sample is using an old version of the embedded container Created: 25/Jun/14  Updated: 25/Jun/14  Resolved: 25/Jun/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.4
Fix Version/s: 7.0.5

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

NA



 Description   

The ejb/standalone sample is using a 3.2 version of the GF embedded container.

<glassfish.embedded.version>3.2-b06</glassfish.embedded.version> is defined in https://svn.java.net/svn/javaeetutorial~svn/branches/javaee-tutorial-7.0.4/examples/pom.xml
and used in https://svn.java.net/svn/javaeetutorial~svn/branches/javaee-tutorial-7.0.4/examples/ejb/standalone/pom.xml

Note that those coordinates has changed since then
<groupId>org.glassfish.main.extras</groupId> (TUT is using the old org.glassfish.extras)
<artifactId>glassfish-embedded-all</artifactId>
<version>4.0</version>



 Comments   
Comment by jendrock [ 25/Jun/14 ]

Made the indicated changes in the ejb/standalone POM file (fixed the groupID element) and the top-level POM file (fixed the glassfish.embedded.version). Tested the example and it runs fine. Thanks for finding the correct version of the embedded container, David. We tried but were unable to due so, probably due to the change in the groupID. Anyhow, the changes have been committed in the trunk workspace and will appear in the next version of the tutorial (7.0.5).





[JAVAEETUTORIAL-272] dukeetf : add clarification on how to run the sample Created: 23/Jun/14  Updated: 24/Jun/14  Resolved: 24/Jun/14

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.3
Fix Version/s: 7.0.4

Type: Improvement Priority: Trivial
Reporter: David Delabassee Assignee: jendrock
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Not relevant



 Description   

I suggest to add a remark that the url to invoke the sample (17.17.2) should use localhost and only localhost as this is hardcoded in the sample.
Eg. if one try to launch the sample from the GF Admin, it will not work because the actual hostname will be used and the browser will block JS request to localist as it's a different domain



 Comments   
Comment by jendrock [ 24/Jun/14 ]

Since the tutorial promotes 2 ways of deploying and running the examples, neither of which involves the Admin Console, I am going to leave well enough alone in this case and not change the existing text or add any caveats. In a true production environment, the server name and port number would be generated dynamically, not hardcoded as they are in the example. Adding that functionality would be overkill here.

There is a simple solution, however. Replace this line in main.xhtml:

ajaxRequest.open("GET", "http://localhost:8080/dukeetf/dukeetf", true);

With this line:

ajaxRequest.open("GET", "/dukeetf/dukeetf", true);

It will work all three ways (deploy in NetBeans, using mvn install, and using Admin Console). I just don't want to document that. Just know that it works.





[JAVAEETUTORIAL-189] Use rich formatting with multi colors fonts and styles Created: 13/Jun/13  Updated: 26/Mar/14  Resolved: 25/Mar/14

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.4

Type: New Feature Priority: Minor
Reporter: miss_duke Assignee: Ian Evans
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: format, readability, style

 Description   

Java tutorial now uses limited colors and fonts. For example Java code snippets in the tutorial remains in plain black.

Code snippets may be formatted as they are displayed in an IDE editor. Various colors fonts and styles may be used wherever possible in the tutorial text.

This needs some effort but this will tremendously increase the readability of the tutorial.

I can point Android tutorials as an example for good presentation:
http://developer.android.com/guide/components/activities.html



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

We're working on finding a solution that will work with our tools. We'll update this issue as we make progress.

Comment by Ian Evans [ 19/Sep/13 ]

Lowering the priority and deferring to the next release. Our tools team does not have a solution for us at this time.

Comment by Kim Haase [ 25/Mar/14 ]

There is no plan for our tools to implement this feature. Colors used for syntactic purposes impede the accessibility of the documentation.

Comment by miss_duke [ 26/Mar/14 ]

"...Colors used for syntactic purposes impede the accessibility of the documentation..."

Colors used in Git, Android, AngularJS websites are all impede accessibility?! (If you have no resource or skill set please admit it, do not say stupid reasons)

Comment by Kim Haase [ 26/Mar/14 ]

1) Oracle focuses very strongly on accessibility issues, more than most companies.

2) Our tools team will not devote resources to features that might impede accessibility.





[JAVAEETUTORIAL-258] Websocket dukeetf2 and websocketbot, socket remains open after browser tab closed Created: 20/Jan/14  Updated: 25/Mar/14  Resolved: 25/Mar/14

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

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

Chrome Version 32.0.1700.77 GlassFish Server Open Source Edition 4.0 (build 89) OSX 10.9.1


Tags: examples, websocket

 Description   

In the dukeetf2 websocket example:

Why does the server keep sending the messages after the browser tab on the client is closed? Why is the ETFEndpoint @OnClose never called? I understand that the timer service keeps hitting send every second, but the connection should be closed surely, and its session removed from the queue? After which the queue should be empty?

The websocketbot application also does the same, it does not close the connections, from both Chrome and Safari, neither closing the tabs nor the browser works on my machine



 Comments   
Comment by jendrock [ 25/Mar/14 ]

Closing the browser tab does not undeploy the application. If you undeploy the example, the socket closes and the issue no longer exists.





[JAVAEETUTORIAL-249] Duke's Tutoring Administration Panel: editing student record has problems Created: 20/Sep/13  Updated: 25/Mar/14  Resolved: 25/Mar/14

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

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

Attachments: Zip Archive validationTest-0.1.zip     Zip Archive validationTest-ee6.zip    

 Description   

In the Administration Panel of the Duke's Tutoring case study example, strange things happen when you try to edit a student. Let's give Buster Bluth a shot.

Click Edit in Buster Bluth's row.
Move "Buster" from Nickname to Middle Name and click Submit.
You'll see three error messages that indicate you need to fill out the Email, Cell Phone, and Home Phone fields because they are required, but aren't filled in in the existing student record.
Click Submit again.
Click Administration main page and notice that "Buster Bluth" is now known as "Bluth". He has no first name, even though I left the First Name field alone; I just modified the Nickname and Middle Name fields.



 Comments   
Comment by rcervera [ 20/Sep/13 ]

It works when filling all the fields in the page; the record gets updated. Probably the fields below (phone, etc) are not validating properly because they are empty.

Comment by Kim Haase [ 20/Sep/13 ]

I think what Eric found was that even after he filled in those fields and clicked Submit, the data was not recorded correctly.

Comment by jendrock [ 21/Sep/13 ]

Yes, what Kim says is correct. There are 2 issues, the first being that the existing data about the students does not conform to the validation checks for the Email, Cell Phone, or Home Phone fields. There should be some indication that these fields are required. That said, the existing data should conform to those requirements as well. It does not.

The issue that pushed my buttons was the randomness of what happens when Name (First, Middle, Last) and Nicknames are filled out. I can look at the Name data for an existing student in the list, create a new student and fill out the same fields as are shown for the existing student and get an end result that is quite different than what is expected. Try to create a new student in the manner that I previously described and compare the results to George Bluth.

This is just one of the Admin issues. I will write up and add the others sequentially. For example, we can create a new guardian for a student but how can we display the guardians for that, or any, student?

All good case studies, like this one, exercise many different technologies and components, which lead to many interactions and combinations of interactions that need to be discovered, tested, and examined. It takes several different people looking at the same app to truly shake out the things that don't work. In the grand scheme of things, the things I found are relatively small and, while bothersome, do not render the app unusable by any stretch of the imagination. After the latest round of updates, I simply look at these blemishes as growing pains. I really like what the app shows under its skin. I know the user community does too.

Comment by Ian Evans [ 23/Sep/13 ]

The weird thing is that those fields are not required, despite the validation messages that show a violation.

@Email
protected String email;
@Pattern(regexp="\\(\\d{3}\\) \\d{3}-\\d{4}",
         message="{invalid.phonenumber}")
protected String homePhone;
@Pattern(regexp="\\(\\d{3}\\) \\d{3}-\\d{4}",
         message="{invalid.phonenumber}")
protected String mobilePhone;

Note that there is no @NotNull validation constraint on these fields. The empty fields in the Facelets form are apparently being set to something behind the scenes, causing the constraint violations. Which is bewildering.

Comment by Ian Evans [ 02/Oct/13 ]

JSF is interpreting the strings from the form as empty strings rather than null strings. This occurs even if you add the following to web.xml

<context-param>
  <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
  <param-value>true</param-value>
</context-param>

Adding the above parameter appears to trigger different behavior, though, as you won't see the Bean Validation error message put on the constraint, but rather "A Persistence Error Occurred". This is caused by a ContraintViolationException thrown downstream by Bean Validation during the transaction.

Comment by Ian Evans [ 02/Oct/13 ]

The ZIP file contains a test case that shows the errors. A simple JPA entity with a non-required field has a @Pattern constraint. Any attempt to leave the input box blank in the JSF form results in a ConstraintViolationException.

Comment by Kim Haase [ 07/Oct/13 ]

The zip file validationTest-ee6.zip modifies the previous example to run on a Java EE 6 platform (glassfish3). The reported problem does not occur on EE 6, suggesting that it was introduced in EL 3.0.

Comment by Kim Haase [ 22/Oct/13 ]

In the actual Duke's Tutoring example (not the stripped-down version):

If I don't provide the INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL context parameter and I try to create a student with no email address or phone numbers, then when I click Submit I get an error message on the email field saying

must match "[a-z0-9!#$%&'*+/=?^_`

{|}~-](?:\.[a-z0-9!#$%&'*/=?^_`{|}

~-])@(?:[a-z0-9](?:[a-z0-9-][a-z0-9])?\.)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"

and error messages on both phone fields saying

Phone numbers should be of the form (xxx) xxx-xxxx.

In Person.java, none of these fields has the @NotNull annotation, only the @Pattern annotation.

If I do provide the INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL context parameter and I try to create a student with no email address or phone numbers, I immediately go to an Error 500 page that reports a ConstraintViolationException:

type Exception report

messageInternal Server Error

descriptionThe server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: javax.ejb.EJBException
root cause

javax.faces.el.EvaluationException: javax.ejb.EJBException
root cause

javax.ejb.EJBException
root cause

javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'. Please refer to embedded ConstraintViolations for details.
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.0 logs.

Comment by Kim Haase [ 23/Oct/13 ]

Here's another interesting wrinkle (this is the version with the latest fixes):

I did not have the context parameter javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL set.

I created a student with a first name, last name, and nickname, clicked Submit, and got red validation errors because I left out the email and phone numbers. (This is an issue because those fields are not required; they just have pattern specifiers.)

Then I entered correct data in those fields and REMOVED THE FIRST NAME and then clicked Submit again. I did not get an error on the missing first name, though that is a required field. Instead, the student was created with the nickname as the first name.

The interaction between validation and persistence seems to be problematic here.

Comment by jendrock [ 25/Mar/14 ]

Since this isn't intended to be a real, fully operational application, these fixes will be left as an exercise for the reader to complete. Enjoy the example for what it is.





[JAVAEETUTORIAL-250] 54.5 The jobs Concurrency Example missing info and won't run Created: 23/Sep/13  Updated: 25/Mar/14  Resolved: 25/Mar/14

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

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

JavaEE 7.0.21, glassfish-4.0.1-b03



 Description   

I followed the tutorial http://docs.oracle.com/javaee/7/tutorial/doc/concurrency-utilities005.htm#CIHCGGEG (54.5 The jobs Concurrency Example) and there is a configuration options missing.

  • I had to set glassfish.home.prefix property in docs/javaee-tutorial/examples/pom.xml and nowhere does the Tutorial or that documentation say to do this

And then once fixed I couldn't get to work in Netbeans or through Maven as discussed. The reasons are:

  • Firstly was due to an empty beans.xml file - /docs/javaee-tutorial/examples/concurrency/jobs/src/main/webapp/WEB-INF/beans.xml
  • Second was an error I could not work out without becoming more familiar with the code which I don't have time to do now (when all I want to do is see the examples working as described). The error is as below.

I'm looking forward to seeing this working!

Cheers,

Brooke

2013-09-23 10:47:01 .390+1000 [SEVERE] - WebModule[/jobs]StandardWrapper.Throwable
java.lang.IllegalStateException: Error when configuring to use the EJB interceptor binding API. JAX-RS EJB integration can not be supported.
at org.glassfish.jersey.gf.ejb.EjbComponentProvider.registerEjbInterceptor(EjbComponentProvider.java:167)
at org.glassfish.jersey.gf.ejb.EjbComponentProvider.bind(EjbComponentProvider.java:199)
...
Caused by: java.lang.reflect.InvocationTargetException
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:601)
at org.glassfish.jersey.gf.ejb.EjbComponentProvider.registerEjbInterceptor(EjbComponentProvider.java:162)
... 92 more
Caused by: java.lang.NullPointerException
at com.sun.ejb.containers.InternalInterceptorBindingImpl.registerInterceptor(InternalInterceptorBindingImpl.java:97)
... 97 more
2013-09-23 10:47:01 .391+1000 [SEVERE] - WebModule[/jobs]Servlet /jobs threw load() exception
java.lang.NullPointerException
at com.sun.ejb.containers.InternalInterceptorBindingImpl.registerInterceptor(InternalInterceptorBindingImpl.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
2013-09-23 10:47:01 .391+1000 [SEVERE] - Startup of context /jobs failed due to previous errors]]
2013-09-23 10:47:01 .395+1000 [SEVERE] - ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NullPointerException
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5954)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
...
Caused by: org.apache.catalina.LifecycleException: java.lang.NullPointerException
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5712)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5946)
... 72 more
Caused by: java.lang.NullPointerException
at com.sun.ejb.containers.InternalInterceptorBindingImpl.registerInterceptor(InternalInterceptorBindingImpl.java:97)
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:601)
at org.glassfish.jersey.gf.ejb.EjbComponentProvider.registerEjbInterceptor(EjbComponentProvider.java:162)
at org.glassfish.jersey.gf.ejb.EjbComponentProvider.bind(EjbComponentProvider.java:199)
at org.glassfish.jersey.server.ApplicationHandler.bindWithComponentProvider(ApplicationHandler.java:845)
at org.glassfish.jersey.server.ApplicationHandler.bindProvidersAndResources(ApplicationHandler.java:775)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:396)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:161)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:286)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:283)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:298)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5704)
... 73 more
2013-09-23 10:47:01 .396+1000 [WARNING] - java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NullPointerException
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NullPointerException
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1044)
...
2013-09-23 10:47:01 .396+1000 [SEVERE] - Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NullPointerException
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
...
2013-09-23 10:47:01 .397+1000 [SEVERE] - Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NullPointerException
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
...
2013-09-23 10:47:01 .397+1000 [SEVERE] - Exception while loading the app]]
2013-09-23 10:47:01 .403+1000 [SEVERE] - Undeployment failed for context /jobs]]
2013-09-23 10:47:01 .418+1000 [SEVERE] - Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NullPointerException]]



 Comments   
Comment by jendrock [ 27/Sep/13 ]

Several issues are raised here.

We explicitly tell users what environment is optimal for running the tutorial. This is explained here: http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples001.htm#GEXAB.

If you download and install the Java EE 7 SDK, you get the correct environment and the tutorial example tree in one installation. Furthermore, you also get access to Update Tool, a mechanism for ensuring that you always have the most up-to-date tutorial sources installed. If you do not follow these directions, the tutorial will not work out-of-the-box, as you discovered.

The non-zero byte-length beans.xml file was an issue that we recognized as a problem the first day that we shipped the tutorial. I noted this as a problem in the Java EE 7 SDK Release Notes (http://www.oracle.com/technetwork/java/javaee/documentation/javaee7sdk-readme-1957703.html), which are available on the SDK download page. You have 2 options for this problem - delete the beans.xml file or update the tutorial package and get a "patched" tutorial where this shortcoming has been addressed. This is why we encourage folks to use the environment that we promote.

I believe that your final problem is due to the fact that you installed the Web Profile, not the Full Profile version of GlassFish Server. Again, we explicitly say that we support only the Full Profile version.

If you start the application server and then create and configure the 2 managed executor services that are described in http://docs.oracle.com/javaee/7/tutorial/doc/concurrency-utilities005.htm#sthref2912 before you try to run the jobs example, I am sure that you will find that it works as advertised. I just tried it again, after updating my tutorial installation to package 7.0.3-1, and it works as described.

Comment by jendrock [ 25/Mar/14 ]

I believe that the issues that were noted caused the example to not run. Once the issues that were identified were resolved, the app should run as expected, and it does!





[JAVAEETUTORIAL-262] Java EE 6 tutorial example clientsessionmdb add-resources glassfish-resources.xml gives resourcename.isnot.unique error Created: 27/Feb/14  Updated: 25/Mar/14  Resolved: 25/Mar/14

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

Type: Bug Priority: Minor
Reporter: amyk Assignee: Kim Haase
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The workaround is to rename the connector-resource 'pool-name' and connector-connection-pool 'name' in the example's glassfish-resources.xml or use example from Java EE tutorial 7.0.3 for GlassFish 4

1. install GlassFish 4.0
2. svn co https://svn.java.net/svn/javaeetutorial~svn/branches/javaee-tutorial-6/examples
asadmin add-resources examples/jms/clientsessionmdb/setup/glassfish-resources.xml

Connector connection pool jms/ConnectionFactory created.
Administered object jms/Topic created.
Unable to create connector resource jms/ConnectionFactory. Constraints for this ConnectorResource configuration have been violated: on property [ ] violation reason [

{resourcename.isnot.unique}

]
Command add-resources executed successfully.



 Comments   
Comment by Kim Haase [ 25/Mar/14 ]

We recommend that with GlassFish 4 you follow the Java EE 7 Tutorial and use the Java EE 7 examples. The Java EE 6 examples are not guaranteed to work with GlassFish 4, only with GlassFish 3, which supports Java EE 6. The Java EE 6 examples are not being maintained.

Thank you for your interest in the Java EE platform.





[JAVAEETUTORIAL-248] Insufficient spacing between paragraphs inside a list item in HTML Created: 20/Sep/13  Updated: 25/Mar/14  Resolved: 25/Mar/14

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.2
Fix Version/s: 7.0.4

Type: Bug Priority: Trivial
Reporter: rcervera Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

See the paragraphs inside the list items in 53.1.1:
http://docs.oracle.com/javaee/7/tutorial/doc/batch-processing001.htm



 Comments   
Comment by Kim Haase [ 25/Mar/14 ]

Spacing inside lists is not great, but we can't easily modify the current templates.





[JAVAEETUTORIAL-265] hello1-rlc in Tutorial in Chapter 8.8. The greeting.xhtml displays response.xhtml and vice versa pages, Created: 23/Mar/14  Updated: 25/Mar/14  Resolved: 25/Mar/14

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

Type: Bug Priority: Trivial
Reporter: Argyleghost Assignee: Kim Haase
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Netbeans7.4



 Description   

When you run the app with the default settings from your tutorial, I noticed that that the the page loads with the url "http://localhost:8080/hello1-rlc/reply/response.xhtml", but it says Hio and whats your name. and when you enter it, it brings you to the greeting.xhtml and says your name.



 Comments   
Comment by Argyleghost [ 23/Mar/14 ]

This is in the Oracle EE 7 documentation tutorial (http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets008.htm)

Comment by Argyleghost [ 23/Mar/14 ]

Actually the URL is correct ay first but after you enter your name for the first time then the URl says greeting.xhtml, clicking the back button brings you to reply/response.xhtml, which actually greets you.

I know, not a big deal.

Comment by Kim Haase [ 25/Mar/14 ]

This is a feature of Facelets in JavaServer Faces technology. See https://java.net/jira/browse/JAVAEETUTORIAL-156 for more information.

Thanks for your interest in Java EE.





[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-264] Would you please supply moblie format such as epub Created: 05/Mar/14  Updated: 05/Mar/14  Resolved: 05/Mar/14

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

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


 Description   

JavaEE 7 tutorial supplies PDF, which is good for PCs (and may be tablets), but it is not easy to read on a phone. Almost every body has a phone today, would you please supply a mobile format? Or a single page HTML version(it is easy to convert to mobile format)



 Comments   
Comment by jendrock [ 05/Mar/14 ]

This issue is a duplicate of JAVAEETUTORIAL-67. At the time I responded to that issue, I 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 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 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.

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

Comment by jendrock [ 05/Mar/14 ]

I am closing the issue because it is a duplicate of JAVAEETUTORIAL-67. Please read the previous comment for more information about how and when electronic formats of the tutorial will be commercially available.





[JAVAEETUTORIAL-263] dukes-forest build failed - Authentication failed for user: null Created: 02/Mar/14  Updated: 03/Mar/14  Resolved: 03/Mar/14

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

Type: Bug Priority: Minor
Reporter: davidsk Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows XP



 Description   

When I run build on dukes-forest project, I received the following error message:

— exec-maven-plugin:1.2.1:exec (default) @ dukes-store —
Command set failed.
Authentication failed for user: null
(Usually, this means invalid user name and/or password)
------------------------------------------------------------------------
Reactor Summary:

dukes-forest ...................................... SUCCESS [1.203s]
events ............................................ SUCCESS [3.672s]
entities .......................................... SUCCESS [3.219s]
dukes-resources ................................... SUCCESS [1.656s]
dukes-payment ..................................... SUCCESS [6.297s]
dukes-store ....................................... FAILURE [3.469s]
dukes-shipment .................................... SKIPPED
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------

Can you tell me what I may miss?



 Comments   
Comment by davidsk [ 02/Mar/14 ]

It is not an issue. The problem occured when I change the GlassFish Console admin password. After changing it back to the default empty password, it is working.

Comment by Kim Haase [ 03/Mar/14 ]

Thank you very much for the quick explanation of the problem.

We appreciate your interest in the tutorial.





[JAVAEETUTORIAL-253] Update EL chapter to reflect 3.0 changes Created: 27/Sep/13  Updated: 11/Feb/14  Resolved: 11/Feb/14

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.2
Fix Version/s: 7.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   

The Expression Language chapter includes some new features of EL 3.0, but still contains some obsolete language. I have committed some changes based on a first review, but there may be more to come.



 Comments   
Comment by Kim Haase [ 11/Feb/14 ]

Fixes completed.





[JAVAEETUTORIAL-261] dukes-boookstore example, wrong description in bookdetails.html Created: 11/Feb/14  Updated: 11/Feb/14  Resolved: 11/Feb/14

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.3
Fix Version/s: 7.0.4

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


 Description   

Comment in <h:form> in bookdetails.html should be

<!-- Retrieve the "selected" value placed in the session map by the
CatalogBean.details method. -->

instead of

<!-- Retrieve the "selected" value placed in the session map by the
BookstoreBean.details method. -->



 Comments   
Comment by Kim Haase [ 11/Feb/14 ]

Thanks for your attention to detail! In fact that value is placed in the map by both the BookstoreBean and the CatalogBean, so that the details can be retrieved from either page. We will add that information.

Comment by Kim Haase [ 11/Feb/14 ]

Committed fix at revision 1734.

Comment by Kim Haase [ 11/Feb/14 ]

Fixed in source, will appear in next release.





[JAVAEETUTORIAL-260] Wrong CriteriaQuery.join() examples in the Criteria API documentation Created: 30/Jan/14  Updated: 30/Jan/14  Resolved: 30/Jan/14

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.2
Fix Version/s: 7.0.4

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

Tags: CriteriaQuery, criteria, join

 Description   

There are some examples of CriteriaQuery.join() calls in the Criteria API documentation.
Neither CriteriaQuery nor its superinterface AbstractQuery have a join() method.
These local variables should refer to the root node "pet" instead of the CriteriaQuery "cq".

Occurences in "Using the Criteria API and Metamodel API to Create Basic Typesafe Queries":

"Querying Relationships Using Joins":
Join<Owner, Address> address = cq.join(Pet_.owners).join(Owner_.addresses);

"Ordering Results":
Join<Owner, Address> address = cq.join(Pet_.owners).join(Owner_.address);
Join<Pet, Owner> owner = cq.join(Pet_.owners);



 Comments   
Comment by Kim Haase [ 30/Jan/14 ]

Thank you very much for pointing out these errors. The fixes will appear in the next Tutorial update.

We appreciate your interest in the Tutorial.

Comment by Kim Haase [ 30/Jan/14 ]

Fixed in documentation source.





[JAVAEETUTORIAL-259] Tutorial uses nonexisting command: asadmin command create-resources Created: 28/Jan/14  Updated: 28/Jan/14  Resolved: 28/Jan/14

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.2
Fix Version/s: 7.0.4

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


 Description   

Totorial Java EE 7 chapter 3.3 Creating Resources Administratively
uses: asadmin create-resources glassfish-resources.xml
this command doesn't exist
should use: asadmin add-resources glassfish-resources.xml



 Comments   
Comment by Kim Haase [ 28/Jan/14 ]

Thank you very much for pointing out this error.

Comment by Kim Haase [ 28/Jan/14 ]

Fixed in FrameMaker source.





[JAVAEETUTORIAL-256] Update Tag Libraries Supported by Facelets section Created: 15/Dec/13  Updated: 16/Dec/13  Resolved: 16/Dec/13

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

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


 Description   

Tag Libraries Supported by Facelets section(Under what is facelets?) need to be corrected considering the below points

1. Passthrough by elements and passthrough by attributes tablibrary namespaces respective Prefix and Example column values need to be interchanged each other.

2. Composite tab library need to be added

http://xmlns.jcp.org/jsf/composite

Regards,
Sudheer



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

Thank you very much for pointing out these errors. We will correct them in the next version of the Tutorial.

Comment by Kim Haase [ 16/Dec/13 ]

Fixed in Facelets chapter source.





[JAVAEETUTORIAL-254] Wrong version of beans.xml file in example Created: 22/Oct/13  Updated: 22/Oct/13  Resolved: 22/Oct/13

Status: Closed
Project: javaeetutorial
Component/s: examples
Affects Version/s: 7.0.2
Fix Version/s: 7.0.3

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   

For the encoder example in Section 26.1 of "Running the Advanced Contexts and Dependency Injection Examples," the instructions tell the user to run the example, then edit the beans.xml file and rerun the example. The version checked into the workspace is actually the edited version (I forgot to return it to the original state after testing), so the current instructions will confuse users.



 Comments   
Comment by Kim Haase [ 22/Oct/13 ]

Committed fixed version at revision 1675.

Am also correcting some instructions in the advanced CDI examples chapter to make them consistent with the ones in the simple CDI examples 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-251] Parts after 3 are incorrectly numbered Created: 23/Sep/13  Updated: 23/Sep/13  Resolved: 23/Sep/13

Status: Resolved
Project: javaeetutorial
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.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   

After Part IV, Bean Validation, all the other parts have incorrect numbers in the text, though their titles are correct. Part IV doesn't actually say "Part IV" on it.



 Comments   
Comment by Kim Haase [ 23/Sep/13 ]

Renumbered parts.





[JAVAEETUTORIAL-246] Duke's Forest: order list not updated in admin interface after Approve Shipment process Created: 19/Sep/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: Bug Priority: Minor
Reporter: Kim Haase Assignee: William Markito
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Both Firefox and Chrome on Windows 7; Firefox on Solaris



 Description   

If I return to Duke's Store as admin after approving the shipment of a couple of items, and then click on List of Orders, the list is exactly the same as when I left it. The orders that shipped are still marked "Ready to ship". When I click View on an individual item, the status on that page is the same.

When I log in as the user who placed the orders, they are indeed shown as "Order shipped". And when I log out again and log in again as the admin, the orders are also shown as "Order shipped". It's only immediately after the status change that the incorrect status appears.

One wrinkle: If as the admin I deny a shipment, and then return to the list as admin, the status seems to have changed from "Ready to ship" to "Validating payment". This was the second item the user purchased, not the first, so this isn't the previous problem with the first order being perpetually in a "Validating payment" state (though that did happen the first time I tried using Chrome for Duke's Forest).



 Comments   
Comment by Kim Haase [ 19/Sep/13 ]

This may have to do with cached data in the browser – but telling them to clean their browser before they return to Store from Shipment seems a bit much.

Comment by Ian Evans [ 19/Sep/13 ]

Assigning to William.

Comment by Ian Evans [ 19/Sep/13 ]

Ricardo has checked in a fix for this.





[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-174] Use try-with-resources (possibly other JDK 7 features) where we can Created: 06/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: Sub-task Priority: Minor
Reporter: Kim Haase Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

NB provides a hint when it would be useful to wrap code in a try-with-resources block. GreetingServlet.java (in hello2) should implement this fix for the PrintWriter that it uses. Other older examples may need such fixes too.



 Comments   
Comment by jendrock [ 06/Jun/13 ]

Fixed GreetingServlet.java (in web/servlet/hello2), and MoodServlet.java (in web/servlet/mood).

Comment by Ian Evans [ 24/Jun/13 ]

See the following tech note:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html

Comment by rcervera [ 05/Sep/13 ]

Fixed in the connector examples.

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-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-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-247] Shrub is the only viewable/editable product in the admin interface Created: 19/Sep/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.4

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


 Description   

After logging in as admin, click List of Products. Then try to view or edit any product other than the first one (Shrub).

Clicking on any other product (rosebush, green tea, etc.) always brings up the entry for Shrub.

Ian asks, "Is ProductManager not retrieving the correct row index?"



 Comments   
Comment by rcervera [ 19/Sep/13 ]

This issue is now fixed in the source.





[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-245] Validation error message for malformed password can't be found (Duke's Forest) Created: 18/Sep/13  Updated: 19/Sep/13  Resolved: 18/Sep/13

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

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

Attachments: JPEG File password.jpg    

 Description   

If I try to sign up as a new user and enter "1234" as the password, I get an error message that says just "

{person.password}

", indicating that the error message can't be found. I think this means that validation messages have to stay in dukes-store and can't be moved to dukes-resources after all?

Image attached.



 Comments   
Comment by rcervera [ 18/Sep/13 ]

This is now fixed in the source. The ValidationMessages had to be moved one level up in dukes-resources.

Comment by Kim Haase [ 19/Sep/13 ]

Thanks, Ricardo, for fixing this! I can confirm that the validation message now appears:

Password must be between 7 and 100 characters and not empty.





[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-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.





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-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.





[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-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-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-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-243] CDI Part needs to be moved forward in the book Created: 05/Sep/13  Updated: 06/Sep/13  Due: 13/Sep/13  Resolved: 06/Sep/13

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

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


 Description   

Need to reorganize the structure in the beginning of the tutorial. The CDI part needs to be moved to between Part III, Web Tier, and Part IV, Web Services.



 Comments   
Comment by Kim Haase [ 06/Sep/13 ]

Moved CDI part/chapters and updated book. This means all files changed, so if you were working on anything please move it to a safe place before doing an svn update.

Also took advantage of the opportunity to fix some capitalization inconsistencies in figure and table titles (and column titles in tables).

Comment by Kim Haase [ 06/Sep/13 ]

Reopen for edit





[JAVAEETUTORIAL-242] Section of Ajax chapter belongs elsewhere Created: 05/Sep/13  Updated: 05/Sep/13  Resolved: 05/Sep/13

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.2
Fix Version/s: 7.0.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 section "Partial Processing and Partial Rendering" in the Ajax chapter really belongs in the chapter that contains the lifecycle information. I am moving it to a level 1 section after "The Lifecycle of a JavaServer Faces Application." I fixed the chapter jumplists too. I cannot find any broken xrefs that I haven't fixed, but that doesn't mean there aren't any.



 Comments   
Comment by Kim Haase [ 05/Sep/13 ]

Committed fix.





[JAVAEETUTORIAL-240] dukes-forest: Payment web service does not work Created: 28/Aug/13  Updated: 29/Aug/13  Resolved: 29/Aug/13

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

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


 Description   

The payment web service does not work in the current state of the application. Follow these steps to reproduce the issue:

1. Start Glassfish Server

2. Build and deploy the application:
(this enables principal-to-role mapping and creates the required resources)
mvn install

3. Open a web browser:
http://localhost:8080/dukes-store/

4. Register as a new user

5. Log in as the new user
The log is successful on the page, but you get the following error message on the log:
SEVERE: SEC1111: Cannot load group for JDBC realm user [ricardo@gmail.com].

6. Add some products to the cart

7. Check out
You get the following errors on the log:


WARNING: Following exception was thrown:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[...]
Caused by: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://RCERVERA-LAP:8080/dukes-store/PaymentService/__container$publishing$subctx/null?WSDL. It failed with:
Server returned HTTP response code: 502 for URL: http://RCERVERA-LAP:8080/dukes-store/PaymentService/__container$publishing$subctx/null?WSDL.
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:249)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:230)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:193)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:162)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:359)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:321)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:230)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:212)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:208)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
at javax.xml.ws.Service.<init>(Service.java:92)
at services.payment.forest.com.PaymentService.<init>(PaymentService.java:58)
... 36 more
Caused by: java.io.IOException: Server returned HTTP response code: 502 for URL: http://RCERVERA-LAP:8080/dukes-store/PaymentService/__container$publishing$subctx/null?WSDL
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
at java.net.URL.openStream(URL.java:1037)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:983)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:384)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:215)
... 46 more

SEVERE: EJB5070: Exception creating stateless session bean : [PaymentHandler]
WARNING: EJB5184:A system exception occurred ...


Possible cause: the JDBC realm is not working properly.
Possible line of investigation: New Password Encryption Algorithm field that we are not specifying. See the last comment on the following link:
http://stackoverflow.com/questions/12067410/glassfish-3-1-2-jdbcrealm-configuration

(digestrealm-password-enc-algorithm property if we want to add it in glassfish-resources.xml)



 Comments   
Comment by rcervera [ 29/Aug/13 ]

The payment web service works properly. The problem was the proxy configuration in GlassFish. Remove the http.proxyHost and http.proxyPort properties from your server, then the payment works fine.

We made changes to the installation process. Verify as follows:

1. Remove any previous authentication realms:
asadmin delete-auth-realm jdbcRealm

2. Configure resources and realms on dukes-forest/
mvn exec:exec

3. Build and deploy the application:
mvn install

4. Test normally and look at the server log. Payments less than $1000 are processed.





[JAVAEETUTORIAL-239] Refer to JAVA SE 7 security pages instead of SE 6 Created: 28/Aug/13  Updated: 28/Aug/13  Resolved: 28/Aug/13

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

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

N/A



 Description   

At the end of paragraph 44.2.1 the following sentence is found:
"For more information on Java SE security, visit http://docs.oracle.com/javase/6/docs/technotes/guides/security/."

The link should be updated to Java SE 7:

http://docs.oracle.com/javase/7/docs/technotes/guides/security/



 Comments   
Comment by jendrock [ 28/Aug/13 ]

Fixed in source. Fix will appear in the bundle when update 7.0.3 is pushed to the Update center and will appear online when the next update is pushed out.

Thank you, @DLambers, for noticing the error and for filing the issue.





[JAVAEETUTORIAL-238] NullPoint error in chapter 8.5 Composite Components example code. Created: 26/Aug/13  Updated: 26/Aug/13  Resolved: 26/Aug/13

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

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

Java EE 7
GlasshFish 4.0


Issue Links:
Duplicate
duplicates JAVASERVERFACES_SPEC_PUBLIC-1213 f:viewParam doesn't work when using x... Resolved

 Description   

I am reading The Java EE 7 Tutorial from http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets005.htm#GIQZR

After I typed the example code in the chapter 8.5 Composite Components in my IDE and run the example on GlassFish4.0, I got an error.

java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1078)
at com.sun.faces.util.Cache.get(Cache.java:116)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.getComponentMetadata(FaceletViewHandlingStrategy.java:237)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:951)
at javax.faces.application.ApplicationWrapper.createComponent(ApplicationWrapper.java:648)

Then I check the older version of this tutorial, I found a difference in email.xhtml code. The namespace has been changed from Java EE 7. After I changed the namespace back to JavaEE 6 version, it works.

Java EE 7

xmlns:composite="http://xmlns.jcp.org/jsf/composite"

Java EE 6

xmlns:composite="http://java.sun.com/jsf/composite"



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

Duplicate of JAVASERVERFACES_SPEC_PUBLIC-1213.

Comment by Kim Haase [ 26/Aug/13 ]

I believe this is essentially a duplicate of https://java.net/jira/browse/JAVASERVERFACES-2868 (of which https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1213 is also a duplicate, I believe). Several components do not work correctly with the new xmlns.jcp.org namespace at the first release of JSF 2.2. The fix for this problem will be in the next released version of JSF 2.2.x.

We document the namespaces the way they are supposed to work, rather than document the incorrect behavior. The facelets pages for the tutorial examples that use composite components (and a few other components) use the java.sun.com namespace so that the examples will run.





[JAVAEETUTORIAL-176] Sample code lines should be shorter whenever possible to avoid line-wrapping in the HTML output Created: 06/Jun/13  Updated: 21/Aug/13  Resolved: 21/Aug/13

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

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

Tags: examples, html

 Description   

The HTML output seems to fit around 70 characters in one line for code examples. Line wrapping with CSS has been a great improvement, but the code is still difficult to read when it has more than a few long lines.



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

Fixed bad breaks in jsf-advanced-cc.fm.

Comment by Kim Haase [ 03/Jul/13 ]

Bad break in usingexamples.fm (Section 2.9.2.1) fixed as a result of JAVAEETUTORIAL-210.

Comment by Kim Haase [ 03/Jul/13 ]

webapp.fm: Fixed bad break in web.xml servlet-class subelement; also fixed in hello1 example trunk and branch files. Fixed two bad breaks in GreetingServlet.java; also fixed in hello2 example trunk and branch files.

Comment by Kim Haase [ 03/Jul/13 ]

jsf-intro.fm: fixed bad line breaks.

jsf-facelets.fm: fixed bad line breaks in Frame file as well as in guessnumber-jsf and reservation example files (trunk and branch).

Comment by Kim Haase [ 03/Jul/13 ]

jsf-el.fm: Fixed duplicated item (and bad line break) in Table 9-2.

jsf-page.fm: Fixed bad line breaks, and some table formatting as well.

Comment by Kim Haase [ 03/Jul/13 ]

jsf-develop.fm: Fixed bad line break, table formatting.

jsf-custom.fm: Fixed bad line breaks. Experimented with specifying "wide" as role for informal example. Fixed jsf-config.xml to reduce line lengths.

Comment by Kim Haase [ 03/Jul/13 ]

jsf-configure.fm: Fixed bad line breaks.

Comment by Kim Haase [ 03/Jul/13 ]

jms-concepts.fm, jms-examples.fm: fixed bad line breaks (also in producer, shareddurablesubscribererexample, websimplemessage examples).

Comment by Kim Haase [ 09/Aug/13 ]

Now that the font for code examples is smaller, we can probably go back to having lines that are as long as the FrameMaker source will allow.

Comment by rcervera [ 09/Aug/13 ]

Kim, should we close this issue then?

Comment by Kim Haase [ 09/Aug/13 ]

Hm! Yes, maybe that's the best choice. We'd have to retitle it to something like "Code lines should fit on a FrameMaker line", which seems like a no-brainer.

It is unfortunate that our nightly RSB builds don't use the new stylesheets, so we can't test our fixes. I wonder if they could be changed to use them?

Comment by Kim Haase [ 21/Aug/13 ]

Now that the nightly builds use the new stylesheets, maybe you could close this issue as "Works as Designed", Ricardo? That seems to be closest to the actual situation. I have reverted my "fixes".

Comment by rcervera [ 21/Aug/13 ]

Works as designed with the new style sheets.





[JAVAEETUTORIAL-237] Fix leftover Solbook conversion errors regarding line breaks Created: 21/Aug/13  Updated: 21/Aug/13  Resolved: 21/Aug/13

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

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   

In four Frame files, the Solbook conversion process replaced line break directives with the word "linebreak" or "preflinebreak" (the name of the directive in Solbook). (There may originally have been more, but we must have caught them before.)

The files are jsf-facelets.fm, jaxrs.fm, persistence-basicexamples.fm, and security-javaee.fm. I just happened to notice one in the Facelets chapter and found the rest by searching for "linebreak" in the tutorial PDF.

I'm checking in fixed versions.



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

Checked in four Frame files.





[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.





[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-235] Title "Java EE 6 Tutorial" is baked into PDF Created: 14/Aug/13  Updated: 14/Aug/13  Resolved: 14/Aug/13

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

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   

An alert reader has pointed out that the title of the Java EE Tutorial that appears in File->Properties in Adobe Reader, or in a browser title tab in some browsers (notably on the Mac), is "The Java EE 6 Tutorial".

This turns out to be something we have to fix in the FrameMaker .book file. The keywords there are also a bit sparse and could use improvement.



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

Checked in fix to book file. The fix will appear in the next update.





[JAVAEETUTORIAL-234] h:selectManyRadio doesn't seem right Created: 11/Aug/13  Updated: 13/Aug/13  Resolved: 13/Aug/13

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

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


 Description   

In section 12.2.1.4 the element h:selectManyRadio is mentioned as an example. I do not think this element exists but it would be better to replace it with h:selectManyCheckbox.



 Comments   
Comment by AnnTea [ 11/Aug/13 ]

Sorry, this should not have priority Major. I don't see how (or if) I can change that.

Comment by Kim Haase [ 13/Aug/13 ]

Whew, thanks very much for catching that! That's embarrassing, since selectManyRadio is a contradiction in terms.

I'll change the priority to minor (I think Major is the default) and fix it for the next rev of the Tutorial.

Comment by Kim Haase [ 13/Aug/13 ]

Fixed in documentation source.

Comment by AnnTea [ 13/Aug/13 ]

You are very welcome. I find the tutorial to be a great asset.





[JAVAEETUTORIAL-232] Wrong URL given for guessnumber-jsf Created: 02/Aug/13  Updated: 09/Aug/13  Resolved: 09/Aug/13

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

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   

Section 8.3.3.3, "To Run the guessnumber-jsf Example", gives the URL as

http://localhost:8080/guessnumber

This gives an error 404, however. The URL should be

http://localhost:8080/guessnumber-jsf



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

Fixed in jsf-facelets.fm chapter.





[JAVAEETUTORIAL-228] guessnumber-jsf example: implementation of range differs from descriptions Created: 31/Jul/13  Updated: 09/Aug/13  Resolved: 09/Aug/13

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

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


 Description   

In the guessnumber-jsf example, as described by chapter 8.3, the described functionality is that Duke will pick a random number between 0 and 10, while the implementation will give a random number between 0 and 9.

Changing code line
randomInt = new Integer(randomGR.nextInt(10));
to
randomInt = new Integer(randomGR.nextInt(11));
would make the implementation match the description.

It is a minor issue that has no effect on what the example intends to demonstrate, but still might want to have it aligned.



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

Thanks for catching this. We'll make sure the language fits the implementation.

Comment by Kim Haase [ 09/Aug/13 ]

Updated guessnumber-jsf and guessnumber-cdi examples to generate a random number that includes the maximum value. Also updated the code in the jsf-facelets.fm and cdi-basicexamples.fm chapters.





[JAVAEETUTORIAL-20] Advanced Composite Components chapter has error, needs enhancement Created: 20/Apr/11  Updated: 01/Aug/13  Resolved: 01/Aug/13

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.6
Fix Version/s: 7.0.2

Type: Bug Priority: Major
Reporter: jendrock 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



 Description   

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

Error:
I think there is a mistake in chapter 13 of the Java EE 6 Tutorial (Advanced Composite Components), within the fourth section of that chapter (The compositecomponentlogin Example Application), in the first subsection of that section (The Composite Component File): I think there is a composite:attribute clause missing (<composite:attribute name="myloginBean" required="true"/>, or something like that).

Enhancement:
Moreover, from my point of view the contents of the next subsection (The Using Page) would be clearer if the subsection The Composite Component File of Chapter 13 started saying something like "The composite component file is an XHTML file called LoginPanel.xhtml." and a reference was added to the Composite Components section of Chapter 5 (Introduction to Facelets), where the use of Facelet libraries and prefixes for composite components is introduced.



 Comments   
Comment by jendrock [ 27/Apr/11 ]

Removed name of user who reported the issue.

Comment by jendrock [ 05/Feb/13 ]

The "error" was fixed quite some time ago. The required="true" portion is not included, as I believe it is the default. The verbiage requested in the "enhancement" section was included as well.

The cross reference back to the Composite Components section in the Introduction to Facelets chapter would be helpful. We'll add that in for the 7.0.0 release.

Comment by Ian Evans [ 24/Jun/13 ]

Reassigning Chinmayee's issues.

Comment by jendrock [ 01/Aug/13 ]

We will defer this fix until the next update, just prior to JavaOne. For that release, we are looking at replacing the compositecomponentlogin example with a more appropriate example.

Comment by Kim Haase [ 01/Aug/13 ]

Actually, there is a cross-reference to the Facelets chapter intro to composite components, right at the beginning of he Advanced Composite Components chapter. I don't think another one is needed.

So I think this issue can be closed now.

Comment by jendrock [ 01/Aug/13 ]

Actually, Kim is right. I will close the issue and open a new issue for replacing the compositecomponentlogin example with a more appropriate composite component example.





[JAVAEETUTORIAL-64] Consider adding instructions on how to package a custom component in its own JAR file for re-use Created: 07/Mar/12  Updated: 01/Aug/13  Resolved: 01/Aug/13

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 6.0.7-2
Fix Version/s: None

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


 Comments   
Comment by Kim Haase [ 08/Mar/12 ]

Thanks for this suggestion. Would a custom component be packaged as a set of utility classes as in dukes-tutoring/dukes-tutoring-common? We could consider breaking out the custom component of dukes-bookstore this way, in the future.

Comment by Kim Haase [ 08/Mar/12 ]

Assigning to doc component, but may also involve an examples change.

Comment by Ian Evans [ 08/Mar/12 ]

The packaging would be similar to dukes-forest/dukes-resources and dukes-tutoring-common.

dukes-resources shows how to package composite components/images/CSS in a separate JAR file. Do we document how dukes-resources is packaged?

If Forest used custom components (i.e. components implemented as Java classes) they'd be packaged like this:
src/java/com/forest/web/CustomComponentName.java

Comment by Kim Haase [ 08/Mar/12 ]

dukes-resources uses the structure described (briefly) in http://docs.oracle.com/javaee/6/tutorial/doc/girgm.html and http://docs.oracle.com/javaee/6/tutorial/doc/glnrj.html#glwkw.

dukes-tutoring-common contains the entities as well as some utility classes and messages (one of which, DigestUtil, does not seem to be mentioned in the chapter).

Separating out the dukes-bookstore custom components would I think involve moving the components, model, renderers, and taglib into a separate jar (probably not the listeners, though). These are in several different packages.

Comment by Ian Evans [ 08/Mar/12 ]

DigestUtil is something of an orphan right now. Storing passwords clear in the database isn't a good idea, but getting digest auth to work isn't trivial. So I punted, for now, and DigestUtil should probably be removed until I figure it out.

The concept of a utility JAR isn't that complicated, so I don't know if we need to refactor dukes-bookstore for this.

Comment by Kim Haase [ 13/Feb/13 ]

If Manfred can point to some information on packaging custom components, I will attempt to provide this information for 7.0. Otherwise, I will close this as Won't Fix.

Comment by Manfred Riem [ 13/Feb/13 ]

See http://weblogs.java.net/blog/mriem/archive/2012/10/05/packaging-your-jsf-converter

Comment by Kim Haase [ 13/Feb/13 ]

Your example of a converter does not show the use of annotations. Do they change anything? We annotate the source code with @FacesComponent instead of declaring it in faces-config. Is faces-config necessary if you use annotations?

Also, for a component, what else would you need to package? The components, model, renderers, and taglib?

Comment by Kim Haase [ 01/Aug/13 ]

Closing, since I haven't received sufficient information on how to do this.





[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-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-211] Servlet chapter references old Java SE book Created: 03/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: Kim Haase Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

At the end of http://docs.oracle.com/javaee/7/tutorial/doc/servlets003.htm#BNAFS is a reference to "The Java Tutorial, Fourth Edition, by Sharon Zakhour et al. (Addison-Wesley, 2006)." Since there's a link to the online tutorial section anyway, I think this can just be cut.



 Comments   
Comment by jendrock [ 30/Jul/13 ]

Fixed in source. Will appear in update.





[JAVAEETUTORIAL-215] Update Faces Flows example to use appropriate naming conventions Created: 10/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

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

Type: Improvement 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   

Ed Burns (the JavaServer Faces spec lead) wrote an article for the German Oracle users website recommending some naming conventions for Faces Flows applications. The example in the tutorial should be modified to use these.



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

Created new example (simple-flow) to illustrate points made in Ed's article, and updated jsf-configure chapter.





[JAVAEETUTORIAL-186] Make sure "jump lists" are correct Created: 10/Jun/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Closed
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: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Now that we have to manually update the "jump list" at the beginning of each chapter when we add a section, there is at least one mismatch – section 2.7 is not in the jump list at the beginning of Chapter 2. There may be more. This is a placeholder for all such fixes.



 Comments   
Comment by jendrock [ 20/Jun/13 ]

Fixed in source. Will go into update for 7.0.1.

Comment by Kim Haase [ 30/Jul/13 ]

Fixed again for 7.0.2.





[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
Original Estimate: Not Specified
Environment:

http://docs.oracle.com/javaee/7/tutorial/doc/concurrency-utilities002.htm



 Description   

In section 53.2 the description in the bullet point for ManagedThreadFactory is mostly in monospace font.



 Comments   
Comment by jendrock [ 30/Jul/13 ]

Fixed in source. Will appear in the next update.





[JAVAEETUTORIAL-213] Create a simple inbound connector example Created: 10/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: None
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


 Description   

The mailconnector example, while very complete, is very complex and mixes two use cases (inbound vs. outbound) that are better understood separately. JCA would be easier to explain and understand with a basic outbound example and a basic inbound example.

This issue represents creating a basic inbound example.



 Comments   
Comment by rcervera [ 30/Jul/13 ]

The example is now available under connectors/inboundconnector and is also described in the Connector Examples chapter.





[JAVAEETUTORIAL-212] Create a simple outbound connector example Created: 10/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: None
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


 Description   

The mailconnector example, while very complete, is very complex and mixes two use cases (inbound vs. outbound) that are better understood separately. JCA would be easier to explain and understand with a basic outbound example and a basic inbound example.

This issue represents creating a basic outbound example.



 Comments   
Comment by rcervera [ 30/Jul/13 ]

The example is now available under connectors/outboundconnector and is also described in the Connector Examples chapter.





[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-222] Section 'Declaring Welcome Files' would be better placed in 'Configuring' than in 'Example' Created: 29/Jul/13  Updated: 29/Jul/13  Resolved: 29/Jul/13

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

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


 Description   

Section "6.4.4 Declaring Welcome Files" seems misplaced inside Chapter "6.4 The hello2 Example".
It would be better placed inside Chapter "6.5 Configuring Web Applications"



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

Thanks for noticing this. Not only is it misplaced, but it is outdated and could use some reworking.

Comment by Kim Haase [ 29/Jul/13 ]

Moved welcome files section from 6.4.4 to 6.5.2 and revised it slightly.





[JAVAEETUTORIAL-179] Add some .css to the following examples: jsonpmodel, jsonpstreaming, duketf, dukeetf2, webserverlog, phonebilling, websocketbot Created: 06/Jun/13  Updated: 25/Jul/13  Resolved: 25/Jul/13

Status: Closed
Project: javaeetutorial
Component/s: None
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


 Description   

Add some style to the examples above, since they look a little rough right now with no styling at all.



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

What about making a resource library example for JSF with common CSS files that these examples depend on? That way, we'd have one project to maintain for style and accessibility issues, etc.

Comment by rcervera [ 07/Jun/13 ]

That sounds like a good idea.

Some of these projects do not have JSF pages, just plain HTML and JavaScript. Maybe I should convert them to simple JSF pages for using such a common resource and still use the same JavaScript?

Comment by rcervera [ 25/Jul/13 ]

Ian, I added the default.css from other projects to these projects for the time being.

If we go with a JSF resource library for all projects, I'll modify these. They just did not look good without any style at all.





[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.





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.





[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-221] Character without meaning Created: 19/Jul/13  Updated: 19/Jul/13  Resolved: 19/Jul/13

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

Type: Bug Priority: Major
Reporter: enriquezrene Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

pdf



 Description   

I was reading the book and found in the 54/918 page of pdf in the last paragraph

The tool provider is the company or person who creates development, assembly, and packaging tools used by component providers, s, and deployers

I think that you should remove the letter "s" in last part:

providers, s, and deployers

Is not important but I think that you should remove the character



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

Thanks – this is a duplicate of JAVAEETUTORIAL-216, which is fixed for version 7.0.2.





[JAVAEETUTORIAL-114] create actual examples instead of inviting user to imagine Created: 28/Jun/12  Updated: 19/Jul/13  Resolved: 19/Jul/13

Status: Closed
Project: javaeetutorial
Component/s: doc, examples
Affects Version/s: 6.0.7-5
Fix Version/s: None

Type: Improvement Priority: Minor
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   

This issue is in the "The immediate Attribute" section of the page entitled "Adding Components to a Page Using HTML Tags" at http://docs.oracle.com/javaee/6/tutorial/doc/bnarf.html. The third paragraph in this section starts with "Assume that you have a page with a button and a field for entering the quantity of a book in a shopping cart." Why are we assuming here? This is a tutorial, so have readers open an existing example of this scenario or code it up and see what happens. This also relates to other feedback on the sequencing of describing how immediate works without describing the ordinary request lifecycle. The user doesn't yet have the context to imagine what would happen.



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

This is a good suggestion, and we should do something with this section. We have been hoping to add some simpler examples along with the large case study. I'm not absolutely certain that the immediate attribute is the best candidate for such an example, but I'll certainly try.

JAVAEETUTORIAL-88, when fixed, should help provide more lifecycle context at this point.

There's also a subject-verb agreement typo ("occurs" in the 4th paragraph) that should be fixed.

Comment by Kim Haase [ 24/Apr/13 ]

Deferring to an update release later in the year.

Comment by Kim Haase [ 19/Jul/13 ]

Since the lifecycle information is now provided before this chapter, users have the information needed to understand the hypothetical situation presented. The section does describe in detail an example from the case study that provides a more realistic use case.





[JAVAEETUTORIAL-217] Use clearly user-specific names for destinations Created: 12/Jul/13  Updated: 19/Jul/13  Resolved: 19/Jul/13

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

Type: Improvement 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 JMS spec lead suggests that calling the example destinations "Queue" and "Topic" is "a bit confusing as the reader doesn't know whether this choice of name is significant. I prefer a name like "MyQueue".

I will make this change.



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

Fixed in documentation and examples.





[JAVAEETUTORIAL-171] Add info on JMS resource-definition annotations and use in some examples Created: 05/Jun/13  Updated: 19/Jul/13  Resolved: 19/Jul/13

Status: Closed
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: Kim Haase
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Nigel Deakin (JMS spec lead) pointed out that Java EE 7 supports two new annotations that need to be documented. These allow resources to be configured by the developer rather than the administrator. They should also be used in some of the JMS examples.

Examples:

@JMSDestinationDefinition(
name = "java:global/jms/tutorialQueue",
description = "Queue to use in tutorial",
interfaceName = "javax.jms.Queue"
destinationName = "MyQueueForTutorial"
)

@JMSConnectionFactoryDefinition(
name="java:global/jms/tutorialConnectionFactory",
description="ConnectionFactory to use in tutorial"
)



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

After some experimentation (the namespace seems to be java:app rather than java:global), I was able to use @JMSDestinationDefinition in two examples and to describe the annotation feature in the tutorial.

Comment by Kim Haase [ 12/Jul/13 ]

Committed doc and example fixes.

Comment by Kim Haase [ 17/Jul/13 ]

There's still more work to do, based on comments from Nigel on the fixed examples.

Comment by Kim Haase [ 19/Jul/13 ]

Committed fixes for both docs and examples.





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-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-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-216] Missing name of the role assembling Java EE components Created: 12/Jul/13  Updated: 12/Jul/13  Resolved: 12/Jul/13

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

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


 Description   

The name of the role assembling Java EE components is missing from the text (as if it was replaced with blank in a search&replace operation).

Seen in:
Chapter 1.7 introduction text
Chapter 1.7.4 header
Chapter 1.4.7 text
(possibly more)



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

Thank you very much for catching this error. I'm sure you are right about how it happened. We will fix it.

Comment by Kim Haase [ 12/Jul/13 ]

Found and fixed several occurrences in Chapter 1 and single occurrences in Chapters 26 (ejb-intro), 46 (security-javaee) and 49 (resources), by finding all occurrences of "assembler" in the EE 6 Tutorial and inserting the missing work in the EE 7 chapter. If anyone added any new text for EE 7 containing this word, though, I haven't found it.





[JAVAEETUTORIAL-168] Revise 3 advanced JMS examples to use multiple app clients instead of a single multithreaded one Created: 05/Jun/13  Updated: 11/Jul/13  Resolved: 11/Jul/13

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

Type: Task 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 durable subscription, acknowledgement mode, and local transactions examples use a single multithreaded program to demonstrate the associated features. The JMS spec lead suggests in his review that these will be easier for users to understand if the various classes are broken into separate source files and run separately. The fix should go into the July or September update depending on how difficult it is to do.



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

Fixed in code and chapters.





[JAVAEETUTORIAL-205] Content of Java EE 7 Tutorial PDF file does not match contents of Java EE 7 Tutorial HTML files Created: 28/Jun/13  Updated: 10/Jul/13  Resolved: 10/Jul/13

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

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


 Description   

A user reports that http://docs.oracle.com/javaee/7/tutorial/doc/javaeetutorial7.pdf is not as up to date as its HTML counterpart.

The first difference can easily be seen on this page : http://docs.oracle.com/javaee/7/tutorial/doc/overview001.htm#GIQVH and its pdf counterpart.

To match the HTML docs that are in the latest IPS package in the Update Center, the online HTML files for the Java EE 7 Tutorial were updated and pushed out. The individual that pushed the HTML files out, however, did not have ownership of the PDF file, nor was he in the correct group, nor were the permissions set in such a manner that he was able to effect any changes, so this matter will have to rest as is until the original owner returns from vacation and either resets the file so it can be updated or updates the file from the doc directory in the branches/javaeetutorial-7.0.1 repository herself.



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

The correct PDF is now provided on the docs.oracle.com site.





[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-206] Improve information about JSF API reference details Created: 01/Jul/13  Updated: 03/Jul/13  Resolved: 02/Jul/13

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

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   

A user has pointed out that it is not clear in Section 10.2 where to find information about the tags and attributes described there. Links to this information should be added to this section.



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

Checked in fix to section 10.2.





[JAVAEETUTORIAL-209] Tables need to use HRuleFormal role Created: 02/Jul/13  Updated: 03/Jul/13  Resolved: 02/Jul/13

Status: Closed
Project: javaeetutorial
Component/s: None
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

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   

I seem to have used the default (I think) "Formal" role when creating some new tables in JSF and JMS chapters, instead of the correct "HRuleFormal" role. I am fixing any I find in my chapters and will note any I find in others. They all look the same in PDF, but in HTML the Formal ones have shaded contents while the HRuleFormal ones don't.



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

Nope, I'm the only idiot. Fixed table roles in JMS Examples and Facelets chapters.





[JAVAEETUTORIAL-210] Debug options need correcting Created: 02/Jul/13  Updated: 03/Jul/13  Resolved: 02/Jul/13

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

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   

In the section "Using a Debugger" (http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples009.htm#BNADN), two default debug options are shown, with a bad line break:

-Xdebug -
Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009

I thought I'd better check on them before fixing the line break (JAVAEETUTORIAL-176).

Neither option actually appears in the Debug Options field currently. What does appear is

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9009

Do others see this too? I will make the correction if someone confirms the change.



 Comments   
Comment by jendrock [ 02/Jul/13 ]

I also see this for the Debug Options field:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9009

Please feel free to make the correction.

Comment by Kim Haase [ 02/Jul/13 ]

Thanks, Eric. I've made the fix.





[JAVAEETUTORIAL-204] Broken links in the Java EE 7 Tutorial Created: 28/Jun/13  Updated: 02/Jul/13  Resolved: 02/Jul/13

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

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


 Description   

A user reported that links, such as http://docs.oracle.com/javaee/7/javaserverfaces/2.2/docs/renderkitdocs/, in http://docs.oracle.com/javaee/7/tutorial/doc/jsf-page001.htm
are not working.

After rerunning LinkChecker 8.4, the following links have been found to be broken (HTTP 404 error):

In http://docs.oracle.com/javaee/7/tutorial/doc/jsf-ajax013.htm, https://javaserverfaces.java.net/nonav/docs/2.2/jsdocs/symbols/jsf.ajax.html.

In http://docs.oracle.com/javaee/7/tutorial/doc/jsf-configure005.htm#BNAXB, http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt.

In http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets004.htm#GIQXP, http://docs.oracle.com/javaee/7/javaserverfaces/2.2/docs/vdldocs/facelets/.

In http://docs.oracle.com/javaee/7/tutorial/doc/jsf-page001.htm#BNARB, http://docs.oracle.com/javaee/7/javaserverfaces/2.2/docs/renderkitdocs/.

In http://docs.oracle.com/javaee/7/tutorial/doc/preface.htm#GEXAF, https://glassfish.java.net/nonav/docs/v4/api/.

There were two URLs that resulted in a HTTP 301 error (moved permanent) and should be updated:

In http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs004.htm#GILIZ, http://oreilly.com/catalog/9780596529260/ is redirected to http://shop.oreilly.com/product/9780596529260.do

In http://docs.oracle.com/javaee/7/tutorial/doc/jsf-configure002.htm#BNAWP, http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd is redirected to http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-facesconfig_2_2.xsd

There are also several http URLs that are redirected to https URLs and should be updated:

In http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs003.htm#GIPZZ, http://www.netbeans.org/kb/docs/websvc/rest.html is redirected to https://netbeans.org/kb/docs/websvc/rest.html

In http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs003.htm#GIPZZ, http://netbeans.org/kb/docs/websvc/twitter-swing.html is redirected to https://netbeans.org/kb/docs/websvc/twitter-swing.html

In http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets004.htm#GIQXP, http://netbeans.org/kb/docs/web/jsf20-intro.html is redirected to https://netbeans.org/kb/docs/web/jsf20-intro.html

In http://docs.oracle.com/javaee/7/tutorial/doc/preface.htm#GEXAF, http://www.netbeans.org/kb/ is redirected to https://netbeans.org/kb/

In http://docs.oracle.com/javaee/7/tutorial/doc/usingexamples001.htm#GEXAJ, http://www.netbeans.org/downloads/index.html is redirected to https://netbeans.org/downloads/index.html



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

Fixed in doc source (except the jcp.org one, which should be left as is).

Comment by Kim Haase [ 02/Jul/13 ]

Found a bad link that the linkchecker missed, from http://docs.oracle.com/javaee/7/tutorial/doc/jsf-custom008.htm.

Are there more?

Comment by Kim Haase [ 02/Jul/13 ]

Fixed bad link in jsf-custom chapter. Please reopen if more are found.





[JAVAEETUTORIAL-208] Unused JMS example mistakenly included in bundle Created: 02/Jul/13  Updated: 02/Jul/13  Resolved: 02/Jul/13

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

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   

I forgot to remove the webrequestreply example from the workspace, though it was not included in the tutorial examples in the end. I will remove it from the trunk and branch.



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

Removed jms/webrequestreply directories from trunk and 7.0.1 branch at revision 1463.





[JAVAEETUTORIAL-207] Fix application client terminology in JMS chapter(s) Created: 02/Jul/13  Updated: 02/Jul/13  Resolved: 02/Jul/13

Status: Closed
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Kim Haase Assignee: Kim Haase
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A user reports the following issue, which should be addressed:

In chapter 31 of the Java EE 5 Tutorial, in the section "Writing Simple JMS Client Applications", first paragraph,

"This section shows how to create, package, and run simple JMS client programs packaged as stand-alone application clients."

The term "stand-alone application client" is confusing (especially the term "standalone" here), since they are actually Java EE Application Client, using Java EE annotations for resource injection, and are run in a Java EE Application Client container.

This is even more confusing since the rest of the section explains that there are some differences when a JMS client is run in an application server (meaning, as a normal Java Component like a Web component or EJB, I suppose).

Usually the term "standalone" is used for "standalone Java client", which are not run within a container but in a normal JVM.



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

I suddenly noticed that the user raised the issue against the Java EE 5 Tutorial, which is not being updated. We have not used the problematic terminology in the Java EE 6 or 7 tutorials.





[JAVAEETUTORIAL-170] Many links to Java EE 6 API and VDL docs within the Tutorial Created: 05/Jun/13  Updated: 01/Jul/13  Resolved: 01/Jul/13

Status: Closed
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: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The following files have links to the EE 6 API/VDL docs:
ejb-basicexamples004.htm
jaxrs002.htm
jaxrs003.htm
jsf-page-core004.htm



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

Fixed in EJB and JAX-RS chapters.

Comment by Ian Evans [ 05/Jun/13 ]

Reassigning to Kim for JSF fix.

Comment by Kim Haase [ 05/Jun/13 ]

Fixed in JSF chapter.

Comment by Kim Haase [ 05/Jun/13 ]

Ian, did you commit the EJB and JAX-RS chapters? They don't come in when I update.

Comment by Ian Evans [ 05/Jun/13 ]

Source files checked in.

Comment by jendrock [ 01/Jul/13 ]

Update Java SE 6 API doc URLs in webi18n001.htm to Java SE 7 locations.

Comment by jendrock [ 01/Jul/13 ]

Updated Java SE 6 API doc links in webi18n001.htm to Java SE 7 URLs.





[JAVAEETUTORIAL-196] Make the automatic timeout shorter for timersession Created: 21/Jun/13  Updated: 24/Jun/13  Resolved: 24/Jun/13

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

Type: Improvement 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


 Description   

The automatic timeout in ejb/timersession is pretty long. It can be 20 seconds or so.



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

Fixed in source. The new automatic timeout will occur every minute.





[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-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-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: