Array
(
)

Erro de deploy

NILO SOUZA
   - 13 dez 2010

Colega, sou novo no java e estou fazendo umas videos aulas, o que pega  é que geralmente da erro não sei (ou sabemos) como consertar.
O erro é o seguinte:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at C:\Devmedia\EcommerceDevmedia\build\web
Initializing...
deploy?path=C:\Devmedia\EcommerceDevmedia\build\web&name=EcommerceDevmedia&force=true failed on GlassFish Server 3
C:\Devmedia\EcommerceDevmedia\nbproject\build-impl.xml:684: The module has not been deployed.
BUILD FAILED (total time: 7 seconds)
Alguém poderia me dar uma ajuda de como consertar esse erro?
Obrigado!

Davi Gomes da Costa
   - 14 dez 2010

Cara, contextualiza um pouco mais,
acontece as vezes, ou não está conseguindo levantar a aplicação de jeito nenhum?
As vezes quando alteramos algum código com o servidor do glassfish no ar, ele dá esse tipo de erro.
Basta quando ele acontecer ir sempre dando um clean no projeto.
Att Davi

0
|
0

NILO SOUZA
   - 14 dez 2010

Acontece que quando eu mando rodar a aplicação ao inves de aparecer a mensagem de boas vindas o firefox
aparece essa que te enviei.
Começando do zero, quando mandava rodar de uma mensagem que o glasfish estava com falha, ai troquei para a porta 51399 e o glasfish conectou, mas ao fazer essa segunda parte, deu esse erro e não gerou nenhuma entidade (tabela) no meu schema.

0
|
0

DYEGO SOUZA DO CARMO
   - 27 dez 2010

Cole aqui a saida do console do servidor de aplicação...
esta saida que voce colou é do aplicativo ! preciso saber o que ocorre no servidor (possivelmente a aba do lado)


0
|
0

NILO SOUZA
   - 27 dez 2010

Ola Dyego, 

o erro abaixo esta postado na aula 16 do curso de loja virtual, copiei e colei para vc conforme pediu.

Um abraço



Abaixo o erro do glasfish
19/12/2010 23:50:46 com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Sun Dec 19 23:50:51 BRST 2010
INFO: Starting Grizzly Framework 1.9.18-o - Sun Dec 19 23:50:52 BRST 2010
INFO: Grizzly Framework 1.9.18-o started in: 426ms listening on port 29584
INFO: Grizzly Framework 1.9.18-o started in: 348ms listening on port 29579
INFO: Grizzly Framework 1.9.18-o started in: 391ms listening on port 29540
INFO: Grizzly Framework 1.9.18-o started in: 419ms listening on port 29551
INFO: Grizzly Framework 1.9.18-o started in: 488ms listening on port 29583
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(4781ms) startup services(1604ms) total(6385ms)
INFO: Binding RMI port to *:29589
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Grizzly Framework 1.9.18-o started in: 116ms listening on port 29583
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://Nilo-PC:29589/jndi/rmi://Nilo-PC:29589/jmxrmi
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: Grizzly Framework 1.9.18-o started in: 89ms listening on port 29584
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [EcommerceDevmediaPU] failed.
Internal Exception] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The attribute [sells] in entity class [class br.com.devmedia.entity.CreditCard] has a mappedBy value of [creditcard] which does not exist in its owning entity class [class br.com.devmedia.entity.Sell]. If the owning entity class is a @MappedSuperclass, this is invalid, and your attribute should reference the correct subclass.
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:991)
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:202)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:181)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:96)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.Def

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 02 jan 2011

A anotação mappedSuperClass deve ser usada na superclasse de suas entidades ou de todas as suas entidades do sistema e a classe com a mappedSuperClass não deve ser entidade.Remova a anotação e teste se não funfar poste aqui as classes CreditCard e a Sell que são apontadas pelo stackTrace.Ahh antes que eu esqueça reveja como você as relacionou também.

Att
  Robson Passarella

0
|
0

DYEGO SOUZA DO CARMO
   - 11 jan 2011

Opa !
Resolvido ?

0
|
0

NILO SOUZA
   - 11 jan 2011

Ainda não, acontece o mesmo erro!

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 11 jan 2011

