[JAVAEETUTORIAL-302] JPA Static MetaModel examples COMPLETELY WRONG Created: 19/Nov/15  Updated: 19/Nov/15

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

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


 Description   

See https://docs.oracle.com/javaee/6/tutorial/doc/gjiup.html

It states that you can get the entity metamodel class like this

Metamodel m = em.getMetamodel();
EntityType<Pet> Pet_ = m.entity(Pet.class);

and then do things like

cq.join(Pet_.owners);

This is TOTALLY WRONG. The STATIC (canonical) METAMODEL classes that are to be generated by an annotation processor and used in queries in this way are STATIC. They are NOT the EntityType classes you can get out of the JPA Metamodel. If you have an Entity "Pet" then it will generate a class Pet_ (that does not implement EntityType), and you then refer to the STATIC fields on it in the query.

Read the JPA spec.






[JAVAEETUTORIAL-301] The problem in duke-forest with residual messages/queues JMS Created: 08/Jul/15  Updated: 08/Jul/15

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

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


 Description   

The problem in dukes-forest with residual messages/queues JMS

Solution
Insert following into execution plugin in dukes-store/pom.xml:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>${maven.exec.plugin.version}</version>
    <executions>
        <execution>
            <id>Flush JMS Queues</id>
            <phase>compile</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <skip>false</skip>
                <executable>${glassfish.home}/bin/asadmin${glassfish.executables.suffix}</executable>
                <successCodes>
                    <successCode>0</successCode>
                    <successCode>1</successCode>
                </successCodes>
                <arguments>
                    <argument>flush-jmsdest</argument>
                    <argument>--desttype=queue</argument>
                    <argument>PhysicalOrderQueue</argument>
                </arguments>                 
            </configuration>
        </execution>
        <execution>
            <id>Activate SSO and Default Principal To Role Mapping</id>
            <phase>compile</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <skip>false</skip>
                <executable>${glassfish.home}/bin/asadmin${glassfish.executables.suffix}</executable>
                <arguments>
                    <argument>set</argument>
                    <argument>server.security-service.activate-default-principal-to-role-mapping=true</argument>
                    <argument>server.http-service.sso-enabled=true</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin> 





[JAVAEETUTORIAL-300] The problem in duke-forest with the re-creation/duplication of data after the restart GlassFish 4.1 Created: 08/Jul/15  Updated: 08/Jul/15

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

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


 Description   

The problem in duke-forest with the re-creation / duplication of data after the restart GlassFish 4.1

Solution
In entity project remove from persistence.xml following line:

<property name="javax.persistence.sql-load-script-source" value="META-INF/sql/data.sql" />

Also copy information from data.sql to create.sql (after creating tables commands, of course)






[JAVAEETUTORIAL-299] In duke-forest all registered users (ADMINS and USERS) can get access to the administrative Interface .../dukes-store/admin/ and .../dukes-shipment/admin/ Created: 08/Jul/15  Updated: 08/Jul/15

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

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


 Description   

In duke-forest all registered users (ADMINS and USERS) can get access to the administrative Interface .../dukes-store/admin/ and .../dukes-shipment/admin/

Solution
In entity project, edit pom.xml jdbcRealm's creation section:

<arguments>
    <argument>create-auth-realm</argument>
    <argument>--classname=com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm</argument>
    <argument>--property=jaas-context=jdbcRealm:datasource-jndi=java\:global/ForestDataSource:user-table=forest.PERSON:user-name-column=EMAIL:password-column=PASSWORD:group-table=forest.PERSON_GROUPS:group-table-user-name-column=PERSON_EMAIL:group-name-column=GROUPS_NAME:digest-algorithm=MD5:digestrealm-password-enc-algorithm=MD5:charset=UTF-8:encoding=Hex</argument>
    <argument>jdbcRealm</argument>
</arguments>

Also edit create.sql:

