-
1. Re: Hibernate as MBEAN YET
gunzip Apr 4, 2004 10:07 PM (in response to gunzip)BTW
its JBOSS 3.2.3
Hibernate2.1
Red Hat 9
And ANT includes all that jars from hibernate and j2ee -
3. Re: Hibernate as MBEAN YET
gunzip Apr 5, 2004 12:27 PM (in response to gunzip)Ive already followed that, as I said the EAR DEPLOYS alright look:
14:16:37,423 INFO [MainDeployer] Starting deployment of package: file:/usr/local/src/jboss-3.2.3/server/default/deploy/ejbhibernate.ear
14:16:37,425 INFO [EARDeployer] Init J2EE application: file:/usr/local/src/jboss-3.2.3/server/default/deploy/ejbhibernate.ear
14:16:39,211 INFO [EjbModule] Deploying test/EJBHibernate
14:16:39,395 INFO [HibernateServiceMBean] starting service at JNDI name: java:/hibernate/HibernateFactory
14:16:39,396 INFO [HibernateServiceMBean] service properties: {hibernate.session_factory_name=java:/hibernate/HibernateFactory, hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup, hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect, hibernate.show_sql=false, hibernate.use_outer_join=false, hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory, hibernate.connection.datasource=java:/PostgresDS, jta.UserTransaction=UserTransaction}
14:16:39,397 INFO [Configuration] Mapping resource: mappings/User.hbm.xml
14:16:39,695 INFO [Binder] Mapping class: org.jboss.ejbhibernate.User -> users
14:16:39,698 INFO [Configuration] processing one-to-many association mappings
14:16:39,703 INFO [Configuration] processing one-to-one association property references
14:16:39,703 INFO [Configuration] processing foreign key constraints
14:16:39,706 INFO [Dialect] Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
14:16:39,707 INFO [SettingsFactory] Use outer join fetching: false
14:16:39,708 INFO [NamingHelper] JNDI InitialContext properties:{}
14:16:40,131 INFO [DatasourceConnectionProvider] Using datasource: java:/PostgresDS
14:16:40,132 INFO [TransactionFactoryFactory] Transaction strategy: net.sf.hibernate.transaction.JTATransactionFactory
14:16:40,135 INFO [NamingHelper] JNDI InitialContext properties:{}
14:16:40,167 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
14:16:40,170 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
14:16:40,171 INFO [NamingHelper] JNDI InitialContext properties:{}
14:16:40,174 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
14:16:40,175 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
14:16:40,182 INFO [SettingsFactory] Use scrollable result sets: true
14:16:40,182 INFO [SettingsFactory] Use JDBC3 getGeneratedKeys(): false
14:16:40,183 INFO [SettingsFactory] Optimize cache for minimal puts: false
14:16:40,183 INFO [SettingsFactory] Query language substitutions: {}
14:16:40,183 INFO [SettingsFactory] cache provider: net.sf.ehcache.hibernate.Provider
14:16:40,185 INFO [Configuration] instantiating and configuring caches
14:16:40,185 INFO [SessionFactoryImpl] building session factory
14:16:40,485 INFO [SessionFactoryObjectFactory] Factory name: java:/hibernate/HibernateFactory
14:16:40,486 INFO [NamingHelper] JNDI InitialContext properties:{}
14:16:40,488 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: java:/hibernate/HibernateFactory
14:16:40,489 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
14:16:40,490 INFO [NamingHelper] JNDI InitialContext properties:{}
14:16:40,777 INFO [StatelessSessionInstancePool] Started jboss.j2ee:jndiName=ejb/test/EJBHibernate,plugin=pool,service=EJB
14:16:40,778 INFO [StatelessSessionContainer] Started jboss.j2ee:jndiName=ejb/test/EJBHibernate,service=EJB
14:16:40,779 INFO [EjbModule] Started jboss.j2ee:module=ejbhibernate.jar,service=EjbModule
14:16:41,932 INFO [EJBDeployer] Deployed: file:/usr/local/src/jboss-3.2.3/server/default/tmp/deploy/tmp461ejbhibernate.ear-contents/ejbhibernate.jar
14:16:43,275 INFO [EmbeddedTomcatService] deploy, ctxPath=/ejbhibernate, warUrl=file:/usr/local/src/jboss-3.2.3/server/default/tmp/deploy/tmp461ejbhibernate.ear-contents/client.war/
14:16:43,739 INFO [Engine] SingleSignOnContextConfig[/ejbhibernate]: Added certificates -> request attribute Valve
14:16:43,922 WARN [EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@17c50b9
14:16:43,923 INFO [Engine] StandardManager[/ejbhibernate]: Seeding random number generator class java.security.SecureRandom
14:16:44,007 INFO [Engine] StandardManager[/ejbhibernate]: Seeding of random number generator has been completed
14:16:44,010 INFO [Engine] StandardWrapper[/ejbhibernate:default]: Loading container servlet default
14:16:44,066 INFO [Engine] StandardWrapper[/ejbhibernate:invoker]: Loading container servlet invoker
14:16:44,942 INFO [EARDeployer] Started J2EE application: file:/usr/local/src/jboss-3.2.3/server/default/deploy/ejbhibernate.ear
14:16:44,943 INFO [MainDeployer] Deployed package: file:/usr/local/src/jboss-3.2.3/server/default/deploy/ejbhibernate.ear
But when I run the servelt that calls the EJB Session(Who calls Hibernate) I receive:
pages and pages of errors, the hightlights are:(START)
2004-04-05 14:20:06,756 DEBUG [org.apache.tomcat.util.threads.ThreadPool] Getting new thread data2004-04-05 14:20:07,528 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@645fd
2004-04-05 14:20:07,533 INFO [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@125d568
2004-04-05 14:20:07,534 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added LWebSec, org.jboss.security.plugins.SecurityDomainContext@ddcd98 to map
(SNIP)
*********************************************************
2004-04-05 14:20:07,869 INFO [net.sf.hibernate.cfg.Configuration] configuring from resource: /hibernate.cfg.xml
2004-04-05 14:20:07,870 INFO [net.sf.hibernate.cfg.Configuration] Configuration resource: /hibernate.cfg.xml
2004-04-05 14:20:07,884 WARN [net.sf.hibernate.cfg.Configuration] /hibernate.cfg.xml not found
2004-04-05 14:20:07,932 ERROR [org.jboss.ejb.plugins.LogInterceptor] Unexpected Error:
java.lang.ExceptionInInitializerError
at org.jboss.ejbhibernate.EjbHibernateBean.SayHello(EjbHibernateBean.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
**********************************************
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
14:20:08,065 ERROR [STDERR] java.rmi.ServerError: Unexpected Error; nested exception is:
java.lang.NoClassDefFoundError
14:20:08,070 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:374)
********************************************
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.RuntimeException: Exception building SessionFactory: /hibernate.cfg.xml not
found
at org.jboss.ejbhibernate.HibernateUtil.(HibernateUtil.java:14)
... 71 more
Caused by: net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
I using the HibernateUtil.class to TRY
static {
try {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (HibernateException ex) {
throw new RuntimeException("Exception building SessionFactory: " + ex.getMessage(), ex);
}
}
And the configuration lines gives the error, maybe I SHOULD SET A PARAMETER on the function or on one of the XMLS?????????? -
4. Re: Hibernate as MBEAN YET
gunzip Apr 5, 2004 1:10 PM (in response to gunzip)Btw, I solved the problem
the hibernate example(first persistent class)
SHOULNDT be used with jboss, specially the way
the hibernateutil class starts, its wrong and will result in error -
5. Re: Hibernate as MBEAN YET
cglommen Apr 6, 2005 4:35 PM (in response to gunzip)I am having the same problem....PLEASE post your solution:)