Olá NSouza
  você removeu a anotação MappedSuperClass das suas entidades?? Pois no stackTrace e apontado ela como a causa do erro.
 Verifique também as entidades CreditCard e Sell pois tem algum erro na relação entre elas verifique , corriga  e teste se não funcionar post aqui a CreditCard e Sell.

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 11 jan 2011

Complementando
 
The attribute [sells] in entity class [class
br.com.devmedia.entity.CreditCard] has a mappedBy value of [creditcard]
which does not exist in its owning entity class [class
br.com.devmedia.entity.Sell]. If the owning entity class is a
@MappedSuperclass, this is invalid, and your attribute should reference
the correct subclass.
Att
  Robson Passarella

0
|
0

NILO SOUZA
   - 15 jan 2011

Devido minha falta de experiencie, revi as aulas mas não consegui acertar a classe até tive uma noção do que vc falo sobre o erro, mas desculpe não encontrei. Postei as duas classes, poderia dar uma olhada para mim por favor?

CREDITCARD
package br.com.devmedia.entity;
import br.com.devmedia.entity.Types.FlagType;
import java.io.Serializable;
import java.util.Date;
import java.util.LinkedList;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
/**
 *
 * @author Nilo
 */
@Entity
@Table
public class CreditCard implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column
    @Basic(optional=false)
    private Integer id;
   
    @NotEmpty
    @NotNull
    @Column(nullable=false)
    private String number;
        
    @Temporal(javax.persistence.TemporalType.DATE)
    @Column(nullable=false)
    @NotNull
    private Date dateOfValidation;
   
    @Column(nullable=false)
    @NotNull
    @NotEmpty
    private String nameOfCard;
   
    @Column(nullable=false)
    @Enumerated(EnumType.STRING)
    private FlagType flag;
    @Column(nullable=false)
    @Min(1)
    private int times;
    @JoinColumn(referencedColumnName="id")
    @ManyToOne(optional=false)
    @Valid
    private User userOf;
    @OneToMany(cascade=CascadeType.ALL,mappedBy="creditcard")
    private LinkedList<Sell> sells = new LinkedList<Sell>();
    public int getTimes() {
        return times;
    }
    public void setTimes(int times) {
        this.times = times;
    }
   
   
   
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Date getDateOfValidation() {
        return dateOfValidation;
    }
    public void setDateOfValidation(Date dateOfValidation) {
        this.dateOfValidation = dateOfValidation;
    }
    public FlagType getFlag() {
        return flag;
    }
    public void setFlag(FlagType flag) {
        this.flag = flag;
    }
    public String getNameOfCard() {
        return nameOfCard;
    }
    public void setNameOfCard(String nameOfCard) {
        this.nameOfCard = nameOfCard;
    }
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    public User getUserOf() {
        return userOf;
    }
    public void setUserOf(User userOf) {
        this.userOf = userOf;
    }
    public LinkedList<Sell> getSells() {
        return sells;
    }
    public void setSells(LinkedList<Sell> sells) {
        this.sells = sells;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }
    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CreditCard)) {
            return false;
        }
        CreditCard other = (CreditCard) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }
    @Override
    public String toString() {
        return "br.com.devmedia.entity.CreditCard[id=" + id + "]";
    }
}
package br.com.devmedia.entity;
import br.com.devmedia.entity.Types.StatusSellType;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
 *
 * @author Nilo
 */
@Entity
@Table
public class Sell implements Serializable {
    priv

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 16 jan 2011

Olá NSouza
  
   Olhei as suas classes CreditCard e Sell notei o seguinte na annotation OneToMany o atributo mappedBy deve receber a String com o nome do atributo na classe onde está sendo relacionada, veja abaixo
  // classe CreditCard
    @OneToMany(cascade=CascadeType.ALL,mappedBy="creditcard")
    private LinkedList<Sell> sells = new LinkedList<Sell>();
// classe Sell
    @NotNull
    @JoinColumn(referencedColumnName="id")
    @ManyToOne(optional=false)
    @Valid
    private CreditCard creditCard;
na sua lista sells o atributo mappedBy recebe "creditcard" e o declarado na classe Sell e "creditCard" corrija e diga-nos se funcionou.
 
