• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java EE 5 tutorial example bookstore1 - deploying error

 
Jakub Stransky
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i havent been able to find out solution of this problem so I am asking you for help. I am new to J2EE so I deciede to follow one of Sun's tutorial Java EE 5 tutorial and I got stuck on one of the examples - bookstore1, which uses JPA.

Description of problem:
example web/bookstore1 is not possible deploy to app. server GF (Sun GlassFish Enterprise Server v2.1 (9.1.1) (build b60e-fcs)).

I am getting following error:
deployment started : 0%
Deploying application in domain failed; Deployment Error -- **Could not resolve a persistence unit corresponding to the persistence-unit-ref-name** [com.sun.bookstore1.listeners.ContextListener/emf] in scope of the module called [/windows/SHARE/WorkNetBeans/j2ee/javaeetutorial5/examples/web/bookstore1/build/web]. Please verify your application.
/windows/SHARE/WorkNetBeans/j2ee/javaeetutorial5/examples/web/bookstore1/nbproject/build-impl.xml:547: The module has not been deployed.
BUILD FAILED (total time: 1 second)

I have completely followed instruction from manual, verified war file through utility verifier:
/
/dist$ verifier bookstore1.war
INFO: Verifying: [ bookstore1 ]
INFO: Compiling JSPs in [ bookstore1 ]
INFO:
# of Failures : 0
# of Warnings : 0
# of Errors : 0
INFO: No errors found in the archive./

persistence.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="book" transaction-type="JTA">
<jta-data-source>jdbc/BookDB</jta-data-source>
</persistence-unit>
</persistence>

More details about problem from server log:
Message ID

Exception occured in J2EEC Phase com.sun.enterprise.deployment.backend.IASDeploymentException
Complete Message

Deployment Error -- Could not resolve a persistence unit corresponding to the persistence-unit-ref-name [com.sun.bookstore1.listeners.ContextListener/emf] in scope of the module called [/windows/SHARE/WorkNetBeans/j2ee/javaeetutorial5/examples/web/bookstore1/build/web]. Please verify your application. at com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUsViaPURefs(BundleDescriptor.java:711) at com.sun.enterprise.deployment.WebBundleDescriptor.findReferencedPUs(WebBundleDescriptor.java:727) at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.getAllPersistenceUnitDescriptors(PersistenceProcessor.java:214) at com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:175) at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:211) at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:172) at com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:122) at com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:79) at com.sun.enterprise.deployment.backend.ModuleDeployer.handlePostDeployEvent(ModuleDeployer.java:639) at com.sun.enterprise.deployment.backend.ModuleDeployer.postDeploy(ModuleDeployer.java:628) at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:191) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)

Using GlassFish 2.1 :
In aplication server I've verified availability of BookDB by pink. It was ok, these definition
Add to resources: -JDBC: JNDI Name: Required jdbc/BookDB

I would appreciate any help.
Thanks a lot
 
Jakub Stransky
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem revealed - there is a difference between NetBeans running under linux and windows. - one is packing war differently and uncorrectly. Probably the author of ant script frgot that linx do differenciate between upper and lowercase ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic