Hallo zusammen!
ich versuche gerade, das TitanCruises-Tutorial aus dem O'Reilly-Buch Enterprise JavaBeans3.0 (5th) zum laufen zu kriegen, hab da aber gewisse Probleme.
Bisher habe ich eine Entity Bean namens Cabin.java und eine Stateless Session Bean namens TravelAgentBean.java (bean class) und TravelAgentRemote.java (remote interface).
Schon beim Deployen bringt jboss einen Fehler:
Ich bin mir ziemlich sicher, dass das Problem in der persistence.xml liegt. Diese sieht bei mir wie folgt aus:
Laut Buch ist das alles, was ich brauche. Was mich ein wenig stutzig macht, ist, dass ich bisher keine datasource definieren musste. In anderen Tutorials musste ich immer eine datasource-datei anlegen, z.B. default-ds.xml.
Woher sollte Persistence auch wissen, wo die Daten hingehören? Also, schlau wie ich bin
habe ich mir eine titan-ds.xml angelegt, die folgendermaßen aussieht:
Der Fehler beim deployen bleibt aber der selbe. Kann mir jmd sagen, was ich falsch mache?
Gruß
kulri
ich versuche gerade, das TitanCruises-Tutorial aus dem O'Reilly-Buch Enterprise JavaBeans3.0 (5th) zum laufen zu kriegen, hab da aber gewisse Probleme.
Bisher habe ich eine Entity Bean namens Cabin.java und eine Stateless Session Bean namens TravelAgentBean.java (bean class) und TravelAgentRemote.java (remote interface).
Schon beim Deployen bringt jboss einen Fehler:
Code:
15:04:04,750 INFO [ServerImpl] Starting JBoss (Microcontainer)...
15:04:04,750 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)
15:04:04,750 INFO [ServerImpl] Bootstrap URL: null
15:04:04,750 INFO [ServerImpl] Home Dir: C:\jboss-5.0.1.GA
15:04:04,750 INFO [ServerImpl] Home URL: file:/C:/jboss-5.0.1.GA/
15:04:04,750 INFO [ServerImpl] Library URL: file:/C:/jboss-5.0.1.GA/lib/
15:04:04,750 INFO [ServerImpl] Patch URL: null
15:04:04,750 INFO [ServerImpl] Common Base URL: file:/C:/jboss-5.0.1.GA/common/
15:04:04,750 INFO [ServerImpl] Common Library URL: file:/C:/jboss-5.0.1.GA/common/lib/
15:04:04,750 INFO [ServerImpl] Server Name: default
15:04:04,750 INFO [ServerImpl] Server Base Dir: C:\jboss-5.0.1.GA\server
15:04:04,750 INFO [ServerImpl] Server Base URL: file:/C:/jboss-5.0.1.GA/server/
15:04:04,750 INFO [ServerImpl] Server Config URL: file:/C:/jboss-5.0.1.GA/server/default/conf/
15:04:04,750 INFO [ServerImpl] Server Home Dir: C:\jboss-5.0.1.GA\server\default
15:04:04,750 INFO [ServerImpl] Server Home URL: file:/C:/jboss-5.0.1.GA/server/default/
15:04:04,750 INFO [ServerImpl] Server Data Dir: C:\jboss-5.0.1.GA\server\default\data
15:04:04,750 INFO [ServerImpl] Server Library URL: file:/C:/jboss-5.0.1.GA/server/default/lib/
15:04:04,750 INFO [ServerImpl] Server Log Dir: C:\jboss-5.0.1.GA\server\default\log
15:04:04,750 INFO [ServerImpl] Server Native Dir: C:\jboss-5.0.1.GA\server\default\tmp\native
15:04:04,750 INFO [ServerImpl] Server Temp Dir: C:\jboss-5.0.1.GA\server\default\tmp
15:04:04,750 INFO [ServerImpl] Server Temp Deploy Dir: C:\jboss-5.0.1.GA\server\default\tmp\deploy
15:04:05,171 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/C:/jboss-5.0.1.GA/server/default/conf/bootstrap.xml
15:04:05,562 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
15:04:05,562 INFO [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
15:04:05,781 INFO [CopyMechanism] VFS temp dir: C:\jboss-5.0.1.GA\server\default\tmp
15:04:05,781 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled.
15:04:06,562 INFO [ServerInfo] Java version: 1.6.0_12,Sun Microsystems Inc.
15:04:06,562 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
15:04:06,562 INFO [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 11.2-b01,Sun Microsystems Inc.
15:04:06,562 INFO [ServerInfo] OS-System: Windows XP 5.2,amd64
15:04:06,593 INFO [JMXKernel] Legacy JMX core initialized
15:04:08,156 INFO [ProfileServiceImpl] Loading profile: default from: org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@126212dd(root=C:\jboss-5.0.1.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
15:04:08,156 INFO [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@126212dd(root=C:\jboss-5.0.1.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
15:04:08,156 INFO [ProfileServiceImpl] Loaded profile: ProfileImpl@da8e53c{key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]}
15:04:09,156 INFO [WebService] Using RMI server codebase: http://localhost:8083/
15:04:13,062 INFO [NativeServerConfig] JBoss Web Services - Stack Native Core
15:04:13,062 INFO [NativeServerConfig] 3.0.5.GA
15:04:15,484 ERROR [AbstractKernelController] Error installing to Parse: name=vfsfile:/C:/jboss-5.0.1.GA/server/default/deploy/TitanCruises.jar/ state=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/C:/jboss-5.0.1.GA/server/default/deploy/TitanCruises.jar/
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:337)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:297)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:269)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:230)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
at org.jboss.Main.boot(Main.java:209)
at org.jboss.Main$1.run(Main.java:547)
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(SaxJBossXBParser.java:203)
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java:199)
at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java:170)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:132)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:118)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:256)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:323)
... 22 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve schema nsURI= location=persistence
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:313)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 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 Source)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
... 30 more
15:04:19,109 INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://localhost/jndi/rmi://localhost:1090/jmxconnector
15:04:19,218 INFO [MailService] Mail Service bound to java:/Mail
15:04:20,312 WARN [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
15:04:20,328 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
15:04:20,453 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
15:04:20,453 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
15:04:20,625 INFO [TransactionManagerService] Initializing recovery manager
15:04:20,734 INFO [TransactionManagerService] Recovery manager configured
15:04:20,734 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
15:04:20,765 INFO [TransactionManagerService] Starting transaction recovery manager
15:04:21,171 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
15:04:21,171 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
15:04:21,171 INFO [StandardService] Starting service jboss.web
15:04:21,171 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.2.GA
15:04:21,203 INFO [Catalina] Server startup in 92 ms
15:04:21,218 INFO [TomcatDeployment] deploy, ctxPath=/jbossws
15:04:21,609 INFO [TomcatDeployment] deploy, ctxPath=/web-console
15:04:21,812 INFO [TomcatDeployment] deploy, ctxPath=/invoker
15:04:21,968 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
15:04:21,984 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
15:04:22,000 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml
15:04:22,031 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml
15:04:22,062 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
15:04:22,140 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
15:04:22,171 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
15:04:22,171 INFO [RAMJobStore] RAMJobStore initialized.
15:04:22,171 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
15:04:22,171 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
15:04:22,171 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
15:04:22,593 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
15:04:22,937 INFO [ServerPeer] JBoss Messaging 1.4.1.GA server [0] started
15:04:23,000 WARN [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
15:04:23,000 WARN [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
15:04:23,046 INFO [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
15:04:23,046 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@306636f started
15:04:23,046 INFO [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
15:04:23,046 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@c8e4be2 started
15:04:23,062 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
15:04:23,062 INFO [ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds
15:04:23,062 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@4fc23996 started
15:04:23,062 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
15:04:23,156 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
15:04:23,171 INFO [TomcatDeployment] deploy, ctxPath=/
15:04:23,218 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
15:04:23,265 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS IN ERROR:
Deployment "vfsfile:/C:/jboss-5.0.1.GA/server/default/deploy/TitanCruises.jar/" is in error due to the following reason(s): org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve schema nsURI= location=persistence
15:04:23,281 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
15:04:23,296 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
15:04:23,312 INFO [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)] Started in 18s:562ms
Ich bin mir ziemlich sicher, dass das Problem in der persistence.xml liegt. Diese sieht bei mir wie folgt aus:
Code:
<persistence>
<persistence-unit name="titan">
<jta-data-source>java:/TitanDS</jta-data-source>
<class>com.titan.domain.Cabin</class>
</persistence-unit>
</persistence>
Laut Buch ist das alles, was ich brauche. Was mich ein wenig stutzig macht, ist, dass ich bisher keine datasource definieren musste. In anderen Tutorials musste ich immer eine datasource-datei anlegen, z.B. default-ds.xml.
Woher sollte Persistence auch wissen, wo die Daten hingehören? Also, schlau wie ich bin
Code:
<datasources>
<local-tx-datasource>
<jndi-name>TitanDS</jndi-name>
<connection-url>jdbc:postgresql://localhost:5432/examples</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>kulri</user-name>
<password>*****</password>
</local-tx-datasource>
</datasources>
Der Fehler beim deployen bleibt aber der selbe. Kann mir jmd sagen, was ich falsch mache?
Gruß
kulri