 att
   robson Passarella Teixeira

0
|
0

NILO SOUZA
   - 17 jan 2011

Caro Robson, acima de tudo quero deixar evidente minha gratidão pela sua atenção.
Corrigi a falha que para mim era um "monstro" deu certo surgiram as mensagens:
BUILD SUCCESSFUL (total time: 1 minute 3 seconds) e no firefox Hello from Facelets
acho que é evidencia de que aquele erro foi resolvido.

No glassfish apareceu a extensa mensagem que nao sei de novo onde esta o erro, mas  pelo que percebi deve ser alguma configuração, abaixo o extenso codigo de erro, por favor gostaria de sua ajuda de novo.
17/01/2011 19:38:21 com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Mon Jan 17 19:38:36 BRST 2011
INFO: Starting Grizzly Framework 1.9.18-o - Mon Jan 17 19:38:36 BRST 2011
INFO: Grizzly Framework 1.9.18-o started in: 483ms listening on port 29540
INFO: Grizzly Framework 1.9.18-o started in: 592ms listening on port 29584
INFO: Grizzly Framework 1.9.18-o started in: 484ms listening on port 29579
INFO: Grizzly Framework 1.9.18-o started in: 562ms listening on port 29551
INFO: Grizzly Framework 1.9.18-o started in: 639ms listening on port 29583
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: SEC1002: Security Manager is OFF.
INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....
INFO: Created HTTP listener http-listener-1 on port 29583
INFO: Created HTTP listener http-listener-2 on port 29584
INFO: Created HTTP listener admin-listener on port 29551
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Virtual server server loaded system default web module
INFO: WS00018: Webservice Endpoint deployed
 NewWebService  listening at address at http://localhost:29583/EcommerceDevmedia/NewWebServiceService
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
WARNING: Element [field sells] within entity class [class br.com.devmedia.entity.CreditCard] uses a collection type [class java.util.LinkedList] when the JPA specification only supports java.util.Collection, java.util.Set, java.util.List, or java.util.Map.  This type is supported with eager loading; using lazy loading with this collection type requires additional configuration and an IndirectContainer implementation that extends [class java.util.LinkedList] or setting the mapping to use basic indirection and the type to be ValueholderInterface.
INFO]
INFO: Loading EJBTimerService. Please wait.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: [TimerBeanContainer] Created  TimerBeanContainer]
INFO: EJB5109:EJB Timer Service started successfully for datasource [jdbc/__TimerPool]
INFO]
INFO: Portable JNDI names for EJB UserSession : [java]
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: EclipseLink, version: Eclipse Persistence Services - 2.0.1.v20100213-r6600
INFO: JTS5014: Recoverable JTS instance, serverId = [100]
INFO: file:/C:/Program Files (x86)/glassfish-3.0.1/glassfish/domains/domain2/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App login successful
INFO: Rescheduling missed expiration for periodic timer '1@@1295100344477@@server@@domain2' 'TimedObject = ProductSession' 'Application = EcommerceDevmedia' 'CREATED' 'PERIODIC' 'Container ID = 84875674143031296' 'Sun Jan 16 00:30:00 BRST 2011' '0' '0 # 30 # 0 # * # * # * # * # null # null # null # true # callTheUserProductAvaliable # 0' . Timer expirations should  have been delivered starting at Sun Jan 16 00:30:00 BRST 2011
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: EclipseLink, version: Eclipse Persistence Services - 2.0.1.v20100213-r6600
SEVERE: RAR5099 : Wrong class name or classpath for Datasource Object
java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:279)
        at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:108)
        at com.sun.gjc.spi.ManagedConnectionFactory.getDataSource(ManagedConnectionFactory.java:1168)
        at com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:135)
        at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnect

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 17 jan 2011

Olá NSouza
  você setou o driver do mysql no classpath de sua applicação??
  é o que se pode entender no stackTrace postado.
  se vc estiver trocando o banco de dados da aplicação que nem os videos do Dyego verifique o sun-resource.xml.
att
  robson Passarella Teixeira

0
|
0

NILO SOUZA
   - 17 jan 2011

Eu gosto de trabalhar com o postgresql não sou fã do mysql.
nesse caso o que devo fazer?

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 17 jan 2011