CREATE TABLE "FOREST"."CATEGORY"(ID int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), NAME varchar(45) NOT NULL, TAGS varchar(45))
CREATE UNIQUE INDEX SQL_CATEGORY_ID_INDEX ON "FOREST"."CATEGORY"(ID)
CREATE TABLE "FOREST"."PERSON"(ID int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), FIRSTNAME varchar(50) NOT NULL, LASTNAME varchar(100) NOT NULL, EMAIL varchar(45) NOT NULL UNIQUE, ADDRESS varchar(45) NOT NULL, CITY varchar(45) NOT NULL, PASSWORD varchar(100), DTYPE varchar(31))
CREATE UNIQUE INDEX SQL_PERSON_EMAIL_INDEX ON "FOREST"."PERSON"(EMAIL)
CREATE UNIQUE INDEX SQL_PERSON_ID_INDEX ON "FOREST"."PERSON"(ID)
CREATE TABLE "FOREST"."GROUPS"(ID int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), NAME varchar(45) NOT NULL UNIQUE, DESCRIPTION varchar(300))
CREATE UNIQUE INDEX SQL_GROUPS_NAME_INDEX ON "FOREST"."GROUPS"(NAME)
CREATE TABLE "FOREST"."PERSON_GROUPS"(GROUPS_NAME varchar(45) NOT NULL, PERSON_EMAIL varchar(45) NOT NULL)
ALTER TABLE "FOREST"."PERSON_GROUPS" ADD CONSTRAINT FK_PERSON_GROUPS_GROUPS FOREIGN KEY (GROUPS_NAME) REFERENCES "FOREST"."GROUPS"(NAME)
ALTER TABLE "FOREST"."PERSON_GROUPS" ADD CONSTRAINT FK_PERSON_GROUPS_PERSON FOREIGN KEY (PERSON_EMAIL) REFERENCES "FOREST"."PERSON"(EMAIL)
CREATE INDEX SQL_PERSONGROUPS_EMAIL_INDEX ON "FOREST"."PERSON_GROUPS"(PERSON_EMAIL)
CREATE INDEX SQL_PERSONGROUPS_NAME_INDEX ON "FOREST"."PERSON_GROUPS"(GROUPS_NAME)
CREATE TABLE "FOREST"."ORDER_STATUS"(ID int NOT NULL PRIMARY KEY, STATUS varchar(45) NOT NULL, DESCRIPTION varchar(200))
CREATE UNIQUE INDEX SQL_ORDERSTATUS_ID_INDEX ON "FOREST"."ORDER_STATUS"(ID)
CREATE TABLE "FOREST"."CUSTOMER_ORDER"(ID int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), AMOUNT float(52) NOT NULL, DATE_CREATED timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, CUSTOMER_ID int NOT NULL, STATUS_ID int NOT NULL)
ALTER TABLE "FOREST"."CUSTOMER_ORDER" ADD CONSTRAINT FK_CUSTOMER_ORDER_ORDER_STATUS1 FOREIGN KEY (STATUS_ID) REFERENCES "FOREST"."ORDER_STATUS"(ID)
ALTER TABLE "FOREST"."CUSTOMER_ORDER" ADD CONSTRAINT FK_CUSTOMER_ORDER_CUSTOMER1 FOREIGN KEY (CUSTOMER_ID) REFERENCES "FOREST"."PERSON"(ID)
CREATE INDEX SQL_ORDER_STATUS_ID_INDEX ON "FOREST"."CUSTOMER_ORDER"(STATUS_ID)
CREATE INDEX SQL_ORDER_CUSTOMER_ID_INDEX ON "FOREST"."CUSTOMER_ORDER"(CUSTOMER_ID)
CREATE UNIQUE INDEX SQL_ORDER_ID_INDEX ON "FOREST"."CUSTOMER_ORDER"(ID)
CREATE TABLE "FOREST"."PRODUCT"(ID int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), NAME varchar(10000) NOT NULL, PRICE decimal(10,2) NOT NULL, DESCRIPTION varchar(10000) NOT NULL, IMG varchar(45), CATEGORY_ID int NOT NULL, IMG_SRC blob(1073741823))
ALTER TABLE "FOREST"."PRODUCT" ADD CONSTRAINT FK_PRODUCT_CATEGORY FOREIGN KEY (CATEGORY_ID) REFERENCES "FOREST"."CATEGORY"(ID)
CREATE UNIQUE INDEX SQL_PRODUCT_ID_INDEX ON "FOREST"."PRODUCT"(ID)
CREATE INDEX SQL_PRODUCT_CATEGORY ON "FOREST"."PRODUCT" ("CATEGORY_ID")
CREATE TABLE "FOREST"."ORDER_DETAIL"(ORDER_ID int NOT NULL, PRODUCT_ID int NOT NULL, QTY int NOT NULL, CONSTRAINT SQL_ORDER_PRODUCT_PK PRIMARY KEY (ORDER_ID,PRODUCT_ID))
ALTER TABLE "FOREST"."ORDER_DETAIL" ADD CONSTRAINT FK_ORDER_DETAIL_PRODUCT FOREIGN KEY (PRODUCT_ID) REFERENCES "FOREST"."PRODUCT"(ID)
ALTER TABLE "FOREST"."ORDER_DETAIL" ADD CONSTRAINT FK_ORDER_DETAIL_ORDER FOREIGN KEY (ORDER_ID) REFERENCES "FOREST"."CUSTOMER_ORDER"(ID)
CREATE UNIQUE INDEX SQL_ORDER_DETAIL_INDEX ON "FOREST"."ORDER_DETAIL"(ORDER_ID, PRODUCT_ID)
CREATE INDEX SQL_ORDER_PRODUCT_ID_INDEX ON "FOREST"."ORDER_DETAIL"(PRODUCT_ID)
CREATE INDEX SQL_ORDER_DETAIL_ID_INDEX ON "FOREST"."ORDER_DETAIL"(ORDER_ID)





