ошибки при развертывании EAR с EJBs 2.1 в JBoss AS5 - PullRequest
1 голос
/ 21 апреля 2010

Я портирую приложение с EJBs 2.1 с Weblogic9 на JBoss AS5.Я внес некоторые изменения, такие как добавление дескрипторов jboss.xml к EJB-компонентам и исправление application.xml EAR, но при развертывании EAR все еще возникают проблемы.Вот сводка последней ошибки, которую я получаю, когда JBoss развертывает первый EJB (я добавлю полную трассировку стека в конце сообщения):


14:15:48,124 ERROR [AbstractKernelController] Error installing to Parse: name=vf
sfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/ state
=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object for v
fsfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/admin
-ejb.jar/



....

Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed
  to parse schema for nsURI=, baseURI=null, schemaLocation=http://www.jboss.org/j2ee/dtd/jboss_2_4.dtd



....

Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 94:3 The markup in the document preceding the root element must be well-formed.

Этопроблема с разбором самого jboss_2_4.dtd?или это что-то не так с моими дескрипторами для EJB?

Когда я пытаюсь проверить jboss_2_4.dtd в редакторе XML, он жалуется на синтаксическую ошибку в строке 94: 1, которая является началомпервое объявление, хотя выглядит нормально.Есть идеи?

Спасибо!

Марина

Полная трассировка стека ошибок:


14:15:48,124 ERROR [AbstractKernelController] Error installing to Parse: name=vf
sfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/ state
=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object for v
fsfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/admin
-ejb.jar/
        at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentExcept
ion(DeploymentException.java:49)
        at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:362)
        at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:322)
        at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:294)
        at org.jboss.deployment.JBossEjbParsingDeployer.createMetaData(JBossEjbP
arsingDeployer.java:95)
        at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.deploy(AbstractParsingDeployerWithOutput.java:234)
        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deployer
Wrapper.java:171)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deployer
sImpl.java:1439)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi
rst(DeployersImpl.java:1157)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi
rst(DeployersImpl.java:1210)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deployers
Impl.java:1098)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1082)
        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:781)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeploye
rImpl.java:702)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter
.process(MainDeployerAdapter.java:117)
        at org.jboss.system.server.profileservice.repository.ProfileDeployAction
.install(ProfileDeployAction.java:70)
        at org.jboss.system.server.profileservice.repository.AbstractProfileActi
on.install(AbstractProfileAction.java:53)
        at org.jboss.system.server.profileservice.repository.AbstractProfileServ
ice.install(AbstractProfileService.java:361)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1082)
        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.system.server.profileservice.repository.AbstractProfileServ
ice.activateProfile(AbstractProfileService.java:306)
        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(
ProfileServiceBootstrap.java:271)
        at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:
461)
        at org.jboss.Main.boot(Main.java:221)
        at org.jboss.Main$1.run(Main.java:556)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed
to parse schema for nsURI=, baseURI=null, schemaLocation=http://www.jboss.org/j
2ee/dtd/jboss_2_4.dtd
        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.xb.util.JBossXBHelper.parse(JBossXBHelper.java:189)
        at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
        at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(Sch
emaResolverDeployer.java:137)
        at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(Sch
emaResolverDeployer.java:121)
        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:348)
        ... 35 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to parse schema
for nsURI=, baseURI=null, schemaLocation=http://www.jboss.org/j2ee/dtd/jboss_2_4
.dtd
        at org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver.resolve(A
bstractMutableSchemaResolver.java:293)
        at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startE
lement(SundayContentHandler.java:274)
        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.xinclude.XIncludeHandler.startElement(Unknown Sourc
e)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.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)
        ... 43 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 94:3 The markup i
n the document preceding the root element must be well-formed.
        at org.jboss.xb.binding.sunday.unmarshalling.XsdBinderTerminatingErrorHa
ndler.handleError(XsdBinderTerminatingErrorHandler.java:40)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.reportDOMFatalError(Unknown
Source)
        at org.apache.xerces.impl.xs.XSLoaderImpl.load(Unknown Source)
        at org.jboss.xb.binding.Util.loadSchema(Util.java:395)
        at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.ja
va:176)
        at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.ja
va:147)
        at org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver.resolve(A
bstractMutableSchemaResolver.java:285)
        ... 58 more



1 Ответ

1 голос
/ 22 апреля 2010

Я бы хотел увидеть ваш jboss.xml, но мне действительно интересно, почему вы используете этот очень пыльный jboss_2_4.dtd ("JBoss 2.4 EJB deployDescriptor").Поскольку вы используете JBoss AS 5.1, я бы рекомендовал вместо этого использовать схему moderner jboss_5_1.xsd (см. JBossDTDs ).Ниже пустой образец:

<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
 http://www.jboss.org/j2ee/schema/jboss_5_1.xsd"
 version="3.0">
</jboss>
...