Olá NSouza
 
   Sete o driver do postGres na sua aplicação e segue 1 modelo do sun-resouces.xml para que a sua aplicação acesse o postgres.Pois nunca lembro as classes para colocar no xml.
  <resources>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false"
    connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10"
    connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
    connection-validation-method="auto-commit" datasource-classname="org.postgresql.ds.PGSimpleDataSource"
    fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false"
    is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false"
    match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000"
    name="ecommerce_postgres" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource"
    statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
        <property name="serverName" value="localhost"/>
        <property name="portNumber" value="5432"/>
        <property name="databaseName" value="ecommerce"/>
        <property name="User" value="postgres"/>
        <property name="Password" value="postgres"/>
        <property name="URL" value="jdbc:postgresql://localhost:5432/ecommerce"/>
        <property name="driverClass" value="org.postgresql.Driver"/>
    </jdbc-connection-pool>
    <jdbc-resource enabled="true" jndi-name="jdbc/ecommerce" object-type="user"
    pool-name="ecommerce_postgres"/>
</resources>
att
  Robson Passarella Teixeira

0
|
0

NILO SOUZA
   - 17 jan 2011

Caro Robson, tentarei e te darei um retorno!
Bom descanso
Nilo Souza

0
|
0

NILO SOUZA
   - 18 jan 2011

Robson boa noite,
colei o codigo que vc deu de exemplo, o glassfish de o erro abaixo. Me desculpe por colocar esse codigo imenso, mas é que não sei que parte colar  para vc analisar.
A aplicação parece que foi executada com sucesso olhe o codigo abaixo
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at /home/nsouza/NetBeansProjects/EcommerceDevmedia/build/web
Initializing...
run-deploy:
Browsing: http://localhost:8080/EcommerceDevmedia/
run-display-browser:
run:
BUILD SUCCESSFUL (total time: 8 seconds)

Erro do glassfish
18/01/2011 21:17:34 com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Tue Jan 18 21:17:47 BRST 2011
INFO: Starting Grizzly Framework 1.9.18-o - Tue Jan 18 21:17:47 BRST 2011
INFO: Grizzly Framework 1.9.18-o started in: 126ms listening on port 3700
INFO: Grizzly Framework 1.9.18-o started in: 173ms listening on port 4848
INFO: Grizzly Framework 1.9.18-o started in: 228ms listening on port 8080
INFO: Grizzly Framework 1.9.18-o started in: 97ms listening on port 7676
INFO: Grizzly Framework 1.9.18-o started in: 188ms listening on port 8181
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: SEC1002: Security Manager is OFF.
INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....
INFO: Created HTTP listener http-listener-1 on port 8080
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4848
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Virtual server server loaded system default web module
INFO: WS00018: Webservice Endpoint deployed
 NewWebService  listening at address at http://localhost:8080/EcommerceDevmedia/NewWebServiceService
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
WARNING: Element [field sells] within entity class [class br.com.devmedia.entity.CreditCard] uses a collection type [class java.util.LinkedList] when the JPA specification only supports java.util.Collection, java.util.Set, java.util.List, or java.util.Map.  This type is supported with eager loading; using lazy loading with this collection type requires additional configuration and an IndirectContainer implementation that extends [class java.util.LinkedList] or setting the mapping to use basic indirection and the type to be ValueholderInterface.
INFO]
INFO: Portable JNDI names for EJB SellSession : [java]
INFO: Loading EJBTimerService. Please wait.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: [TimerBeanContainer] Created  TimerBeanContainer]
INFO: EJB5109:EJB Timer Service started successfully for datasource [jdbc/__TimerPool]
INFO]
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: EclipseLink, version: Eclipse Persistence Services - 2.0.1.v20100213-r6600
INFO: JTS5014: Recoverable JTS instance, serverId = [100]
INFO]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: Connection object cannot be null
WARNING: RAR5114 : Error allocating connection : [Error in allocating a connection. Cause]
SEVERE: Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection object cannot be null
Error Code: 0
        at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:309)
        at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:138)
        at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:94)
        at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:584)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:369)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerF

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 18 jan 2011

Olá Nilo
  como você copiou o sun-resouce.xml você verificou se o netBeans criou o pool de conexão é o jndi  no glassFish???
  Qualquer coisa compare com o meu e veja as diferenças com o seu sun-resouce.xml que passei e veja o seu, para ver o diferente dei 1 olhada nuns arquivos, meus e vi outra vei as video-aulas do Dyego e vi que trocou o datasource-classname, os property do xml para apontar o banco diferente e mantendo o jndi-name  pool-name teste isso e de o retorno ok!