[JAVAEETUTORIAL-298] Problem with timezone (GMT) in duke-forest Created: 08/Jul/15  Updated: 08/Jul/15

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

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


 Description   

Problem with timezone in duke-forest (GMT). In my case, Moscow time (GMT +3) not displayed correctly.

Solution
Add to each web.xml following:

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





[JAVAEETUTORIAL-297] Problem with create and update admin from admin's interface in duke-forest Created: 08/Jul/15  Updated: 08/Jul/15

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

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


 Description   

Problem with create and update admin from admin's interface in duke-forest. Also i think remove last admin ability not good idea.

Solution
AdministratorBean.java and AdministratorController.java should look like this:

/**
 * 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
 */
package com.forest.ejb;

import com.forest.entity.Administrator;
import com.forest.entity.Groups;
import com.forest.entity.Person;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author ievans
 */
@Stateless
public class AdministratorBean extends AbstractFacade<Administrator> {
    @PersistenceContext(unitName = "forestPU")
    private EntityManager em;

    private boolean lastAdministrator;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public Person getAdministratorByEmail(String email) {
        Query createNamedQuery = getEntityManager().createNamedQuery("Person.findByEmail");

        createNamedQuery.setParameter("email", email);

        if (createNamedQuery.getResultList().size() > 0) {
            return (Person) createNamedQuery.getSingleResult();
        } else {
            return null;
        }
    }

    public AdministratorBean() {
        super(Administrator.class);
    }

    @Override
    public void create(Administrator admin) {
        Groups adminGroup = (Groups) em.createNamedQuery("Groups.findByName")
                .setParameter("name", "ADMINS")
                .getSingleResult();
        admin.getGroupsList().add(adminGroup);
        adminGroup.getPersonList().add(admin);
        em.persist(admin);
        em.merge(adminGroup);
    }

    public boolean isLastAdmimistrator() {
        return lastAdministrator;
    }

