users@glassfish.java.net

Re: JDBC Connection Pool error on GF3.1

From: <glassfish_at_javadesktop.org>
Date: Sun, 10 Oct 2010 01:04:05 PDT

Hi jr158900 ,

Thank you to your suggestion on this threat.

Looks like the jdbc-resource issue has been resolved by changing pool name on GF3.1:domain.xml from "mysql_StockDB_applicationuserPool" back to "mysqlPool", same as what is in GF2.1. Nevertheless, it does appears that the syntaces for <jdbc-connection-pool> and <jdbc-resource> have changed slightly compared to GF2.1. Only the second Java enum issue still remains in GF 3.1 server log as follows:

Launching GlassFish on Felix platform
10/10/2010 4:21:36 PM com.sun.enterprise.glassfish.bootstrap.ASMainHelper$ClassLoaderBuilder findDerbyClient
[b]INFO: Cannot find javadb client jar file, jdbc driver not available[/b]
OSGiGlassFishRuntime: Initialized org.apache.felix.framework [0]
10/10/2010 4:22:13 PM com.sun.enterprise.util.EarlyLogger add
INFO: Total time to parse domain.xml: 1 seconds
gfKernel = com.sun.enterprise.v3.server.AppServerStartup_at_9021e3
INFO: This message was emitted before the logging service started:Total time to parse domain.xml: 1 seconds
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
INFO: Registered SHOAL BackingStore Proxy with persistence-type = replicated
INFO: Registered org.glassfish.ha.store.adapter.cache.ReplicationStoreProxy2 for persistence-type = replication in BackingStoreFactoryRegistry
INFO: Registered ReplicationStoreProxy with persistence-type = replication
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Grizzly Framework 1.9.19 started in: 270ms - bound to [0.0.0.0:4848]
INFO: Grizzly Framework 1.9.19 started in: 1251ms - bound to [0.0.0.0:8080]
INFO: Grizzly Framework 1.9.19 started in: 380ms - bound to [0.0.0.0:8181]
INFO: GRIZZLY0001: Starting Grizzly Framework 1.9.19 - 10/10/10 4:22 PM
INFO: GRIZZLY0001: Starting Grizzly Framework 1.9.19 - 10/10/10 4:22 PM
INFO: Grizzly Framework 1.9.19 started in: 20ms - bound to [localhost:7676]
INFO: Grizzly Framework 1.9.19 started in: 90ms - bound to [0.0.0.0:3700]
INFO: The Admin Console is already installed, but not yet loaded.
INFO: GlassFish Server Open Source Edition 3.1-b21 (21) startup time : Felix(39717ms) startup services(16313ms) total(56030ms)
INFO: Binding RMI port to *:8686
INFO: C:\Sun\glassfish3\glassfish\domains\domain1\autodeploy\bundles does not exist, please create it.
INFO: Started bundle: file:/C:/Sun/glassfish3/glassfish/modules/autostart/osgi-web-container.jar
INFO: Started bundle: file:/C:/Sun/glassfish3/glassfish/modules/autostart/org.apache.felix.bundlerepository.jar
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.CacheSize=30
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.ThreadPoolSize=20
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.Timeout=5000
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.RequireTopic=true
INFO: Started bundle: file:/C:/Sun/glassfish3/glassfish/modules/autostart/org.apache.felix.eventadmin.jar
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.CacheSize=30
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.ThreadPoolSize=20
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.Timeout=5000
INFO: DEBUG: EventAdmin: org.apache.felix.eventadmin.RequireTopic=true
INFO: ExtenderManager starting
INFO: Starting extender called org.glassfish.osgiweb.WebExtender_at_d3e83f
INFO: Starting extender called org.glassfish.osgijavaeebase.JavaEEExtender_at_1881149
INFO: Started bundle: file:/C:/Sun/glassfish3/glassfish/modules/autostart/osgi-javaee-base.jar
INFO: Started bundle: file:/C:/Sun/glassfish3/glassfish/modules/autostart/org.apache.felix.scr.jar
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://localhost:8686/jndi/rmi://localhost:8686/jmxrmi
INFO: DTX5019: Using [com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate] as the delegate
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO: Installed C:\Sun\glassfish3\glassfish\modules\autostart\org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: C:\Sun\glassfish3\glassfish\domains\domain1\autodeploy\bundles does not exist, please create it.
INFO: Installed C:\Sun\glassfish3\glassfish\modules\autostart\org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg
INFO: Hibernate Validator null
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Grizzly Framework 1.9.19 started in: 10ms - bound to [0.0.0.0:8080]
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Grizzly Framework 1.9.19 started in: 10ms - bound to [0.0.0.0:8181]
INFO: SEC1002: Security Manager is OFF.
INFO: SEC1010: Entering Security Startup Service
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
INFO: SEC1011: Security Service(s) Started Successfully
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
[b]SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method
SEVERE: Exception while preparing the app
SEVERE: Exception while preparing the app : Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [StockDB-PU] failed.
Internal Exception: Exception [EclipseLink-7151] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The type [class definition.Color] for the attribute [color] on the entity class [class domain.Rainbow] is not a valid type for an enumerated mapping. The attribute must be defined as a Java enum.
javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.EntityManagerSetupException
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1005)[/b]
        at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:205)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:205)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:119)
        at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:140)
        at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:247)
        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:147)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:738)
        at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:289)
        at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:85)
        at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:140)
        at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:137)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:214)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:223)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:249)
        at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:137)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:738)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:356)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:221)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:351)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:360)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:375)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1072)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:101)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1221)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1210)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:375)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:824)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:721)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1014)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:220)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:530)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:511)
        at java.lang.Thread.run(Thread.java:619)
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.EntityManagerSetupException

Below is the content of definition.java (re-created in Netbeans 6.9.1 as Java Enum class, a global defnition POJO Standalone class, not part of domain.Rainbow) is as follows:

public enum Color { YELLOW, BLUE, RED, GREEN, WHITE, BLACK, BLUE };

The following is the code snippet of domain.Rainbow that is an entity class, part of Java EE 6 EAR:

import definition.*;

@Entity
@Table(name="RAINBOW", catalog="StockDB", schema="")
public class Rainbow implements Serializable {

@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="ID")
    ......

@Id
    @Enumerated(EnumType.STRING)
    @Column(name="COLOR")
    private Color color;
    public Color getColor()
    {
        return color;
    }
    public void setColor(Color color)
    {
        this.color = color;
    }
....

The error "[b]Exception Description: The type [class definition.Color] for the attribute [color] on the entity class [class domain.Rainbow] is not a valid type for an enumerated mapping. The attribute must be defined as a Java enum.[/b]", [i]but I have re-defined defnition.Color as Java enum class[/i]. It appears that GF3.1 is insisting that definition.Color be defined in domain.Rainbow. Is this true? If so, how to do it? I am reluctant to define definition.Color as an inner class which is only available to domain.Rainbow. Otherwise, what is it referring to that is not defined properly? This is a working Java EE 5 EAR in GF2.1.

Thanks a lot again,

Jack
[Message sent by forum member 'htran_888']

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