File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Exception while deploying the bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Exception while deploying the bean" Watch "Exception while deploying the bean" New topic
Author

Exception while deploying the bean

Rakesh Rajagopalan
Ranch Hand

Joined: Sep 19, 2006
Posts: 59
Hi All,

Im new to EJB3. I developed a code with a simple Entity Bean and Session Bean facade. Im using JBoss 5.0.0 Candidate Release 2 as the Application Server. Im always getting an exception. The stack trace of the exception, the codes are attached below. Please help me out.

1. The entity class:
---------------------

2. Stateless Session Bean class:
--------------------------------

3. The component Interface:
---------------------------

4. persistence.xml:
-------------------


The, I jar-ed them into a jar file and placed it under %JBOSS_HOME%\server\default\deploy folder.Then I got this exception:

---------------------------------------------------------------------------
14:21:40,578 ERROR [AbstractKernelController] Error installing to Parse: name=vf
szip:/C:/jboss-5.0.0/server/default/deploy/FirstEjb3Tutorial.jar state=Not Insta
lled mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object for v
fszip:/C:/jboss-5.0.0/server/default/deploy/FirstEjb3Tutorial.jar
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentExcept
ion(DeploymentException.java:49)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:343)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:303)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:275)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.deploy(AbstractParsingDeployerWithOutput.java:236)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deployer
Wrapper.java:169)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deployer
sImpl.java:1285)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi
rst(DeployersImpl.java:1003)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deployers
Impl.java:944)
at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(Deployers
Impl.java:627)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeploye
rImpl.java:541)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadPr
ofile(ProfileServiceBootstrap.java:265)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(
ProfileServiceBootstrap.java:143)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:
409)
at org.jboss.Main.boot(Main.java:209)
at org.jboss.Main$1.run(Main.java:544)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed
to resolve schema nsURI= location=persistence
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBPars
er.java:203)
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java
:168)
at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBos
sXBDeployerHelper.java:199)
at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBos
sXBDeployerHelper.java:170)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(Sch
emaResolverDeployer.java:132)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(Sch
emaResolverDeployer.java:118)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse
AndInit(AbstractVFSParsingDeployer.java:256)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse
(AbstractVFSParsingDeployer.java:188)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:329)
... 22 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve schem
a nsURI= location=persistence
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startE
lement(SundayContentHandler.java:313)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHan
dler.startElement(SaxJBossXBParser.java:401)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour
ce)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Sou
rce)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Sourc
e)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkn
own Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.s
canRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
ce)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBPars
er.java:199)
... 30 more
---------------------------------------------------------------------------
Kindly tell me what Im missing or what is going wrong.

Kind Regards,
Rakesh.R
[ November 18, 2008: Message edited by: Rakesh Rajagopalan ]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to resolve schema nsURI= location=persistence


The JBoss 5 version is strict in validating xml files. Your persistence.xml should be changed to:


[My Blog] [JavaRanch Journal]
Rakesh Rajagopalan
Ranch Hand

Joined: Sep 19, 2006
Posts: 59
Thank you so much Jai Kiran.. The reply was almost instantaneous!! Thanks a tonne!!!
miracles oralero
Greenhorn

Joined: Jul 19, 2009
Posts: 1
I have the same problem with excercise o'really enterprise javabeas 3.0 titan
jboss 4.x woks!

not in jboss 5.0 and 5.1

in persistence.xml



sometimes also add class need @PersistenceContext



Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
Sorry to awake an old thread! But even i am facing problems what miracles oralero mentioned. I am trying out the same example and i get the same type of error, didn't want to start a fresh thread for the same issue:



Could you please provide a solution for this!
And the persistance namespace provided by Jaikiran shows an error!

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

Somnath Mallick wrote:
And the persistance namespace provided by Jaikiran shows an error!



Looks like the forum software messed up the contents of the code block in my reply.

Here's what the persistence.xml should contain:
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
I meant the first one you gave:


My persistence XML is something like:


The namespace here is similar to the one you mentioned.
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
When i copy paste your persistence.xml specification i get an error.. something like:
"No persistence unit defined"

Even my code blocks are giant text areas!!!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

Somnath Mallick wrote:When i copy paste your persistence.xml specification i get an error.. something like:
"No persistence unit defined"


Please open a new thread, in an appropriate forum, with the details including the exception stacktrace.
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
New thread created!
http://www.coderanch.com/t/465717/Object-Relational-Mapping/java/Failed-resolve-schema-nsURI-location
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception while deploying the bean