    @Override
    public void remove(Administrator admin) {
        Groups adminGroup = (Groups) em.createNamedQuery("Groups.findByName")
                .setParameter("name", "ADMINS")
                .getSingleResult();
        if (adminGroup.getPersonList().size() > 1) {
            adminGroup.getPersonList().remove(admin);
            em.remove(em.merge(admin));
            em.merge(adminGroup);
            lastAdministrator = false;
        } else {
            lastAdministrator = true;
        }
    }

}
/**
 * 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
 */
package com.forest.web;

import com.forest.ejb.AdministratorBean;
import com.forest.entity.Administrator;
import com.forest.entity.Person;
import com.forest.web.util.AbstractPaginationHelper;
import com.forest.web.util.JsfUtil;
import com.forest.web.util.PageNavigation;
import java.io.Serializable;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import javax.faces.model.SelectItem;
import javax.inject.Named;
import com.forest.web.util.MD5Util;

@Named(value = "administratorController")
@SessionScoped
public class AdministratorController implements Serializable {

    private static final String BUNDLE = "bundles.Bundle";
    private static final long serialVersionUID = -2691147357609941284L;

    private Administrator current;
    private DataModel items = null;
    @EJB
    private com.forest.ejb.AdministratorBean ejbFacade;

    private static final Logger logger = Logger.getLogger(CustomerController.class.getCanonicalName());

    private AbstractPaginationHelper pagination;
    private int selectedItemIndex;

    public AdministratorController() {
    }

    public Administrator getSelected() {
        if (current == null) {
            current = new Administrator();
            selectedItemIndex = -1;
        }
        return current;
    }

    private AdministratorBean getFacade() {
        return ejbFacade;
    }

    public AbstractPaginationHelper getPagination() {
        if (pagination == null) {
            pagination = new AbstractPaginationHelper(10) {

                @Override
                public int getItemsCount() {
                    return getFacade().count();
                }

                @Override
                public DataModel createPageDataModel() {
                    return new ListDataModel(getFacade().findRange(new int[]{getPageFirstItem(), getPageFirstItem() + getPageSize()}));
                }
            };
        }
        return pagination;
    }

    public PageNavigation prepareList() {
        recreateModel();
        return PageNavigation.LIST;
    }

    public PageNavigation prepareView() {
        current = (Administrator) getItems().getRowData();
        selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
        return PageNavigation.VIEW;
    }

    private boolean isAdministratorDuplicated(Person p) {
        return (getFacade().getAdministratorByEmail(p.getEmail()) != null);
    }

    public PageNavigation prepareCreate() {
        current = new Administrator();
        selectedItemIndex = -1;
        return PageNavigation.CREATE;
    }

    public PageNavigation create() {
        try {
            if (!isAdministratorDuplicated(current)) {
                current.setPassword(MD5Util.generateMD5(current.getPassword()));
                getFacade().create(current);
                JsfUtil.addSuccessMessage(ResourceBundle.getBundle(BUNDLE).getString("AdministratorCreated"));
                return PageNavigation.VIEW;
            } else {
                JsfUtil.addErrorMessage(ResourceBundle.getBundle(BUNDLE).getString("AdministratorDuplicatedError"));

            }
            return PageNavigation.VIEW;
        } catch (Exception e) {
            JsfUtil.addErrorMessage(e, ResourceBundle.getBundle(BUNDLE).getString("PersistenceErrorOccured"));
            return null;
        }
    }

    public PageNavigation prepareEdit() {
        current = (Administrator) getItems().getRowData();
        selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
        return PageNavigation.EDIT;
    }

