[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-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-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-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-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-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 ));






Generated at Sun Jul 05 18:30:37 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.