att
  Robson Passarella Teixeira

0
|
0

NILO SOUZA
   - 19 jan 2011

Como verifico se o netBeans criou o pool de conexão é o jndi  no glassFish???
O que percebi foi que quando copiei e colei seu codigo deu uns erros, mas depois fui verificar no servidor e as tabelas estavam todas criadas no banco de dados postgres, coisa que não fez quando estava fazendo as video aulas no windows  pois agora estou no linux.

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 20 jan 2011

Oi Nilo
  tem 2 opções para ver isso.
  1º   no NetBeans na aba Serviços você clica em servidores para ver os sevidores que você adicionou no IDE como o JBoss e o glassFish e quando o glassfish estiver iniciado clique no simbolo de '+' do lado do glassfish para mostrar as opções ,clique em recursos onde ele vai mostrar as opções JDBC,Conectores e Sessões JavaMail.Clique na opção JDBC e vai mostrar mais 2 opções a Recursos JDBC (JNDI) e o pool de conexão abrindo elas você ver se existe no glassFish o pool de conexão e o jndi apontados no sun-resources.xml.
  2º Quando o glassFish estiver Iniciado você entra no browser http://localhost:4848 do lado esquerdor você vai ver um menu e verá Recursos e dentro de recursos a opção JDBC e clicando em JDBC o resto vai ser igual da opção acima so vai ter 1 tela bonitinha.XD
e com relação ao fato de ter criando as tabelas no linux e não no windows realmente fiquei na duvida pois era para criado as tabelas nos 2 SO e sem da erros no log isso e estranho vou da 1 pesquisado e fazer uns testes no linux pois fiquei curioso.
Assim que possivel tento dar 1 retorno OK?
e verifique se criou o jndi,pool conexão e se o persistence.xml da aplicação se está apontando para o jndi desejado.
att
  robson Passarella

0
|
0

NILO SOUZA
   - 20 jan 2011

Caro Robson,
criou tudo o que vc disse, inclusive a opção 2 tb mostra a conexão com o postgresql (ecommerce_postgresql).
Tudo esta conforme vc disse.

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 21 jan 2011

Olá Nilo
 
  Ja que tudo foi criado direitinho e so você ir no persistence.xml de sua aplicação e colocar a tag <jta-data-source>'Nome do JNDI' </jta-data-source>(caso ja exista a tag e so trocar o nome) que os erros vão sumir e sua aplicação vai está sem erros de acesso ao banco de dados cetim??
att
  Robson Passarella Teixeira

0
|
0

NILO SOUZA
   - 21 jan 2011


Robson um detalhe,
entrei no endereço http://localhost:4848, na opção jdbc mostra as conexões, mas na opçao JNDI, Customs resource e external resource esta vazia, isso esta correto?

0
|
0

NILO SOUZA
   - 21 jan 2011

Como observação. O nome que esta na  tag e <jta-data-source>jdbc/ecommerce_postgre</jta-data-source> nome da minha conexão.

0
|
0

NILO SOUZA
   - 21 jan 2011

