users@glassfish.java.net

Re: Glassfish v3: Trying to create a Hibernate based JPA application

From: Nicolás Lichtmaier <nico.lichtmaier_at_gmail.com>
Date: Fri, 17 Apr 2009 09:28:53 -0300

Already tried that.

Besides, I thought that having jdbc-resource and jdbc-connection-pool
elements sun-resources.xml made Glassfish create the resources on
deployment. At least that worked in v2... has that changed?

Thanks!

On Fri, Apr 17, 2009 at 5:19 AM, Sahoo <Sahoo_at_sun.com> wrote:

> The error indicates you have configured your persistence.xml to use a JDBC
> datasourec by name "lamateria," which is not defined in the system. You need
> to do the following:
> 1. Open admin console
> 2. Create a connection pool. Give it a name.
> 3. Create a JDBC resource, call it lamateria and bind it to the pool
> created in step #2.
>
> Redeploy the app.
>
> Thanks,
> Sahoo
>
>
> Nicolás Lichtmaier wrote:
>
>> I've been started to do a Hibernate based JPA application. I've had had
>> success in Glassfish 2.1, but I wanted to upgrade to Glassfish v3 prelude. I
>> couldn't run it there. I keep getting this:
>>
>>
>> FINA: No local string for exceptionwebapphasnoentitymgrrefbyname
>> FINA: No local string for exceptionwebapphasnoentitymgrfactoryrefbyname
>> GRAVE: Exception while invoking class
>> org.glassfish.persistence.jpa.JPADeployer prepare method
>> java.lang.RuntimeException: javax.naming.NameNotFoundException: lamateria
>> not found
>> at
>> org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:107)
>> at
>> org.glassfish.persistence.jpa.JPAApplication.loadPU(JPAApplication.java:175)
>> at
>> org.glassfish.persistence.jpa.JPAApplication.loadAllPus(JPAApplication.java:156)
>> at
>> org.glassfish.persistence.jpa.JPAApplication.<init>(JPAApplication.java:92)
>> at
>> org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
>> at
>> com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:447)
>> at
>> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:173)
>> at
>> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329)
>> at
>> com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302)
>> at
>> com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
>> at
>> com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
>> at
>> com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
>> at
>> com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250)
>> at
>> com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176)
>> at
>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147)
>> at
>> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
>> at
>> com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
>> at
>> com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
>> at
>> com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
>> at
>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
>> at
>> com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
>> at
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>> at
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>> at
>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>> at
>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
>> at
>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
>> at
>> com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
>> at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
>> Caused by: javax.naming.NameNotFoundException: lamateria not found
>> at
>> com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:197)
>> at
>> com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:168)
>> at
>> com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
>> at
>> com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:58)
>> at
>> com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:95)
>> at
>> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:233)
>> at javax.naming.InitialContext.lookup(InitialContext.java:392)
>> at
>> com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl.lookup(ConnectorResourceAdminServiceImpl.java:189)
>> at
>> com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:355)
>> at
>> org.glassfish.persistence.jpa.JPADeployer$ProviderContainerContractInfoImpl.lookupDataSource(JPADeployer.java:176)
>> at
>> org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:104)
>> ... 27 more
>>
>> I've tried with the latest Glassfish v3, I've tried using the Hibernate
>> package from the update-tool, I've tried manually creating JDBC resources in
>> the Glassfish admin interface (instead of relying on sun-resources.xml).
>>
>> Could someone please point me at some way to debug this? Or... is there
>> something obvious I am missing?
>>
>> Thanks!
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>