[JBoss-user] [JBoss/Spring Integration] - Re: JBoss Hibernate+Spring Application Deployment (JNDI Prob
Hi, you have to use the .har Deployer tool. Package your persistence layer containing all hibernate related stuff (.hbm.xml and the appropriate classes) together in the .har file and specify to load it in jboss-app.xml. place the jboss-app.xml file inside the .ear file or directory in the META-INF directory. Here is the content of the jboss-app.xml file: | jboss-app |module | harhibernatestuff.har/har |/module | /jboss-app | Then you must name your deployment descriptor correctly. Before jboss version 4.0.3RC2 it was hibernate-service.xml and after jboss-service.xml. The hibernate-service.xml or jboss-service.xml must be placed in the META-INF directory of the .har file. Here is the content of my jboss-service.xml: | server | mbean code=org.jboss.hibernate.jmx.Hibernate name=jboss.har:service=Hibernate | attribute name=DatasourceNamejava:/DataSource/attribute | attribute name=SessionFactoryNamejava:/hibernate/SessionFactory/attribute | attribute name=Dialectorg.hibernate.dialect.MySQLInnoDBDialect/attribute | attribute name=CacheProviderClassorg.hibernate.cache.HashtableCacheProvider/attribute | attribute name=Hbm2ddlAutoupdate/attribute | attribute name=ShowSqlEnabledtrue/attribute | /mbean | /server | To use together with Spring you have to place the file applicationContext.xml of Spring inside of xxx.ear/xxx.war/WEB-INF containing the following lines to connect the Hibernate MBean: | bean id=sessionFactory class=org.springframework.jndi.JndiObjectFactoryBean | property name=jndiNamevaluejava:/hibernate/SessionFactory/value/property | /bean | Don't forget to specify the datasource at first (inside xxx-ds.xml, where xxx stands for the specific database string e.g. mysql, mssql, ...). Try these settings and tell me about further problems. Best regards Manuel Lamotte View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3940168#3940168 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940168 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss/Spring Integration] - Re: JBoss Hibernate+Spring Application Deployment (JNDI Prob
Hi, allright, next time I will try to place the topic in the right subject. I tried to load the Hibernate MBean in /server/default/conf/jboss-service.xml and then only the web application part. To this time I wanted to use the scan for mapping documents. Now I tried another configuration and played with the settings and the things work. Anyway, thank you for your help. I use now the .har Deployer tool. I packaged my persistenc layer containing all hibernate related stuff (.hbm.xml and the appropriate classes) together in the .har file and specified to load it in jboss-app.xml in my .ear/META-INF directory. There was also a lot of trouble because of the changed name of the deployment descriptor from hibernate-service.xml to jboss-service.xml since 4.0.3RC2 which should be placed in the META-INF directory of the .har file. The help files and howtos don't describe this change or give any clues to the problem. You could also mention the best name to choose for the Hibernate MBean such as jboss.har:service=Hibernate. This is the name I have chosen. Anyway I use the newest version of JBoss (4.0.4CR2) and also the newest Hibernate version (3.1.3). There is one another line in my logs I want to know: 2006-04-17 10:52:42,632 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 45 2006-04-17 11:00:12,629 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 45 2006-04-17 11:07:42,636 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 45 2006-04-17 11:15:12,633 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 45 2006-04-17 11:22:42,630 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 45 What does this mean, I get this line if the server is idle. Best regards Manuel Lamotte View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3937653#3937653 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3937653 --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Installation, Configuration Deployment] - Apply Hibernates NamingStrategy to an Hibernate MBean
Hi to all, I've developed an application using the JBoss JMX (Hibernate MBean) and want to apply Hibernates NamingStrategy to affect the naming of the database tables. The sessions returned by the Hibernate MBean are set to the default naming strategy. I prefer to apply the NamingStrategy in the hibernate-service.xml or jboss-service.xml (since 4.0.3RC2) e.g. using an additional attribute. Is it generally possible to use a NamingStrategy in this configuration? If yes...how to apply? Best Regards Manuel Lamotte View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3937655#3937655 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3937655 --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss/Spring Integration] - JBoss Hibernate+Spring Application Deployment (JNDI Problem)
Hi to all, I'm not able to deploy my Application in JBoss. I use the JMX (Hibernate MBean) and Spring. I created a folder called pronego.ear containing the META-INF and pronego.war folders. Inside the META-INF exists the file jboss-service.xml which creates the MBean: | server | mbean code=org.jboss.hibernate.jmx.Hibernate name=jboss:service=HibernateSessionFactory | attribute name=DatasourceNamejava:/ProNegoDataSource/attribute | attribute name=SessionFactoryNamejava:/pronego/hibernate/SessionFactory/attribute | attribute name=Dialectorg.hibernate.dialect.MySQLInnoDBDialect/attribute | attribute name=CacheProviderClassorg.hibernate.cache.HashtableCacheProvider/attribute | attribute name=Hbm2ddlAutoupdate/attribute | attribute name=ShowSqlEnabledtrue/attribute | attribute name=ScanForMappingsEnabledtrue/attribute | /mbean | /server | To use together with Spring I have the file applicationContext.xml inside of pronego.ear/pronego.war/WEB-INF with the following lines: | bean id=sessionFactory class=org.springframework.jndi.JndiObjectFactoryBean | property name=jndiNamevaluejava:/pronego/hibernate/SessionFactory/value/property | /bean | As you can see there should be two objects located in JNDI (datasource and sessionfactory). During deployment it seems that the datasource is registered in JNDI correctly. But the sessionfactory will be retrieved before it is registered in JNDI. Here is the stacktrace: 2006-04-15 01:22:25,202 DEBUG [org.springframework.jndi.JndiTemplate] Looking up JNDI object with name [java:/pronego/hibernate/SessionFactory] 2006-04-15 01:22:25,202 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Retrieving dependent beans for bean 'sessionFactory' 2006-04-15 01:22:25,202 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [namingStrategy,sessionFactory,transactionManager,userDao,userManagerTarget,userManager,/loginAction,/myAccount,/myAccountUserDataChange]; root of BeanFactory hierarchy} 2006-04-15 01:22:25,202 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Retrieving dependent beans for bean 'namingStrategy' 2006-04-15 01:22:25,202 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Applying DestructionAwareBeanPostProcessors to bean with name 'namingStrategy' 2006-04-15 01:22:25,202 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: pronego not bound javax.naming.NameNotFoundException: pronego not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) at org.jnp.server.NamingServer.getObject(NamingServer.java:543) at org.jnp.server.NamingServer.lookup(NamingServer.java:267) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587) at javax.naming.InitialContext.lookup(Unknown Source) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123) at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146) at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:86) at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:104) at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:125) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) at