users@glassfish.java.net

Problem deploying EJB

From: <glassfish_at_javadesktop.org>
Date: Tue, 05 Jun 2007 06:24:33 PDT

Hi,

I am using glassfish-v1_ur1-p01-b02, the stable version of glasfish, together with netbeans 5.5.1 on a Linux-box. There I created a very simple enterprise-application consisting of an ejb- and a war-Project. The war is emty. The ejb consists of an entity, a fecade for it and the local-Interface for the facade:

PhysicalVolume.java:
================

package de.upb.cs.alg.vdrive.mda.components.ejb;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class PhysicalVolume implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    private String uuid;
    
    private String model;
    
    private long capacity;
    
    public PhysicalVolume() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (this.id != null ? this.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 PhysicalVolume)) {
            return false;
        }
        PhysicalVolume other = (PhysicalVolume)object;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
        return true;
    }

    @Override
    public String toString() {
        return "de.upb.cs.alg.vdrive.mda.components.ejb.PhysicalVolume[id=" + id + "]";
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public long getCapacity() {
        return capacity;
    }

    public void setCapacity(long capacity) {
        this.capacity = capacity;
    }
    
}





PhysicalVolumeFacade:
==================

package de.upb.cs.alg.vdrive.mda.components.ejb;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class PhysicalVolumeFacade implements PhysicalVolumeFacadeLocal {

    @PersistenceContext
    private EntityManager em;
    
    public PhysicalVolumeFacade() {
    }

    public void create(PhysicalVolume physicalVolume) {
        em.persist(physicalVolume);
    }

    public void edit(PhysicalVolume physicalVolume) {
        em.merge(physicalVolume);
    }

    public void destroy(PhysicalVolume physicalVolume) {
        em.merge(physicalVolume);
        em.remove(physicalVolume);
    }

    public PhysicalVolume find(Object pk) {
        return (PhysicalVolume) em.find(PhysicalVolume.class, pk);
    }

    public List<PhysicalVolume> findAll() {
        return em.createQuery("select object(o) from PhysicalVolume as o").getResultList();
    }
    
}





PhysicalVolumeFacadeLocal.java:
=========================

package de.upb.cs.alg.vdrive.mda.components.ejb;

import java.util.List;
import javax.ejb.Local;

@Local
public interface PhysicalVolumeFacadeLocal {
    void create(PhysicalVolume physicalVolume);

    void edit(PhysicalVolume physicalVolume);

    void destroy(PhysicalVolume physicalVolume);

    PhysicalVolume find(Object pk);

    List findAll();
    
}





Building the Projects results in no errors. Deploying results in the errormessage:
An error has occurred.
Deploying application in domain failed; N/A N/A
In the admin console of glassfish. The log says the following:

[#|2007-06-05T15:03:00.533+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.532--ServerSession(1545056)--The alias name for the entity class [class de.upb.cs.alg.vdrive.mda.components.ejb.PhysicalVolume] is being default
ed to: PhysicalVolume.
|#]

[#|2007-06-05T15:03:00.533+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.533--ServerSession(1545056)--The table name for entity [class de.upb.cs.alg.vdrive.mda.components.ejb.PhysicalVolume] is being defaulted to: PHY
SICALVOLUME.
|#]

[#|2007-06-05T15:03:00.534+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.534--ServerSession(1545056)--The column name for element [private java.lang.Long de.upb.cs.alg.vdrive.mda.components.ejb.PhysicalVolume.id] is b
eing defaulted to: ID.
|#]

[#|2007-06-05T15:03:00.534+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.534--ServerSession(1545056)--The column name for element [private java.lang.String de.upb.cs.alg.vdrive.mda.components.ejb.PhysicalVolume.uuid]
is being defaulted to: UUID.
|#]

[#|2007-06-05T15:03:00.534+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.534--ServerSession(1545056)--The column name for element [private java.lang.String de.upb.cs.alg.vdrive.mda.components.ejb.PhysicalVolume.model]
 is being defaulted to: MODEL.
|#]

[#|2007-06-05T15:03:00.535+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.535--ServerSession(1545056)--The column name for element [private long de.upb.cs.alg.vdrive.mda.components.ejb.PhysicalVolume.capacity] is being
 defaulted to: CAPACITY.
|#]

[#|2007-06-05T15:03:00.538+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Info]: 2007.06.05
03:03:00.538--ServerSession(1545056)--TopLink, version: Oracle TopLink Essentials - 2006.8 (Build 060830)
|#]

[#|2007-06-05T15:03:00.728+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.728--ServerSession(1545056)--Connection(5099054)--connecting(DatabaseLogin(
        platform=>PostgreSQLPlatform
        user name=> ""
        connector=>JNDIConnector datasource name=>null
))
|#]

[#|2007-06-05T15:03:00.728+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.728--ServerSession(1545056)--Connection(1785491)--Connected: jdbc:postgresql://localhost:5432/vdrivej2ee?loginTimeout=0&prepareThreshold=0
        User: j2eeuser
        Database: PostgreSQL Version: 8.1.5
        Driver: PostgreSQL Native Driver Version: PostgreSQL 8.1 JDBC3 with SSL (build 404)
|#]

[#|2007-06-05T15:03:00.734+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.734--ServerSession(1545056)--Connection(8799203)--connecting(DatabaseLogin(
        platform=>PostgreSQLPlatform
        user name=> ""
        connector=>JNDIConnector datasource name=>null
))
|#]

[#|2007-06-05T15:03:00.735+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.734--ServerSession(1545056)--Connection(13831731)--Connected: jdbc:postgresql://localhost:5432/vdrivej2ee?loginTimeout=0&prepareThreshold=0
        User: j2eeuser
        Database: PostgreSQL Version: 8.1.5
        Driver: PostgreSQL Native Driver Version: PostgreSQL 8.1 JDBC3 with SSL (build 404)
|#]

[#|2007-06-05T15:03:00.736+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Config]: 2007.06.0
5 03:03:00.736--ServerSession(1545056)--Connection(801575)--disconnect
|#]

[#|2007-06-05T15:03:00.736+0200|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=17;_ThreadName=Thread-32;|[TopLink Info]: 2007.06.05
03:03:00.736--ServerSession(1545056)--file:/home/fermat/usr/glassfish-v1_ur1-p01-b02/domains/domain1/applications/j2ee-apps/mda-1/mda-1_5-ejb_jar/-mda-1.5-
ejbPU logout successful
|#]

[#|2007-06-05T15:03:00.744+0200|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.tools.deployment|_ThreadID=17;_ThreadName=Thread-32;_RequestID=ca6530a4-
6068-480d-a7f2-3bb5e0c55c76;|Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException
        at oracle.toplink.essentials.platform.database.PostgreSQLPlatform.platformSpecificSequencingInitialization(PostgreSQLPlatform.java:413)
        at oracle.toplink.essentials.internal.sequencing.SequencingManager.onConnect(SequencingManager.java:568)
        at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeSequencing(DatabaseSessionImpl.java:137)
        at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:371)
        at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:360)
        at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:677)
        at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:559)
        at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:180)
        at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:230)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:113)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:107)
        at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.loadPersistenceUnitBundle(PersistenceProcessor.java:468)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.createTablesInDB(PersistenceProcessor.java:325)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processAppBundle(PersistenceProcessor.java:190)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:125)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:193)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:152)
        at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:109)
        at com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:66)
        at com.sun.enterprise.deployment.backend.AppDeployer.postDeploy(AppDeployer.java:429)
        at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:225)
        at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
        at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
        at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)
|#]





I realy do not get what is going wrong. For Persistence I added a PostgreSQL-Server as you can see in the log. Can anybody help me?

tschau

Sascha Effert
[Message sent by forum member 'fermat42' (fermat42)]

http://forums.java.net/jive/thread.jspa?messageID=220542