Caro Robson,
me perdoe por te dar tanto trabalho, mas desde já sou grato pela boa disposição que mostrou, disposição esse que infelizmente não foi mostrada pelo criado das video aulas.
O erro ainda esta no glassfish olha abaixo. Pode me dar uma ajuda?
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Fri Jan 21 21:43:21 BRST 2011
INFO: Starting Grizzly Framework 1.9.18-o - Fri Jan 21 21:43:21 BRST 2011
INFO: Grizzly Framework 1.9.18-o started in: 115ms listening on port 4848
INFO: Grizzly Framework 1.9.18-o started in: 75ms listening on port 3700
INFO: Grizzly Framework 1.9.18-o started in: 199ms listening on port 8080
INFO: Grizzly Framework 1.9.18-o started in: 152ms listening on port 8181
INFO: Grizzly Framework 1.9.18-o started in: 27ms listening on port 7676
INFO: The Admin Console is already installed, but not yet loaded.
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: SEC1002: Security Manager is OFF.
INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....
INFO: Created HTTP listener http-listener-1 on port 8080
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4848
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Virtual server server loaded system default web module
INFO: WS00018: Webservice Endpoint deployed
 NewWebService  listening at address at http://localhost:8080/EcommerceDevmedia/NewWebServiceService
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
WARNING: Element [field sells] within entity class [class br.com.devmedia.entity.CreditCard] uses a collection type [class java.util.LinkedList] when the JPA specification only supports java.util.Collection, java.util.Set, java.util.List, or java.util.Map.  This type is supported with eager loading; using lazy loading with this collection type requires additional configuration and an IndirectContainer implementation that extends [class java.util.LinkedList] or setting the mapping to use basic indirection and the type to be ValueholderInterface.
INFO]
INFO: Loading EJBTimerService. Please wait.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: [TimerBeanContainer] Created  TimerBeanContainer]
INFO: EJB5109:EJB Timer Service started successfully for datasource [jdbc/__TimerPool]
INFO]
INFO: Portable JNDI names for EJB SellSession : [java]
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: EclipseLink, version: Eclipse Persistence Services - 2.0.1.v20100213-r6600
INFO: JTS5014: Recoverable JTS instance, serverId = [100]
INFO]] started
INFO: Created HTTP listener http-listener-1 on port 8080
INFO: Grizzly Framework 1.9.18-o started in: 32ms listening on port 8080
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /usr/local/glassfish_v3/glassfish/domains/domain1/autodeploy/bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /tmp/fileinstall--3630556292912930599, felix.fileinstall.filter = null}
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /usr/local/glassfish_v3/glassfish/modules/autostart, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /tmp/fileinstall-740729829884510823, felix.fileinstall.filter = null}
INFO: Started bundle: file:/usr/local/glassfish_v3/glassfish/modules/autostart/osgi-web-container.jar
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Grizzly Framework 1.9.18-o started in: 3ms listening on port 8181
INFO: Updating configuration from org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: Installed /usr/local/glassfish_v3/glassfish/modules/autostart/org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /usr/local/glassfish_v3/glassfish/domains/domain1/autodeploy/bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /tmp/fileinstall-4909639977950627899, felix.fileinstall.filter = null}
WARNING: Got SQLException executing statement "ALTER TABLE CREDITCARD DROP CONSTRAINT FK_CREDITCARD_USEROF_ID": org.postgresql.util.PSQLException: ERRO: constraint "fk_creditcard_userof_id" of relation "creditcard" does not exist
WARNING: Got SQLException executing statement "ALTER TABLE sell DROP CONSTRAINT FK_sell_ADDRESSTOSEND_ID": org.postgresql.util.PSQLException: ERRO: constraint "fk_sell_addresstosend_id" of relation "sell" does not exist
WARNING: Got SQLException executing statement "ALTER TABLE sell DROP CONSTRAINT FK_sell_CREDITCARD_ID": org.postgresql.util.PSQLException: ERRO: constraint "fk_sell_creditcard_id" of relation "sell" does not exist
WARNING: Got SQLException executing statement "ALTER TABLE sell DROP CONSTRAINT FK_sell_USEROF_ID": org.postgresql.util.PSQLException: ERRO: constraint "fk_sell_userof_id" of relation "sell" does not exist
WARNING: Got SQLException executing statement "ALTER TABLE ADDRESS DROP CONSTRAINT FK_ADDRESS_userOf": org.postgresql.util.PSQLException: ERRO: constraint "fk_address_userof" of relation "address" does not exist
WARNING: Got SQLException executing statement "ALTER TABLE PRODUCT DROP CONSTRAINT FK_PRODUCT_CATEGORY_ID": org.postgresql.util.PSQLException: ERRO: constraint "fk_product_categ

0
|
0

NILO SOUZA
   - 21 jan 2011


