[jboss-user] [Installation, Configuration & DEPLOYMENT] - Configuring dependencies in Services

Marcelo.S_ do-not-reply at jboss.com
Thu Jul 3 11:12:54 EDT 2008


I am using JBoss 4.2.2GA (Windows XP, Java v.1.6.0_02), trying to figure out how to use Hibernate with JBoss (started following the how-to available in http://www.hibernate.org/66.html).


The folder structure is as follows:
- ...\server\default\deploy
---------- App.war (application, expanded in a folder)
---------- hibernate-ds.xml (Datasource for hibernate)
---------- hibernate-service.sar (hibernate service, expanded)
-------------------- META-INF
------------------------------ jboss-service.xml
------------------------------ MANIFEST.MF

My problem is, I need the DataSource available when the hibernate-service is started, but that is not currently happening!! What am I doing wrong?

The jboss-service.xml is (Lines I *guess* are important are in bold):

  | <?xml version="1.0" encoding="UTF-8"?>
  | <server>
  | 	<mbean code="org.hibernate.jmx.HibernateService" 
  | 		name="jboss.jca:service=HibernateFactory, name=HibernateFactory">
  | 
  | 	<!-- Supposed to make it deploy ONLY after DataSource had been started -->	
  | 		<depends>jboss.jca:service=RARDeployer</depends>
  | 		<depends optional-attribute-name="datasourc">
  | 			jboss.jca:service=LocalTxCM,name=hibernate-ds
  | 		</depends>
  | 	     <!-- 
  | 		<attribute name="MapResources">mappings/Attribute.hbm.xml</attribute>
  | 	     -->
  | 
  | 		<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
  | 		<attribute name="Datasource">java:/hibernate-ds</attribute>
  | 		<attribute name="Dialect">org.hibernate.dialect.Oracle9iDialect</attribute>
  | 		<attribute name="TransactionStrategy">org.hibernate.transaction.JTATransactionFactory</attribute>
  | 		<attribute name="TransactionManagerLookupStrategy">org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
  | 		<attribute name="UserTransactionName">UserTransaction</attribute>
  | 
  | 	</mbean>
  | </server>
  | 

The hibernate-ds.xml...

  | <?xml version="1.0" encoding="UTF-8"?>
  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>hibernate-ds</jndi-name>
  | 
  |     <connection-url>jdbc:oracle:thin:@vts68:1521:app00</connection-url>
  |     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
  | 	<user-name>user</user-name>
  |     <password>pass</password>
  |     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
  | 
  |     <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
  |     <metadata>
  |        <type-mapping>Oracle9i</type-mapping>
  |     </metadata>
  |   </local-tx-datasource>
  | 
  | </datasources>
  | 

The exception that is thrown:

  | 11:29:27,656 INFO  [ServiceConfigurator] Problem configuring service jboss.jca:s
  | ervice=HibernateFactory, name=HibernateFactory
  | org.jboss.deployment.DeploymentException: Exception setting attribute datasourc
  | = jboss.jca:service=LocalTxCM,name=hibernate-ds on mbean jboss.jca:service=Hibernat
  | eFactory, name=HibernateFactory; - nested throwable: (javax.management.Attribute
  | NotFoundException: not found: datasourc)
  |         at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:707)
  |         at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:382)
  |         at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:462)
  |         at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
  |         at org.jboss.system.ServiceController.install(ServiceController.java:226)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy4.install(Unknown Source)
  |         at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
  |         at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
  |         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
  |         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy9.deploy(Unknown Source)
  |         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
  |         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
  |         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
  |         at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
  |         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
  |         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
  |         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
  |         at $Proxy0.start(Unknown Source)
  |         at org.jboss.system.ServiceController.start(ServiceController.java:417)
  |         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy4.start(Unknown Source)
  |         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
  |         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
  |         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
  |         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
  |         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy5.deploy(Unknown Source)
  |         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
  |         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
  |         at org.jboss.Main.boot(Main.java:200)
  |         at org.jboss.Main$1.run(Main.java:508)
  |         at java.lang.Thread.run(Thread.java:619)
  | Caused by: javax.management.AttributeNotFoundException: not found: datasourc
  |         at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:428)
  |         at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:608)
  |         at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:703)
  |         ... 84 more
  | 

And finally the result telling me it will not work ): 

  | 11:32:24,578 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
  | 
  | --- Incompletely deployed packages ---
  | org.jboss.deployment.DeploymentInfo at e568eb36 { url=file:/D:/jboss/server/default/deploy/App.war/ }
  |   deployer: MBeanProxyExt[jboss.web:service=WebServer]
  |   status: Deployment FAILED reason: URL file:/D:/jboss/server/default/deploy/App.war/ deployment failed
  |   state: FAILED
  |   watch: file:/D:/jboss/server/default/deploy/App.war/WEB-INF/web.xml
  |   altDD: null
  |   lastDeployed: 1215095515343
  |   lastModified: 1215009631000
  |   mbeans:
  | 
  | --- MBeans waiting for other MBeans ---
  | ObjectName: jboss.jca:service=HibernateFactory, name=HibernateFactory
  |   State: FAILED
  |   Reason: org.jboss.deployment.DeploymentException: Exception setting attribute
  | datasourc = jboss.jca:service=LocalTxCM,name=hibernate-ds on mbean jboss.jca:servic
  | e=HibernateFactory, name=HibernateFactory; - nested throwable: (javax.management
  | .AttributeNotFoundException: not found: datasourc)
  |   I Depend On:
  |     jboss.jca:service=RARDeployer
  |     jboss.jca:service=LocalTxCM,name=hibernate-ds
  | 
  | ObjectName: jboss.web.deployment:war=App.war,id=-446108874
  |   State: FAILED
  |   Reason: org.jboss.deployment.DeploymentException: URL file:/D:/jboss/server/default/deploy/
  | App.war/ deployment failed
  | 
  | --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
  | ObjectName: jboss.jca:service=HibernateFactory, name=HibernateFactory
  |   State: FAILED
  |   Reason: org.jboss.deployment.DeploymentException: Exception setting attribute
  | datasourc = jboss.jca:service=LocalTxCM,name=hibernate-ds on mbean jboss.jca:servic
  | e=HibernateFactory, name=HibernateFactory; - nested throwable: (javax.management
  | .AttributeNotFoundException: not found: datasourc)
  |   I Depend On:
  |     jboss.jca:service=RARDeployer
  |     jboss.jca:service=LocalTxCM,name=hibernate-ds
  | 
  | ObjectName: jboss.web.deployment:war=App.war,id=-446108874
  |   State: FAILED
  |   Reason: org.jboss.deployment.DeploymentException: URL file:/D:/jboss/server/default/deploy/
  | App.war/ deployment failed
  | 


Any help is greatly appreciated (:

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162336#4162336

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162336



More information about the jboss-user mailing list