    public PageNavigation update() {
        try {
            logger.log(Level.INFO, "Updating administrator ID:{0}", current.getId());
            current.setPassword(MD5Util.generateMD5(current.getPassword()));
            getFacade().edit(current);
            JsfUtil.addSuccessMessage(ResourceBundle.getBundle(BUNDLE).getString("AdministratorUpdated"));
            return PageNavigation.VIEW;
        } catch (Exception e) {
            JsfUtil.addErrorMessage(e, ResourceBundle.getBundle(BUNDLE).getString("PersistenceErrorOccured"));
            return null;
        }
    }

    public PageNavigation destroy() {
        current = (Administrator) getItems().getRowData();
        selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
        performDestroy();
        recreateModel();
        return PageNavigation.LIST;
    }

    public PageNavigation destroyAndView() {
        performDestroy();
        recreateModel();
        updateCurrentItem();
        if (selectedItemIndex >= 0) {
            return PageNavigation.VIEW;
        } else {
            recreateModel();
            return PageNavigation.LIST;
        }
    }

    private void performDestroy() {
        try {
            getFacade().remove(current);
            if (getFacade().isLastAdmimistrator()) {
                JsfUtil.addErrorMessage(ResourceBundle.getBundle(BUNDLE).getString("AdministratorLastNonDelete"));
            } else {
                JsfUtil.addSuccessMessage(ResourceBundle.getBundle(BUNDLE).getString("AdministratorDeleted"));
            }
        } catch (Exception e) {
            JsfUtil.addErrorMessage(e, ResourceBundle.getBundle(BUNDLE).getString("PersistenceErrorOccured"));
        }
    }

    private void updateCurrentItem() {
        int count = getFacade().count();
        if (selectedItemIndex >= count) {
            selectedItemIndex = count - 1;
            if (pagination.getPageFirstItem() >= count) {
                pagination.previousPage();
            }
        }
        if (selectedItemIndex >= 0) {
            current = getFacade().findRange(new int[]{selectedItemIndex, selectedItemIndex + 1}).get(0);
        }
    }

    public DataModel getItems() {
        if (items == null) {
            items = getPagination().createPageDataModel();
        }
        return items;
    }

    private void recreateModel() {
        items = null;
    }

    public PageNavigation next() {
        getPagination().nextPage();
        recreateModel();
        return PageNavigation.LIST;
    }

    public PageNavigation previous() {
        getPagination().previousPage();
        recreateModel();
        return PageNavigation.LIST;
    }

    public SelectItem[] getItemsAvailableSelectMany() {
        return JsfUtil.getSelectItems(ejbFacade.findAll(), false);
    }

    public SelectItem[] getItemsAvailableSelectOne() {
        return JsfUtil.getSelectItems(ejbFacade.findAll(), true);
    }

    @FacesConverter(forClass = Administrator.class)
    public static class AdministratorControllerConverter implements Converter {

        @Override
        public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
            if (value == null || value.length() == 0) {
                return null;
            }
            AdministratorController controller = (AdministratorController) facesContext.getApplication().getELResolver().
                    getValue(facesContext.getELContext(), null, "administratorController");
            return controller.ejbFacade.find(getKey(value));
        }

        java.lang.Integer getKey(String value) {
            java.lang.Integer key;
            key = Integer.valueOf(value);
            return key;
        }

        String getStringKey(java.lang.Integer value) {
            StringBuilder sb = new StringBuilder();
            sb.append(value);
            return sb.toString();
        }

        @Override
        public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
            if (object == null) {
                return null;
            }
            if (object instanceof Administrator) {
                Administrator o = (Administrator) object;
                return getStringKey(o.getId());
            } else {
                throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName() + "; expected type: " + AdministratorController.class.getName());
            }
        }
    }

}





[JAVAEETUTORIAL-296] problem with update client from admin's interface in duke-forest Created: 07/Jul/15  Updated: 07/Jul/15

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

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


 Description   

Problem with update client from admin's interface in duke-forest

Solution
In CustomerController.java's method update() add the following line of code:

current.setPassword(MD5Util.generateMD5(current.getPassword()));





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





Generated at Mon Feb 08 13:38:58 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.