Robson, depois de tantos erros e acertos, consegui chegar nesse nível e obter este erro. Na verdade um aviso.

Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Starting Grizzly Framework 1.9.18-o - Fri Jan 21 22:24:03 BRST 2011
INFO: Starting Grizzly Framework 1.9.18-o - Fri Jan 21 22:24:03 BRST 2011
INFO: Grizzly Framework 1.9.18-o started in: 123ms listening on port 3700
INFO: Grizzly Framework 1.9.18-o started in: 184ms listening on port 8181
INFO: Grizzly Framework 1.9.18-o started in: 234ms listening on port 8080
INFO: Grizzly Framework 1.9.18-o started in: 156ms listening on port 4848
INFO: Grizzly Framework 1.9.18-o started in: 96ms listening on port 7676
INFO: The Admin Console is already installed, but not yet loaded.
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(2889ms) startup services(1264ms) total(4153ms)
INFO: Binding RMI port to *:8686
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://nsouza:8686/jndi/rmi://nsouza:8686/jmxrmi
INFO: Grizzly Framework 1.9.18-o started in: 11ms listening on port 8080
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO] within entity class [class br.com.devmedia.entity.CreditCard] uses a collection type [class java.util.LinkedList] when the JPA specification only supports java.util.Collection, java.util.Set, java.util.List, or java.util.Map.  This type is supported with eager loading; using lazy loading with this collection type requires additional configuration and an IndirectContainer implementation that extends [class java.util.LinkedList] or setting the mapping to use basic indirection and the type to be ValueholderInterface.
INFO] Created  TimerBeanContainer: TimerBean
INFO: Portable JNDI names for EJB TimerBean : [java]
INFO: EJB5109:EJB Timer Service started successfully for datasource [jdbc/__TimerPool]
INFO]
INFO: Portable JNDI names for EJB SellSession : [java]
INFO: Portable JNDI names for EJB UserSession : [java]
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: EclipseLink, version: Eclipse Persistence Services - 2.0.1.v20100213-r6600
INFO: JTS5014: Recoverable JTS instance, serverId = [100]
INFO: file:/usr/local/glassfish_v3/glassfish/domains/domain1/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App login successful
INFO: Inicializando Mojarra 2.0.2 (FCS b10) para o contexto '/EcommerceDevmedia'
INFO: Loading application EcommerceDevmedia at /EcommerceDevmedia
INFO: EcommerceDevmedia was successfully deployed in 20.630 milliseconds.

CLASSE CREDIT CAR:

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 22 jan 2011

Olá Nilo
  Sua aplicação está ok pois conforme os stacktraces postados não ha erros se a sua duvida e com relação ao warning destacado em vermelho e por que a especificação do JPA diz para trabalhar com colleções mas sem dizer a coleção especifica note como na linha abaixo.
 
 when the JPA specification only supports java.util.Collection, java.util.Set, java.util.List, or   java.util.Map
a especificação consegue trabalhar com o LinkedList mas o proveito e melhor com o que a especificação diz usando a Collection, Set, List e Map
então nas suas entidades como a do curso do Loja virtual use sempre a List pois e a interface que todas as Listas existentes no java implementão.
 OK??
Att
  Robson Passarella Teixeira

0
|
0

NILO SOUZA
   - 22 jan 2011

Caro Robson,
entendi e tentei fazer, mas alguns erros e não consegui acertar. Entendi que mesmo com aquela mensagem eu posso continuar o curso pois não afetaria correto?
Mas como ficaria minha classe usando o util.list conforme a mensagem de aviso?
Abaixo a classe do meu sistema.
Um abraço!
[tagcod]
package br.com.devmedia.entity;
import br.com.devmedia.entity.Types.FlagType;
import java.io.Serializable;
import java.util.Date;

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 22 jan 2011

Olá Nilo
  Simples veja
   @OneToMany(cascade=CascadeType.ALL,mappedBy="creditCard")
    private List<Sell> sell = new LinkedList<Sell>();
isso fará o warnig sumir no log pois polimorficamente o JPA trata como os tipos mencionados na outra mensagem.

0
|
0

ROBSON PASSARELLA TEIXEIRA
   - 22 jan 2011

Olá Nilo
  Simples veja
   @OneToMany(cascade=CascadeType.ALL,mappedBy="creditCard")
    private List<Sell> sell = new LinkedList<Sell>();
isso fará o warnig sumir no log pois polimorficamente o JPA trata como os tipos mencionados na outra mensagem.
Att
  robson Passarella Teixeira

0
|
0

DYEGO SOUZA DO CARMO
   - 26 jan 2011

Resolvido ? Se sim , favor fechar o post :)





0
|
0